1 | import BaseComponent, { GetInstanceFactory, GetOrCreateInstanceFactory } from "./base-component";
|
2 |
|
3 | declare class Toast extends BaseComponent {
|
4 | |
5 |
|
6 |
|
7 |
|
8 | static getInstance: GetInstanceFactory<Toast>;
|
9 |
|
10 | |
11 |
|
12 |
|
13 |
|
14 | static getOrCreateInstance: GetOrCreateInstanceFactory<Toast, Partial<Toast.Options>>;
|
15 |
|
16 | static jQueryInterface: Toast.jQueryInterface;
|
17 |
|
18 | |
19 |
|
20 |
|
21 |
|
22 |
|
23 | static Default: Toast.Options;
|
24 | constructor(element: string | Element, options?: Partial<Toast.Options>);
|
25 |
|
26 | /**
|
27 | * Reveals an element’s toast. Returns to the caller before the toast has actually
|
28 | * been shown (i.e. before the shown.bs.toast event occurs).
|
29 | * You have to manually call this method, instead your toast won’t show.
|
30 | */
|
31 | show(): void;
|
32 |
|
33 | /**
|
34 | * Hides an element’s toast. Returns to the caller before the toast has actually
|
35 | * been hidden (i.e. before the hidden.bs.toast event occurs).
|
36 | * You have to manually call this method if you made autohide to false.
|
37 | */
|
38 | hide(): void;
|
39 |
|
40 | /**
|
41 | * Returns a boolean according to toast’s visibility state.
|
42 | */
|
43 | isShown(): boolean;
|
44 | }
|
45 |
|
46 | declare namespace Toast {
|
47 | enum Events {
|
48 | |
49 |
|
50 |
|
51 | show = "show.bs.toast",
|
52 |
|
53 | |
54 |
|
55 |
|
56 | shown = "shown.bs.toast",
|
57 |
|
58 | |
59 |
|
60 |
|
61 |
|
62 | hide = "hide.bs.toast",
|
63 |
|
64 | |
65 |
|
66 |
|
67 |
|
68 | hidden = "hidden.bs.toast",
|
69 | }
|
70 |
|
71 | interface Options {
|
72 | |
73 |
|
74 |
|
75 |
|
76 |
|
77 | animation: boolean;
|
78 |
|
79 | |
80 |
|
81 |
|
82 |
|
83 |
|
84 | autohide: boolean;
|
85 |
|
86 | |
87 |
|
88 |
|
89 |
|
90 |
|
91 | delay: number;
|
92 | }
|
93 |
|
94 | type jQueryInterface = (config?: Partial<Options> | "show" | "hide" | "dispose") => JQuery;
|
95 | }
|
96 |
|
97 | export default Toast;
|