API reference > @kontsedal/olas-core > Collection
Collection type
The reactive surface returned by ctx.collection(...). items is the canonical ordered view (source-order, with any construction-failed items filtered out); size mirrors items.length; get / has are imperative key lookups. Once the owner disposes, items is empty and has is false. SPEC §11.1.
Signature:
typescript
type Collection<K, Api> = {
readonly items: ReadSignal<ReadonlyArray<{
readonly key: K;
readonly api: Api;
}>>;
readonly size: ReadSignal<number>;
get(key: K): Api | undefined;
has(key: K): boolean;
suspendItem(key: K): void;
resumeItem(key: K): void;
isItemSuspended(key: K): boolean;
};References: ReadSignal