decorator-make
v1.5.0
Published
## Property Decorator
Downloads
824
Maintainers
Readme
decorator-make
Property Decorator
const deco = makePropertyDecorator();
TypeScript with experimentalDecorators & emitDecoratorMetadata
class Target {
@deco.decorate prop: Type;
}
JavaScript
class Target {
}
deco.decorate(Target.prototype, 'prop', Type);
Get Types
deco.getTypes(Target.prototype);
Method Decorator
const deco = makeMethodDecorator();
TypeScript with experimentalDecorators & emitDecoratorMetadata
class Target {
@deco.decorate someFunc(type?: Type, ...) {}
}
JavaScript
class Target {
someFunc(type, ...) {}
}
deco.decorate(Target.prototype, 'someFunc', [Type, ...]);
Get Methods
deco.getMethods(Target.prototype);
Class Decorator
const deco = makeClassDecorator();
TypeScript with experimentalDecorators & emitDecoratorMetadata
@deco.decorate class Target {}
JavaScript
class Target {}
deco.decorate(Target);
Get Value
deco.getValue(Target); // return true