lavalink-client 2.5.7 → 2.5.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. package/README.md +9 -2
  2. package/dist/index.d.mts +3036 -0
  3. package/dist/index.d.ts +3036 -0
  4. package/dist/index.js +4965 -0
  5. package/dist/index.mjs +4904 -0
  6. package/package.json +21 -24
  7. package/dist/cjs/index.d.ts +0 -16
  8. package/dist/cjs/index.js +0 -19
  9. package/dist/cjs/package.json +0 -3
  10. package/dist/cjs/structures/Constants.d.ts +0 -90
  11. package/dist/cjs/structures/Constants.js +0 -296
  12. package/dist/cjs/structures/CustomSearches/BandCampSearch.d.ts +0 -3
  13. package/dist/cjs/structures/CustomSearches/BandCampSearch.js +0 -39
  14. package/dist/cjs/structures/Filters.d.ts +0 -169
  15. package/dist/cjs/structures/Filters.js +0 -700
  16. package/dist/cjs/structures/LavalinkManager.d.ts +0 -232
  17. package/dist/cjs/structures/LavalinkManager.js +0 -621
  18. package/dist/cjs/structures/LavalinkManagerStatics.d.ts +0 -15
  19. package/dist/cjs/structures/LavalinkManagerStatics.js +0 -149
  20. package/dist/cjs/structures/Node.d.ts +0 -523
  21. package/dist/cjs/structures/Node.js +0 -1605
  22. package/dist/cjs/structures/NodeManager.d.ts +0 -100
  23. package/dist/cjs/structures/NodeManager.js +0 -224
  24. package/dist/cjs/structures/Player.d.ts +0 -223
  25. package/dist/cjs/structures/Player.js +0 -807
  26. package/dist/cjs/structures/Queue.d.ts +0 -186
  27. package/dist/cjs/structures/Queue.js +0 -390
  28. package/dist/cjs/structures/Types/Filters.d.ts +0 -190
  29. package/dist/cjs/structures/Types/Filters.js +0 -2
  30. package/dist/cjs/structures/Types/Manager.d.ts +0 -271
  31. package/dist/cjs/structures/Types/Manager.js +0 -2
  32. package/dist/cjs/structures/Types/Node.d.ts +0 -238
  33. package/dist/cjs/structures/Types/Node.js +0 -2
  34. package/dist/cjs/structures/Types/Player.d.ts +0 -114
  35. package/dist/cjs/structures/Types/Player.js +0 -2
  36. package/dist/cjs/structures/Types/Queue.d.ts +0 -35
  37. package/dist/cjs/structures/Types/Queue.js +0 -2
  38. package/dist/cjs/structures/Types/Track.d.ts +0 -134
  39. package/dist/cjs/structures/Types/Track.js +0 -2
  40. package/dist/cjs/structures/Types/Utils.d.ts +0 -443
  41. package/dist/cjs/structures/Types/Utils.js +0 -2
  42. package/dist/cjs/structures/Utils.d.ts +0 -116
  43. package/dist/cjs/structures/Utils.js +0 -567
  44. package/dist/esm/index.d.ts +0 -16
  45. package/dist/esm/index.js +0 -16
  46. package/dist/esm/package.json +0 -3
  47. package/dist/esm/structures/Constants.d.ts +0 -90
  48. package/dist/esm/structures/Constants.js +0 -293
  49. package/dist/esm/structures/CustomSearches/BandCampSearch.d.ts +0 -3
  50. package/dist/esm/structures/CustomSearches/BandCampSearch.js +0 -35
  51. package/dist/esm/structures/Filters.d.ts +0 -169
  52. package/dist/esm/structures/Filters.js +0 -696
  53. package/dist/esm/structures/LavalinkManager.d.ts +0 -232
  54. package/dist/esm/structures/LavalinkManager.js +0 -617
  55. package/dist/esm/structures/LavalinkManagerStatics.d.ts +0 -15
  56. package/dist/esm/structures/LavalinkManagerStatics.js +0 -146
  57. package/dist/esm/structures/Node.d.ts +0 -523
  58. package/dist/esm/structures/Node.js +0 -1600
  59. package/dist/esm/structures/NodeManager.d.ts +0 -100
  60. package/dist/esm/structures/NodeManager.js +0 -220
  61. package/dist/esm/structures/Player.d.ts +0 -223
  62. package/dist/esm/structures/Player.js +0 -803
  63. package/dist/esm/structures/Queue.d.ts +0 -186
  64. package/dist/esm/structures/Queue.js +0 -384
  65. package/dist/esm/structures/Types/Filters.d.ts +0 -190
  66. package/dist/esm/structures/Types/Filters.js +0 -1
  67. package/dist/esm/structures/Types/Manager.d.ts +0 -271
  68. package/dist/esm/structures/Types/Manager.js +0 -1
  69. package/dist/esm/structures/Types/Node.d.ts +0 -238
  70. package/dist/esm/structures/Types/Node.js +0 -1
  71. package/dist/esm/structures/Types/Player.d.ts +0 -114
  72. package/dist/esm/structures/Types/Player.js +0 -1
  73. package/dist/esm/structures/Types/Queue.d.ts +0 -35
  74. package/dist/esm/structures/Types/Queue.js +0 -1
  75. package/dist/esm/structures/Types/Track.d.ts +0 -134
  76. package/dist/esm/structures/Types/Track.js +0 -1
  77. package/dist/esm/structures/Types/Utils.d.ts +0 -443
  78. package/dist/esm/structures/Types/Utils.js +0 -1
  79. package/dist/esm/structures/Utils.d.ts +0 -116
  80. package/dist/esm/structures/Utils.js +0 -559
  81. package/dist/types/index.d.ts +0 -16
  82. package/dist/types/structures/Constants.d.ts +0 -90
  83. package/dist/types/structures/CustomSearches/BandCampSearch.d.ts +0 -3
  84. package/dist/types/structures/Filters.d.ts +0 -169
  85. package/dist/types/structures/LavalinkManager.d.ts +0 -232
  86. package/dist/types/structures/LavalinkManagerStatics.d.ts +0 -15
  87. package/dist/types/structures/Node.d.ts +0 -523
  88. package/dist/types/structures/NodeManager.d.ts +0 -100
  89. package/dist/types/structures/Player.d.ts +0 -223
  90. package/dist/types/structures/Queue.d.ts +0 -186
  91. package/dist/types/structures/Types/Filters.d.ts +0 -190
  92. package/dist/types/structures/Types/Manager.d.ts +0 -271
  93. package/dist/types/structures/Types/Node.d.ts +0 -238
  94. package/dist/types/structures/Types/Player.d.ts +0 -114
  95. package/dist/types/structures/Types/Queue.d.ts +0 -35
  96. package/dist/types/structures/Types/Track.d.ts +0 -134
  97. package/dist/types/structures/Types/Utils.d.ts +0 -443
  98. package/dist/types/structures/Utils.d.ts +0 -116
