Skip to content

Commit 9ecdd87

Browse files
committed
Fix event emitter types on CompassApplication
1 parent d594057 commit 9ecdd87

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

packages/compass/src/main/application.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -383,9 +383,6 @@ class CompassApplication {
383383
event: 'show-log-file-dialog',
384384
handler: () => void
385385
): typeof CompassApplication;
386-
// @ts-expect-error typescript is not happy with this overload even though it
387-
// worked when it wasn't static and the implementation does
388-
// match the overload declaration
389386
static on(
390387
event: 'new-window',
391388
handler: (bw: BrowserWindow) => void
@@ -402,9 +399,9 @@ class CompassApplication {
402399
event: 'menu-request-restart',
403400
handler: () => void
404401
): typeof CompassApplication;
405-
static on(
402+
static on<Args extends unknown[]>(
406403
event: string,
407-
handler: (...args: unknown[]) => void
404+
handler: (...args: Args) => void
408405
): typeof CompassApplication {
409406
this.emitter.on(event, handler);
410407
return this;

0 commit comments

Comments
 (0)