1 | import BaseComponent from './base-component';
|
2 |
|
3 | declare class Modal extends BaseComponent {
|
4 | constructor(element: string | Element, options?: Partial<Modal.Options>);
|
5 |
|
6 | /**
|
7 | * Manually toggles a modal. Returns to the caller before the modal has
|
8 | * actually been shown or hidden (i.e. before the shown.bs.modal or
|
9 | * hidden.bs.modal event occurs).
|
10 | */
|
11 | toggle(): void;
|
12 |
|
13 | /**
|
14 | * Manually opens a modal. Returns to the caller before the modal has
|
15 | * actually been shown (i.e. before the shown.bs.modal event occurs).
|
16 | */
|
17 | show(): void;
|
18 |
|
19 | /**
|
20 | * Manually hides a modal. Returns to the caller before the modal has
|
21 | * actually been hidden (i.e. before the hidden.bs.modal event occurs).
|
22 | */
|
23 | hide(): void;
|
24 |
|
25 | /**
|
26 | * Manually readjust the modal’s position if the height of a modal
|
27 | * changes while it is open (i.e. in case a scrollbar appears).
|
28 | */
|
29 | handleUpdate(): void;
|
30 |
|
31 | /**
|
32 | * Static method which allows you to get the modal instance associated with
|
33 | * a DOM element
|
34 | */
|
35 | static getInstance(element: Element, options?: Partial<Modal.Options>): Modal;
|
36 |
|
37 | static jQueryInterface: Modal.jQueryInterface;
|
38 |
|
39 | // static NAME: 'modal';
|
40 |
|
41 | /**
|
42 | * Default settings of this plugin
|
43 | *
|
44 | * @link https://getbootstrap.com/docs/5.0/getting-started/javascript/#default-settings
|
45 | */
|
46 | static Default: Modal.Options;
|
47 | }
|
48 |
|
49 | declare namespace Modal {
|
50 | enum Events {
|
51 | |
52 |
|
53 |
|
54 |
|
55 |
|
56 | show = 'show.bs.modal',
|
57 |
|
58 | |
59 |
|
60 |
|
61 |
|
62 |
|
63 |
|
64 | shown = 'shown.bs.modal',
|
65 |
|
66 | |
67 |
|
68 |
|
69 |
|
70 | hide = 'hide.bs.modal',
|
71 |
|
72 | |
73 |
|
74 |
|
75 |
|
76 | hidden = 'hidden.bs.modal',
|
77 |
|
78 | |
79 |
|
80 |
|
81 |
|
82 |
|
83 | hidePrevented = 'hidePrevented.bs.modal',
|
84 | }
|
85 |
|
86 | interface Options {
|
87 | |
88 |
|
89 |
|
90 |
|
91 |
|
92 |
|
93 | backdrop: 'static' | boolean;
|
94 |
|
95 | |
96 |
|
97 |
|
98 |
|
99 |
|
100 | keyboard: boolean;
|
101 |
|
102 | |
103 |
|
104 |
|
105 |
|
106 |
|
107 | focus: boolean;
|
108 | }
|
109 |
|
110 | type jQueryInterface = (
|
111 | config?: Partial<Options> | 'toggle' | 'show' | 'hide' | 'handleUpdate' | 'dispose',
|
112 | ) => void;
|
113 | }
|
114 |
|
115 | export default Modal;
|