import { FocusOrigin } from '@angular/cdk/a11y'; import { OverlayRef } from '@angular/cdk/overlay'; import { Observable } from 'rxjs'; import { ModalPosition } from './modal-config'; import { _BaoModalContainerBase } from './modal-container'; /** Possible states of the lifecycle of a modal. */ export declare const enum BaoModalState { OPEN = 0, CLOSING = 1, CLOSED = 2 } /** * Reference to a modal opened via the BaoModalService. */ export declare class BaoModalRef { private _overlayRef; _containerInstance: _BaoModalContainerBase; /** Id of the modal. */ readonly id: string; /** The instance of component opened into the modal. */ componentInstance: T; /** Whether the user is allowed to close the modal. */ disableClose: boolean | undefined; /** Subject for notifying the user that the modal has finished opening. */ private readonly _afterOpened; /** Subject for notifying the user that the modal has finished closing. */ private readonly _afterClosed; /** Subject for notifying the user that the modal has started closing. */ private readonly _beforeClosed; /** Result to be passed to afterClosed. */ private _result; /** Handle to the timeout that's running as a fallback in case the exit animation doesn't fire. */ private _closeFallbackTimeout; /** Current state of the modal. */ private _state; constructor(_overlayRef: OverlayRef, _containerInstance: _BaoModalContainerBase, /** Id of the modal. */ id?: string); /** * Close the modal. * @param modalResult Optional result to return to the modal opener. */ close(modalResult?: R): void; startOpenAnimation(): void; /** * Gets an observable that is notified when the modal is finished opening. */ afterOpened(): Observable; /** * Gets an observable that is notified when the modal is finished closing. */ afterClosed(): Observable; /** * Gets an observable that is notified when the modal has started closing. */ beforeClosed(): Observable; /** * Gets an observable that emits when the overlay's backdrop has been clicked. */ backdropClick(): Observable; /** * Gets an observable that emits when keydown events are targeted on the overlay. */ keydownEvents(): Observable; /** * Updates the dialog's position. */ updatePosition(position?: ModalPosition): this; /** * Updates the modal's width and height. */ updateSize(width?: string, height?: string): this; /** Add a CSS class or an array of classes to the overlay pane. */ addPanelClass(classes: string | string[]): this; /** Remove a CSS class or an array of classes from the overlay pane. */ removePanelClass(classes: string | string[]): this; /** Gets the current state of the modal's lifecycle. */ getState(): BaoModalState; /** * Finishes the modal close by updating the state of the modal * and disposing the overlay. */ private _finishModalClose; /** Fetches the position strategy object from the overlay ref. */ private _getPositionStrategy; } /** * Closes the modal with the specified interaction type. This is currently not part of * `BaoModalRef` as that would conflict with custom modal ref mocks provided in tests. * More details. See: https://github.com/angular/components/pull/9257#issuecomment-651342226. */ export declare function _closeModalVia(ref: BaoModalRef, interactionType: FocusOrigin, result?: R): void;