1 | import { InjectionToken } from '@angular/core';
|
2 | import { Observable } from 'rxjs';
|
3 | import { ComponentType } from '../portal/portal';
|
4 | import { ToastRef } from './toast-ref';
|
5 | export type ProgressAnimationType = 'increasing' | 'decreasing';
|
6 | export type DisableTimoutType = boolean | 'timeOut' | 'extendedTimeOut';
|
7 |
|
8 |
|
9 |
|
10 | export interface IndividualConfig<ConfigPayload = any> {
|
11 | |
12 |
|
13 |
|
14 |
|
15 | disableTimeOut: DisableTimoutType;
|
16 | |
17 |
|
18 |
|
19 |
|
20 | timeOut: number;
|
21 | |
22 |
|
23 |
|
24 |
|
25 | closeButton: boolean;
|
26 | |
27 |
|
28 |
|
29 |
|
30 | extendedTimeOut: number;
|
31 | |
32 |
|
33 |
|
34 |
|
35 | progressBar: boolean;
|
36 | |
37 |
|
38 |
|
39 |
|
40 | progressAnimation: ProgressAnimationType;
|
41 | |
42 |
|
43 |
|
44 |
|
45 | enableHtml: boolean;
|
46 | |
47 |
|
48 |
|
49 |
|
50 | toastClass: string;
|
51 | |
52 |
|
53 |
|
54 |
|
55 | positionClass: string;
|
56 | |
57 |
|
58 |
|
59 |
|
60 | titleClass: string;
|
61 | |
62 |
|
63 |
|
64 |
|
65 | messageClass: string;
|
66 | |
67 |
|
68 |
|
69 |
|
70 | easing: string;
|
71 | |
72 |
|
73 |
|
74 |
|
75 | easeTime: string | number;
|
76 | |
77 |
|
78 |
|
79 |
|
80 | tapToDismiss: boolean;
|
81 | |
82 |
|
83 |
|
84 |
|
85 | toastComponent?: ComponentType<any>;
|
86 | |
87 |
|
88 |
|
89 |
|
90 | onActivateTick: boolean;
|
91 | |
92 |
|
93 |
|
94 |
|
95 | newestOnTop: boolean;
|
96 | |
97 |
|
98 |
|
99 | payload?: ConfigPayload;
|
100 | }
|
101 | export interface ToastrIconClasses {
|
102 | error: string;
|
103 | info: string;
|
104 | success: string;
|
105 | warning: string;
|
106 | [key: string]: string;
|
107 | }
|
108 |
|
109 |
|
110 |
|
111 |
|
112 | export interface GlobalConfig extends IndividualConfig {
|
113 | |
114 |
|
115 |
|
116 |
|
117 |
|
118 | maxOpened: number;
|
119 | |
120 |
|
121 |
|
122 |
|
123 | autoDismiss: boolean;
|
124 | iconClasses: Partial<ToastrIconClasses>;
|
125 | |
126 |
|
127 |
|
128 |
|
129 | preventDuplicates: boolean;
|
130 | |
131 |
|
132 |
|
133 |
|
134 | countDuplicates: boolean;
|
135 | |
136 |
|
137 |
|
138 |
|
139 | resetTimeoutOnDuplicate: boolean;
|
140 | |
141 |
|
142 |
|
143 |
|
144 | includeTitleDuplicates: boolean;
|
145 | }
|
146 |
|
147 |
|
148 |
|
149 | export declare class ToastPackage<ConfigPayload = any> {
|
150 | toastId: number;
|
151 | config: IndividualConfig<ConfigPayload>;
|
152 | message: string | null | undefined;
|
153 | title: string | undefined;
|
154 | toastType: string;
|
155 | toastRef: ToastRef<any>;
|
156 | private _onTap;
|
157 | private _onAction;
|
158 | constructor(toastId: number, config: IndividualConfig<ConfigPayload>, message: string | null | undefined, title: string | undefined, toastType: string, toastRef: ToastRef<any>);
|
159 | /** Fired on click */
|
160 | triggerTap(): void;
|
161 | onTap(): Observable<void>;
|
162 | /** available for use in custom toast */
|
163 | triggerAction(action?: any): void;
|
164 | onAction(): Observable<void>;
|
165 | }
|
166 | /** @deprecated use GlobalConfig */
|
167 | export interface GlobalToastrConfig extends GlobalConfig {
|
168 | }
|
169 |
|
170 | export interface IndividualToastrConfig extends IndividualConfig {
|
171 | }
|
172 |
|
173 | export interface ToastrConfig extends IndividualConfig {
|
174 | }
|
175 | export declare const DefaultNoComponentGlobalConfig: GlobalConfig;
|
176 | export interface ToastToken {
|
177 | default: GlobalConfig;
|
178 | config: Partial<GlobalConfig>;
|
179 | }
|
180 | export declare const TOAST_CONFIG: InjectionToken<ToastToken>;
|