UNPKG

1.35 kBTypeScriptView Raw
1export declare function toJSON(value: Date): string;
2export declare function toJSON(value: Function): undefined;
3export declare function toJSON(value: unknown[]): unknown[];
4/**
5 * JSON encoding does not preserve properties that are undefined
6 * As a result, deepEqual checks fail because the expected model
7 * value contains these undefined property values, while the actual
8 * result returned by REST API does not.
9 * Use this function to convert a model instance into a data object
10 * as returned by REST API
11 */
12export declare function toJSON(value: object): object;
13export declare function toJSON(value: undefined): undefined;
14export declare function toJSON(value: null): null;
15export declare function toJSON(value: number): number;
16export declare function toJSON(value: boolean): boolean;
17export declare function toJSON(value: string): string;
18export declare function toJSON(value: unknown[] | null): unknown[] | null;
19export declare function toJSON(value: unknown[] | undefined): unknown[] | undefined;
20export declare function toJSON(value: unknown[] | null | undefined): unknown[] | null | undefined;
21export declare function toJSON(value: object | null): object | null;
22export declare function toJSON(value: object | undefined): object | undefined;
23export declare function toJSON(value: object | null | undefined): object | null | undefined;