Closed crishoj closed 3 months ago
Thanks!
Maybe TypedEmitter
should be added manually? Maybe adding a new dependency is not worth it:
https://github.com/binier/tiny-typed-emitter/blob/master/lib/index.d.ts
Anyways, this is an excellent idea.
This is now implemented in commit https://github.com/jisotalo/ads-client/commit/2865ede260253a33e2a9828dd6b6dc5cb5ef6f13
It seems that nowadays Node.js supports declaring EventHandler types without any special code / library (see https://stackoverflow.com/a/78449821/8140625). However, I didn't manage to get the comments working in VSCode - not sure if there is a way to get them to work.
However, the event types are shown in intellisense as well as event payload types and names :)
It seems that nowadays Node.js supports declaring EventHandler types without any special code / library
Even better — TIL !
This no-overhead change adds type information for
Client
events and handlers.