@discordx/internal
    Preparing search index...

    Class Decorator

    Base decorator class that tracks metadata about where decorators are applied.

    This class serves as the foundation for all decorator implementations in the framework, providing a consistent way to track and link decorators across classes, methods, and parameters.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    _methodReference?: Record<string, any>
    _parameterIndex?: number
    _propertyName: string
    _sourceClass: Record<string, any>
    _targetClass: Record<string, any>

    Accessors

    • get from(): Record<string, any>

      The original class where the decoration was first applied. May differ from classRef in inheritance scenarios.

      Returns Record<string, any>

    • set from(value: Record<string, any>): void

      Parameters

      • value: Record<string, any>

      Returns void

    • get index(): undefined | number

      The zero-based index of the parameter being decorated (parameter decorators only).

      Returns undefined | number

    • get method(): undefined | Record<string, any>

      The actual method function reference (for method decorators).

      Returns undefined | Record<string, any>

    Methods

    • 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.

      Parameters

      • classConstructor: Record<string, any>

        The class constructor

      • OptionalpropertyKey: string

        Property/method name (undefined for class decorators)

      • OptionalmethodDescriptor: PropertyDescriptor

        Method descriptor (undefined for parameter decorators)

      • OptionalparameterIndex: number

        Parameter index (undefined for class/method decorators)

      Returns this

      This instance for method chaining

    • Manually sets all metadata properties for this decorator.

      Parameters

      • targetClass: Record<string, any>

        The class being decorated

      • propertyName: string

        The property/method name

      • OptionalmethodRef: Record<string, any>

        The method function reference

      • OptionalsourceClass: Record<string, any>

        The originating class (defaults to targetClass)

      • OptionalparameterIndex: number

        The parameter position

      Returns this

      This instance for method chaining