From c9b6bd88715d8d0adb21b5de2693a95b7926d157 Mon Sep 17 00:00:00 2001 From: Ayfri Date: Sat, 21 Aug 2021 03:43:41 +0200 Subject: [PATCH] fix: Fix typings of listener methods. --- src/Fetcher.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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); } /**