Queue
Table of contents
Constructors
Properties
Accessors
Methods
Constructors
constructor
• new Queue()
Defined in
Properties
tracks
• tracks: (default
| default
)[]
Defined in
Accessors
duration
• get
duration(): number
Gets the queue duration in milliseconds.
Returns
number
Defined in
size
• get
size(): number
Gets the queue size.
Returns
number
Defined in
Methods
add
▸ add(track
): void
Adds a track to the queue.
Parameters
Name | Type | Description |
---|---|---|
track | default | default | The track to add to the queue |
Returns
void
Defined in
clear
▸ clear(): void
Clears the queue.
Returns
void
Defined in
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
push
▸ push(track
): void
Adds a track to the queue.
Deprecated
- Use
add()
instead
Parameters
Name | Type | Description |
---|---|---|
track | default | default | The track to add to the queue |
Returns
void
Defined in
remove
▸ remove(): boolean
Removes the first track in the queue.
Returns
boolean
Returns true if the track was successfully removed, false otherwise
Defined in
▸ remove(index
): boolean
Removes the track at the specified position.
Parameters
Name | Type | Description |
---|---|---|
index | number | The index of the track to remove. |
Returns
boolean
Returns true if the track was successfully removed, false otherwise
Defined in
▸ remove(start
, end
): boolean
Removes the tracks in the specified range.
Parameters
Name | Type | Description |
---|---|---|
start | number | The start index of the range. |
end | number | The end index of the range. |
Returns
boolean
Returns true if the tracks were successfully removed, false otherwise
Defined in
shuffle
▸ shuffle(): void
Shuffles the queue
Returns
void
Defined in
skipNTracks
▸ skipNTracks(n
): void
Remove the next n tracks from the queue
Parameters
Name | Type | Description |
---|---|---|
n | number | The number of tracks to skip |
Returns
void