Skip to content

IWaitableStack

Defined in: packages/data/src/stack/iwaitable-stack.ts:11

The blocking sibling of IBoundedStack: waits for capacity instead of throwing when the stack is full. The inherited push still throws — this adds a way to wait, it does not change the way to fail.

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.

IBounded.capacity

[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>

IStack.[iterator]


clear(): void

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

Removes all elements from the collection.

void

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

IStack.count


pop(): T | undefined

Defined in: packages/data/src/stack/istack.ts:38

Removes and returns the item at the top of the stack.

T | undefined

The item at the top of the stack, or undefined if the stack is empty.

IStack.pop


push(item): void

Defined in: packages/data/src/stack/istack.ts:22

Adds an item to the top of the stack.

T

The item to add to the stack.

void

IStack.push


pushAll(items): void

Defined in: packages/data/src/stack/istack.ts:30

Adds every item to the top of the stack, in array order, so the last one is the first to be popped.

readonly T[]

The items to add to the stack.

void

IStack.pushAll


top(): T | undefined

Defined in: packages/data/src/stack/istack.ts:46

Returns the item at the top of the stack without removing it.

T | undefined

The item at the top of the stack, or undefined if the stack is empty.

IStack.top


waitPush(item, signal?): Promise<void>

Defined in: packages/data/src/stack/iwaitable-stack.ts:19

Same as push, but waits for capacity if the operation would exceed it.

T

AbortSignal | null

Optional abort signal to cancel the operation.

Promise<void>

IStack.push


waitPushAll(items, signal?): Promise<void>

Defined in: packages/data/src/stack/iwaitable-stack.ts:28

Same as pushAll, but waits for capacity if the operation would exceed it. The whole batch lands at once, never interleaved with another waiter’s.

Iterable<T>

AbortSignal | null

Optional abort signal to cancel the operation.

Promise<void>

IStack.pushAll