-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
45 lines (39 loc) · 1.34 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
export interface CustomElementAdopted {
/**
* Invoked each time the custom element is moved to a new document.
*/
adoptedCallback(): void;
}
export interface CustomElementAttributeChanged {
/**
* Invoked each time one of the custom element's attributes is added, removed, or changed.
* Which attributes to notice change for is specified in a static get `observedAttributes` method.
*/
attributeChangedCallback<T1, T2>(name: string, oldValue: T1, newValue: T2): void;
}
export interface CustomElementConnected {
/**
* Invoked each time the custom element is appended into a document-connected element.
* This will happen each time the node is moved, and may happen before the element's contents have been fully parsed.
*/
connectedCallback(): void;
}
export interface CustomElementDisconnected {
/**
* Invoked each time the custom element is disconnected from the document's DOM.
*/
disconnectedCallback(): void;
}
interface CustomElementStatic {
readonly observedAttributes: string[];
}
/**
* Implement this interface to define all lifecycle hooks for custom `HTMLElement`
*/
export interface CustomElement extends
HTMLElement,
CustomElementAdopted,
CustomElementAttributeChanged,
CustomElementConnected,
CustomElementDisconnected {}
export declare const CustomElement: CustomElementStatic;