import { ToastNotificationMessage } from '../models/toast-notification-message.interface'; import * as i0 from "@angular/core"; export declare class ToastNotificationService { private readonly _toastNotificationMessage; toastNotificationMessage$: import("rxjs").Observable; private toasts; /** * show toast * @param message */ showToast(message: ToastNotificationMessage): void; /** * hide message * @param id */ hideMessage(id: string | undefined): void; /** * show success toast * @param content * @param timeout * @param unique set to true in order to prevent displaying the same message multiple times */ success(content: string, timeout?: number, unique?: boolean): void; /** * show error toast * @param content * @param timeout * @param unique set to true in order to prevent displaying the same message multiple times */ error(content: string, timeout?: number, unique?: boolean): void; /** * show warning toast * @param content * @param timeout * @param unique set to true in order to prevent displaying the same message multiple times */ warning(content: string, timeout?: number, unique?: boolean): void; /** * show info toast * @param content * @param timeout * @param unique set to true in order to prevent displaying the same message multiple times */ info(content: string, timeout?: number, unique?: boolean): void; /** * remove item when timeout pass * @param message */ private removeWithTimeout; /** * calc default timeout. * as we can get different messages length we check * the proper timeout by checking the number of words in the message. * the min timeout is 5 sec * the max timeout is 15 sec * @param message */ private calcDefaultTimeOut; /** * calc the number of words in the message * replace(/<[^>]*>/g, '') >> remove html tags * replace(/\s\s+/g, ' ') >> remove multiple spaces with single space */ private calcNumOfWords; /** * check if allowed to add a message to the list of the messages. * - only if we get unique true we will check if it already exists. * - in case content is empty we will not show the toast message. * * in case unique is true and we get the same text we init the timeout of the current message * @param message */ private allowToPushMessage; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } //# sourceMappingURL=toast-notification.service.d.ts.map