Options
All
  • Public
  • Public/Protected
  • All
Menu

Type parameters

Hierarchy

Index

Constructors

constructor

Properties

classMirror

classMirror: ClassMirror<any>

classMirror 当前Mirror所属的ClassMirror

descriptor

descriptor: D

descriptor 当前参数的 descriptor

isStatic

isStatic: boolean

isStatic 是否为静态成员

Readonly metadata

metadata: Set<T> = ...

metadata collection 元数据集合

Private parameters

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

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

propertyKey

propertyKey: string | symbol

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

target

target: Object

target Mirror映射的目标

Methods

getAllMetadata

getDesignParamTypes

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

    Returns Function[]

getMetadata

getParameter

getParameters

getReturnType

  • getReturnType(): undefined | Function

setParameter

  • setParameter<T>(index: number, mirror: T): Map<number, ParameterMirror<any>>

Static createDecorator

  • 创建方法装饰器

    Parameters

    • metadata: MethodMetadata<any, any>

      使用此方法可以创建一个成员方法装饰器, metadata 必须继承至MethodMetadata对象

    Returns MethodDecorator

Static reflect

  • 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>