Options
All
  • Public
  • Public/Protected
  • All
Menu

Class MethodMirror<T, D>

Type parameters

Hierarchy

Index

Constructors

Properties

classMirror: ClassMirror<any>

classMirror 当前Mirror所属的ClassMirror

decorates: Set<T> = ...

metadata collection 元数据集合

descriptor: D

descriptor 当前参数的 descriptor

isStatic: boolean

isStatic 是否为静态成员

parameters: Map<number, ParameterMirror<any>> = ...

parameters 当前Mirror的所有参数ParameterMirror集合

propertyKey: string | symbol

propertyKey 当前Mirror所属target成员上的key名称

target: Object

target Mirror映射的目标

Methods

  • getDesignParamTypes(): Function[]
  • 获取参数的类型映射列表 包含该函数上的所有参数 返回数组的下标 对应ParameterMirror的index属性

    Returns Function[]

  • getReturnType(): undefined | Function
  • setParameter<T>(index: number, mirror: T): Map<number, ParameterMirror<any>>
  • reflect<T>(type: T, method: string | symbol, isStatic?: boolean): undefined | MethodMirror<any, any>
  • reflect<T>(type: T, method: (...args: any[]) => any, isStatic?: boolean): undefined | MethodMirror<any, any>
  • 使用函数名称查找映射数据

    Type parameters

    • T: Function

    Parameters

    • type: T
    • method: string | symbol
    • Optional isStatic: boolean

    Returns undefined | MethodMirror<any, any>

  • 使用函数查找映射数据

    Type parameters

    • T: Function

    Parameters

    • type: T
    • method: (...args: any[]) => any
        • (...args: any[]): any
        • Parameters

          • Rest ...args: any[]

          Returns any

    • Optional isStatic: boolean

      使用此方法可以目标类上的函数所映射的MethodMirror实例 具体使用方法请查阅test/index.spec.ts文件.

    Returns undefined | MethodMirror<any, any>