import { ChangeDetectorRef, ElementRef, EventEmitter, InjectionToken, OnDestroy } from '@angular/core'; import { VdlIconRegistry } from 'vdl-angular/icon'; import { VdlNotificationStateIntl } from './notification-state-intl'; import { NotificationStates, NotificationTypes } from './notification.interface'; /** Default `vdl-notification` options that can be overridden. */ export interface VdlNotificationDefaultOptions { /** Amount of time in milliseconds to show the transient notification */ timer: number; } /** Injection token to be used to override the default options for `vdl-notification`. */ export declare const VDL_NOTIFICATION_DEFAULT_OPTIONS: InjectionToken; /** @docs-private */ export declare function VDL_NOTIFICATION_DEFAULT_OPTIONS_FACTORY(): VdlNotificationDefaultOptions; /** VDL Transient and Persistent Notifications */ export declare class VdlNotification implements OnDestroy { _intl: VdlNotificationStateIntl; private _changeDetectorRef; _elementRef: ElementRef; private defaults; /** Enum representing the notification type either persistent or transient. * NotificationType.Persistent is 0, * NotificationType.Transient is 1 * */ readonly NotificationTypes: typeof NotificationTypes; private _intlChanges; /** Aria-label attribute internationalized strings. */ /** @docs-private */ uniqueNotificationId: string; /** Enum representing notification states as followings: * NotificationStates.Default is 0, * NotificationStates.Error is 1, * NotificationStates.Success is 2, * NotificationStates.Info is 3, * NotificationStates.Warning is 4 * */ readonly NotificationStates: typeof NotificationStates; /** * Data pertaining to the Notifications currently in scope. * persistentData: { state, message, isOpen, buttonText } * transientData: { state, message, isOpen, buttonText, timer } */ readonly notificationData: any; /** * State to Icon mapping */ /** @docs-private */ readonly _notificationIconMap: { [index: string]: any; }; /** Aria-label attribute internationalized strings. */ /** @docs-private */ severityAriaLabel: { [index: string]: string; }; /** * Close timer reference. */ private closeTimer; /** @docs-private */ notificationButton: ElementRef; /** * Event emitter for notification done displaying */ notificationDone: EventEmitter; /** * Event emitter for notification button click */ notificationButtonClicked: EventEmitter; constructor(_intl: VdlNotificationStateIntl, _changeDetectorRef: ChangeDetectorRef, _elementRef: ElementRef, vdlIconRegistry: VdlIconRegistry, defaults: VdlNotificationDefaultOptions); ngOnDestroy(): void; /** * Sets up notification object within container * @param message Message for the Notification * @param type (optional) Default is NotificationTypes.Persistent. Use NotificationTypes enum * @param state (optional) Default is NotificationStates.Default. Use NotificationStates enum * @param buttonText (optional) Specifying the Button text enables the notification button * @param timer (optional) Used in Transient notification for how long to display message in milliseconds. * If less than 3000 will default to 3000. Can be configured globally through the `VDL_NOTIFICATION_DEFAULT_OPTIONS` token. */ setNotification(message: string, type?: NotificationTypes, state?: NotificationStates, buttonText?: string, timer?: number): void; /** * Close notification by type within the container. * * @param type Specify the type fo notification to close. */ close(type: NotificationTypes): void; /** * Closes all types of notifications within the container. */ closeAll(): void; /** @docs-private */ buttonClickedHandler(type: string): void; /** @docs-private */ closeButtonClickHandler(): void; /** @docs-private */ closeOnTimer(timer: number): void; /** @docs-private */ slideEnd(event: any): void; /** @docs-private */ closeNotification(type: string): void; /** @docs-private */ private getNotificationKey(type); }