kernel/di/token
Interfaces
Section titled “Interfaces”Defined in: app/src/kernel/di/token.ts:5
Identifies a service in the Container. The type parameter carries the type of
the service, so resolve(token) is typed without casts.
Type Parameters
Section titled “Type Parameters”T
Properties
Section titled “Properties”
readonlyid:symbol
Defined in: app/src/kernel/di/token.ts:7
Unique identity of the token.
readonlyname:string
Defined in: app/src/kernel/di/token.ts:9
Human-readable name used in error messages and diagnostics.
Type Aliases
Section titled “Type Aliases”TokenType
Section titled “TokenType”TokenType<
K> =KextendsToken<infer T> ?T:never
Defined in: app/src/kernel/di/token.ts:18
The service type a Token stands for.
Type Parameters
Section titled “Type Parameters”K
TokenTypes
Section titled “TokenTypes”TokenTypes<
K> ={ readonly [I in keyof K]: TokenType<K[I]> }
Defined in: app/src/kernel/di/token.ts:21
Maps a tuple of tokens to the tuple of their service types.
Type Parameters
Section titled “Type Parameters”K extends readonly Token<unknown>[]
Functions
Section titled “Functions”token()
Section titled “token()”token<
T>(name):Token<T>
Defined in: app/src/kernel/di/token.ts:30
Creates a new token. Two calls with the same name create two different tokens.
Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”string
Name for diagnostics, conventionally the interface name.
Returns
Section titled “Returns”Token<T>
A frozen token.