diff --git a/src/Fetcher.ts b/src/Fetcher.ts index 48b790a..88972e3 100644 --- a/src/Fetcher.ts +++ b/src/Fetcher.ts @@ -33,12 +33,12 @@ export class Fetcher extends EventEmitter { this.fetching = false; } - public on(event: K, listener: (args: Events[K]) => void) { - return super.on(event, listener); + public on(event: K, listener: (...args: Events[K]) => void) { + return super.on(event, listener as (...args: any[]) => void); } - public once(event: K, listener: (args: Events[K]) => void) { - return super.on(event, listener); + public once(event: K, listener: (...args: Events[K]) => void) { + return super.on(event, listener as (...args: any[]) => void); } public emit(event: K, ...args: Events[K]) { @@ -49,8 +49,8 @@ export class Fetcher extends EventEmitter { return super.eventNames() as Array; } - public off(event: K, listener: (args: Events[K]) => void) { - return super.off(event, listener); + public off(event: K, listener: (...args: Events[K]) => void) { + return super.off(event, listener as (...args: any[]) => void); } /**