-
Notifications
You must be signed in to change notification settings - Fork 60
/
Copy pathhooks.ts
28 lines (27 loc) · 918 Bytes
/
hooks.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
export interface Hooks {
createElement(element: Element, ns?: string | null): void;
setAttribute(
element: Element,
name: string,
value: string,
ns?: string | null,
): void;
removeAttribute(element: Element, name: string, ns?: string | null): void;
createText(text: Text, data: string): void;
setText(text: Text, data: string): void;
insertChild(parent: Element, node: Element | Text, index: number): void;
removeChild(parent: Element, node: Element | Text, index: number): void;
addEventListener(
element: EventTarget,
type: string,
listener: EventListenerOrEventListenerObject | null,
options?: boolean | AddEventListenerOptions,
): void;
removeEventListener(
element: EventTarget,
type: string,
listener: EventListenerOrEventListenerObject | null,
options?: boolean | EventListenerOptions,
): void;
}
export const hooks: Partial<Hooks> = {};