1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 | import { MDCFoundation } from './foundation';
|
24 | import { CustomEventListener, EventType, SpecificEventListener } from './types';
|
25 | export declare class MDCComponent<FoundationType extends MDCFoundation> {
|
26 | root: Element;
|
27 | static attachTo(root: Element): MDCComponent<MDCFoundation<{}>>;
|
28 | protected foundation: FoundationType;
|
29 | constructor(root: Element, foundation?: FoundationType, ...args: unknown[]);
|
30 | initialize(..._args: Array<unknown>): void;
|
31 | getDefaultFoundation(): FoundationType;
|
32 | initialSyncWithDOM(): void;
|
33 | destroy(): void;
|
34 | /**
|
35 | * Wrapper method to add an event listener to the component's root element. This is most useful when
|
36 | * listening for custom events.
|
37 | */
|
38 | listen<K extends EventType>(evtType: K, handler: SpecificEventListener<K>, options?: AddEventListenerOptions | boolean): void;
|
39 | listen<E extends Event>(evtType: string, handler: CustomEventListener<E>, options?: AddEventListenerOptions | boolean): void;
|
40 | /**
|
41 | * Wrapper method to remove an event listener to the component's root element. This is most useful when
|
42 | * unlistening for custom events.
|
43 | */
|
44 | unlisten<K extends EventType>(evtType: K, handler: SpecificEventListener<K>, options?: AddEventListenerOptions | boolean): void;
|
45 | unlisten<E extends Event>(evtType: string, handler: CustomEventListener<E>, options?: AddEventListenerOptions | boolean): void;
|
46 | /**
|
47 | * Fires a cross-browser-compatible custom event from the component root of the given type, with the given data.
|
48 | */
|
49 | emit<T extends object>(evtType: string, evtData: T, shouldBubble?: boolean): void;
|
50 | }
|
51 | export default MDCComponent;
|