-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
161 lines (143 loc) · 2.79 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
import type { EventEmitter } from "events";
import type { Player, Plugin } from "@fortune-inc/lavaclient";
declare module "@lavaclient/queue" {
interface Player {
queue: Queue;
}
}
export class Queue extends EventEmitter {
/**
* The tracks that are in this queue.
*/
readonly tracks: Song[];
/**
* The player for this queue.
*/
readonly player: Player;
/**
* The previously played songs.
*/
previous: Song[];
/**
* Whether this queue has been started or not.
*/
started: boolean;
/**
* The currently playing song.
*/
current?: Song;
/**
* The current length of the queue.
*/
length: number;
/**
* @param player
*/
constructor(player: Player);
/**
* The current type of loop that is occurring.
*/
get loopType(): "song" | "queue" | undefined;
/**
* Skips the current song and returns the new playing one.
* @since 2.0.1
*/
skip(): Promise<Song | undefined>;
/**
* Start the queue.
* @since 1.0.0
*/
start(): Promise<boolean>;
/**
* Add songs to the queue.
* @param songs The song(s) to add.
* @param requester The user that requested this song.
* @since 1.00.
*/
add(songs: Addable | Array<Addable>, requester?: string | Record<string, any>): number;
/**
* Loop the track or queue.
* @param type
* @since 2.0.1
*/
loop(type: "queue" | "song"): Queue;
/**
* Sort the queued songs.
* @param predicate
* @since 1.0.0
*/
sort(predicate?: (a: Song, b: Song) => number): Array<Song>;
/**
* Shuffle all the tracks in the queue.
* @since 1.0.0
*/
shuffle(): void;
}
export type Addable = string | Record<string, any> | Song;
export class QueuePlugin extends Plugin {
/**
* The type of queue to use.
*/
queue: typeof Queue;
/**
* @param queue
*/
constructor(queue?: typeof Queue);
/**
* Initiates this plugin
* @since 1.0.0
*/
init(): typeof Player;
}
export class Song implements TrackInfo {
/**
* The base64 lavaplayer track.
*/
track: string;
/**
* The user that requested this song.
*/
requester?: string;
/**
* The length of this track.
*/
length: number;
/**
* The identifier of this track.
*/
identifier: string;
/**
* The author of this track.
*/
author: string;
/**
* Whether this track is a stream.
*/
isStream: boolean;
/**
* The position of this track
*/
position: number;
/**
* The title of this track.
*/
title: string;
/**
* The uri of this track.
*/
uri: string;
/**
* @param track
* @param requester
*/
constructor(track: string, requester?: string);
}
export interface TrackInfo {
length: number;
identifier: string;
author: string;
isStream: boolean;
position: number;
title: string;
uri: string;
}