decorator-make
TypeScript icon, indicating that this package has built-in type declarations

1.3.1 • Public • Published

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

Package Sidebar

Install

npm i decorator-make

Weekly Downloads

231

Version

1.3.1

License

MIT

Unpacked Size

11.5 kB

Total Files

7

Last publish

Collaborators

  • yefei777