damonjs
Version:
A modified Shoukaku wrapper with enhanced queue support.
50 lines (49 loc) • 1.59 kB
TypeScript
import { DamonJsTrack } from './DamonJsTrack';
import { DamonJsPlayer } from '../DamonJsPlayer';
export interface DamonJsQueue {
player: DamonJsPlayer;
}
export declare class DamonJsQueue extends Array<DamonJsTrack> {
constructor(player: DamonJsPlayer);
/** Get the size of queue */
get size(): number;
private _current;
/** Get the size of queue including current */
get totalSize(): number;
/** Check if the queue is empty or not */
get isEmpty(): boolean;
/** Check if the queue is ended or not */
get isEnd(): boolean;
/** Get the queue's duration */
get durationLength(): number;
/** Current playing trackId
* Do not do anything to this if you do anything to this player is likely gonna fail
*/
currentId: number;
/** Current playing track */
get current(): DamonJsTrack | undefined;
/**
* set current track of the queue
* @param track DamonJsTrack to add
*/
set current(track: DamonJsTrack | undefined);
/** last played/playing track */
get lastTrack(): DamonJsTrack | undefined;
/**
* Add track(s) to the queue
* @param track DamonJsTrack to add
* @returns DamonJsQueue
*/
add(track: DamonJsTrack | DamonJsTrack[]): DamonJsQueue;
/**
* Remove track from the queue
* @param position Position of the track
* @returns DamonJsQueue
*/
remove(position: number): DamonJsQueue;
/** Shuffle the queue */
shuffle(): DamonJsQueue;
/** Clear the queue */
clear(): DamonJsQueue;
removeDupes(): DamonJsQueue;
}