import * as i0 from '@angular/core'; import { EventEmitter, EmbeddedViewRef, OnDestroy, ViewContainerRef, TemplateRef } from '@angular/core'; import * as i1 from '@angular/router'; import { NavigationExtras } from '@angular/router'; import * as i1$1 from '@sbb-esta/angular/core'; import * as i3 from '@sbb-esta/angular/icon'; import { AnimationEvent, AnimationTriggerMetadata } from '@angular/animations'; import { Subject, Observable } from 'rxjs'; /** Alert states used for the animation */ type SbbAlertState = 'visible' | 'dismissed'; /** Alert deleted custom event */ interface SbbAlertEvent { alert: SbbAlert; } declare class SbbAlert { private _changeDetector; _labelClose: string; /** The id of this element. */ id: string; /** The animation state of this alert. */ _animationState: SbbAlertState; /** Whether this alert is closed. */ _closed: boolean; /** Set to true, if the host element is an element. */ _isNativeLink: boolean; /** Emitted when a alert is to be dismissed. */ readonly dismissed: EventEmitter; /** * The indicator icon, which will be shown before the content. * Must be a valid svgIcon input for sbb-icon. * * e.g. svgIcon="plus-small" */ svgIcon: string; constructor(...args: unknown[]); /** Dismiss this alert. */ dismiss(): void; /** Handles the click on the close button. */ _handleDismiss(event: Event): void; _handleAnimation(event: AnimationEvent): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } interface SbbRouterLink extends NavigationExtras { /** Router reference to navigate between page buttons. */ routerLink: string | any[]; } /** Alert configuration to be passed to the service to create an instance. */ interface SbbAlertConfig { /** * Icon to be used in the alert. * Must be a valid svgIcon input for sbb-icon. * * e.g. svgIcon="plus-small" */ svgIcon?: string; /** Link to be used for the alert. Will be applied to routerLink. */ routerLink?: string | any[] | SbbRouterLink; /** Link to be used for the alert. Will be treated as an external link. */ link?: string; } declare class SbbAlertRefConnector implements SbbAlertConfig { /** The message to display in the alert. */ message: string; /** * Icon to be used in the alert. * Must be a valid svgIcon input for sbb-icon. */ svgIcon?: string; /** Link to be used for the alert. Will be applied to routerLink. */ routerLink?: SbbRouterLink; /** Link to be used for the alert. Will be treated as an external link. */ link?: string; /** Subject which will emit once the dismissed event happened. */ readonly afterDismissed: Subject; constructor(message: string, config: SbbAlertConfig); /** Handles the dismissed event of the referenced alert. */ _handleDismissed(): void; } /** * Reference to a alert created via service API. */ declare class SbbAlertRef { readonly instanceOutlet: SbbAlertOutlet; private _connector; /** The instance of the component making up the content of the alert. */ instance: EmbeddedViewRef; constructor(instanceOutlet: SbbAlertOutlet, _connector: SbbAlertRefConnector); dismiss(): void; /** Gets an observable that is notified when the alert has been dismissed. */ afterDismissed(): Observable; } /** * This component is used for handle a collection of alerts via the AlertService. */ declare class SbbAlertOutlet implements OnDestroy { private _alertService; private _changeDetectorRef; id: string; /** The portal where to attach the alerts generated by the service. */ _outletRef: ViewContainerRef; _templateStandard: TemplateRef; _templateRouterLink: TemplateRef; _templateExternalLink: TemplateRef; constructor(...args: unknown[]); ngOnDestroy(): void; /** Creates a new ComponentPortal of an Alert and attach it to the cdkPortalOutlet */ createAlert(message: string, config: SbbAlertConfig): SbbAlertRef; /** Dismiss all alert instances from this outlet. */ dismissAll(): void; private _selectTemplate; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class SbbAlertModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } /** Animations used by alert. */ declare const sbbAlertAnimations: { readonly showDismiss: AnimationTriggerMetadata; }; /** Service to add alerts to a placed sbb-alert-outlet. */ declare class SbbAlertService { /** Observable you can subscribe to know if sbb-alert-outlet has been loaded */ readonly outletReady: Observable; private _outletReady; private _outletInstance?; constructor(); /** Add a new alert. */ add(config: SbbAlertConfig & { message: string; }): SbbAlertRef; add(message: string, config?: SbbAlertConfig): SbbAlertRef; /** Dismiss all alerts. */ dismissAll(): void; _register(outletInstance: SbbAlertOutlet): void; _unregister(outletInstance: SbbAlertOutlet): void; private _assertOutlet; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } export { SbbAlert, SbbAlertModule, SbbAlertOutlet, SbbAlertRef, SbbAlertRefConnector, SbbAlertService, sbbAlertAnimations }; export type { SbbAlertConfig, SbbAlertEvent, SbbAlertState, SbbRouterLink };