Reflect
- 反射
- 参考
Reflect.metadata
ext | for |
---|---|
Reflect.decorate | |
Reflect.defineMetadata | |
Reflect.getMetadata | |
Reflect.hasMetadata | |
Reflect.getOwnMetadata | |
Reflect.hasOwnMetadata | |
Reflect.metadata | 返回 decorator |
@Reflect.metadata(metadataKey, metadataValue)
class C {
// apply metadata via a decorator to a method (property)
@Reflect.metadata(metadataKey, metadataValue)
method() {
}
}
- 类型信息 Key - emitDecoratorMetadata
- design:type
- design:paramtypes
- design:returntype
- Typescript
- emitDecoratorMetadata
- https://www.typescriptlang.org/docs/handbook/decorators.html
- core-js/es7/reflect
- reflect-metadata
- @abraham/reflection