mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-06-03 06:27:46 +08:00
add types for jsonic (#25671)
This commit is contained in:
19
types/jsonic/index.d.ts
vendored
Normal file
19
types/jsonic/index.d.ts
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
// Type definitions for jsonic 0.3
|
||||
// Project: https://github.com/rjrodger/jsonic
|
||||
// Definitions by: Rong SHen <https://github.com/jacobbubu>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare function jsonic(text: string): any;
|
||||
declare namespace jsonic {
|
||||
interface Options {
|
||||
depth?: number;
|
||||
maxitems?: number;
|
||||
maxchars?: number;
|
||||
omit?: string[];
|
||||
exclude?: string[];
|
||||
}
|
||||
|
||||
function stringify(val: any, opts?: Options): string;
|
||||
}
|
||||
|
||||
export = jsonic;
|
||||
7
types/jsonic/jsonic-tests.ts
Normal file
7
types/jsonic/jsonic-tests.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import * as jsonic from "jsonic";
|
||||
|
||||
jsonic("a:x, b:y z");
|
||||
jsonic.stringify(
|
||||
{ a: "a", b: "b", c: { c1: "c1" } },
|
||||
{ depth: 1, omit: ["a"], exclude: ["b"] }
|
||||
);
|
||||
16
types/jsonic/tsconfig.json
Normal file
16
types/jsonic/tsconfig.json
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": ["es6"],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": ["../"],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": ["index.d.ts", "jsonic-tests.ts"]
|
||||
}
|
||||
1
types/jsonic/tslint.json
Normal file
1
types/jsonic/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user