Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing types for event callbacks #1372

Closed
ArnaudBarre opened this issue Oct 14, 2024 · 2 comments · Fixed by #1381
Closed

Missing types for event callbacks #1372

ArnaudBarre opened this issue Oct 14, 2024 · 2 comments · Fixed by #1381

Comments

@ArnaudBarre
Copy link

ArnaudBarre commented Oct 14, 2024

  • Chokidar v4.0.1
  • TS v5.5
import chokidar from "chokidar";

chokidar.watch("src").on('change', (path) => {
  //                                 ^ this is any for me in v4
});

v3 types have implements fs.FSWatcher on FSWatcher which made things better typed it seems

@43081j
Copy link
Collaborator

43081j commented Oct 14, 2024

We probably shouldn't just mimick FSWatcher again but should strongly type our event handlers

I don't think we have many, so it should be easy to do

@aleclarson
Copy link

FYI: @types/node recently added generics to EventEmitter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants