import * as i2 from '@angular/cdk/overlay'; import { OverlayRef, ComponentType } from '@angular/cdk/overlay'; import * as i0 from '@angular/core'; import { InjectionToken, ViewContainerRef, OnDestroy, ElementRef, NgZone, ChangeDetectorRef, ComponentRef, EmbeddedViewRef, Type, TemplateRef } from '@angular/core'; import { AriaLivePoliteness } from '@angular/cdk/a11y'; import { SbbNotificationType } from '@sbb-esta/angular/notification'; export { SbbNotificationType } from '@sbb-esta/angular/notification'; import { AnimationEvent, AnimationTriggerMetadata } from '@angular/animations'; import * as i1 from '@angular/cdk/portal'; import { BasePortalOutlet, CdkPortalOutlet, ComponentPortal, TemplatePortal, DomPortal } from '@angular/cdk/portal'; import { Subject, Observable } from 'rxjs'; import * as i1$1 from '@sbb-esta/angular/core'; import { TypeRef } from '@sbb-esta/angular/core'; import * as i3 from '@sbb-esta/angular/icon'; /** Injection token that can be used to access the data that was passed into a notification toast. */ declare const SBB_NOTIFICATION_TOAST_DATA: InjectionToken; /** Possible values for verticalPosition on SbbNotificationToastConfig. */ type SbbNotificationToastVerticalPosition = 'top' | 'bottom'; declare class SbbNotificationToastConfig { /** The politeness level for the AriaLiveAnnouncer announcement. */ politeness?: AriaLivePoliteness; /** * Message to be announced by the LiveAnnouncer. When opening a notification without a custom * component or template, the announcement message will default to the specified message. */ announcementMessage?: string; /** * The view container that serves as the parent for the notification for the purposes of dependency * injection. Note: this does not affect where the notification is inserted in the DOM. */ viewContainerRef?: ViewContainerRef; /** The length of time in milliseconds to wait before automatically dismissing the notification. */ duration?: number; /** Extra CSS classes to be added to the notification container. */ panelClass?: string | string[]; /** Data being injected into the child component. */ data?: D | null; /** Possible values for the notification's vertical position. */ verticalPosition?: SbbNotificationToastVerticalPosition; /** The notification type */ type?: SbbNotificationType; } /** * Base class for notification toast container. * @docs-private */ declare abstract class SbbNotificationToastContainerBase extends BasePortalOutlet implements OnDestroy { private _ngZone; protected _elementRef: ElementRef; private _changeDetectorRef; config: SbbNotificationToastConfig; private _destroyed; /** The portal outlet inside of this container into which the notification toast content will be loaded. */ _portalOutlet: CdkPortalOutlet; /** Subject for notifying that the notification toast has exited from view. */ readonly _onExit: Subject; /** Subject for notifying that the notification toast has finished entering the view. */ readonly _onEnter: Subject; /** The state of the notification toast animations. */ _animationState: string; /** ARIA role for the notification toast container. */ _role: 'alert' | 'status' | null; get _svgIcon(): "tick-small" | "sign-exclamation-point-small" | "circle-information-small"; constructor(_ngZone: NgZone, _elementRef: ElementRef, _changeDetectorRef: ChangeDetectorRef, config: SbbNotificationToastConfig); /** Attach a component portal as content to this notification toast container. */ attachComponentPortal(portal: ComponentPortal): ComponentRef; /** Attach a template portal as content to this notification toast container. */ attachTemplatePortal(portal: TemplatePortal): EmbeddedViewRef; /** * Attaches a DOM portal to the notification toast 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 notification toast. */ onAnimationEnd(event: AnimationEvent): void; /** Begin animation of notification toast entrance into view. */ enter(): void; /** Begin animation of the notification toast exiting from view. */ exit(): Observable; /** Makes sure the exit callbacks have been invoked when the element is destroyed. */ ngOnDestroy(): void; /** * Removes the element in a microtask. Helps prevent errors where we end up * removing an element which is in the middle of an animation. * Waits for the microtasks 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; /** * 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; /** Asserts that no content is already attached to the container. */ private _assertNotAttached; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } declare class SbbNotificationToastContainer extends SbbNotificationToastContainerBase { protected _afterPortalAttached(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } /** Reference to a notification toast dispatched from the notification toast service. */ declare class SbbNotificationToastRef { private _overlayRef; /** The instance of the component making up the content of the notification toast. */ instance: T; /** * The instance of the component making up the content of the notification toast. * @docs-private */ containerInstance: SbbNotificationToastContainerBase; /** Subject for notifying the user that the notification toast has been dismissed. */ private readonly _afterDismissed; /** Subject for notifying the user that the notification toast has opened and appeared. */ private readonly _afterOpened; /** * Timeout ID for the duration setTimeout call. Used to clear the timeout if the notification toast is * dismissed before the duration passes. */ private _durationTimeoutId; constructor(containerInstance: TypeRef, _overlayRef: OverlayRef); /** Dismisses the notification toast. */ dismiss(): void; /** Dismisses the notification toast after some duration */ _dismissAfter(duration: number): void; /** Marks the notification toast as opened */ _open(): void; /** Cleans up the DOM after closing. */ private _finishDismiss; /** Gets an observable that is notified when the notification toast is finished closing. */ afterDismissed(): Observable; /** Gets an observable that is notified when the notification toast has opened and appeared. */ afterOpened(): Observable; } /** Interface for a simple notification toast component that has a message and a single action. */ interface SbbTextOnlyNotificationToast { data: { message: string; }; notificationToastRef: SbbNotificationToastRef; } /** * A component used to open as the default notification toast, matching digital.sbb.ch spec. * This should only be used internally by the notification toast service. */ declare class SbbSimpleNotification implements SbbTextOnlyNotificationToast { notificationToastRef: SbbNotificationToastRef; /** Data that was injected into the notification toast. */ data: { message: string; }; constructor(...args: unknown[]); /** Dismisses the notification toast. */ dismiss(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } /** Injection token that can be used to specify default notification toast. */ declare const SBB_NOTIFICATION_TOAST_DEFAULT_OPTIONS: InjectionToken>; /** @docs-private */ declare function SBB_NOTIFICATION_TOAST_DEFAULT_OPTIONS_FACTORY(): SbbNotificationToastConfig; /** Service to dispatch notification toast messages. */ declare class SbbNotificationToast implements OnDestroy { private _overlay; private _injector; private _live; private _breakpointObserver; private _parentNotification; private _defaultConfig; /** * Reference to the current notification toast in the view *at this level* (in the Angular injector tree). * If there is a parent notification toast service, all operations should delegate to that parent * via `_openednotification toastRef`. */ private _notificationRefAtThisLevel; /** The component that should be rendered as the notification toast's simple component. */ protected _simpleNotificationToastComponent: Type; /** The container component that attaches the provided template or component. */ protected _notificationToastContainerComponent: Type; /** The CSS class to applie for mobile mode. */ protected _mobileDeviceCssClass: string; /** Reference to the currently opened notification toast at *any* level. */ get _openedNotificationRef(): SbbNotificationToastRef | null; set _openedNotificationRef(value: SbbNotificationToastRef | null); /** Inserted by Angular inject() migration for backwards compatibility */ constructor(...args: unknown[]); /** * Creates and dispatches a notification toast with a custom component for the content, removing any * currently opened notification toasts. * * @param component Component to be instantiated. * @param config Extra configuration for the notification toast. */ openFromComponent(component: ComponentType, config?: SbbNotificationToastConfig): SbbNotificationToastRef; /** * Creates and dispatches a notification toast with a custom template for the content, removing any * currently opened notification toasts. * * @param template Template to be instantiated. * @param config Extra configuration for the notification toast. */ openFromTemplate(template: TemplateRef, config?: SbbNotificationToastConfig): SbbNotificationToastRef>; /** * Opens a notification toast with a message and an optional action. * @param message The message to show in the notification toast. * @param action The label for the notification toast action. * @param config Additional configuration options for the notification toast. */ open(message: string, config?: SbbNotificationToastConfig): SbbNotificationToastRef; /** Dismisses the currently-visible notification toast. */ dismiss(): void; ngOnDestroy(): void; /** Attaches the notification toast container component to the overlay. */ private _attachNotificationToastContainer; /** Places a new component or a template as the content of the notification toast container. */ private _attach; /** Animates the old notification toast out and the new one in. */ private _animateNotification; /** * Creates a new overlay and places it in the correct location. * @param config The user-specified notification toast config. */ private _createOverlay; /** * Creates an injector to be used inside of a notification toast component. * @param config Config that was used to create the notification toast. * @param notificationRef toastRef Reference to the notification toast. */ private _createInjector; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare const SBB_NOTIFICATION_TOAST_ANIMATIONS: { readonly notificationState: AnimationTriggerMetadata; }; declare class SbbNotificationToastModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } export { SBB_NOTIFICATION_TOAST_ANIMATIONS, SBB_NOTIFICATION_TOAST_DATA, SBB_NOTIFICATION_TOAST_DEFAULT_OPTIONS, SBB_NOTIFICATION_TOAST_DEFAULT_OPTIONS_FACTORY, SbbNotificationToast, SbbNotificationToastConfig, SbbNotificationToastContainer, SbbNotificationToastContainerBase, SbbNotificationToastModule, SbbNotificationToastRef, SbbSimpleNotification }; export type { SbbNotificationToastVerticalPosition, SbbTextOnlyNotificationToast };