Creates a new decorator modifier.
The function that modifies target decorators.
The list of decorator types that can be modified.
Protected
Optional
_Protected
Optional
_Protected
_Protected
_Protected
_The class constructor where this decorator was applied.
The original class where the decoration was first applied.
May differ from classRef
in inheritance scenarios.
The zero-based index of the parameter being decorated (parameter decorators only).
Determines if this decorator was applied to a class constructor.
The name of the property or method being decorated.
The actual method function reference (for method decorators).
Applies this modifier's function to a specific decorator.
The decorator to modify.
The result of the modification function.
Automatically detects the decoration target type and applies appropriate metadata.
This method handles the complexity of TypeScript's decorator signatures and normalizes them into a consistent internal representation.
The class constructor
Optional
propertyKey: stringProperty/method name (undefined for class decorators)
Optional
methodDescriptor: PropertyDescriptorMethod descriptor (undefined for parameter decorators)
Optional
parameterIndex: numberParameter index (undefined for class/method decorators)
This instance for method chaining
Manually sets all metadata properties for this decorator.
The class being decorated
The property/method name
Optional
methodRef: Record<string, any>The method function reference
Optional
sourceClass: Record<string, any>The originating class (defaults to targetClass)
Optional
parameterIndex: numberThe parameter position
This instance for method chaining
Static
createFactory method for creating modifier instances with better type inference.
The function that performs the modification.
The decorator types that can be modified.
A new modifier instance.
Static
modifyApplies a collection of modifiers to a collection of decorators.
This is the main entry point for the modification system. It processes all modifiers and applies them to their applicable decorators in parallel for better performance.
A promise that resolves when all modifications are applied.
A powerful system for modifying the behavior of existing decorators without altering their implementation.
Modifiers allow you to create cross-cutting concerns that can affect multiple decorators based on their type and location. This enables features like development mode overrides, logging, validation, and dynamic behavior changes.