Skip to content

IReplacing

Defined in: packages/data/src/collection/ireplacing.ts:20

A bounded associative collection that replaces an entry instead of rejecting an over-capacity insert.

Positional ADTs have a natural eviction victim (see ILossy) contrary to associative ones.

readonly capacity: number

Defined in: packages/data/src/collection/ibounded.ts:17

The maximum number of elements the collection can hold.

Note: Infinity is not a legal value here — an unbounded type omits this mixin.

IBounded.capacity


readonly overflowPolicy: ReplacementPolicy

Defined in: packages/data/src/collection/ireplacing.ts:25

The policy that determines which entry to replace when the collection exceeds its capacity.