-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
32 lines (28 loc) · 1023 Bytes
/
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
export declare type NodeType = 'DOCUMENT' | 'ELEMENT' | 'TEXT' | 'CDATA' | 'COMMENT' | 'WHITESPACE' | 'TEMPLATE' | 'UNKNOWN';
export declare type XElement = {
childNodes: XElement[];
nodeType: NodeType;
parent: Element | null;
outerHTML: string;
innerText: string;
tagName: string | null;
attr: (name: string) => string | undefined;
attr_s: (name: string) => string;
find: (selector: string) => XElement[];
first: (selector: string) => XElement | null;
first_s: (selector: string) => XElement;
hasClass: (name: string) => boolean;
hasAttribute: (name: string) => boolean;
prev: (selector?: string) => XElement | null;
next: (selector?: string) => XElement | null;
};
export declare type XDocument = {
documentElement: XElement;
outerHTML: string;
innerText: string;
tagName: string | null;
find: (selector: string) => XElement[]
first: (selector: string) => XElement | null;
first_s: (selector: string) => XElement;
};
export declare function parse(html: string): XDocument;