mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-11 11:34:12 +08:00
33 lines
719 B
TypeScript
33 lines
719 B
TypeScript
|
|
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;
|
|
|