UNPKG

type-transformer

Version:

Transformation / serialization / deserialization of plain JavaScript objects to typed objects and vice versa

15 lines (14 loc) 895 B
import { SchemaRegistry } from './registry'; import { Schema } from './schema'; import { TransformationOptions } from './transformer'; export * from './decorators'; export * from './selection'; export { CircularRefStrategy } from './references'; export declare function createRegistry(): SchemaRegistry; export declare function createSchema(type: Function, registry?: SchemaRegistry): Schema; export declare function typedToPlain<T extends Object>(object: T, options?: TransformationOptions, existingObject?: any): any; declare type ClassType<T> = { new (...args: any[]): T; }; export declare function plainToTyped<O extends Array<any>, T>(object: O, targetType: ClassType<T>, options?: TransformationOptions, existingObject?: any): T[]; export declare function plainToTyped<O, T>(object: O, targetType: ClassType<T>, options?: TransformationOptions, existingObject?: any): T;