Skip to content

IReplacingMap

Defined in: packages/data/src/map/ireplacing-map.ts:11

The sibling of IMap carrying IReplacing: never throws or waits when a bounded map is full, replacing an existing entry under its own policy (LRU/LFU/FIFO) instead of throwing, or skipping the incoming one.

K

V extends DefinedValue

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.

IReplacing.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.

IReplacing.overflowPolicy

[iterator](): Iterator<readonly [K, V], any, any>

Defined in: node_modules/.store/typescript-npm-6.0.3-585eecd158/package/lib/lib.es2015.iterable.d.ts:47

Iterator<readonly [K, V], any, any>

IMap.[iterator]


clear(): void

Defined in: packages/data/src/collection/icollection.ts:23

Removes all elements from the collection.

void

IMap.clear


count(): number

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

The number of elements in the collection.

A method, not a getter: its async counterpart needs a round trip to the backing store, and a member must have the same shape in both.

number

IMap.count


delete(key): boolean

Defined in: packages/data/src/map/imap.ts:19

K

boolean

IMap.delete


entries(): IterableIterator<readonly [K, V]>

Defined in: packages/data/src/map/imap.ts:22

IterableIterator<readonly [K, V]>

IMap.entries


get(key): V | undefined

Defined in: packages/data/src/map/imap.ts:16

K

V | undefined

IMap.get


has(key): boolean

Defined in: packages/data/src/map/imap.ts:18

K

boolean

IMap.has


keys(): IterableIterator<K>

Defined in: packages/data/src/map/imap.ts:20

IterableIterator<K>

IMap.keys


set(key, value): readonly readonly [K, V][]

Defined in: packages/data/src/map/ireplacing-map.ts:20

Same as IMap.set, but never throws — returns the entry displaced to make room (empty if nothing was displaced; under "skip", the would-be-inserted entry itself).

K

V

readonly readonly [K, V][]

IMap.set

IMap.set


values(): IterableIterator<V>

Defined in: packages/data/src/map/imap.ts:21

IterableIterator<V>

IMap.values