UNPKG

1.07 kBTypeScriptView Raw
1/// <reference lib="dom" />
2
3declare namespace xmldom {
4 var DOMParser: DOMParserStatic;
5 var XMLSerializer: XMLSerializerStatic;
6 var DOMImplementation: DOMImplementationStatic;
7
8 interface DOMImplementationStatic {
9 new(): DOMImplementation;
10 }
11
12 interface DOMParserStatic {
13 new(): DOMParser;
14 new(options: Options): DOMParser;
15 }
16
17 interface XMLSerializerStatic {
18 new(): XMLSerializer;
19 }
20
21 interface DOMParser {
22 parseFromString(xmlsource: string, mimeType?: string): Document;
23 }
24
25 interface XMLSerializer {
26 serializeToString(node: Node): string;
27 }
28
29 interface Options {
30 locator?: any;
31 errorHandler?: ErrorHandlerFunction | ErrorHandlerObject | undefined;
32 }
33
34 interface ErrorHandlerFunction {
35 (level: string, msg: any): any;
36 }
37
38 interface ErrorHandlerObject {
39 warning?: ((msg: any) => any) | undefined;
40 error?: ((msg: any) => any) | undefined;
41 fatalError?: ((msg: any) => any) | undefined;
42 }
43}
44
45export = xmldom;
46
\No newline at end of file