• A decorator to register a class in the TSinjex DI (Dependency Injection) container.

    Type Parameters

    • TargetType extends (new (...args: unknown[]) => InstanceType<TargetType>)

      The type of the class to be registered.

    Parameters

    • identifier: string

      The identifier used to register the class in the DI container.

    • Optionaldeprecated: boolean

      If true, the dependency is deprecated and a warning is logged only once upon the first resolution of the dependency.

    Returns ((constructor: TargetType, ...args: unknown[]) => void)

    The decorator function to be applied on the class.

      • (constructor, ...args): void
      • Parameters

        Returns void

    Identifier for more information on identifiers.

    @Register('MyClassIdentifier')
    class MyClass {
    // ...
    }