Function injectable

  • Decorator for a class or static factory which has no parameters. Inject options are optional in this case because no dependency qualifiers needs to be specified.

    Type Parameters

    • T

      The class/method type

    Parameters

    Returns InjectableDecorator<T, []>

    The decorator.

  • Decorator for a class or static factory with parameters. Inject options are not optional because dependency qualifiers must be specified so the injector knows what has to be injected.

    Type Parameters

    • T

      The type of the decorated class or static method

    • P extends unknown[]

      The constructor/method parameter types

    • Q extends { [K in string | number | symbol]: Qualifier<P[K<K>]> }

    Parameters

    • options: InjectableOptions<Q> & { inject: Q }

      The inject options with a mandatory inject property.

    Returns InjectableDecorator<T, P>

    the decorator

  • Decorator for a class or static factory with parameters. Inject options are not optional because dependency qualifiers must be specified so the injector knows what has to be injected.

    Type Parameters

    • T

      The type of the decorated class or static method

    • P extends unknown[]

      The constructor/method parameter types

    • Q extends { [K in string | number | symbol]: NullableQualifier<P[K<K>]> }

    Parameters

    Returns InjectableDecorator<T, P>

    the decorator

  • Short-form of the decorator without any inject options. Can only be used on classes or static factories without parameters.

    Type Parameters

    • T

      The type of the decorated class or static method

    Parameters

    • target: Constructor<T, []> | Factory<T, []>

      The class or static method

    • context: InjectableDecoratorContext<T, []>

      The decorator context.

    Returns void