import { ClassTransformOptions } from './interfaces'; import { ClassConstructor } from './interfaces'; export { ClassTransformer } from './ClassTransformer'; export * from './decorators'; export * from './interfaces'; export * from './enums'; /** * Converts class (constructor) object to plain (literal) object. Also works with arrays. * * @deprecated Function name changed, use the `instanceToPlain` method instead. */ export declare function classToPlain(object: T, options?: ClassTransformOptions): Record; export declare function classToPlain(object: T[], options?: ClassTransformOptions): Record[]; /** * Converts class (constructor) object to plain (literal) object. Also works with arrays. */ export declare function instanceToPlain(object: T, options?: ClassTransformOptions): Record; export declare function instanceToPlain(object: T[], options?: ClassTransformOptions): Record[]; /** * Converts class (constructor) object to plain (literal) object. * Uses given plain object as source object (it means fills given plain object with data from class object). * Also works with arrays. * * @deprecated This function is being removed. */ export declare function classToPlainFromExist(object: T, plainObject: Record, options?: ClassTransformOptions): Record; export declare function classToPlainFromExist(object: T, plainObjects: Record[], options?: ClassTransformOptions): Record[]; /** * Converts plain (literal) object to class (constructor) object. Also works with arrays. * * @deprecated Function name changed, use the `plainToInstance` method instead. */ export declare function plainToClass(cls: ClassConstructor, plain: V[], options?: ClassTransformOptions): T[]; export declare function plainToClass(cls: ClassConstructor, plain: V, options?: ClassTransformOptions): T; /** * Converts plain (literal) object to class (constructor) object. Also works with arrays. */ export declare function plainToInstance(cls: ClassConstructor, plain: V[], options?: ClassTransformOptions): T[]; export declare function plainToInstance(cls: ClassConstructor, plain: V, options?: ClassTransformOptions): T; /** * Converts plain (literal) object to class (constructor) object. * Uses given object as source object (it means fills given object with data from plain object). * Also works with arrays. * * @deprecated This function is being removed. The current implementation is incorrect as it modifies the source object. */ export declare function plainToClassFromExist(clsObject: T[], plain: V[], options?: ClassTransformOptions): T[]; export declare function plainToClassFromExist(clsObject: T, plain: V, options?: ClassTransformOptions): T; /** * Converts class (constructor) object to new class (constructor) object. Also works with arrays. */ export declare function instanceToInstance(object: T, options?: ClassTransformOptions): T; export declare function instanceToInstance(object: T[], options?: ClassTransformOptions): T[]; /** * Converts class (constructor) object to plain (literal) object. * Uses given plain object as source object (it means fills given plain object with data from class object). * Also works with arrays. * * @deprecated This function is being removed. The current implementation is incorrect as it modifies the source object. */ export declare function classToClassFromExist(object: T, fromObject: T, options?: ClassTransformOptions): T; export declare function classToClassFromExist(object: T, fromObjects: T[], options?: ClassTransformOptions): T[]; /** * Serializes given object to a JSON string. * * @deprecated This function is being removed. Please use * ``` * JSON.stringify(instanceToPlain(object, options)) * ``` */ export declare function serialize(object: T, options?: ClassTransformOptions): string; export declare function serialize(object: T[], options?: ClassTransformOptions): string; /** * Deserializes given JSON string to a object of the given class. * * @deprecated This function is being removed. Please use the following instead: * ``` * instanceToClass(cls, JSON.parse(json), options) * ``` */ export declare function deserialize(cls: ClassConstructor, json: string, options?: ClassTransformOptions): T; /** * Deserializes given JSON string to an array of objects of the given class. * * @deprecated This function is being removed. Please use the following instead: * ``` * JSON.parse(json).map(value => instanceToClass(cls, value, options)) * ``` * */ export declare function deserializeArray(cls: ClassConstructor, json: string, options?: ClassTransformOptions): T[];