1 | import BaseComponent, { GetInstanceFactory, GetOrCreateInstanceFactory } from "./base-component";
|
2 |
|
3 | declare class Offcanvas extends BaseComponent {
|
4 | |
5 |
|
6 |
|
7 | static getInstance: GetInstanceFactory<Offcanvas>;
|
8 |
|
9 | |
10 |
|
11 |
|
12 |
|
13 | static getOrCreateInstance: GetOrCreateInstanceFactory<Offcanvas, Partial<Offcanvas.Options>>;
|
14 |
|
15 | static jQueryInterface: Offcanvas.jQueryInterface;
|
16 |
|
17 | constructor(element: string | Element, options?: Partial<Offcanvas.Options>);
|
18 |
|
19 | /**
|
20 | * Toggles an offcanvas element to shown or hidden. Returns to the caller before the offcanvas element has actually
|
21 | * been shown or hidden (i.e. before the shown.bs.offcanvas or hidden.bs.offcanvas event occurs).
|
22 | */
|
23 | toggle(relatedTarget?: HTMLElement): void;
|
24 |
|
25 | /**
|
26 | * Shows an offcanvas element. Returns to the caller before the offcanvas element has actually been shown
|
27 | * (i.e. before the shown.bs.offcanvas event occurs).
|
28 | */
|
29 | show(relatedTarget?: HTMLElement): void;
|
30 |
|
31 | /**
|
32 | * Hides an offcanvas element. Returns to the caller before the offcanvas element has actually been hidden
|
33 | * (i.e. before the hidden.bs.offcanvas event occurs).
|
34 | */
|
35 | hide(): void;
|
36 | }
|
37 |
|
38 | declare namespace Offcanvas {
|
39 | interface Options {
|
40 | |
41 |
|
42 |
|
43 |
|
44 |
|
45 |
|
46 | backdrop: boolean | "static";
|
47 |
|
48 | |
49 |
|
50 |
|
51 |
|
52 |
|
53 | keyboard: boolean;
|
54 |
|
55 | |
56 |
|
57 |
|
58 |
|
59 |
|
60 | scroll: boolean;
|
61 | }
|
62 |
|
63 | enum Events {
|
64 | |
65 |
|
66 |
|
67 | show = "show.bs.offcanvas",
|
68 |
|
69 | |
70 |
|
71 |
|
72 | shown = "shown.bs.offcanvas",
|
73 |
|
74 | |
75 |
|
76 |
|
77 | hide = "hide.bs.offcanvas",
|
78 |
|
79 | |
80 |
|
81 |
|
82 | hidden = "hidden.bs.offcanvas",
|
83 | }
|
84 |
|
85 | type jQueryInterface = (config?: "toggle" | "show" | "hide") => JQuery;
|
86 | }
|
87 |
|
88 | export default Offcanvas;
|