From a0f9e09f64ce7ae70cc6ae1f5615f65cb35f532f Mon Sep 17 00:00:00 2001 From: Ben Polinsky Date: Fri, 2 Feb 2024 15:19:58 -0500 Subject: [PATCH 1/2] update fs.FSWatcher types to satisfy node versions >= 16; fixes #1299 --- types/index.d.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/types/index.d.ts b/types/index.d.ts index aab8e337..d1194032 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -60,9 +60,13 @@ export class FSWatcher extends EventEmitter implements fs.FSWatcher { */ on(event: 'ready', listener: () => void): this; - on(event: 'unlink'|'unlinkDir', listener: (path: string) => void): this; + on(event: 'unlink' | 'unlinkDir', listener: (path: string) => void): this; on(event: string, listener: (...args: any[]) => void): this; + + ref(): this; + + unref(): this; } export interface WatchOptions { From 29a2f13171e4e1036ecdb47bc134cd9c7e3c22de Mon Sep 17 00:00:00 2001 From: Ben Polinsky Date: Fri, 2 Feb 2024 15:31:21 -0500 Subject: [PATCH 2/2] fix formatting --- types/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/index.d.ts b/types/index.d.ts index d1194032..45580663 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -60,7 +60,7 @@ export class FSWatcher extends EventEmitter implements fs.FSWatcher { */ on(event: 'ready', listener: () => void): this; - on(event: 'unlink' | 'unlinkDir', listener: (path: string) => void): this; + on(event: 'unlink'|'unlinkDir', listener: (path: string) => void): this; on(event: string, listener: (...args: any[]) => void): this;