forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
xml2json.d.ts
36 lines (29 loc) · 915 Bytes
/
xml2json.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
// Type definitions for x2js
// Project: https://code.google.com/p/x2js/
// Definitions by: Horiuchi_H <https://github.com/horiuchi>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
interface IX2JS {
new (config?: IX2JSOption): IX2JS;
getVersion(): string;
xml2json<T>(dom: Node): T;
json2xml<T>(json: T): Node;
xml_str2json<T>(xml: string): T;
json2xml_str<T>(json: T): string;
parseXmlString(xml: string): Node;
asArray(prop: any): any[];
asDateTime(key: string): string;
asXmlDateTime(date: Date): string;
asXmlDateTime(date: number): string;
}
interface IX2JSOption {
escapeMode?: boolean;
attributePrefix?: string;
arrayAccessForm?: string;
emptyNodeForm?: string;
enableToStringFunc?: boolean;
arrayAccessFormPaths?: any[];
skipEmptyTextNodesForObj?: boolean;
stripWhitespaces?: boolean;
datetimeAccessFormPaths?: any[];
}
declare var X2JS: IX2JS;