Skip to content

ILossyDeque

Defined in: packages/data/src/deque/ilossy-deque.ts:14

The lossy sibling of IDeque: never throws or waits when a bounded deque is full, evicting or skipping instead (overflowPolicy).

"evict" drops the end opposite the insertion — push (back) drops the front, unshift (front) drops the back — mirroring Python’s deque(maxlen=N) and Boost’s circular_buffer.

T extends DefinedValue = 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.

ILossy.capacity


readonly overflowPolicy: OverflowPolicy

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

Policy applied when the collection reaches its capacity.

ILossy.overflowPolicy

[iterator](): Iterator<T, any, any>

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

Iterator<T, any, any>

IDeque.[iterator]


back(): T | undefined

Defined in: packages/data/src/deque/ideque.ts:81

Returns the item at the back of the deque without removing it.

T | undefined

The item at the back of the deque, or undefined if the deque is empty.

IDeque.back


clear(): void

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

Removes all elements from the collection.

void

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

IDeque.count


front(): T | undefined

Defined in: packages/data/src/deque/ideque.ts:73

Returns the item at the front of the deque without removing it.

T | undefined

The item at the front of the deque, or undefined if the deque is empty.

IDeque.front


pop(): T | undefined

Defined in: packages/data/src/deque/ideque.ts:65

Removes and returns the item at the back of the deque.

T | undefined

The item at the back of the deque, or undefined if the deque is empty.

IDeque.pop


push(item): readonly T[]

Defined in: packages/data/src/deque/ilossy-deque.ts:38

Same as IDeque.push, but never throws — returns the items dropped from the front to make room (empty if nothing was dropped).

T

readonly T[]

IDeque.push

IDeque.push


pushAll(items): readonly T[]

Defined in: packages/data/src/deque/ilossy-deque.ts:46

Same as IDeque.pushAll, but never throws — returns the items dropped from the front to make room (empty if nothing was dropped).

readonly T[]

readonly T[]

IDeque.pushAll

IDeque.pushAll


shift(): T | undefined

Defined in: packages/data/src/deque/ideque.ts:57

Removes and returns the item at the front of the deque.

T | undefined

The item at the front of the deque, or undefined if the deque is empty.

IDeque.shift


unshift(item): readonly T[]

Defined in: packages/data/src/deque/ilossy-deque.ts:22

Same as IDeque.unshift, but never throws — returns the items dropped from the back to make room (empty if nothing was dropped).

T

readonly T[]

IDeque.unshift

IDeque.unshift


unshiftAll(items): readonly T[]

Defined in: packages/data/src/deque/ilossy-deque.ts:30

Same as IDeque.unshiftAll, but never throws — returns the items dropped from the back to make room (empty if nothing was dropped).

readonly T[]

readonly T[]

IDeque.unshiftAll

IDeque.unshiftAll