In the 3.x branch, the TS Typings for these methods were generic and thus allowed the returned promise to be correctly typed. In the 5.x branch at the moment, this promise is typed to CallSender which is just a function dictionary and so there's no type safety.
Something like this would keep compatibility
connectToParent<TParent = CallSender>(...)
So if a generic parameter isn't provided, it falls back to CallSender.
Hello,
In the 3.x branch, the TS Typings for these methods were generic and thus allowed the returned promise to be correctly typed. In the 5.x branch at the moment, this promise is typed to
CallSender
which is just a function dictionary and so there's no type safety.Something like this would keep compatibility
So if a generic parameter isn't provided, it falls back to
CallSender
.Am happy to provide a pull request if you want.