UNPKG

1.01 kBTypeScriptView Raw
1/**
2 * If you’d like to get a particular plugin instance,
3 * each plugin exposes a getInstance method. In order to retrieve it directly from an element, do this: bootstrap.Popover.getInstance(myPopoverEl)
4 */
5export type GetInstanceFactory<T> = (element: string | Element) => T | null;
6export type GetOrCreateInstanceFactory<T, C extends ComponentOptions = ComponentOptions> = (
7 element: string | Element,
8 config?: C,
9) => T;
10export type ComponentOptions = Record<string, any>;
11
12/**
13 * Base Component
14 *
15 * @link https://github.com/twbs/bootstrap/blob/main/js/src/base-component.js
16 */
17export default class BaseComponent {
18 /**
19 * Version of this plugin
20 *
21 * @link https://getbootstrap.com/docs/5.0/getting-started/javascript/#version-numbers
22 */
23 static readonly VERSION: string;
24
25 static readonly DATA_KEY: string;
26
27 static readonly EVENT_KEY: string;
28
29 constructor(element: string | Element);
30
31 /**
32 * Destroys an element's.
33 */
34 dispose(): void;
35}