mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Add types for jsonabc
This commit is contained in:
parent
70fe269343
commit
f39fd15de1
20
types/jsonabc/index.d.ts
vendored
Normal file
20
types/jsonabc/index.d.ts
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
// Type definitions for jsonabc 2.3
|
||||
// Project: http://novicelab.org/jsonabc
|
||||
// Definitions by: Florian Keller <https://github.com/ffflorian>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
/**
|
||||
* Sort the JSON (clean, parse, sort, stringify).
|
||||
* @param noArray Sort or don't sort arrays
|
||||
*/
|
||||
export function sort(inputStr: string, noArray?: boolean): string;
|
||||
|
||||
/**
|
||||
* Sort the JSON (clean, parse, sort, stringify).
|
||||
* @param noArray Sort or don't sort arrays
|
||||
*/
|
||||
export function sortObj(input: object, noArray?: boolean): object;
|
||||
|
||||
/** Remove trailing commas */
|
||||
export function cleanJSON(input: string): string;
|
||||
9
types/jsonabc/jsonabc-tests.ts
Normal file
9
types/jsonabc/jsonabc-tests.ts
Normal file
@ -0,0 +1,9 @@
|
||||
import * as myJsonAbc from 'jsonabc';
|
||||
|
||||
myJsonAbc.sortObj({ c: 0, b: 1, a: 0 });
|
||||
myJsonAbc.sortObj({ c: 0, b: 1, a: 0 }, false);
|
||||
|
||||
myJsonAbc.sort('{ c: 0, b: 1, a: 0 }');
|
||||
myJsonAbc.sort('{ c: 0, b: 1, a: 0 }', true);
|
||||
|
||||
myJsonAbc.cleanJSON('{ c: 0, b: 1, a: 0 }');
|
||||
23
types/jsonabc/tsconfig.json
Normal file
23
types/jsonabc/tsconfig.json
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"jsonabc-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/jsonabc/tslint.json
Normal file
1
types/jsonabc/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user