mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-28 17:35:49 +08:00
Add xml2js definition
This commit is contained in:
7
xml2js/xml2js-tests.ts
Normal file
7
xml2js/xml2js-tests.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
/// <reference path="xml2js.d.ts" />
|
||||
|
||||
import xml2js = require('xml2js');
|
||||
|
||||
xml2js.parseString("<root>Hello xml2js!</root>", (err: any, result: any) => { });
|
||||
|
||||
xml2js.parseString("<root>Hello xml2js!</root>", {trim: true}, (err: any, result: any) => { });
|
||||
36
xml2js/xml2js.d.ts
vendored
Normal file
36
xml2js/xml2js.d.ts
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
// Type definitions for node-xml2js
|
||||
// Project: https://github.com/Leonidas-from-XIV/node-xml2js
|
||||
// Definitions by: Michel Salib <michelsalib@hotmail.com>
|
||||
// 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;
|
||||
|
||||
interface Options {
|
||||
attrkey?: string;
|
||||
charkey?: string;
|
||||
explicitCharkey?: boolean;
|
||||
trim?: boolean;
|
||||
normalizeTags?: boolean;
|
||||
normalize?: boolean;
|
||||
explicitRoot?: boolean;
|
||||
emptyTag?: any;
|
||||
explicitArray?: boolean;
|
||||
ignoreAttrs?: boolean;
|
||||
mergeAttrs?: boolean;
|
||||
validator?: Function;
|
||||
xmlns?: boolean;
|
||||
explicitChildren?: boolean;
|
||||
charsAsChildren?: boolean;
|
||||
async?: boolean;
|
||||
strict?: boolean;
|
||||
attrNameProcessors?: (name: string) => string;
|
||||
tagNameProcessors?: (name: string) => string;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user