a library to speed up the development of Fivem scripts and frameworks
fivem-ts - Documentation v0.7.5 • Docs
fivem-ts - Documentation v0.7.5 / Shared / Queue
Represents a generic queue data structure.
• T
The type of elements stored in the queue.
IQueue
<T
>new Queue<
T
>():Queue
<T
>
Queue
<T
>
dequeue():
T
Removes and returns the first element from the queue.
T
The first element from the queue, or undefined if the queue is empty.
enqueue(
item
):void
Adds an item to the end of the queue.
• item: T
The item to be added to the queue.
void
isEmpty():
boolean
Checks if the collection is empty.
boolean
True if the collection has no elements, false otherwise.
peek():
T
Retrieves but does not remove the first element of the collection. If the collection is empty, returns undefined.
T
The first element of the collection, or undefined if the collection is empty.
size():
number
Returns the number of elements in the collection.
number
The count of elements in the collection.