forked from ionic-team/ionic-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathelementtree.d.ts
More file actions
35 lines (31 loc) · 1006 Bytes
/
elementtree.d.ts
File metadata and controls
35 lines (31 loc) · 1006 Bytes
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
declare module 'elementtree' {
namespace et {
class ElementTree {
getroot(): IElement;
find(p: string): IElement | null;
findall(p: string): IElement[];
write(opts?: { indent?: number }): string;
}
interface IElement {
tag: string;
attrib: { [key: string]: string };
text: null | string;
tail: null | string;
find(p: string): IElement | null;
findall(p: string): IElement[];
getchildren(): IElement[];
append(e: IElement): void;
remove(e: IElement): void;
extend(e: IElement[]): void;
clear(): void;
get(k: string): string | undefined;
set(k: string, v?: string): string;
keys(): string[];
items(): [string, string][];
}
function Element(tag: string, attrib: { [key: string]: string }): IElement;
function SubElement(parent: IElement, tag: string, attrib: { [key: string]: string }): IElement;
function parse(data: string): ElementTree;
}
export = et;
}