From 3fa04b55f19adf01885e76fcff40ee22fde0a49d Mon Sep 17 00:00:00 2001 From: James Garbutt <43081j@users.noreply.github.com> Date: Wed, 18 Dec 2024 19:10:59 +0000 Subject: [PATCH] fix: strongly type `unlink` events The `unlink` and `unlinkDir` events both have known types, so this adds them to the known event map. --- src/index.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/index.ts b/src/index.ts index 45666552..4fc2ad56 100644 --- a/src/index.ts +++ b/src/index.ts @@ -303,6 +303,8 @@ export interface FSWatcherKnownEventMap { [EV.RAW]: Parameters; [EV.ERROR]: Parameters; [EV.ALL]: [EventName, ...EmitArgs]; + [EV.UNLINK]: [path: string]; + [EV.UNLINK_DIR]: [path: string]; } export type FSWatcherEventMap = FSWatcherKnownEventMap & {