@@ -1,443 +0,0 @@
1
- import type { MiniMap } from "../Utils.js";
2
- import type { LavalinkFilterData } from "./Filters.js";
3
- import type { LyricsLine, LyricsResult, NodeStats } from "./Node.js";
4
- import type { LavalinkPlayOptions } from "./Player.js";
5
- import type { LavalinkTrack, PluginInfo, Track, UnresolvedTrack } from "./Track.js";
6
- /** Helper for generating Opaque types. */
7
- export type Opaque<T, K> = T & {
8
- __opaque__: K;
9
- };
10
- /** Opqaue tyep for integernumber */
11
- export type IntegerNumber = Opaque<number, 'Int'>;
12
- /** Opqaue tyep for floatnumber */
13
- export type FloatNumber = Opaque<number, 'Float'>;
14
- export type LavaSrcSearchPlatformBase = "spsearch" | "sprec" | "amsearch" | "dzsearch" | "dzisrc" | "dzrec" | "ymsearch" | "ymrec" | "vksearch" | "vkrec" | "tdsearch" | "tdrec" | "qbsearch" | "qbisrc" | "qbrec";
15
- export type LavaSrcSearchPlatform = LavaSrcSearchPlatformBase | "ftts";
16
- export type JioSaavnSearchPlatform = "jssearch" | "jsrec";
17
- export type DuncteSearchPlatform = "speak" | "phsearch" | "pornhub" | "porn" | "tts";
18
- export type LavalinkClientSearchPlatform = "bcsearch";
19
- export type LavalinkClientSearchPlatformResolve = "bandcamp" | "bc";
20
- export type LavalinkSearchPlatform = "ytsearch" | "ytmsearch" | "scsearch" | "bcsearch" | LavaSrcSearchPlatform | DuncteSearchPlatform | JioSaavnSearchPlatform | LavalinkClientSearchPlatform;
21
- export type ClientCustomSearchPlatformUtils = "local" | "http" | "https" | "link" | "uri";
22
- export type ClientSearchPlatform = ClientCustomSearchPlatformUtils | // for file/link requests
23
- "youtube" | "yt" | "youtube music" | "youtubemusic" | "ytm" | "musicyoutube" | "music youtube" | "soundcloud" | "sc" | "am" | "apple music" | "applemusic" | "apple" | "musicapple" | "music apple" | "sp" | "spsuggestion" | "spotify" | "spotify.com" | "spotifycom" | "dz" | "deezer" | "yandex" | "yandex music" | "yandexmusic" | "vk" | "vk music" | "vkmusic" | "tidal" | "tidal music" | "qobuz" | "flowerytts" | "flowery" | "flowery.tts" | LavalinkClientSearchPlatformResolve | LavalinkClientSearchPlatform | "js" | "jiosaavn" | "td" | "tidal" | "tdrec";
24
- export type SearchPlatform = LavalinkSearchPlatform | ClientSearchPlatform;
25
- export type SourcesRegex = "YoutubeRegex" | "YoutubeMusicRegex" | "SoundCloudRegex" | "SoundCloudMobileRegex" | "DeezerTrackRegex" | "DeezerArtistRegex" | "DeezerEpisodeRegex" | "DeezerMixesRegex" | "DeezerPageLinkRegex" | "DeezerPlaylistRegex" | "DeezerAlbumRegex" | "AllDeezerRegex" | "AllDeezerRegexWithoutPageLink" | "SpotifySongRegex" | "SpotifyPlaylistRegex" | "SpotifyArtistRegex" | "SpotifyEpisodeRegex" | "SpotifyShowRegex" | "SpotifyAlbumRegex" | "AllSpotifyRegex" | "mp3Url" | "m3uUrl" | "m3u8Url" | "mp4Url" | "m4aUrl" | "wavUrl" | "aacpUrl" | "tiktok" | "mixcloud" | "musicYandex" | "radiohost" | "bandcamp" | "jiosaavn" | "appleMusic" | "tidal" | "TwitchTv" | "vimeo";
26
- export interface PlaylistInfo {
27
- /** The playlist name */
28
- name: string;
29
- /** The playlist title (same as name) */
30
- title: string;
31
- /** The playlist Author */
32
- author?: string;
33
- /** The playlist Thumbnail */
34
- thumbnail?: string;
35
- /** A Uri to the playlist */
36
- uri?: string;
37
- /** The playlist selected track. */
38
- selectedTrack: Track | null;
39
- /** The duration of the entire playlist. (calcualted) */
40
- duration: number;
41
- }
42
- export interface SearchResult {
43
- loadType: LoadTypes;
44
- exception: Exception | null;
45
- pluginInfo: PluginInfo;
46
- playlist: PlaylistInfo | null;
47
- tracks: Track[];
48
- }
49
- export interface UnresolvedSearchResult {
50
- loadType: LoadTypes;
51
- exception: Exception | null;
52
- pluginInfo: PluginInfo;
53
- playlist: PlaylistInfo | null;
54
- tracks: UnresolvedTrack[];
55
- }
56
- /**
57
- * @internal
58
- */
59
- export interface MiniMapConstructor {
60
- new (): MiniMap<unknown, unknown>;
61
- new <K, V>(entries?: ReadonlyArray<readonly [K, V]> | null): MiniMap<K, V>;
62
- new <K, V>(iterable: Iterable<readonly [K, V]>): MiniMap<K, V>;
63
- readonly prototype: MiniMap<unknown, unknown>;
64
- readonly [Symbol.species]: MiniMapConstructor;
65
- }
66
- export type PlayerEvents = TrackStartEvent | TrackEndEvent | TrackStuckEvent | TrackExceptionEvent | WebSocketClosedEvent | SponsorBlockSegmentEvents | LyricsEvent;
67
- export type Severity = "COMMON" | "SUSPICIOUS" | "FAULT";
68
- export interface Exception {
69
- /** Severity of the error */
70
- severity: Severity;
71
- /** Nodejs Error */
72
- error?: Error;
73
- /** Message by lavalink */
74
- message: string;
75
- /** Cause by lavalink */
76
- cause: string;
77
- /** causeStackTrace by lavalink */
78
- causeStackTrace: string;
79
- }
80
- export interface PlayerEvent {
81
- op: "event";
82
- type: PlayerEventType;
83
- guildId: string;
84
- }
85
- export interface TrackStartEvent extends PlayerEvent {
86
- type: "TrackStartEvent";
87
- track: LavalinkTrack;
88
- }
89
- export interface TrackEndEvent extends PlayerEvent {
90
- type: "TrackEndEvent";
91
- track: LavalinkTrack;
92
- reason: TrackEndReason;
93
- }
94
- export interface TrackExceptionEvent extends PlayerEvent {
95
- type: "TrackExceptionEvent";
96
- exception?: Exception;
97
- track: LavalinkTrack;
98
- error: string;
99
- }
100
- export interface TrackStuckEvent extends PlayerEvent {
101
- type: "TrackStuckEvent";
102
- thresholdMs: number;
103
- track: LavalinkTrack;
104
- }
105
- export interface WebSocketClosedEvent extends PlayerEvent {
106
- type: "WebSocketClosedEvent";
107
- code: number;
108
- byRemote: boolean;
109
- reason: string;
110
- }
111
- /**
112
- * Types & Events for Sponsorblock-plugin from Lavalink: https://github.com/topi314/Sponsorblock-Plugin#segmentsloaded
113
- */
114
- export type SponsorBlockSegmentEvents = SponsorBlockSegmentSkipped | SponsorBlockSegmentsLoaded | SponsorBlockChapterStarted | SponsorBlockChaptersLoaded;
115
- export type SponsorBlockSegmentEventType = "SegmentSkipped" | "SegmentsLoaded" | "ChaptersLoaded" | "ChapterStarted";
116
- export interface SponsorBlockSegmentsLoaded extends PlayerEvent {
117
- type: "SegmentsLoaded";
118
- segments: {
119
- category: string;
120
- start: number;
121
- end: number;
122
- }[];
123
- }
124
- export interface SponsorBlockSegmentSkipped extends PlayerEvent {
125
- type: "SegmentSkipped";
126
- segment: {
127
- category: string;
128
- start: number;
129
- end: number;
130
- };
131
- }
132
- export interface SponsorBlockChapterStarted extends PlayerEvent {
133
- type: "ChapterStarted";
134
- /** The Chapter which started */
135
- chapter: {
136
- /** The Name of the Chapter */
137
- name: string;
138
- start: number;
139
- end: number;
140
- duration: number;
141
- };
142
- }
143
- export interface SponsorBlockChaptersLoaded extends PlayerEvent {
144
- type: "ChaptersLoaded";
145
- /** All Chapters loaded */
146
- chapters: {
147
- /** The Name of the Chapter */
148
- name: string;
149
- start: number;
150
- end: number;
151
- duration: number;
152
- }[];
153
- }
154
- /**
155
- * Types & Events for Lyrics plugin from Lavalink: https://github.com/topi314/LavaLyrics
156
- */
157
- export type LyricsEvent = LyricsFoundEvent | LyricsNotFoundEvent | LyricsLineEvent;
158
- export type LyricsEventType = "LyricsFoundEvent" | "LyricsNotFoundEvent" | "LyricsLineEvent";
159
- export interface LyricsFoundEvent extends PlayerEvent {
160
- /** The lyricsfound event */
161
- type: "LyricsFoundEvent";
162
- /** The guildId */
163
- guildId: string;
164
- /** The lyrics */
165
- lyrics: LyricsResult;
166
- }
167
- export interface LyricsNotFoundEvent extends PlayerEvent {
168
- /**The lyricsnotfound event*/
169
- type: "LyricsNotFoundEvent";
170
- /**The guildId*/
171
- guildId: string;
172
- }
173
- export interface LyricsLineEvent extends PlayerEvent {
174
- /**The lyricsline event*/
175
- type: "LyricsLineEvent";
176
- /** The guildId */
177
- guildId: string;
178
- /** The line number */
179
- lineIndex: number;
180
- /** The line */
181
- line: LyricsLine;
182
- /**skipped is true if the line was skipped */
183
- skipped: boolean;
184
- }
185
- export interface LyricsFoundEvent extends PlayerEvent {
186
- /** The lyricsfound event */
187
- type: "LyricsFoundEvent";
188
- /** The guildId */
189
- guildId: string;
190
- /** The lyrics */
191
- lyrics: LyricsResult;
192
- }
193
- export interface LyricsNotFoundEvent extends PlayerEvent {
194
- /**The lyricsnotfound event*/
195
- type: "LyricsNotFoundEvent";
196
- /**The guildId*/
197
- guildId: string;
198
- }
199
- export interface LyricsLineEvent extends PlayerEvent {
200
- /**The lyricsline event*/
201
- type: "LyricsLineEvent";
202
- /** The guildId */
203
- guildId: string;
204
- /** The line number */
205
- lineIndex: number;
206
- /** The line */
207
- line: LyricsLine;
208
- /**skipped is true if the line was skipped */
209
- skipped: boolean;
210
- }
211
- export type LoadTypes = "track" | "playlist" | "search" | "error" | "empty";
212
- export type State = "CONNECTED" | "CONNECTING" | "DISCONNECTED" | "DISCONNECTING" | "DESTROYING";
213
- export type PlayerEventType = "TrackStartEvent" | "TrackEndEvent" | "TrackExceptionEvent" | "TrackStuckEvent" | "WebSocketClosedEvent" | SponsorBlockSegmentEventType | LyricsEventType;
214
- export type TrackEndReason = "finished" | "loadFailed" | "stopped" | "replaced" | "cleanup";
215
- export interface InvalidLavalinkRestRequest {
216
- /** Rest Request Data for when it was made */
217
- timestamp: number;
218
- /** Status of the request */
219
- status: number;
220
- /** Specific Errro which was sent */
221
- error: string;
222
- /** Specific Message which was created */
223
- message?: string;
224
- /** The specific error trace from the request */
225
- trace?: unknown;
226
- /** Path of where it's from */
227
- path: string;
228
- }
229
- export interface LavalinkPlayerVoice {
230
- /** The Voice Token */
231
- token: string;
232
- /** The Voice Server Endpoint */
233
- endpoint: string;
234
- /** The Voice SessionId */
235
- sessionId: string;
236
- /** Wether or not the player is connected */
237
- connected?: boolean;
238
- /** The Ping to the voice server */
239
- ping?: number;
240
- }
241
- export type LavalinkPlayerVoiceOptions = Omit<LavalinkPlayerVoice, 'connected' | 'ping'>;
242
- export interface FailingAddress {
243
- /** The failing address */
244
- failingAddress: string;
245
- /** The timestamp when the address failed */
246
- failingTimestamp: number;
247
- /** The timestamp when the address failed as a pretty string */
248
- failingTime: string;
249
- }
250
- export type RoutePlannerTypes = "RotatingIpRoutePlanner" | "NanoIpRoutePlanner" | "RotatingNanoIpRoutePlanner" | "BalancingIpRoutePlanner";
251
- export interface RoutePlanner {
252
- class?: RoutePlannerTypes;
253
- details?: {
254
- /** The ip block being used */
255
- ipBlock: {
256
- /** The type of the ip block */
257
- type: "Inet4Address" | "Inet6Address";
258
- /** The size of the ip block */
259
- size: string;
260
- };
261
- /** The failing addresses */
262
- failingAddresses: FailingAddress[];
263
- /** The number of rotations */
264
- rotateIndex?: string;
265
- /** The current offset in the block */
266
- ipIndex?: string;
267
- /** The current address being used */
268
- currentAddress?: string;
269
- /** The current offset in the ip block */
270
- currentAddressIndex?: string;
271
- /** The information in which /64 block ips are chosen. This number increases on each ban. */
272
- blockIndex?: string;
273
- };
274
- }
275
- export interface Session {
276
- /** Wether or not session is resuming or not */
277
- resuming: boolean;
278
- /** For how long a session is lasting while not connected */
279
- timeout: number;
280
- }
281
- export interface GuildShardPayload {
282
- /** The OP code */
283
- op: number;
284
- /** Data to send */
285
- d: {
286
- /** Guild id to apply voice settings */
287
- guild_id: string;
288
- /** channel to move/connect to, or null to leave it */
289
- channel_id: string | null;
290
- /** wether or not mute yourself */
291
- self_mute: boolean;
292
- /** wether or not deafen yourself */
293
- self_deaf: boolean;
294
- };
295
- }
296
- export interface PlayerUpdateInfo {
297
- /** guild id of the player */
298
- guildId: string;
299
- /** Player options to provide to lavalink */
300
- playerOptions: LavalinkPlayOptions;
301
- /** Whether or not replace the current track with the new one (true is recommended) */
302
- noReplace?: boolean;
303
- }
304
- export interface LavalinkPlayer {
305
- /** Guild Id of the player */
306
- guildId: string;
307
- /** IF playing a track, all of the track information */
308
- track?: LavalinkTrack;
309
- /** Lavalink volume (mind volumedecrementer) */
310
- volume: number;
311
- /** Wether it's paused or not */
312
- paused: boolean;
313
- /** Voice Endpoint data */
314
- voice: LavalinkPlayerVoice;
315
- /** All Audio Filters */
316
- filters: Partial<LavalinkFilterData>;
317
- /** Lavalink-Voice-State Variables */
318
- state: {
319
- /** Time since connection established */
320
- time: number;
321
- /** Position of the track */
322
- position: number;
323
- /** COnnected or not */
324
- connected: boolean;
325
- /** Ping to voice server */
326
- ping: number;
327
- };
328
- }
329
- export interface ChannelDeletePacket {
330
- /** Packet key for channel delete */
331
- t: "CHANNEL_DELETE";
332
- /** data which is sent and relevant */
333
- d: {
334
- /** guild id */
335
- guild_id: string;
336
- /** Channel id */
337
- id: string;
338
- };
339
- }
340
- export interface VoiceState {
341
- /** OP key from lavalink */
342
- op: "voiceUpdate";
343
- /** GuildId provided by lavalink */
344
- guildId: string;
345
- /** Event data */
346
- event: VoiceServer;
347
- /** Session Id of the voice connection */
348
- sessionId?: string;
349
- /** guild id of the voice channel */
350
- guild_id: string;
351
- /** user id from the voice connection */
352
- user_id: string;
353
- /** Session Id of the voice connection */
354
- session_id: string;
355
- /** Voice Channel Id */
356
- channel_id: string;
357
- /** Server Mute status */
358
- mute: boolean;
359
- /** Server Deaf status */
360
- deaf: boolean;
361
- /** Self Deaf status */
362
- self_deaf: boolean;
363
- /** Self Mute status */
364
- self_mute: boolean;
365
- /** Self Video (Camera) status */
366
- self_video: boolean;
367
- /** Self Stream status */
368
- self_stream: boolean;
369
- /** Wether the user requests to speak (stage channel) */
370
- request_to_speak_timestamp: boolean;
371
- /** Self suppressed status (stage channel) */
372
- suppress: boolean;
373
- }
374
- /** The Base64 decodes tring by lavalink */
375
- export type Base64 = string;
376
- export interface VoiceServer {
377
- /** Voice Token */
378
- token: string;
379
- /** Guild Id of the voice server connection */
380
- guild_id: string;
381
- /** Server Endpoint */
382
- endpoint: string;
383
- }
384
- export interface VoicePacket {
385
- /** Voice Packet Keys to send */
386
- t?: "VOICE_SERVER_UPDATE" | "VOICE_STATE_UPDATE";
387
- /** Voice Packets to send */
388
- d: VoiceState | VoiceServer;
389
- }
390
- export interface NodeMessage extends NodeStats {
391
- /** The type of the event */
392
- type: PlayerEventType;
393
- /** what ops are applying to that event */
394
- op: "stats" | "playerUpdate" | "event";
395
- /** The specific guild id for that message */
396
- guildId: string;
397
- }
398
- /** Specific types to filter for lavasearch, will be filtered to correct types */
399
- export type LavaSearchType = "track" | "album" | "artist" | "playlist" | "text" | "tracks" | "albums" | "artists" | "playlists" | "texts";
400
- export interface LavaSearchFilteredResponse {
401
- /** The Information of a playlist provided by lavasearch */
402
- info: PlaylistInfo;
403
- /** additional plugin information */
404
- pluginInfo: PluginInfo;
405
- /** List of tracks */
406
- tracks: Track[];
407
- }
408
- export interface LavaSearchResponse {
409
- /** An array of tracks, only present if track is in types */
410
- tracks: Track[];
411
- /** An array of albums, only present if album is in types */
412
- albums: LavaSearchFilteredResponse[];
413
- /** An array of artists, only present if artist is in types */
414
- artists: LavaSearchFilteredResponse[];
415
- /** An array of playlists, only present if playlist is in types */
416
- playlists: LavaSearchFilteredResponse[];
417
- /** An array of text results, only present if text is in types */
418
- texts: {
419
- text: string;
420
- pluginInfo: PluginInfo;
421
- }[];
422
- /** Addition result data provided by plugins */
423
- pluginInfo: PluginInfo;
424
- }
425
- /** SearchQuery Object for raw lavalink requests */
426
- export type SearchQuery = {
427
- /** lavalink search Query / identifier string */
428
- query: string;
429
- /** Extra url query params to use, e.g. for flowertts */
430
- extraQueryUrlParams?: URLSearchParams;
431
- /** Source to append to the search query string */
432
- source?: SearchPlatform;
433
- } | /** Our just the search query / identifier string */ string;
434
- /** SearchQuery Object for Lavalink LavaSearch Plugin requests */
435
- export type LavaSearchQuery = {
436
- /** lavalink search Query / identifier string */
437
- query: string;
438
- /** Source to append to the search query string */
439
- source: LavaSrcSearchPlatformBase;
440
- /** The Types to filter the search to */
441
- types?: LavaSearchType[];
442
- };
443
- export type Awaitable<T> = Promise<T> | T;
@@ -1 +0,0 @@
1
- export {};
@@ -1,116 +0,0 @@
1
- import type { LavalinkNodeOptions } from "./Types/Node.js";
2
- import type { LavalinkSearchPlatform, LavaSearchQuery, MiniMapConstructor, SearchPlatform, SearchQuery } from "./Types/Utils.js";
3
- import type { LavalinkManager } from "./LavalinkManager.js";
4
- import type { LavalinkNode } from "./Node.js";
5
- import type { Player } from "./Player.js";
6
- import type { LavalinkTrack, Track, UnresolvedQuery, UnresolvedTrack } from "./Types/Track.js";
7
- export declare const TrackSymbol: unique symbol;
8
- export declare const UnresolvedTrackSymbol: unique symbol;
9
- export declare const QueueSymbol: unique symbol;
10
- export declare const NodeSymbol: unique symbol;
11
- /**
12
- * Parses Node Connection Url: "lavalink://<nodeId>:<nodeAuthorization(Password)>@<NodeHost>:<NodePort>"
13
- * @param connectionUrl
14
- * @returns
15
- */
16
- export declare function parseLavalinkConnUrl(connectionUrl: string): {
17
- authorization: string;
18
- id: string;
19
- host: string;
20
- port: number;
21
- };
22
- export declare class ManagerUtils {
23
- LavalinkManager: LavalinkManager | undefined;
24
- constructor(LavalinkManager?: LavalinkManager);
25
- buildPluginInfo(data: any, clientData?: any): any;
26
- buildTrack(data: LavalinkTrack | Track, requester: unknown): Track;
27
- /**
28
- * Builds a UnresolvedTrack to be resolved before being played .
29
- * @param query
30
- * @param requester
31
- */
32
- buildUnresolvedTrack(query: UnresolvedQuery | UnresolvedTrack, requester: unknown): UnresolvedTrack;
33
- /**
34
- * Validate if a data is equal to a node
35
- * @param data
36
- */
37
- isNode(data: LavalinkNode): boolean;
38
- getTransformedRequester(requester: unknown): unknown;
39
- /**
40
- * Validate if a data is equal to node options
41
- * @param data
42
- */
43
- isNodeOptions(data: LavalinkNodeOptions): boolean;
44
- /**
45
- * Validate if a data is equal to a track
46
- * @param data the Track to validate
47
- * @returns
48
- */
49
- isTrack(data: Track | UnresolvedTrack): data is Track;
50
- /**
51
- * Checks if the provided argument is a valid UnresolvedTrack.
52
- * @param track
53
- */
54
- isUnresolvedTrack(data: UnresolvedTrack | Track): data is UnresolvedTrack;
55
- /**
56
- * Checks if the provided argument is a valid UnresolvedTrack.
57
- * @param track
58
- */
59
- isUnresolvedTrackQuery(data: UnresolvedQuery): boolean;
60
- getClosestTrack(data: UnresolvedTrack, player: Player): Promise<Track | undefined>;
61
- validateQueryString(node: LavalinkNode, queryString: string, sourceString?: LavalinkSearchPlatform): void;
62
- transformQuery(query: SearchQuery): {
63
- query: string;
64
- extraQueryUrlParams: URLSearchParams;
65
- source: any;
66
- };
67
- transformLavaSearchQuery(query: LavaSearchQuery): {
68
- query: string;
69
- types: string[];
70
- source: any;
71
- };
72
- validateSourceString(node: LavalinkNode, sourceString: SearchPlatform): void;
73
- }
74
- /**
75
- * Separate interface for the constructor so that emitted js does not have a constructor that overwrites itself
76
- *
77
- * @internal
78
- */
79
- export interface MiniMap<K, V> extends Map<K, V> {
80
- constructor: MiniMapConstructor;
81
- }
82
- export declare class MiniMap<K, V> extends Map<K, V> {
83
- constructor(data?: [K, V][]);
84
- /**
85
- * Identical to
86
- * [Array.filter()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter),
87
- * but returns a MiniMap instead of an Array.
88
- *
89
- * @param fn The function to test with (should return boolean)
90
- * @param thisArg Value to use as `this` when executing function
91
- *
92
- * @example
93
- * miniMap.filter(user => user.username === 'Bob');
94
- */
95
- filter<K2 extends K>(fn: (value: V, key: K, miniMap: this) => key is K2): MiniMap<K2, V>;
96
- filter<V2 extends V>(fn: (value: V, key: K, miniMap: this) => value is V2): MiniMap<K, V2>;
97
- filter(fn: (value: V, key: K, miniMap: this) => boolean): MiniMap<K, V>;
98
- filter<This, K2 extends K>(fn: (this: This, value: V, key: K, miniMap: this) => key is K2, thisArg: This): MiniMap<K2, V>;
99
- filter<This, V2 extends V>(fn: (this: This, value: V, key: K, miniMap: this) => value is V2, thisArg: This): MiniMap<K, V2>;
100
- filter<This>(fn: (this: This, value: V, key: K, miniMap: this) => boolean, thisArg: This): MiniMap<K, V>;
101
- toJSON(): [K, V][];
102
- /**
103
- * Maps each item to another value into an array. Identical in behavior to
104
- * [Array.map()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map).
105
- *
106
- * @param fn Function that produces an element of the new array, taking three arguments
107
- * @param thisArg Value to use as `this` when executing function
108
- *
109
- * @example
110
- * miniMap.map(user => user.tag);
111
- */
112
- map<T>(fn: (value: V, key: K, miniMap: this) => T): T[];
113
- map<This, T>(fn: (this: This, value: V, key: K, miniMap: this) => T, thisArg: This): T[];
114
- }
115
- export declare function queueTrackEnd(player: Player, dontShiftQueue?: boolean): Promise<Track>;
116
- export declare function safeStringify(obj: any, padding?: number): string;