Skip to content

DI Bag API / index / CollectionToken

Interface: CollectionToken<TokenSymbol extends symbol, Item> ​

Defined in: tokens.ts:39

An immutable typed-token handle pairing a canonical symbol with an invariant collection item contract. Create one with DiBag.createToken(key).forCollectionOf<Item>().

Extends ​

Type Parameters ​

Type ParameterDescription
TokenSymbolThe unique symbol that is this token's runtime identity.
ItemThe item type accepted by contributions and returned in collection views.

Properties ​

symbol ​

ts
readonly symbol: TokenSymbol;

Defined in: tokens.ts:43

Ordinary services. Checked composition. Explicit ownership.