chore: use descriptive type parameter names (#9937)

* chore: use descriptive type parameter names

* refactor: requested changes

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
Almeida
2023-11-12 17:21:51 +00:00
committed by GitHub
parent 4ff3ea4a1b
commit 975d5f18ae
34 changed files with 1104 additions and 895 deletions

View File

@@ -182,9 +182,9 @@ export interface AudioPlayer extends EventEmitter {
*
* @eventProperty
*/
on<T extends AudioPlayerStatus>(
event: T,
listener: (oldState: AudioPlayerState, newState: AudioPlayerState & { status: T }) => void,
on<Event extends AudioPlayerStatus>(
event: Event,
listener: (oldState: AudioPlayerState, newState: AudioPlayerState & { status: Event }) => void,
): this;
}
@@ -375,7 +375,7 @@ export class AudioPlayer extends EventEmitter {
* @param resource - The resource to play
* @throws Will throw if attempting to play an audio resource that has already ended, or is being played by another player
*/
public play<T>(resource: AudioResource<T>) {
public play<Metadata>(resource: AudioResource<Metadata>) {
if (resource.ended) {
throw new Error('Cannot play a resource that has already ended.');
}