diff --git a/package.json b/package.json index 65710c6..83b3476 100644 --- a/package.json +++ b/package.json @@ -12,8 +12,8 @@ "build": "rimraf lib && tsc", "format": "prettier --write \"src/**/*.ts\" \"example/**/*.ts\"", "lint": "tslint -p tsconfig.json", - "docs": "docgen --jsdoc jsdoc.json --verbose --source src/*.ts src/**/*.ts --custom docs/index.yml --output docs/docs.json", - "docs:test": "docgen --jsdoc jsdoc.json --verbose --source src/*.ts src/**/*.ts --custom docs/index.yml" + "docs": "docgen --jsdoc jsdoc.json --source src/*.ts src/**/*.ts --custom docs/index.yml --output docs/docs.json", + "docs:test": "docgen --jsdoc jsdoc.json --source src/*.ts src/**/*.ts --custom docs/index.yml" }, "funding": "https://github.com/Androz2091/discord-player?sponsor=1", "contributors": [ diff --git a/src/Player.ts b/src/Player.ts index 170cb6d..73a3e01 100644 --- a/src/Player.ts +++ b/src/Player.ts @@ -456,4 +456,65 @@ class Player extends EventEmitter { } } +/** + * Emitted when bot gets disconnected from a voice channel + * @event Player#botDisconnect + * @param {Queue} queue The queue + */ + +/** + * Emitted when the voice channel is empty + * @event Player#channelEmpty + * @param {Queue} queue The queue + */ + +/** + * Emitted when bot connects to a voice channel + * @event Player#connectionCreate + * @param {Queue} queue The queue + * @param {StreamDispatcher} connection The discord player connection object + */ + +/** + * Debug information + * @event Player#debug + * @param {Queue} queue The queue + * @param {string} message The message + */ + +/** + * Emitted on error + * This event should handled properly otherwise it may crash your process! + * @event Player#error + * @param {Queue} queue The queue + * @param {Error} error The error + */ + +/** + * Emitted when queue ends + * @event Player#queueEnd + * @param {Queue} queue The queue + */ + +/** + * Emitted when a single track is added + * @event Player#trackAdd + * @param {Queue} queue The queue + * @param {Track} track The track + */ + +/** + * Emitted when multiple tracks are added + * @event Player#tracksAdd + * @param {Queue} queue The queue + * @param {Track[]} tracks The tracks + */ + +/** + * Emitted when a track starts playing + * @event Player#trackStart + * @param {Queue} queue The queue + * @param {Track} track The track + */ + export { Player }; diff --git a/src/types/types.ts b/src/types/types.ts index 4f23802..54c02d2 100644 --- a/src/types/types.ts +++ b/src/types/types.ts @@ -138,74 +138,21 @@ export enum QueryType { } export interface PlayerEvents { - /** - * Emitted when bot gets disconnected from a voice channel - * @event Player#botDisconnect - * @param {Queue} queue The queue - */ botDisconnect: (queue: Queue) => any; - - /** - * Emitted when the voice channel is empty - * @event Player#channelEmpty - * @param {Queue} queue The queue - */ channelEmpty: (queue: Queue) => any; - /** - * Emitted when bot connects to a voice channel - * @event Player#connectionCreate - * @param {Queue} queue The queue - * @param {StreamDispatcher} connection The discord player connection object - */ connectionCreate: (queue: Queue, connection: StreamDispatcher) => any; - /** - * Debug information - * @event Player#debug - * @param {Queue} queue The queue - * @param {string} message The message - */ debug: (queue: Queue, message: string) => any; - /** - * Emitted on error - * This event should handled properly otherwise it may crash your process! - * @event Player#error - * @param {Queue} queue The queue - * @param {Error} error The error - */ error: (queue: Queue, error: Error) => any; - /** - * Emitted when queue ends - * @event Player#queueEnd - * @param {Queue} queue The queue - */ queueEnd: (queue: Queue) => any; - /** - * Emitted when a single track is added - * @event Player#trackAdd - * @param {Queue} queue The queue - * @param {Track} track The track - */ trackAdd: (queue: Queue, track: Track) => any; - /** - * Emitted when multiple tracks are added - * @event Player#tracksAdd - * @param {Queue} queue The queue - * @param {Track[]} tracks The tracks - */ tracksAdd: (queue: Queue, track: Track[]) => any; - /** - * Emitted when a track starts playing - * @event Player#trackStart - * @param {Queue} queue The queue - * @param {Track} track The track - */ trackStart: (queue: Queue, track: Track) => any; }