diff --git a/types/circular-json/circular-json-tests.ts b/types/circular-json/circular-json-tests.ts index 41ec8f0a36..786ec5cec6 100644 --- a/types/circular-json/circular-json-tests.ts +++ b/types/circular-json/circular-json-tests.ts @@ -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"}'); diff --git a/types/circular-json/index.d.ts b/types/circular-json/index.d.ts index 1b4e5c1d2b..ce94972de4 100644 --- a/types/circular-json/index.d.ts +++ b/types/circular-json/index.d.ts @@ -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 // 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 | null, space?: any, placeholder?: boolean): string; diff --git a/types/circular-json/tslint.json b/types/circular-json/tslint.json new file mode 100644 index 0000000000..b4b47a0378 --- /dev/null +++ b/types/circular-json/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +}