Utility type for typing event handler callbacks that can be defined outside of inline client.on() calls.
client.on()
The server type (use typeof yourServerInstance)
typeof yourServerInstance
The event name (must be a key of IncomingEvents)
const ws = new EZEZWebsocketServer<IncomingEvents, OutgoingEvents>(...);const ping2Handler: OnCallback<typeof ws, "ping2"> = (args, reply, ids) => { // args, reply, etc. are typed};client.on("ping2", ping2Handler); Copy
const ws = new EZEZWebsocketServer<IncomingEvents, OutgoingEvents>(...);const ping2Handler: OnCallback<typeof ws, "ping2"> = (args, reply, ids) => { // args, reply, etc. are typed};client.on("ping2", ping2Handler);
Utility type for typing event handler callbacks that can be defined outside of inline
client.on()calls.