fivem-ts

a library to speed up the development of Fivem scripts and frameworks


Project maintained by Purpose-Dev Hosted on GitHub Pages — Theme by mattgraham

fivem-ts - Documentation v0.7.5Docs


fivem-ts - Documentation v0.7.5 / Shared / Queue

Class: Queue<T>

Represents a generic queue data structure.

Type Parameters

T

The type of elements stored in the queue.

Implements

Constructors

new Queue()

new Queue<T>(): Queue<T>

Returns

Queue<T>

Methods

dequeue()

dequeue(): T

Removes and returns the first element from the queue.

Returns

T

The first element from the queue, or undefined if the queue is empty.

Implementation of

IQueue.dequeue

Defined in

shared/ds/queue/Queue.ts:26


enqueue()

enqueue(item): void

Adds an item to the end of the queue.

Parameters

item: T

The item to be added to the queue.

Returns

void

Implementation of

IQueue.enqueue

Defined in

shared/ds/queue/Queue.ts:17


isEmpty()

isEmpty(): boolean

Checks if the collection is empty.

Returns

boolean

True if the collection has no elements, false otherwise.

Implementation of

IQueue.isEmpty

Defined in

shared/ds/queue/Queue.ts:45


peek()

peek(): T

Retrieves but does not remove the first element of the collection. If the collection is empty, returns undefined.

Returns

T

The first element of the collection, or undefined if the collection is empty.

Implementation of

IQueue.peek

Defined in

shared/ds/queue/Queue.ts:36


size()

size(): number

Returns the number of elements in the collection.

Returns

number

The count of elements in the collection.

Implementation of

IQueue.size

Defined in

shared/ds/queue/Queue.ts:54