UNPKG

ng-toast-notify

Version:

Lightweight and flexible toast notifications for Angular

74 lines (73 loc) 2.31 kB
import { ToastysoundService } from './toastysound.service'; import * as i0 from "@angular/core"; export declare enum ToastType { Basic = "basic", Success = "success", Error = "error", Info = "info", Warning = "warning", Custom = "custom" } interface ToastGesture { date: number; touchStart?: Touch; touchEnd?: Touch; offsetX?: number; } export interface ToastModel { id: number; title: string; message: string; type: ToastType; timestamp: number; duration: number; expires: number; config?: ToastyConfig; get icon(): string; gesture?: ToastGesture; animatePbar?: boolean; } export interface ToastyConfig { type?: ToastType; duration?: number; sticky?: boolean; enableHtml?: boolean; customStyle?: Record<string, string>; loading?: boolean; beep?: boolean; progressBar?: boolean; } export interface ToastyPromise<T> { promise: Promise<T>; loading: string; success: string | ((result: T) => string); error: string | ((err: any) => string); } export declare class ToastyService { private _toastySoundService; private TOASTY_SERVICE_CONFIG; private queue; private counter; private newToastBehaviorSubject; newToast$: import("rxjs").Observable<ToastModel[]>; private deleteToastBehaviorSubject; deleteToast$: import("rxjs").Observable<ToastModel | undefined>; private updateToastBehaviorSubject; updateToast$: import("rxjs").Observable<ToastModel | undefined>; constructor(_toastySoundService: ToastysoundService); setDefaultDuration(d: number): void; getDefaultDuration(): number; setCapacity(c: number): void; getCapacity(): number; showToast(title: string, message: string, toastConfig?: ToastyConfig | undefined, isPromise?: boolean): number; showToastPromise<T>(title: string, promise: ToastyPromise<T>, config?: ToastyConfig): void; removeToast(id: number): void; closeToast(id: number): void; updateTouchStart(id: number, touch: Touch): void; updateTouchEnd(touch: Touch): void; updateTouchMove(touch: Touch): void; private updateToast; static ɵfac: i0.ɵɵFactoryDeclaration<ToastyService, never>; static ɵprov: i0.ɵɵInjectableDeclaration<ToastyService>; } export {};