Function injectableClass

  • Decorates a class by passing resolved values as arguments to its constructor.

    If an argument is an object which has tokens as its properties, then returns an object containing resolved values as properties.

    Returns

    A factory function which takes a dependency container as a single argument and returns a new created class.

    Type Parameters

    • Tokens extends (Token<unknown> | {
          [key: string]: Token<unknown>;
      })[]

    • Values extends { [ K in string | number | symbol]: Tokens[K] extends Token<V> ? V : Tokens[K] extends TokenProps<Props> ? Props : never }

    • Result

    Parameters

    • this: unknown
    • constructor: (new (...params: Values) => Result)

      Constructor of a class

        • new (...params: Values): Result
        • Parameters

          • Rest ...params: Values

          Returns Result

    • Rest ...tokens: Tokens

      Tokens which correspond to constructor arguments

    Returns ((container: Container) => Result)

Generated using TypeDoc