-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCOMPONENT-NAME.d.ts
More file actions
65 lines (58 loc) · 1.51 KB
/
COMPONENT-NAME.d.ts
File metadata and controls
65 lines (58 loc) · 1.51 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/**
* ComponentNameElement - COMPONENT_DESCRIPTION
*
* @element COMPONENT-NAME
*
* @attr {string} example-attribute - Description of the attribute
*
* @fires COMPONENT-NAME:event-name - Description of the event
*
* @slot - Default slot for content
*
* @cssprop --component-name-color - Description of CSS custom property
*/
export class ComponentNameElement extends HTMLElement {
/**
* List of attributes to observe for changes
*/
static readonly observedAttributes: string[];
/**
* Internal state and flags
*/
private readonly _internals: {
isRendered: boolean;
};
constructor();
/**
* Called when the element is connected to the DOM
*/
connectedCallback(): void;
/**
* Called when an observed attribute changes
* @param name - The attribute name that changed
* @param oldValue - The previous value
* @param newValue - The new value
*/
attributeChangedCallback(
name: string,
oldValue: string | null,
newValue: string | null,
): void;
/**
* Upgrade a property to handle cases where it was set before the element upgraded.
* This is especially important for framework compatibility.
* @param prop - Property name to upgrade
* @private
*/
private _upgradeProperty(prop: string): void;
/**
* Example attribute as a property.
* Reflects between property and attribute to keep them in sync.
*/
get exampleAttribute(): string | null;
set exampleAttribute(value: string | null | undefined);
/**
* Renders the component's shadow DOM content
*/
render(): void;
}