mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 04:49:15 +08:00
refactored as per best practices
This commit is contained in:
20
ejson/ejson.d.ts
vendored
20
ejson/ejson.d.ts
vendored
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user