Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Type aliases

TransformFn

TransformFn: (value: any, obj: any, transformationType: CT.TransformationType) => any

Type declaration

    • (value: any, obj: any, transformationType: CT.TransformationType): any
    • Parameters

      • value: any
      • obj: any
      • transformationType: CT.TransformationType

      Returns any

Functions

Class

  • Class(typeFunction?: (type?: CT.TypeOptions) => Function): (target: any, key: string | symbol, parameterIndex?: number) => void
  • Specifies the class of a property.

    decorator

    Parameters

    • Optional typeFunction: (type?: CT.TypeOptions) => Function
        • (type?: CT.TypeOptions): Function
        • Parameters

          • Optional type: CT.TypeOptions

          Returns Function

    Returns (target: any, key: string | symbol, parameterIndex?: number) => void

      • (target: any, key: string | symbol, parameterIndex?: number): void
      • Parameters

        • target: any
        • key: string | symbol
        • Optional parameterIndex: number

        Returns void

Classify

  • Defines custom transformation logic when converting from a primitive to a class

    Parameters

    Returns (target: any, key: string) => void

      • (target: any, key: string): void
      • Parameters

        • target: any
        • key: string

        Returns void

Exclude

  • Exclude(options?: IExcludeOptions): (object: Object | Function, propertyName?: string) => void
  • Marks property as excluded from the process of transformation. By default it excludes the property for both constructorToPlain and plainToConstructor transformations, however you can specify on which of transformation types you want to skip this property.

    Parameters

    Returns (object: Object | Function, propertyName?: string) => void

      • (object: Object | Function, propertyName?: string): void
      • Parameters

        • object: Object | Function
        • Optional propertyName: string

        Returns void

Expose

  • Expose(options?: IExposeOptions): (object: Object | Function, propertyName?: string) => void
  • Marks property as included in the process of transformation. By default it includes the property for both constructorToPlain and plainToConstructor transformations, however you can specify on which of transformation types you want to skip this property.

    Parameters

    Returns (object: Object | Function, propertyName?: string) => void

      • (object: Object | Function, propertyName?: string): void
      • Parameters

        • object: Object | Function
        • Optional propertyName: string

        Returns void

Primitify

  • Defines custom transformation logic when converting from a primitive to a class

    Parameters

    Returns (target: any, key: string) => void

      • (target: any, key: string): void
      • Parameters

        • target: any
        • key: string

        Returns void

SerializeOptions

TransformClassToPlain

classify

deserialize

deserializeArray

hydrate

  • Hydrates an existing class instance with data from a plain object

    Type parameters

    • TClass

    Parameters

    • instance: TClass

      An instance to fill

    • objects: Object

      An object to get the data from

    • Optional options: ITransformationOptions

      Transformation options

    Returns TClass

  • Hydrates many existing instances with data from plain objects

    Type parameters

    • TClass

    Parameters

    • instances: TClass[]

      An array of instances to fill

    • objects: Object[]

      An array of plain objects to get the data from

    • Optional options: ITransformationOptions

      Transformation options

    Returns TClass[]

hydratePrimitive

  • Hydrates an existing plain object with data from a class instance

    Type parameters

    • TClass

    Parameters

    • instance: TClass

      An instance to get the data from

    • object: Object

      An object to fill

    • Optional options: ITransformationOptions

      Transformation options

    Returns Object

  • Hydrates an existing plain object with data from a class instance

    Type parameters

    • TClass

    Parameters

    • instances: TClass[]

      An array of instances to get the data from

    • objects: Object[]

      An array of objects to fill

    • Optional options: ITransformationOptions

      Transformation options

    Returns Object[]

primitify

serialize

Legend

  • Constructor
  • Property
  • Method
  • Inherited constructor
  • Inherited method
  • Property
  • Private property
  • Static method

Generated using TypeDoc