Decorator Metadata
Attach and read metadata with the metadata API.
The Decorator Metadata API
Standardized decorators include a built-in metadata channel. The context object exposes a metadata object you can write to, and the class later carries it under the well-known Symbol.metadata key.
context.metadata
Every decorator context shares a single metadata object for the class being defined. Decorators attach data to it; it becomes the class metadata.
function tag(label: string) {
return function (value: any, context: DecoratorContext) {
context.metadata[context.name] = label;
};
}