mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-20 21:12:38 +08:00
Fix circular-json declarations to match JSON object (#20755)
* Fix circular-json declarations * Simplify definitions of circular-json
This commit is contained in:
@@ -1,14 +1,10 @@
|
||||
|
||||
import CircularJSON = require('circular-json');
|
||||
|
||||
var replacer = (key: any, val: any) => {
|
||||
const replacer = (key: any, val: any) => {
|
||||
return val;
|
||||
}
|
||||
};
|
||||
|
||||
var replacerArray = ['a', 'x'];
|
||||
|
||||
// implements JSON interface
|
||||
var json_obj: JSON = CircularJSON;
|
||||
const replacerArray = ['a', 'x'];
|
||||
|
||||
CircularJSON.parse('{"a":"b"}');
|
||||
|
||||
|
||||
13
types/circular-json/index.d.ts
vendored
13
types/circular-json/index.d.ts
vendored
@@ -1,14 +1,7 @@
|
||||
// Type definitions for circular-json v0.1.6
|
||||
// Type definitions for circular-json 0.4
|
||||
// Project: https://github.com/WebReflection/circular-json
|
||||
// Definitions by: Jonathan Pevarnek <https://github.com/jpevarnek>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
|
||||
interface ICircularJSON extends JSON {
|
||||
parse(text: string, reviver?: (key: any, value: any) => any): any;
|
||||
stringify(value: any, replacer?: ((key: string, value: any) => any) | any[], space?: any, placeholder?: boolean): string;
|
||||
}
|
||||
|
||||
declare var CircularJSON: ICircularJSON;
|
||||
|
||||
export = CircularJSON;
|
||||
export function parse(text: string, reviver?: (key: any, value: any) => any): any;
|
||||
export function stringify(value: any, replacer?: ((key: string, value: any) => any) | Array<number | string> | null, space?: any, placeholder?: boolean): string;
|
||||
|
||||
3
types/circular-json/tslint.json
Normal file
3
types/circular-json/tslint.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
Reference in New Issue
Block a user