UNPKG

2.15 kBTypeScriptView Raw
1import { NgZone, OnDestroy, WritableSignal } from '@angular/core';
2import { IndividualConfig, ToastPackage } from './toastr-config';
3import { ToastrService } from './toastr.service';
4import * as i0 from "@angular/core";
5export declare class Toast<ConfigPayload = any> implements OnDestroy {
6 protected toastrService: ToastrService;
7 toastPackage: ToastPackage;
8 protected ngZone?: NgZone;
9 message?: string | null;
10 title?: string;
11 options: IndividualConfig<ConfigPayload>;
12 duplicatesCount: number;
13 originalTimeout: number;
14 /** width of progress bar */
15 width: WritableSignal<number>;
16 /** a combination of toast type and options.toastClass */
17 toastClasses: string;
18 state: WritableSignal<{
19 value: 'inactive' | 'active' | 'removed';
20 params: {
21 easeTime: number | string;
22 easing: string;
23 };
24 }>;
25 /** controls animation */
26 get _state(): {
27 value: "inactive" | "active" | "removed";
28 params: {
29 easeTime: string | number;
30 easing: string;
31 };
32 };
33 /** hides component when waiting to be displayed */
34 get displayStyle(): string | undefined;
35 private timeout;
36 private intervalId;
37 private hideTime;
38 private sub;
39 private sub1;
40 private sub2;
41 private sub3;
42 constructor(toastrService: ToastrService, toastPackage: ToastPackage, ngZone?: NgZone);
43 ngOnDestroy(): void;
44 /**
45 * activates toast and sets timeout
46 */
47 activateToast(): void;
48 /**
49 * updates progress bar width
50 */
51 updateProgress(): void;
52 resetTimeout(): void;
53 /**
54 * tells toastrService to remove this toast after animation time
55 */
56 remove(): void;
57 tapToast(): void;
58 stickAround(): void;
59 delayedHideToast(): void;
60 outsideTimeout(func: () => any, timeout: number): void;
61 outsideInterval(func: () => any, timeout: number): void;
62 private runInsideAngular;
63 static ɵfac: i0.ɵɵFactoryDeclaration<Toast<any>, never>;
64 static ɵcmp: i0.ɵɵComponentDeclaration<Toast<any>, "[toast-component]", never, {}, {}, never, never, true, never>;
65}