

NOTE Should you choose to return a new constructor function, you must take care to maintain the original prototype. If the class decorator returns a value, it will replace the class declaration with the provided constructor function. The expression for the class decorator will be called as a function at runtime, with the constructor of the decorated class as its only argument. The class decorator is applied to the constructor of the class and can be used to observe, modify, or replace a class definition.Ī class decorator cannot be used in a declaration file, or in any other ambient context (such as on a declare class). Class Decorators are applied for the class.Ī Class Decorator is declared just before a class declaration.Parameter Decorators are applied for the constructor.Parameter Decorators, followed by Method, Accessor, or Property Decorators are applied for each static member.Parameter Decorators, followed by Method, Accessor, or Property Decorators are applied for each instance member.

There is a well defined order to how decorators applied to various declarations inside of a class are applied:
