Skip to content

DI Bag API / index / TokenMember

Type Alias: TokenMember<R extends Registrations, T> ​

ts
type TokenMember<R extends Registrations, T> = ValidToken<T> extends true ? [WrongToken<T, R> | MissingToken<T, R>] extends [never] ? unknown : Unsatisfied<`token must match an existing binding contract${SeeErrors<'unknown-key'>}`, {}> : Unsatisfied<`token must be an individually known genuine handle${SeeErrors<'unknown-key'>}`, {}>;

Defined in: token-types.ts:85

Admit a genuine token only when it exactly matches an existing binding contract.

Type Parameters ​

Type ParameterDescription
R-
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.