- Preparing search index...
- The search index is not available
Ditox.js
- injectableClass<Tokens, Values, Result>(this: unknown, constructor: (new (...params: Values) => Result), ...tokens: Tokens): ((container: Container) => Result)
-
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)
-
- new (...params: Values): Result
-
Returns Result
-
Rest
...tokens: Tokens
Returns ((container: Container) => Result)
-
- (container: Container): Result
-
Returns Result
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.