UNPKG

889 BTypeScriptView Raw
1export declare enum HostNodeType {
2 Text = "text",
3 Element = "element",
4 ShadowRoot = "shadow-root"
5}
6export interface HostText {
7 type: HostNodeType.Text;
8 parent: HostElement | null;
9 value: string;
10}
11export interface HostAttribute {
12 name: string;
13 namespace: string | null;
14 value: string;
15}
16export interface HostShadowRoot {
17 type: HostNodeType.ShadowRoot;
18 children: HostChildNode[];
19 mode: 'open' | 'closed';
20 delegatesFocus: boolean;
21}
22export interface HostElement {
23 type: HostNodeType.Element;
24 name: string;
25 parent: HostElement | null;
26 shadowRoot: HostShadowRoot | null;
27 namespace?: string;
28 children: HostChildNode[];
29 attributes: HostAttribute[];
30 eventListeners: Record<string, Function[]>;
31}
32export declare type HostNode = HostText | HostElement;
33export declare type HostChildNode = HostElement | HostText;