UNPKG

1.68 kBMarkdownView Raw
1# Installation
2> `npm install --save @types/xmldom`
3
4# Summary
5This package contains type definitions for xmldom (https://github.com/xmldom/xmldom).
6
7# Details
8Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/xmldom.
9## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/xmldom/index.d.ts)
10````ts
11/// <reference lib="dom" />
12
13declare namespace xmldom {
14 var DOMParser: DOMParserStatic;
15 var XMLSerializer: XMLSerializerStatic;
16 var DOMImplementation: DOMImplementationStatic;
17
18 interface DOMImplementationStatic {
19 new(): DOMImplementation;
20 }
21
22 interface DOMParserStatic {
23 new(): DOMParser;
24 new(options: Options): DOMParser;
25 }
26
27 interface XMLSerializerStatic {
28 new(): XMLSerializer;
29 }
30
31 interface DOMParser {
32 parseFromString(xmlsource: string, mimeType?: string): Document;
33 }
34
35 interface XMLSerializer {
36 serializeToString(node: Node): string;
37 }
38
39 interface Options {
40 locator?: any;
41 errorHandler?: ErrorHandlerFunction | ErrorHandlerObject | undefined;
42 }
43
44 interface ErrorHandlerFunction {
45 (level: string, msg: any): any;
46 }
47
48 interface ErrorHandlerObject {
49 warning?: ((msg: any) => any) | undefined;
50 error?: ((msg: any) => any) | undefined;
51 fatalError?: ((msg: any) => any) | undefined;
52 }
53}
54
55export = xmldom;
56
57````
58
59### Additional Details
60 * Last updated: Tue, 07 Nov 2023 15:11:36 GMT
61 * Dependencies: none
62
63# Credits
64These definitions were written by [Qubo](https://github.com/tkqubo), and [Karfau](https://github.com/karfau).
65
\No newline at end of file