Merge pull request #23495 from tuananh/add-camaro-type

Add types for camaro package
This commit is contained in:
Daniel Rosenwasser
2018-02-13 11:16:55 -08:00
committed by GitHub
4 changed files with 41 additions and 0 deletions
+3
View File
@@ -0,0 +1,3 @@
import transform = require('camaro');
const x: object = transform('<root><child>text</child></root>', { text: 'root/child'});
+13
View File
@@ -0,0 +1,13 @@
// Type definitions for camaro 2.2
// Project: https://github.com/tuananh/camaro
// Definitions by: Tuan Anh Tran <https://github.com/tuananh>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
/**
* Transform the input xml to json using the input template object.
* @param input The input xml string
* @param template The output template
*/
declare function transform(input: string, template: object): object;
export = transform;
+24
View File
@@ -0,0 +1,24 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true,
"esModuleInterop": true
},
"files": [
"index.d.ts",
"camaro-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }