IDeque
Defined in: packages/data/src/deque/ideque.ts:14
Interface representing a double-ended queue (deque) data type.
A deque is a generalized version of a queue that allows insertion and removal of items from both ends.
Extends
Section titled “Extends”ICollection<T>
Extended by
Section titled “Extended by”Type Parameters
Section titled “Type Parameters”T extends DefinedValue = DefinedValue
The type of elements in the deque. Anything except undefined,
which means “no element”.
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”back()
Section titled “back()”back():
T|undefined
Defined in: packages/data/src/deque/ideque.ts:81
Returns the item at the back of the deque without removing it.
Returns
Section titled “Returns”T | undefined
The item at the back of the deque, or undefined if the deque is
empty.
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”front()
Section titled “front()”front():
T|undefined
Defined in: packages/data/src/deque/ideque.ts:73
Returns the item at the front of the deque without removing it.
Returns
Section titled “Returns”T | undefined
The item at the front of the deque, or undefined if the deque is
empty.
pop():
T|undefined
Defined in: packages/data/src/deque/ideque.ts:65
Removes and returns the item at the back of the deque.
Returns
Section titled “Returns”T | undefined
The item at the back of the deque, or undefined if the deque is
empty.
push()
Section titled “push()”push(
item):void
Defined in: packages/data/src/deque/ideque.ts:39
Adds an item to the back of the deque.
Parameters
Section titled “Parameters”T
The item to add to the back of the deque.
Returns
Section titled “Returns”void
pushAll()
Section titled “pushAll()”pushAll(
items):void
Defined in: packages/data/src/deque/ideque.ts:49
Adds every item to the back of the deque.
The items keep their relative order, so the last element of the array
becomes the new back — Array.prototype.push semantics.
Parameters
Section titled “Parameters”readonly T[]
The items to add to the back of the deque.
Returns
Section titled “Returns”void
shift()
Section titled “shift()”shift():
T|undefined
Defined in: packages/data/src/deque/ideque.ts:57
Removes and returns the item at the front of the deque.
Returns
Section titled “Returns”T | undefined
The item at the front of the deque, or undefined if the deque is
empty.
unshift()
Section titled “unshift()”unshift(
item):void
Defined in: packages/data/src/deque/ideque.ts:22
Adds an item to the front of the deque.
Parameters
Section titled “Parameters”T
The item to add to the front of the deque.
Returns
Section titled “Returns”void
unshiftAll()
Section titled “unshiftAll()”unshiftAll(
items):void
Defined in: packages/data/src/deque/ideque.ts:32
Adds every item to the front of the deque.
The items keep their relative order, so the first element of the array
becomes the new front — Array.prototype.unshift semantics.
Parameters
Section titled “Parameters”readonly T[]
The items to add to the front of the deque.
Returns
Section titled “Returns”void