-
Notifications
You must be signed in to change notification settings - Fork 12
/
x-element.d.ts
69 lines (67 loc) · 1.96 KB
/
x-element.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
export class XElement extends HTMLElement {
readonly properties: {
[property: string]: {
type: any,
attribute: string,
input: string[],
compute: (...any) => any,
observe: (host: XElement, value: any, oldValue: any) => void,
reflect: boolean,
internal: boolean,
readOnly: boolean,
initial: any,
default: any,
}
};
readonly listeners: {
[type: string]: (
this: typeof XElement,
host: XElement,
event: Event
) => any
};
readonly internal: object;
render(): void;
listen(
element: EventTarget,
type: string,
callback: (this: typeof XElement, host: XElement, event: Event) => any,
options: AddEventListenerOptions
): void;
unlisten(
element: EventTarget,
type: string,
callback: (this: typeof XElement, host: XElement, event: Event) => any,
options: AddEventListenerOptions
): void;
dispatchError(error: Error): void;
static readonly defaultTemplateEngine: {
render: (container: HTMLElement, result: any) => void,
html: (strings: TemplateStringsArray, ...any) => any,
svg: (strings: TemplateStringsArray, ...any) => any,
map: (
items: any[],
identify: (item: any, index: number) => string,
callback: (item: any, index: number) => any
) => any,
nullish: (value: any) => any,
live: (value: any) => any,
unsafeHTML: (value: any) => any,
unsafeSVG: (value: any) => any,
ifDefined: (value: any) => any,
repeat: (
items: any[],
identify: (item: any, index: number) => any,
callback?: (item: any, index: number) => any
) => any,
};
static readonly templateEngine: {
render: (container: HTMLElement, result: any) => void,
html: (strings: TemplateStringsArray, ...any) => any,
}
static createRenderRoot(host: XElement): HTMLElement;
static template(
html: (strings: TemplateStringsArray, ...any) => any,
object
): (properties: object, host: XElement) => any;
}