forked from jbaroudi/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
xml2js.d.ts
73 lines (64 loc) · 2.24 KB
/
xml2js.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
// Type definitions for node-xml2js
// Project: https://github.com/Leonidas-from-XIV/node-xml2js
// Definitions by: Michel Salib <https://github.com/michelsalib>, Jason McNeil <https://github.com/jasonrm>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module 'xml2js' {
export = xml2js;
module xml2js {
function parseString(xml: string, callback: (err: any, result: any) => void): void;
function parseString(xml: string, options: Options, callback: (err: any, result: any) => void): void;
class Builder {
constructor(options?: BuilderOptions);
buildObject(rootObj: any): string;
}
class Parser {
constructor(options?: Options);
processAsync(): any;
assignOrPush(obj: any, key: string, newValue: any): any;
reset(): any;
parseString(str: string , cb?: Function): void;
}
interface RenderOptions {
indent?: string;
newline?: string;
pretty?: boolean;
}
interface XMLDeclarationOptions {
encoding?: string;
standalone?: boolean;
version?: string;
}
interface BuilderOptions {
doctype?: any;
headless?: boolean;
indent?: string;
newline?: string;
pretty?: boolean;
renderOpts?: RenderOptions;
rootName?: string;
xmldec?: XMLDeclarationOptions;
}
interface Options {
async?: boolean;
attrkey?: string;
attrNameProcessors?: (name: string) => string;
charkey?: string;
charsAsChildren?: boolean;
childkey?: string;
emptyTag?: any;
explicitArray?: boolean;
explicitCharkey?: boolean;
explicitChildren?: boolean;
explicitRoot?: boolean;
ignoreAttrs?: boolean;
mergeAttrs?: boolean;
normalize?: boolean;
normalizeTags?: boolean;
strict?: boolean;
tagNameProcessors?: [(name: string) => string];
trim?: boolean;
validator?: Function;
xmlns?: boolean;
}
}
}