@angular-mdc/web
Version:
31 lines (30 loc) • 1.36 kB
TypeScript
import { Observable } from 'rxjs';
import { OverlayRef } from '@angular/cdk/overlay';
import { MdcSnackbarContainer } from './snackbar-container';
/** Event that is emitted when a snackbar is dismissed. */
export interface MdcSnackbarDismissReason {
/** Whether the snackbar was dismissed using the action button. */
action?: boolean;
/** Whether the snackbar was dismissed using the dismiss icon button. */
dismiss?: boolean;
}
/**
* Reference to a snackbar dispatched from the snackbar service.
*/
export declare class MdcSnackbarRef<T> {
containerInstance: MdcSnackbarContainer;
private _overlayRef;
/** The instance of the component making up the content of the snackbar. */
instance: T;
componentInstance: MdcSnackbarContainer;
/** Whether the snackbar was dismissed using the action button. */
private _dismissedReason?;
/** Subject for notifying the user that the snackbar has been dismissed. */
private readonly _afterDismiss;
constructor(containerInstance: MdcSnackbarContainer, _overlayRef: OverlayRef);
/** Gets an observable that is notified when the snackbar is finished closing. */
afterDismiss(): Observable<MdcSnackbarDismissReason | string>;
dismiss(reason?: MdcSnackbarDismissReason | string): void;
/** Cleans up the DOM after closing. */
private _finishDismiss;
}