UNPKG

typescript-domain

Version:

Decorator-based transformation of JSON or plain Javascript objects to classes

17 lines (16 loc) 741 B
export declare type Constructor<T = any> = new (...args: any[]) => T; export declare type Indexable = { [key: string]: unknown; }; export declare type PlainData<T> = { [P in keyof T]?: T[P] extends Array<infer U> ? Array<PlainData<U>> | null | undefined : T[P] extends ReadonlyArray<infer U> ? ReadonlyArray<PlainData<U>> | null | undefined : PlainData<T[P]> | null | undefined; }; export declare type EnumOptions = unknown[]; export declare type BasicTypes = BooleanConstructor | DateConstructor | NumberConstructor | StringConstructor | EnumOptions; export declare type DebugOutput = { class: string; field: string; value: string; info: string; }; export declare type DebugFunction = (output: DebugOutput) => void;