refactored as per best practices

This commit is contained in:
Shantanu Bhadoria
2016-10-14 12:41:30 +08:00
parent 38b0ab0339
commit 0ffa9c0f32

20
ejson/ejson.d.ts vendored
View File

@@ -3,22 +3,24 @@
// Definitions by: Shantanu Bhadoria <https://github.com/shantanubhadoria>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare interface IStringifyOptions {
canonical: boolean;
indent: boolean|number|string;
}
declare interface ICloneOptions {
keyOrderSensitive: boolean;
}
declare module "ejson" {
interface StringifyOptions {
canonical: boolean;
indent: boolean|number|string;
}
interface CloneOptions {
keyOrderSensitive: boolean;
}
function clone<T>(obj: T): T;
function parse(str: string): any;
function stringify(obj: any, options?: IStringifyOptions): string;
function stringify(obj: any, options?: StringifyOptions): string;
function toJSONValue(obj: any): string;
function fromJSONValue(obj: string): any;
function isBinary(value: any): boolean;
function newBinary(len: number): Uint8Array;
function equals(a: any, b: any, options?: ICloneOptions): boolean;
function equals(a: any, b: any, options?: CloneOptions): boolean;
}