Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface Property<T>

A compound property which provides either a getter, setter or both. Specifies the schema type for the property this decorator is applied to. This can be used to replace the static schema property on your instance. Multiple instances of this decorator can be applied, but no more than one per property. Specifies the schema type for a property with the given name on the class this decorator is applied to. This can either compliment or replace the static schema property on your instance class.

Type parameters

  • T

    The type of objects stored in the property

Hierarchy

  • Property

Callable

  • Property<TInstance, K>(asType: any, required?: undefined | true | false): function
  • Property<TInstance, K>(name: K, asType: any, required?: undefined | true | false): function
  • Specifies the schema type for the property this decorator is applied to. This can be used to replace the static schema property on your instance. Multiple instances of this decorator can be applied, but no more than one per property.

    Type parameters

    • TInstance: Instance<any, TInstance>

    • K: keyof TInstance

    Parameters

    • asType: any

      The schema validation type to make use of for this property

    • Optional required: undefined | true | false

    Returns function

      • (target: TInstance, name: K): void
      • Parameters

        • target: TInstance
        • name: K

        Returns void

  • Specifies the schema type for a property with the given name on the class this decorator is applied to. This can either compliment or replace the static schema property on your instance class.

    Type parameters

    Parameters

    • name: K

      The name of the property that is being targetted

    • asType: any

      The schema validation type to make use of for this property

    • Optional required: undefined | true | false

    Returns function

      • (target: TInstance): void
      • Parameters

        • target: TInstance

        Returns void

Index

Properties

Properties

Optional get

An optional getter which can be used to retrieve the property's value

Optional set

An optional setter which can be used to set the property's value

Generated using TypeDoc