UNPKG

1.08 kBTypeScriptView Raw
1import BaseComponent, { GetInstanceFactory, GetOrCreateInstanceFactory } from './base-component';
2
3declare class Offcanvas extends BaseComponent {
4 static getInstance: GetInstanceFactory<Offcanvas>;
5
6 /**
7 * Static method which allows you to get the offcanvas instance associated with
8 * a DOM element, or create a new one in case it wasn’t initialised
9 */
10 static getOrCreateInstance: GetOrCreateInstanceFactory<Offcanvas>;
11
12 static jQueryInterface: Offcanvas.jQueryInterface;
13
14 toggle(relatedTarget?: HTMLElement): void;
15
16 show(relatedTarget?: HTMLElement): void;
17
18 hide(): void;
19}
20
21declare namespace Offcanvas {
22 type jQueryInterface = (config?: 'toggle' | 'show' | 'hide' | 'dispose') => void;
23
24 enum Events {
25 show = 'show.bs.offcanvas',
26
27 shown = 'shown.bs.offcanvas',
28
29 hide = 'hide.bs.offcanvas',
30
31 hidden = 'hidden.bs.offcanvas',
32
33 focusin = 'focusin.bs.offcanvas',
34
35 click = 'click.bs.offcanvas',
36
37 clickDismiss = 'click.dismiss.bs.offcanvas',
38 }
39}
40
41export default Offcanvas;