IWaitableHeap
Defined in: packages/data/src/heap/iwaitable-heap.ts:11
The blocking sibling of IHeap: waits for capacity when the heap is
full. The inherited insert throws — this adds a way to wait, it does not
change the way to fail.
Extends
Section titled “Extends”Type Parameters
Section titled “Type Parameters”T extends DefinedValue = 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”precedes
Section titled “precedes”
readonlyprecedes:OrderPredicate<T>
Defined in: packages/data/src/heap/iheap.ts:15
Strict weak ordering: precedes(a, b) is true when a outranks b.
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”[iterator]()
Section titled “[iterator]()”[iterator]():
Iterator<T,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<T, 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”extract()
Section titled “extract()”extract():
T|undefined
Defined in: packages/data/src/heap/iheap.ts:36
Removes and returns the root item of the heap.
Returns
Section titled “Returns”T | undefined
The root item of the heap, or undefined if the heap is empty.
Inherited from
Section titled “Inherited from”extractAndInsert()
Section titled “extractAndInsert()”extractAndInsert(
item):T|undefined
Defined in: packages/data/src/heap/iheap.ts:51
Extracts the root item from the heap and inserts a new item in one operation.
Parameters
Section titled “Parameters”T
The item to replace.
Returns
Section titled “Returns”T | undefined
Inherited from
Section titled “Inherited from”insert()
Section titled “insert()”insert(
item):void
Defined in: packages/data/src/heap/iheap.ts:22
Inserts an item into the heap.
Parameters
Section titled “Parameters”T
The item to insert.
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”insertAll()
Section titled “insertAll()”insertAll(
items):void
Defined in: packages/data/src/heap/iheap.ts:29
Inserts every item into the heap.
Parameters
Section titled “Parameters”readonly T[]
The items to insert.
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”insertAndExtract()
Section titled “insertAndExtract()”insertAndExtract(
item):T|undefined
Defined in: packages/data/src/heap/iheap.ts:59
Inserts an item into the heap and then extracts and returns the root item in one operation.
Parameters
Section titled “Parameters”T
The item to insert and extract.
Returns
Section titled “Returns”T | undefined
Inherited from
Section titled “Inherited from”peek()
Section titled “peek()”peek():
T|undefined
Defined in: packages/data/src/heap/iheap.ts:43
Returns the root item of the heap without removing it.
Returns
Section titled “Returns”T | undefined
The root item of the heap, or undefined if the heap is empty.
Inherited from
Section titled “Inherited from”waitInsert()
Section titled “waitInsert()”waitInsert(
item,signal?):Promise<void>
Defined in: packages/data/src/heap/iwaitable-heap.ts:19
Same as insert, but waits for capacity if the operation would exceed it.
Parameters
Section titled “Parameters”T
signal?
Section titled “signal?”AbortSignal | null
Optional abort signal to cancel the operation.
Returns
Section titled “Returns”Promise<void>
IHeap.insert
waitInsertAll()
Section titled “waitInsertAll()”waitInsertAll(
items,signal?):Promise<void>
Defined in: packages/data/src/heap/iwaitable-heap.ts:29
Same as insertAll, but waits for capacity if the operation would exceed
it. The whole batch lands at once, never interleaved with another
waiter’s.
Parameters
Section titled “Parameters”Iterable<T>
signal?
Section titled “signal?”AbortSignal | null
Optional abort signal to cancel the operation.
Returns
Section titled “Returns”Promise<void>
IHeap.insertAll