[howler] off() event fix allowing to unsubscribe all registered callbacks (#45401)

* [howler] Fixed off event typings

Allow unsubscribing by name again, without having to pass a callback method.

* Update index.d.ts
This commit is contained in:
Martijn Swart 2020-06-24 10:38:45 +02:00 committed by GitHub
parent 20c9b607bf
commit e429a2aa32
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -237,15 +237,14 @@ export class Howl {
): this;
once(event: string, callback: HowlCallback | HowlErrorCallback, id?: number): this;
off(): this;
off(event: 'load', callback: () => void, id?: number): this;
off(event: 'loaderror' | 'playerror', callback: HowlErrorCallback, id?: number): this;
off(event: 'load', callback?: () => void, id?: number): this;
off(event: 'loaderror' | 'playerror', callback?: HowlErrorCallback, id?: number): this;
off(
event: 'play' | 'end' | 'pause' | 'stop' | 'mute' | 'volume' | 'rate' | 'seek' | 'fade' | 'unlock',
callback: HowlCallback,
callback?: HowlCallback,
id?: number,
): this;
off(event: string, callback: HowlCallback | HowlErrorCallback, id?: number): this;
off(event?: string, callback?: HowlCallback | HowlErrorCallback, id?: number): this;
stereo(pan: number, id?: number): this | void;
pos(x: number, y: number, z: number, id?: number): this | void;