1 |
|
2 |
|
3 | import BaseComponent from './base-component';
|
4 |
|
5 | declare class Collapse extends BaseComponent {
|
6 | constructor(element: string | Element, options?: Partial<Collapse.Options>);
|
7 |
|
8 | /**
|
9 | * Toggles a collapsible element to shown or hidden. Returns to the caller
|
10 | * before the collapsible element has actually been shown or hidden (i.e.
|
11 | * before the shown.bs.collapse or hidden.bs.collapse event occurs).
|
12 | */
|
13 | toggle(): void;
|
14 |
|
15 | /**
|
16 | * Shows a collapsible element. Returns to the caller before the collapsible
|
17 | * element has actually been shown (e.g., before the shown.bs.collapse event
|
18 | * occurs).
|
19 | */
|
20 | show(): void;
|
21 |
|
22 | /**
|
23 | * Hides a collapsible element. Returns to the caller before the collapsible
|
24 | * element has actually been hidden (e.g., before the hidden.bs.collapse
|
25 | * event occurs).
|
26 | */
|
27 | hide(): void;
|
28 |
|
29 | /**
|
30 | * Static method which allows you to get the collapse instance associated
|
31 | * with a DOM element.
|
32 | */
|
33 | static getInstance(element: Element, options?: Partial<Collapse.Options>): Collapse;
|
34 |
|
35 | static jQueryInterface: Collapse.jQueryInterface;
|
36 |
|
37 | // static NAME: 'collapse';
|
38 |
|
39 | /**
|
40 | * Default settings of this plugin
|
41 | *
|
42 | * @link https://getbootstrap.com/docs/5.0/getting-started/javascript/#default-settings
|
43 | */
|
44 | static Default: Collapse.Options;
|
45 | }
|
46 |
|
47 | declare namespace Collapse {
|
48 | enum Events {
|
49 | |
50 |
|
51 |
|
52 | show = 'show.bs.collapse',
|
53 |
|
54 | |
55 |
|
56 |
|
57 | shown = 'shown.bs.collapse',
|
58 |
|
59 | |
60 |
|
61 |
|
62 | hide = 'hide.bs.collapse',
|
63 |
|
64 | |
65 |
|
66 |
|
67 |
|
68 | hidden = 'hidden.bs.collapse',
|
69 | }
|
70 |
|
71 | interface Options {
|
72 | |
73 |
|
74 |
|
75 |
|
76 |
|
77 |
|
78 |
|
79 |
|
80 | parent: string | Element | JQuery;
|
81 |
|
82 | |
83 |
|
84 |
|
85 |
|
86 |
|
87 | toggle: boolean;
|
88 | }
|
89 |
|
90 | type jQueryInterface = (config?: Partial<Options> | 'show' | 'hide' | 'toggle' | 'dispose') => void;
|
91 | }
|
92 |
|
93 | export default Collapse;
|