import { NgZone } from '@angular/core'; import { Observable, Subject } from 'rxjs'; export declare class Message { id: string; content: string; title: string; type: string; dismissed: boolean; timeout: number; cleanOld: boolean; /** * triggered when toast is active */ onShown: Observable; /** * triggered when toast is destroyed */ onHidden: Observable; private _afterShow; private _afterHidden; constructor(title: string, content: string, type?: string, timeout?: number, cleanOld?: boolean); /** * Get the default time by type * @param type type of toast * @returns a time in milliseconds */ getTime(type: string): number; triggerOnShow(value: any): void; triggerOnHidden(): void; } export declare enum NotificationCommand { CLEAR_ALL = "clearAll", CLOSE = "close", SET = "set" } export interface ToastEvent { command: NotificationCommand; notification?: Message; } export declare class ToastService { private ngZone; private toastEventEmitter; constructor(ngZone: NgZone); /** * Add a {@link Message} to notifications. * @param title of message * @param content of message * @param type Is optional. Available options: 'success', 'error', 'warning', 'info' * @param timeout time in milliseconds. Default: error notifications hasn't timeout */ private setToastMessage; dismissToastMessage(message: Message): Message; dismissAllToastMessages(): void; getEmitter(): Subject; /** * Add success message * @param title of message * @param content of message * @param timeout to close */ success(title: string, content: string, timeout?: number): Message; /** * Add error message * @param title of message * @param content of message * @param timeout to close */ error(title: string, content: string, timeout?: number): Message; /** * Add warning message * @param title of message * @param content of message * @param timeout to close */ warning(title: string, content: string, timeout?: number): Message; /** * * @param title of message * @param content of message * @param timeout to close */ info(title: string, content: string, timeout?: number): Message; }