You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We need to improve on our type annotations (and also rename getWorker, it made me believe you're referring to the Service Worker, when, in fact, the add-on properly assigns the api to the worker/server depending on the environment).
I wonder if one can do conditional types based on the environment. The least we can do right now is to make getWorker a generic function so that you could use it like this:
This is odd, the following code generates a TS error even though on the face of it the types look OK:
It seems to think
close
is missing fromSetupApi
but that doesn't make sense.I have created a sample repo here:
https://github.com/robcaldecott/msw-storybook-addon-type-errors
Current workarounds are either
// @ts-ignore
or this:Better ideas are welcome.
The text was updated successfully, but these errors were encountered: