Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AbstractMethodDecorator<T>

抽象方法装饰器类

Type parameters

  • T

Hierarchy

  • AbstractMethodDecorator

Index

Properties

Optional descriptor

descriptor: TypedPropertyDescriptor<T>

Optional propertyKey

propertyKey: string | symbol

Static Private _targets

_targets: TargetMap<Object, MethodMap<string | symbol, MethodSet<AbstractMethodDecorator>>> = new TargetMap()

Methods

Optional onBeforeInvoke

  • 当此方法装饰器 装饰的方法 被调用前触发

    Parameters

    Returns Promise<void>

Optional onInvoked

  • onInvoked<V>(methodReflect: MethodReflect<any>, value: V): Promise<V>
  • 当此方法装饰器 装饰的方法 被调用后触发 在此处可以针对函数的返回值做类型检测 或返回值更新

    Type parameters

    • V

    Parameters

    • methodReflect: MethodReflect<any>

      方法元数据映射

    • value: V

      该方法运行后的返回值

    Returns Promise<V>

    T 返回新的value

setDescriptor

  • setDescriptor(descriptor: TypedPropertyDescriptor<T>): this
  • Parameters

    • descriptor: TypedPropertyDescriptor<T>

    Returns this

setPropertyKey

  • setPropertyKey(propertyKey: string | symbol): this
  • Parameters

    • propertyKey: string | symbol

    Returns this

Static create

Static defineMetadata

  • defineMetadata<T, M, P>(target: T, metadata: M, propertyKey: P): void
  • 根据目标类 定义元数据

    Type parameters

    Parameters

    • target: T

      目标类

    • metadata: M

      元数据

    • propertyKey: P

      目标类的成员方法名称

    Returns void

Static getMetadata

  • 根据目标类获取 方法装饰器的元数据集合

    Type parameters

    • T: Object

    • P: string | symbol

    Parameters

    • target: T
    • propertyKey: P

    Returns MethodSet<AbstractMethodDecorator> | undefined

Static getPropertyKeys

  • getPropertyKeys<T>(target: T): IterableIterator<string | symbol> | undefined
  • 根据目标类获取方法装饰器的成员方法名称

    Type parameters

    • T: Object

    Parameters

    • target: T

    Returns IterableIterator<string | symbol> | undefined

Generated using TypeDoc