• A decorator to register a class in the 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 => a warning is logged when the dependency is resolved.

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

    A function that is applied as a decorator to the class.

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

        Returns void

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