import { AnimationEvent } from '@angular/animations'; import { AriaLivePoliteness } from '@angular/cdk/a11y'; import { Platform } from '@angular/cdk/platform'; import { BasePortalOutlet, CdkPortalOutlet, ComponentPortal, DomPortal, TemplatePortal } from '@angular/cdk/portal'; import { ChangeDetectorRef, ComponentRef, ElementRef, EmbeddedViewRef, NgZone, OnDestroy } from '@angular/core'; import { Observable, Subject } from 'rxjs'; import { BaoSnackBarConfig } from './snack-bar-config'; import * as i0 from "@angular/core"; /** * Internal interface for a snack bar container. * @docs-private */ export interface IBaoSnackBarContainer { snackBarConfig: BaoSnackBarConfig; _onAnnounce: Subject; _onExit: Subject; _onEnter: Subject; enter: () => void; exit: () => Observable; attachTemplatePortal: (portal: TemplatePortal) => EmbeddedViewRef; attachComponentPortal: (portal: ComponentPortal) => ComponentRef; } /** * Internal component that wraps user-provided snack bar content. * @docs-private */ export declare class BaoSnackBarContainerComponent extends BasePortalOutlet implements OnDestroy, IBaoSnackBarContainer { private _ngZone; private _elementRef; private _changeDetectorRef; private _platform; /** The snack bar configuration. */ snackBarConfig: BaoSnackBarConfig; /** The portal outlet inside of this container into which the snack bar content will be loaded. */ _portalOutlet: CdkPortalOutlet; private _document; private _trackedModals; /** Subject for notifying that the snack bar has announced to screen readers. */ readonly _onAnnounce: Subject; /** Subject for notifying that the snack bar has exited from view. */ readonly _onExit: Subject; /** Subject for notifying that the snack bar has finished entering the view. */ readonly _onEnter: Subject; /** The state of the snack bar animations. */ _animationState: string; /** aria-live value for the live region. */ _live: AriaLivePoliteness; /** The number of milliseconds to wait before announcing the snack bar's content. */ private readonly _announceDelay; /** The timeout for announcing the snack bar's content. */ private _announceTimeoutId; /** Whether the component has been destroyed. */ private _destroyed; /** * Role of the live region. This is only for Firefox as there is a known issue where Firefox + * JAWS does not read out aria-live message. */ _role?: 'status' | 'alert'; /** Unique ID of the aria-live element. */ readonly _liveElementId: string; constructor(_ngZone: NgZone, _elementRef: ElementRef, _changeDetectorRef: ChangeDetectorRef, _platform: Platform, /** The snack bar configuration. */ snackBarConfig: BaoSnackBarConfig); /** Attach a component portal as content to this snack bar container. */ attachComponentPortal(portal: ComponentPortal): ComponentRef; /** Attach a template portal as content to this snack bar container. */ attachTemplatePortal(portal: TemplatePortal): EmbeddedViewRef; /** * Attaches a DOM portal to the snack bar container. * @deprecated To be turned into a method. * @breaking-change 10.0.0 */ attachDomPortal: (portal: DomPortal) => void; /** Handle end of animations, updating the state of the snackbar. */ onAnimationEnd(event: AnimationEvent): void; /** Begin animation of snack bar entrance into view. */ enter(): void; /** Begin animation of the snack bar exiting from view. */ exit(): Observable; /** Makes sure the exit callbacks have been invoked when the element is destroyed. */ ngOnDestroy(): void; /** * Waits for the zone to settle before removing the element. Helps prevent * errors where we end up removing an element which is in the middle of an animation. */ private completeExit; /** Applies the various positioning and user-configured CSS classes to the snack bar. */ private applySnackBarClasses; /** * Called after the portal contents have been attached. Can be * used to modify the DOM once it's guaranteed to be in place. */ protected _afterPortalAttached(): void; /** * Some browsers won't expose the accessibility node of the live element if there is an * `aria-modal` and the live element is outside of it. This method works around the issue by * pointing the `aria-owns` of all modals to the live element. */ private _exposeToModals; /** Clears the references to the live element from any modals it was added to. */ private _clearFromModals; /** Asserts that no content is already attached to the container. */ private assertNotAttached; /** * Starts a timeout to move the snack bar content to the live region so screen readers will * announce it. */ private screenReaderAnnounce; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; }