How can I type a generic emitWithTimeout helper for a typed Root.Socket (with Root.Actions callbacks) so that:
- It infers payload and response types from
Root.Actions[K](payload + callback or callback-only). - The call
emitWithTimeout(socketRef, 'prompts:getPrompts', undefined, opts)gives a correctly typed{ success; data; error? }response. - Without
nevershowing up or needing extra manualSocketResponse<T>types?
Playground:
https://tinyurl.com/3z3jnu8u