Protected Optional_toThe converter used to transform a raw element (R) into a public element (E).
Get the compaction threshold (offset/size).
Auto-compaction ratio in (0,1].
Set the compaction threshold.
New ratio; compacts when offset/size exceeds this value.
void
Get the number of elements currently in the queue.
Current length.
Upper bound for length (if positive), or -1 when unbounded.
Maximum allowed length.
Get the current start offset into the array.
Zero-based offset.
Protected_createProtected_createProtected_getProtected_getProtected_setReturns an iterator over the structure's elements.
Rest...args: unknown[]Optional iterator arguments forwarded to the internal iterator.
An IterableIterator<E> that yields the elements in traversal order.
Insert a new element at a given index.
Zero-based index from the front.
Element to insert.
True if inserted.
Fill a range with a value.
Value to set.
Inclusive start.
Exclusive end.
This list.
Finds the first element that satisfies the predicate and returns it.
Finds the first element of type S (a subtype of E) that satisfies the predicate and returns it.
The matched element typed as S, or undefined if not found.
Checks whether a strictly-equal element exists in the structure.
The element to test with === equality.
true if an equal element is found; otherwise false.
First index of a value from the left.
Value to match.
Start position (supports negative index).
Index or -1 if not found.
Last index of a value from the right.
Value to match.
Start position (supports negative index).
Index or -1 if not found.
Enqueue one element at the back.
Element to enqueue.
True on success.
Replace the element at a given index.
Zero-based index from the front.
New element to set.
True if updated.
Remove and/or insert elements at a position (array-like).
Start index (clamped to [0, length]).
OptionaldeleteCount: number = 0Number of elements to remove (default 0).
Optional Rest...items: E[]Elements to insert after start.
A new queue containing the removed elements (typed as this).
Staticfrom
Array-backed queue with amortized O(1) enqueue/dequeue via an offset pointer and optional auto-compaction.
Remarks
Time O(1), Space O(1)
Example
Example