import { Observable, Subject } from 'rxjs'; import * as i0 from '@angular/core'; import { InjectionToken, OnInit, OnDestroy, AfterViewInit, ViewContainerRef, EventEmitter, ModuleWithProviders } from '@angular/core'; import * as i1 from '@angular/common'; type ToastType = "success" | "info" | "warning" | "wait" | "error"; type OnActionCallback = (_toast: Toast) => void; type ProgressBarDirection = "decreasing" | "increasing"; declare enum BodyOutputType { Default = 0, TrustedHtml = 1, Component = 2 } interface IClearWrapper { toastId?: string; toastContainerId?: number; } interface Toast { type: ToastType; title?: string; body?: any; toastId?: string; toastContainerId?: number; onShowCallback?: OnActionCallback; onHideCallback?: OnActionCallback; onClickCallback?: OnActionCallback; timeout?: number; bodyOutputType?: BodyOutputType; showCloseButton?: boolean; closeHtml?: string; data?: any; tapToDismiss?: boolean; progressBar?: boolean; progressBarDirection?: ProgressBarDirection; } declare const DefaultTypeClasses: Partial>; declare const DefaultIconClasses: Partial>; interface IToasterConfig { limit?: number | null; tapToDismiss?: boolean; showCloseButton?: boolean | Partial>; closeHtml?: string; newestOnTop?: boolean; timeout?: number | Partial>; typeClasses?: Partial>; iconClasses?: Partial>; bodyOutputType?: BodyOutputType; bodyTemplate?: string; defaultToastType?: ToastType; positionClass?: string; titleClass?: string; messageClass?: string; animation?: string; preventDuplicates?: boolean; mouseoverTimerStop?: boolean; toastContainerId?: number | null; } declare const defaultToasterConfig: IToasterConfig; declare const ToasterConfigInjectionToken: InjectionToken; declare class ToasterConfig implements IToasterConfig { limit?: number | null; tapToDismiss: boolean; showCloseButton: boolean | Partial>; closeHtml: string; newestOnTop: boolean; timeout: number | Partial>; typeClasses: Partial>; iconClasses: Partial>; bodyOutputType: BodyOutputType; bodyTemplate: string; defaultToastType: ToastType; positionClass: string; titleClass: string; messageClass: string; animation: string; preventDuplicates: boolean; mouseoverTimerStop: boolean; toastContainerId?: number | null; constructor(configOverrides?: IToasterConfig); } declare class ToasterService { addToast: Observable; private _addToast; clearToasts: Observable; private _clearToasts; removeToast: Observable; /** @internal */ _removeToastSubject: Subject; constructor(); /** * Synchronously create and show a new toast instance. * * @param {(string | Toast)} type The type of the toast, or a Toast object. * @param {string=} title The toast title. * @param {string=} body The toast body. * @returns {Toast} * The newly created Toast instance with a randomly generated GUID Id. */ pop(type: ToastType | Toast, title?: string, body?: string): Toast; /** * Asynchronously create and show a new toast instance. * * @param {(string | Toast)} type The type of the toast, or a Toast object. * @param {string=} title The toast title. * @param {string=} body The toast body. * @returns {Observable} * A hot Observable that can be subscribed to in order to receive the Toast instance * with a randomly generated GUID Id. */ popAsync(type: ToastType | Toast, title?: string, body?: string): Observable; /** * Clears a toast by toastId and/or toastContainerId. * * @param {string} toastId The toastId to clear. * @param {number=} toastContainerId * The toastContainerId of the container to remove toasts from. */ clear(toastId?: string, toastContainerId?: number): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare class ToasterContainerComponent implements OnInit, OnDestroy { private _defaultToasterConfig; private _toasterconfig; set toasterconfig(_toasterconfig: IToasterConfig); get toasterconfig(): IToasterConfig; toasts: Toast[]; private toasterService; private addToastSubscriber; private clearToastsSubscriber; constructor(); ngOnInit(): void; ngOnDestroy(): void; click(toast: Toast, isCloseButton?: boolean): void; keypress(toast: Toast): void; childClick($event: { value: { toast: Toast; isCloseButton?: boolean; }; }): void; removeToast(toast: Toast): void; protected buildPositionClass(): string[]; protected buildToastCompClasses(toast: Toast): string[]; private registerSubscribers; private addToast; private isLimitExceeded; private removeAllToasts; private clearToasts; private clearToastsAction; private toastIdOrDefault; private isNullOrUndefined; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class ToasterComponent implements OnInit, AfterViewInit, OnDestroy { toasterconfig: IToasterConfig; toast: Toast; titleClass: string; messageClass: string; componentBody: ViewContainerRef; private viewContainerRef; private changeDetectorRef; private ngZone; private element; private renderer2; progressBarWidth: number; bodyOutputType: typeof BodyOutputType; clickEvent: EventEmitter; removeToastEvent: EventEmitter; private timeoutId?; private timeout; private progressBarIntervalId?; private removeToastTick; private removeMouseOverListener; ngOnInit(): void; ngAfterViewInit(): void; click(event: MouseEvent, toast: Toast): void; stopTimer(): void; restartTimer(): void; ngOnDestroy(): void; private configureTimer; private updateProgressBar; private clearTimers; private removeToast; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class ToasterModule { static forRoot(config?: IToasterConfig): ModuleWithProviders; static forChild(config?: IToasterConfig): ModuleWithProviders; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } declare const provideAngularToaster: (config?: IToasterConfig) => i0.EnvironmentProviders; export { BodyOutputType, DefaultIconClasses, DefaultTypeClasses, ToasterComponent, ToasterConfig, ToasterConfigInjectionToken, ToasterContainerComponent, ToasterModule, ToasterService, defaultToasterConfig, provideAngularToaster }; export type { IClearWrapper, IToasterConfig, OnActionCallback, ProgressBarDirection, Toast, ToastType };