ClassMethodDecoratorContext
The typed object passed as the second argument to a standard method decorator, describing the method being decorated.
In more detail
context.name is the method's name, context.kind is "method", context.addInitializer registers setup code and context.metadata stores shared information. Similar types exist for classes, fields and accessors.
Related terms
- decorator — A line starting with @ placed above a function or class that wraps it to add behaviour or information.
- addInitializer — A method on a decorator's context that registers a function to run when each instance, or the class itself, is set up.
- decorator metadata — An object shared by all decorators on a class, reached through context.metadata and later readable at Symbol.metadata on the class.
Taught in
- Modern Decorators: Stage 3 Standards And Class Metadata — Production TypeScript