Skip to content

ILossyPriorityQueue

Defined in: packages/data/src/priority-queue/ilossy-priority-queue.ts:15

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

"evict" drops the root — the same element extract/peek already expose. To keep the N highest-priority items instead, construct with the inverse ordering.

T extends DefinedValue = DefinedValue

P = number

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


readonly precedes: OrderPredicate<P>

Defined in: packages/data/src/priority-queue/ipriority-queue.ts:34

Strict weak ordering over priorities: precedes(a, b) means a outranks b.

IPriorityQueue.precedes

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

IPriorityQueue.[iterator]


clear(): void

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

Removes all elements from the collection.

void

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

IPriorityQueue.count


entries(): IterableIterator<PriorityEntry<T, P>>

Defined in: packages/data/src/priority-queue/ipriority-queue.ts:81

Every entry, in priority order (highest first).

IterableIterator<PriorityEntry<T, P>>

IPriorityQueue.entries


extract(): T | undefined

Defined in: packages/data/src/priority-queue/ipriority-queue.ts:59

Removes and returns the item with the highest priority from the priority queue.

T | undefined

The item with the highest priority, or undefined if the queue is empty.

IPriorityQueue.extract


insert(priority, item): readonly T[]

Defined in: packages/data/src/priority-queue/ilossy-priority-queue.ts:26

Same as IPriorityQueue.insert, but never throws — returns the items dropped to make room (empty if nothing was dropped).

P

T

readonly T[]

IPriorityQueue.insert

IPriorityQueue.insert


insertAll(priority, items): readonly T[]

Defined in: packages/data/src/priority-queue/ilossy-priority-queue.ts:34

Same as IPriorityQueue.insertAll, but never throws — returns the items dropped to make room (empty if nothing was dropped).

P

readonly T[]

readonly T[]

IPriorityQueue.insertAll

IPriorityQueue.insertAll


peek(): T | undefined

Defined in: packages/data/src/priority-queue/ipriority-queue.ts:68

Returns the item with the highest priority without removing it from the queue.

T | undefined

The item with the highest priority, or undefined if the queue is empty.

IPriorityQueue.peek


setPriority(item, priority): boolean

Defined in: packages/data/src/priority-queue/ipriority-queue.ts:78

Updates the priority of an existing item in the priority queue.

T

The item whose priority is to be updated.

P

The new priority of the item.

boolean

true if the item was found and its priority updated, false otherwise.

IPriorityQueue.setPriority