Fix circular-json declarations to match JSON object (#20755)

* Fix circular-json declarations

* Simplify definitions of circular-json
This commit is contained in:
Alessandro Vergani
2017-10-20 18:10:45 +02:00
committed by Andy
parent fee527c103
commit 09b08e4b7d
3 changed files with 9 additions and 17 deletions

View File

@@ -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"}');

View File

@@ -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;

View File

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