Add json3 typing. (#25543)

This commit is contained in:
NN
2018-05-07 19:20:26 +03:00
committed by Andy
parent 021d2ad272
commit d7e112022a
4 changed files with 39 additions and 0 deletions

7
types/json3/index.d.ts vendored Normal file
View File

@@ -0,0 +1,7 @@
// Type definitions for json3 3.3
// Project: https://bestiejs.github.io/json3/
// Definitions by: NN <https://github.com/NN--->
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare var json3: JSON;
export = json3;

View File

@@ -0,0 +1,5 @@
import * as JSON3 from "json3";
const obj = JSON3.parse('{ "a" : { "b" : [1, 2] } }');
const str = JSON3.stringify(obj, null, "\t");
console.log(str);

24
types/json3/tsconfig.json Normal file
View File

@@ -0,0 +1,24 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6",
"dom"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"json3-tests.ts"
]
}

3
types/json3/tslint.json Normal file
View File

@@ -0,0 +1,3 @@
{
"extends": "dtslint/dt.json"
}