1 | import * as React from 'react';
|
2 | import { OnChangeCallback } from './eventManager';
|
3 | import { ToastContent, ToastOptions, Id, ToastContainerProps, UpdateOptions, ClearWaitingQueueParams, TypeOptions } from '../types';
|
4 | declare const toast: {
|
5 | (content: ToastContent, options?: ToastOptions<{}> | undefined): React.ReactText;
|
6 | loading(content: ToastContent, options?: ToastOptions<{}> | undefined): React.ReactText;
|
7 | promise: typeof handlePromise;
|
8 | success: (content: ToastContent, options?: ToastOptions<{}> | undefined) => React.ReactText;
|
9 | info: (content: ToastContent, options?: ToastOptions<{}> | undefined) => React.ReactText;
|
10 | error: (content: ToastContent, options?: ToastOptions<{}> | undefined) => React.ReactText;
|
11 | warning: (content: ToastContent, options?: ToastOptions<{}> | undefined) => React.ReactText;
|
12 | warn: (content: ToastContent, options?: ToastOptions<{}> | undefined) => React.ReactText;
|
13 | dark(content: ToastContent, options?: ToastOptions<{}> | undefined): React.ReactText;
|
14 | |
15 |
|
16 |
|
17 | dismiss(id?: string | number | undefined): void;
|
18 | |
19 |
|
20 |
|
21 | clearWaitingQueue(params?: ClearWaitingQueueParams): void;
|
22 | |
23 |
|
24 |
|
25 | isActive(id: Id): boolean;
|
26 | update(toastId: Id, options?: UpdateOptions): void;
|
27 | |
28 |
|
29 |
|
30 | done(id: Id): void;
|
31 | |
32 |
|
33 |
|
34 |
|
35 | onChange(callback: OnChangeCallback): () => void;
|
36 | |
37 |
|
38 |
|
39 | configure(config?: ToastContainerProps): void;
|
40 | POSITION: {
|
41 | TOP_LEFT: import("../types").ToastPosition;
|
42 | TOP_RIGHT: import("../types").ToastPosition;
|
43 | TOP_CENTER: import("../types").ToastPosition;
|
44 | BOTTOM_LEFT: import("../types").ToastPosition;
|
45 | BOTTOM_RIGHT: import("../types").ToastPosition;
|
46 | BOTTOM_CENTER: import("../types").ToastPosition;
|
47 | };
|
48 | TYPE: {
|
49 | INFO: TypeOptions;
|
50 | SUCCESS: TypeOptions;
|
51 | WARNING: TypeOptions;
|
52 | ERROR: TypeOptions;
|
53 | DEFAULT: TypeOptions;
|
54 | };
|
55 | };
|
56 | interface ToastPromiseParams {
|
57 | pending: string | UpdateOptions;
|
58 | success: string | UpdateOptions;
|
59 | error: string | UpdateOptions;
|
60 | }
|
61 | declare function handlePromise<T>(promise: Promise<T> | (() => Promise<T>), { pending, error, success }: ToastPromiseParams, options?: ToastOptions): Promise<T>;
|
62 | export { toast };
|