Skip to content

Commit 357c396

Browse files
authored
fix(cdk/overlay): expand OverlayReference interface to cover more properties (#23254)
We have an interface called `OverlayReference` which is meant to mimic `OverlayRef` while allowing us to break the circular dependency of `ScrollStrategy -> OverlayRef -> OverlayConfig -> ScrollStrategy`. The problem is that it currently doesn't expose some useful members. These changes expand the interface to cover more of the `OverlayRef` API surface. Fixes #23234.
1 parent 0baca18 commit 357c396

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/cdk/overlay/overlay-reference.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import {Portal} from '@angular/cdk/portal';
1010
import {Direction, Directionality} from '@angular/cdk/bidi';
11-
import {Subject} from 'rxjs';
11+
import {Observable, Subject} from 'rxjs';
1212

1313
/**
1414
* Basic interface for an overlay. Used to avoid circular type references between
@@ -21,12 +21,20 @@ export interface OverlayReference {
2121
dispose: () => void;
2222
overlayElement: HTMLElement;
2323
hostElement: HTMLElement;
24+
backdropElement: HTMLElement | null;
2425
getConfig: () => any;
2526
hasAttached: () => boolean;
2627
updateSize: (config: any) => void;
2728
updatePosition: () => void;
2829
getDirection: () => Direction;
2930
setDirection: (dir: Direction | Directionality) => void;
31+
backdropClick: () => Observable<MouseEvent>;
32+
attachments: () => Observable<void>;
33+
detachments: () => Observable<void>;
34+
keydownEvents: () => Observable<KeyboardEvent>;
35+
outsidePointerEvents: () => Observable<MouseEvent>;
36+
addPanelClass: (classes: string | string[]) => void;
37+
removePanelClass: (classes: string | string[]) => void;
3038
readonly _outsidePointerEvents: Subject<MouseEvent>;
3139
readonly _keydownEvents: Subject<KeyboardEvent>;
3240
}

0 commit comments

Comments
 (0)