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.
Extends
Section titled “Extends”IMap<K,V>.IReplacing
Type Parameters
Section titled “Type Parameters”K
V extends DefinedValue
Properties
Section titled “Properties”capacity
Section titled “capacity”
readonlycapacity: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.
Inherited from
Section titled “Inherited from”overflowPolicy
Section titled “overflowPolicy”
readonlyoverflowPolicy:ReplacementPolicy
Defined in: packages/data/src/collection/ireplacing.ts:25
The policy that determines which entry to replace when the collection exceeds its capacity.
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”[iterator]()
Section titled “[iterator]()”[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
Returns
Section titled “Returns”Iterator<readonly [K, V], any, any>
Inherited from
Section titled “Inherited from”clear()
Section titled “clear()”clear():
void
Defined in: packages/data/src/collection/icollection.ts:23
Removes all elements from the collection.
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”count()
Section titled “count()”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.
Returns
Section titled “Returns”number
Inherited from
Section titled “Inherited from”delete()
Section titled “delete()”delete(
key):boolean
Defined in: packages/data/src/map/imap.ts:19
Parameters
Section titled “Parameters”K
Returns
Section titled “Returns”boolean
Inherited from
Section titled “Inherited from”entries()
Section titled “entries()”entries():
IterableIterator<readonly [K,V]>
Defined in: packages/data/src/map/imap.ts:22
Returns
Section titled “Returns”IterableIterator<readonly [K, V]>
Inherited from
Section titled “Inherited from”get(
key):V|undefined
Defined in: packages/data/src/map/imap.ts:16
Parameters
Section titled “Parameters”K
Returns
Section titled “Returns”V | undefined
Inherited from
Section titled “Inherited from”has(
key):boolean
Defined in: packages/data/src/map/imap.ts:18
Parameters
Section titled “Parameters”K
Returns
Section titled “Returns”boolean
Inherited from
Section titled “Inherited from”keys()
Section titled “keys()”keys():
IterableIterator<K>
Defined in: packages/data/src/map/imap.ts:20
Returns
Section titled “Returns”IterableIterator<K>
Inherited from
Section titled “Inherited from”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).
Parameters
Section titled “Parameters”K
V
Returns
Section titled “Returns”readonly readonly [K, V][]
IMap.set
Overrides
Section titled “Overrides”values()
Section titled “values()”values():
IterableIterator<V>
Defined in: packages/data/src/map/imap.ts:21
Returns
Section titled “Returns”IterableIterator<V>