Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "types/decorators"

Index

Type aliases

AccessorDecorator

AccessorDecorator: function

Defines a static or instance get/set property accessor decorator function type.

param

Decorated accessor property class' prototype (for instance accessor) or constructor function (for static accessor).

param

Name of the decorated property accessor.

param

Descriptor of the decorated property accessor.

remarks

If the accessor decorator returns a value, it will be used as the Property Descriptor for the member.

When targeting versions less than ES5 propDescriptor will be undefined and the return value is ignored.

See https://www.typescriptlang.org/docs/handbook/decorators.html#accessor-decorators

Type declaration

    • <TPropName, TProtoOrClass>(protoOrClass: TProtoOrClass, propName: TPropName, propDescriptor: TypedPropertyDescriptor<TPropType>): void | TypedPropertyDescriptor<TPropType>
    • Type parameters

      • TPropName: string | symbol

      • TProtoOrClass: Record<TPropName, TPropType>

      Parameters

      • protoOrClass: TProtoOrClass
      • propName: TPropName
      • propDescriptor: TypedPropertyDescriptor<TPropType>

      Returns void | TypedPropertyDescriptor<TPropType>

ClassDecorator

ClassDecorator: function

Defines a class decorator generic function type.

param

Target class constructor function type.

param

Decorated class constructor function.

remarks

If the class decorator returns a value, it will replace the class declaration with the provided constructor function.

See https://www.typescriptlang.org/docs/handbook/decorators.html#-decorators

Type declaration

    • <TClassType>(targetClass: TClassType): TClassType | void
    • Type parameters

      Parameters

      • targetClass: TClassType

      Returns TClassType | void

MethodDecorator

MethodDecorator: function

Defines a static or instance method decorator function type.

param

Prototype of the decorated method's class (for instance method) or constructor function (for static method).

param

Name of the property, that contains decorated method.

param

Descriptor of the decorated method property.

remarks

Decorated function this context is of typeof protoOrClass type.

If the method decorator returns a value, it will be used as the Property Descriptor for the method.

When targeting versions less than ES5 methodDescriptor will be undefined and the return value is ignored.

See https://www.typescriptlang.org/docs/handbook/decorators.html#method-decorators

Type declaration

    • <TMethodName, TProtoOrClass>(protoOrClass: TProtoOrClass, methodName: TMethodName, methodDescriptor: TypedPropertyDescriptor<BasicFunction<TArgs, TRetval, TProtoOrClass>>): void | TypedPropertyDescriptor<BasicFunction<TArgs, TRetval, TProtoOrClass>>
    • Type parameters

      • TMethodName: string | symbol

      • TProtoOrClass: Record<TMethodName, BasicFunction<TArgs, TRetval, TProtoOrClass>>

      Parameters

      • protoOrClass: TProtoOrClass
      • methodName: TMethodName
      • methodDescriptor: TypedPropertyDescriptor<BasicFunction<TArgs, TRetval, TProtoOrClass>>

      Returns void | TypedPropertyDescriptor<BasicFunction<TArgs, TRetval, TProtoOrClass>>

ParameterDecorator

ParameterDecorator: function

Defines a static or instance method parameter decorator function type. Type parameter TParamType is an experimental feature and it won't work untill the following issue is solved https://github.com/Microsoft/TypeScript/issues/30102

param

Decorated method parameter class' prototype (for instance method) or constructor function (for static method).

param

Name of the decorated parameter's method.

param

The ordinal index of the parameter in the function’s parameter list.

remarks

Return value is totally ignored.

See https://www.typescriptlang.org/docs/handbook/decorators.html#parameter-decorators

Type declaration

    • <TMethodName, TParamIndex, TProtoOrClass>(protoOrClass: TProtoOrClass, methodName: TMethodName, parameterIndex: TParamIndex): void
    • Type parameters

      • TMethodName: string | symbol

      • TParamIndex: number

      • TProtoOrClass: Record<TMethodName, function>

      Parameters

      • protoOrClass: TProtoOrClass
      • methodName: TMethodName
      • parameterIndex: TParamIndex

      Returns void

PropertyDecorator

PropertyDecorator: function

Defines a static or instance property decorator function type.

param

Decorated property class' prototype (for instance property) or constructor function (for static property).

param

Name of the decorated property.

remarks

Return value is totally ignored.

See https://www.typescriptlang.org/docs/handbook/decorators.html#property-decorators

Type declaration

    • <TPropName, TProtoOrClass>(protoOrClass: TProtoOrClass, propName: TPropName): void
    • Type parameters

      • TPropName: string | symbol

      • TProtoOrClass: Record<TPropName, TPropType>

      Parameters

      • protoOrClass: TProtoOrClass
      • propName: TPropName

      Returns void

Generated using TypeDoc