Skip to content

DI Bag API / index / TokenService

Type Alias: TokenService<T> ​

ts
type TokenService<T> = T extends infer U & {} ? U extends Token<infer _K, infer S> ? S : never : never;

Defined in: tokens.ts:61

Extract the invariant service contract declared by a typed token.

Type Parameters ​

Type ParameterDescription
T-

See ​

https://dany-fedorov.github.io/di-bag/guides/tutorial.html#use-typed-tokens-for-explicit-positional-injection

Ordinary services. Checked composition. Explicit ownership.