@types/xml2js
Advanced tools
Comparing version 0.4.5 to 0.4.6
@@ -18,4 +18,8 @@ // Type definitions for node-xml2js 0.4 | ||
export function parseString(str: convertableToString, callback: (err: Error, result: any) => void): void; | ||
export function parseString(str: convertableToString, options: OptionsV2, callback: (err: Error, result: any) => void): void; | ||
export function parseStringPromise(str: convertableToString, options?: OptionsV2): Promise<any>; | ||
export function parseString( | ||
str: convertableToString, | ||
options: ParserOptions, | ||
callback: (err: Error, result: any) => void, | ||
): void; | ||
export function parseStringPromise(str: convertableToString, options?: ParserOptions): Promise<any>; | ||
@@ -27,4 +31,16 @@ export const defaults: { | ||
export interface XmlDeclarationAttributes { | ||
version: string; | ||
encoding?: string; | ||
standalone?: boolean; | ||
} | ||
export interface RenderOptions { | ||
pretty?: boolean; | ||
indent?: string; | ||
newline?: string; | ||
} | ||
export class Builder { | ||
constructor(options?: OptionsV2); | ||
constructor(options?: BuilderOptions); | ||
buildObject(rootObj: any): string; | ||
@@ -34,3 +50,3 @@ } | ||
export class Parser extends EventEmitter { | ||
constructor(options?: OptionsV2); | ||
constructor(options?: ParserOptions); | ||
parseString(str: convertableToString, cb?: Function): void; | ||
@@ -41,2 +57,41 @@ parseStringPromise(str: convertableToString): Promise<any>; | ||
export interface ParserOptions { | ||
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; | ||
childkey?: string; | ||
preserveChildrenOrder?: boolean; | ||
charsAsChildren?: boolean; | ||
includeWhiteChars?: boolean; | ||
async?: boolean; | ||
strict?: boolean; | ||
attrNameProcessors?: Array<(name: string) => any>; | ||
attrValueProcessors?: Array<(value: string, name: string) => any>; | ||
tagNameProcessors?: Array<(name: string) => any>; | ||
valueProcessors?: Array<(value: string, name: string) => any>; | ||
} | ||
export interface BuilderOptions { | ||
attrkey?: string; | ||
charkey?: string; | ||
rootName?: string; | ||
renderOpts?: RenderOptions; | ||
xmldec?: XmlDeclarationAttributes; | ||
doctype?: any; | ||
headless?: boolean; | ||
allowSurrogateChars?: boolean; | ||
cdata?: boolean; | ||
} | ||
export interface Options { | ||
@@ -71,13 +126,5 @@ async?: boolean; | ||
rootName?: string; | ||
xmldec?: { | ||
version: string; | ||
encoding?: string; | ||
standalone?: boolean; | ||
}; | ||
xmldec?: XmlDeclarationAttributes; | ||
doctype?: any; | ||
renderOpts?: { | ||
pretty?: boolean; | ||
indent?: string; | ||
newline?: string; | ||
}; | ||
renderOpts?: RenderOptions; | ||
headless?: boolean; | ||
@@ -84,0 +131,0 @@ chunkSize?: number; |
{ | ||
"name": "@types/xml2js", | ||
"version": "0.4.5", | ||
"version": "0.4.6", | ||
"description": "TypeScript definitions for node-xml2js", | ||
@@ -49,3 +49,3 @@ "license": "MIT", | ||
"main": "", | ||
"types": "index", | ||
"types": "index.d.ts", | ||
"repository": { | ||
@@ -60,4 +60,4 @@ "type": "git", | ||
}, | ||
"typesPublisherContentHash": "c7c9a1ca79bc9b5a3b53c7f34ca89a3413f66b1746349eb81750949afa5acf85", | ||
"typeScriptVersion": "2.0" | ||
"typesPublisherContentHash": "9640741789edbce90fe756dba738750e000521ef02489cc213d70e864635eaa2", | ||
"typeScriptVersion": "3.2" | ||
} |
@@ -8,10 +8,10 @@ # Installation | ||
# Details | ||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/xml2js | ||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/xml2js. | ||
Additional Details | ||
* Last updated: Fri, 06 Sep 2019 23:54:00 GMT | ||
* Dependencies: @types/node | ||
### Additional Details | ||
* Last updated: Sun, 15 Nov 2020 11:13:12 GMT | ||
* Dependencies: [@types/node](https://npmjs.com/package/@types/node) | ||
* Global values: none | ||
# Credits | ||
These definitions were written by Michel Salib <https://github.com/michelsalib>, Jason McNeil <https://github.com/jasonrm>, Christopher Currens <https://github.com/ccurrens>, Edward Hinkle <https://github.com/edwardhinkle>, Behind The Math <https://github.com/BehindTheMath>, Claas Ahlrichs <https://github.com/claasahl>, Grzegorz Redlicki <https://github.com/redlickigrzegorz>, and Ryan Ling <https://github.com/72636c>. | ||
These definitions were written by [Michel Salib](https://github.com/michelsalib), [Jason McNeil](https://github.com/jasonrm), [Christopher Currens](https://github.com/ccurrens), [Edward Hinkle](https://github.com/edwardhinkle), [Behind The Math](https://github.com/BehindTheMath), [Claas Ahlrichs](https://github.com/claasahl), [Grzegorz Redlicki](https://github.com/redlickigrzegorz), and [Ryan Ling](https://github.com/72636c). |
Sorry, the diff of this file is not supported yet
8125
126