UNPKG

1.66 kBTypeScriptView Raw
1
2import { ExposeOptions, ExcludeOptions, TypeOptions, TransformOptions } from "./metadata/ExposeExcludeOptions";
3import { ClassTransformOptions } from "./ClassTransformOptions";
4/**
5 * Defines a custom logic for value transformation.
6 */
7export declare function Transform(transformFn: (value: any) => any, options?: TransformOptions): (target: any, key: string) => void;
8/**
9 * Specifies a type of the property.
10 */
11export declare function Type(typeFunction?: (type?: TypeOptions) => Function): (target: any, key: string) => void;
12/**
13 * Marks property as included in the process of transformation. By default it includes the property for both
14 * constructorToPlain and plainToConstructor transformations, however you can specify on which of transformation types
15 * you want to skip this property.
16 */
17export declare function Expose(options?: ExposeOptions): (object: Object | Function, propertyName?: string) => void;
18/**
19 * Marks property as excluded from the process of transformation. By default it excludes the property for both
20 * constructorToPlain and plainToConstructor transformations, however you can specify on which of transformation types
21 * you want to skip this property.
22 */
23export declare function Exclude(options?: ExcludeOptions): (object: Object | Function, propertyName?: string) => void;
24/**
25 * Transform the object from class to plain object and return only with the exposed properties.
26 */
27export declare function TransformClassToPlain(params?: ClassTransformOptions): Function;
28/**
29 * Return the class instance only with the exposed properties.
30 */
31export declare function TransformClassToClass(params?: ClassTransformOptions): Function;