UNPKG

1.41 kBTypeScriptView Raw
1import { ComponentRef, ApplicationRef, NgZone, ViewContainerRef, ComponentFactoryResolver } from '@angular/core';
2import { ToastOptions } from './toast-options';
3import { Toast } from './toast';
4import { Observable } from 'rxjs/Observable';
5export declare class ToastsManager {
6 private componentFactoryResolver;
7 private ngZone;
8 private appRef;
9 private options;
10 container: ComponentRef<any>;
11 private index;
12 private toastClicked;
13 private _rootViewContainerRef;
14 constructor(componentFactoryResolver: ComponentFactoryResolver, ngZone: NgZone, appRef: ApplicationRef, options: ToastOptions);
15 setRootViewContainerRef(vRef: ViewContainerRef): void;
16 onClickToast(): Observable<Toast>;
17 show(toast: Toast, options?: Object): Promise<Toast>;
18 createTimeout(toast: Toast): any;
19 setupToast(toast: Toast, options?: any): Toast;
20 private _onToastClicked(toast);
21 dismissToast(toast: Toast): void;
22 clearToast(toast: Toast): void;
23 clearAllToasts(): void;
24 dispose(): void;
25 error(message: string, title?: string, options?: any): Promise<Toast>;
26 info(message: string, title?: string, options?: any): Promise<Toast>;
27 success(message: string, title?: string, options?: any): Promise<Toast>;
28 warning(message: string, title?: string, options?: any): Promise<Toast>;
29 custom(message: string, title?: string, options?: any): Promise<Toast>;
30}