Decorators
TypeScript decorators provide a powerful system for annotating class declarations and modifying functionality outside of the standard class inheritance mechanisms.
It provides you full control over a class declaration, along with the properties and methods declared in that class.
Class decorators
With decorator functions, you can take complete control over how a class
declaration works. Notice in the example below that the classDecorator
function is called before any instances of the class are created.
Loading TypeScript...
A common pattern for using decorators is to provide a decorator factory function, which produces a function whose type matches the global
utility type ClassDecorator
.
Loading TypeScript...
Property decorators
TODO
Accessor decorators
TODO
Method decorators
TODO
Parameter decorators
TODO