import { Client, Collection, GuildResolvable } from "discord.js"; import { TypedEmitter as EventEmitter } from "tiny-typed-emitter"; import { Queue } from "./Structures/Queue"; import { VoiceUtils } from "./VoiceInterface/VoiceUtils"; import { PlayerEvents, PlayerOptions, SearchOptions, PlayerInitOptions, PlayerSearchResult, PlaylistInitData } from "./types/types"; import Track from "./Structures/Track"; import { Playlist } from "./Structures/Playlist"; import { ExtractorModel } from "./Structures/ExtractorModel"; declare class Player extends EventEmitter { readonly client: Client; readonly options: PlayerInitOptions; readonly queues: Collection>; readonly voiceUtils: VoiceUtils; readonly extractors: Collection; requiredEvents: string[]; /** * Creates new Discord Player * @param {Client} client The Discord Client * @param {PlayerInitOptions} [options] The player init options */ constructor(client: Client, options?: PlayerInitOptions); /** * Handles voice state update * @param {VoiceState} oldState The old voice state * @param {VoiceState} newState The new voice state * @returns {void} * @private */ private _handleVoiceState; /** * Creates a queue for a guild if not available, else returns existing queue * @param {GuildResolvable} guild The guild * @param {PlayerOptions} queueInitOptions Queue init options * @returns {Queue} */ createQueue(guild: GuildResolvable, queueInitOptions?: PlayerOptions & { metadata?: T; }): Queue; /** * Returns the queue if available * @param {GuildResolvable} guild The guild id * @returns {Queue} */ getQueue(guild: GuildResolvable): Queue; /** * Deletes a queue and returns deleted queue object * @param {GuildResolvable} guild The guild id to remove * @returns {Queue} */ deleteQueue(guild: GuildResolvable): Queue; /** * @typedef {object} PlayerSearchResult * @property {Playlist} [playlist] The playlist (if any) * @property {Track[]} tracks The tracks */ /** * Search tracks * @param {string|Track} query The search query * @param {SearchOptions} options The search options * @returns {Promise} */ search(query: string | Track, options: SearchOptions): Promise; /** * Registers extractor * @param {string} extractorName The extractor name * @param {ExtractorModel|any} extractor The extractor object * @param {boolean} [force=false] Overwrite existing extractor with this name (if available) * @returns {ExtractorModel} */ use(extractorName: string, extractor: ExtractorModel | any, force?: boolean): ExtractorModel; /** * Removes registered extractor * @param {string} extractorName The extractor name * @returns {ExtractorModel} */ unuse(extractorName: string): ExtractorModel; /** * Generates a report of the dependencies used by the `@discordjs/voice` module. Useful for debugging. * @returns {string} */ scanDeps(): string; emit(eventName: U, ...args: Parameters): boolean; /** * Resolves queue * @param {GuildResolvable|Queue} queueLike Queue like object * @returns {Queue} */ resolveQueue(queueLike: GuildResolvable | Queue): Queue; [Symbol.iterator](): Generator, void, undefined>; /** * Creates `Playlist` instance * @param data The data to initialize a playlist */ createPlaylist(data: PlaylistInitData): Playlist; } export { Player };