documentation

This commit is contained in:
Snowflake107 2021-06-21 11:16:28 +05:45
parent 3bcc7adce6
commit 63eb26dc7b
2 changed files with 8 additions and 8 deletions

View file

@ -145,11 +145,16 @@ class Player extends EventEmitter<PlayerEvents> {
return prev;
}
/**
* @typedef {object} SearchResult
* @property {Playlist} [playlist] The playlist (if any)
* @property {Track[]} tracks The tracks
*/
/**
* Search tracks
* @param {string|Track} query The search query
* @param {UserResolvable} requestedBy The person who requested track search
* @returns {Promise<object>}
* @param {SearchOptions} options The search options
* @returns {Promise<SearchResult>}
*/
async search(query: string | Track, options: SearchOptions) {
if (query instanceof Track) return { playlist: null, tracks: [query] };
@ -409,6 +414,7 @@ class Player extends EventEmitter<PlayerEvents> {
}
/**
* 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)

View file

@ -135,7 +135,6 @@ export interface PlayerOptions {
}
/**
* The extractor model data
* @typedef {object} ExtractorModelData
* @property {object} [playlist] The playlist info (if any)
* @property {string} [playlist.title] The playlist title
@ -306,7 +305,6 @@ export interface PlayerEvents {
}
/**
* Options passed to `<Queue>.play()`
* @typedef {object} PlayOptions
* @property {boolean} [filtersUpdate=false] If this play was triggered for filters update
* @property {string[]} [encoderArgs=[]] FFmpeg args passed to encoder
@ -322,7 +320,6 @@ export interface PlayOptions {
}
/**
* Options passed to `<Player>.search()`
* @typedef {object} SearchOptions
* @property {UserResolvable} requestedBy The user who requested this search
* @property {QueryType} searchEngine The query search engine
@ -348,7 +345,6 @@ export enum QueueRepeatMode {
}
/**
* Playlist init data
* @typedef {object} PlaylistInitData
* @property {Track[]} tracks The tracks of this playlist
* @property {string} title The playlist title
@ -380,7 +376,6 @@ export interface PlaylistInitData {
}
/**
* The JSON representation of a track
* @typedef {object} TrackJSON
* @property {string} title The track title
* @property {string} description The track description
@ -407,7 +402,6 @@ export interface TrackJSON {
}
/**
* The JSON representation of the playlist
* @typedef {object} PlaylistJSON
* @property {string} id The playlist id
* @property {string} url The playlist url