Skip to main content
Version: v1.1.1

Queue

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new Queue()

Defined in

Queue.ts:8

Properties

tracks

tracks: (default | default)[]

Defined in

Queue.ts:6

Accessors

duration

get duration(): number

Gets the queue duration in milliseconds.

Returns

number

Defined in

Queue.ts:22


size

get size(): number

Gets the queue size.

Returns

number

Defined in

Queue.ts:15

Methods

add

add(track): void

Adds a track to the queue.

Parameters

NameTypeDescription
trackdefault | defaultThe track to add to the queue

Returns

void

Defined in

Queue.ts:39


clear

clear(): void

Clears the queue.

Returns

void

Defined in

Queue.ts:76


poll

poll(): null | default | default

Polls the queue for the next track.

Returns

null | default | default

The next track in the queue or null if the queue is empty.

Defined in

Queue.ts:47


push

push(track): void

Adds a track to the queue.

Deprecated

  • Use add() instead

Parameters

NameTypeDescription
trackdefault | defaultThe track to add to the queue

Returns

void

Defined in

Queue.ts:31


remove

remove(): boolean

Removes the first track in the queue.

Returns

boolean

Returns true if the track was successfully removed, false otherwise

Defined in

Queue.ts:84

remove(index): boolean

Removes the track at the specified position.

Parameters

NameTypeDescription
indexnumberThe index of the track to remove.

Returns

boolean

Returns true if the track was successfully removed, false otherwise

Defined in

Queue.ts:90

remove(start, end): boolean

Removes the tracks in the specified range.

Parameters

NameTypeDescription
startnumberThe start index of the range.
endnumberThe end index of the range.

Returns

boolean

Returns true if the tracks were successfully removed, false otherwise

Defined in

Queue.ts:97


shuffle

shuffle(): void

Shuffles the queue

Returns

void

Defined in

Queue.ts:62


skipNTracks

skipNTracks(n): void

Remove the next n tracks from the queue

Parameters

NameTypeDescription
nnumberThe number of tracks to skip

Returns

void

Defined in

Queue.ts:55