Not really sure why this was here in the first place.
I think the idea was to make autocompletions for setResponseHandlers() work or something.
Either way, this doesn't seem necessary anymore now, and in fact was causing some issues while working on #800.
Specifically, I was trying to pass an existing generic argument to the TypedMessenger, something like:
/**
* @template {TypedMessengerSignatures} TRes
* @template {TypedMessengerSignatures} TReq
* @param {TRes}
*/
function createMessenger(responseHandlers) {
/** @type {TypedMessenger<TRes, TReq> */
const messenger = new TypedMessenger();
messenger.setResponseHandlers(responseHandlers);
// ^^^^^^^^^^^^^^^^
// 'TRes' is not assignable to parameter of type 'ResponseHandlers'
}
Not really sure why this was here in the first place. I think the idea was to make autocompletions for
setResponseHandlers()
work or something. Either way, this doesn't seem necessary anymore now, and in fact was causing some issues while working on #800. Specifically, I was trying to pass an existing generic argument to the TypedMessenger, something like: