mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 20:40:20 +00:00
Add types for jsonabc
This commit is contained in:
Vendored
+20
@@ -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;
|
||||
@@ -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 }');
|
||||
@@ -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"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user