react-storybook-addon-props-combinations icon indicating copy to clipboard operation
react-storybook-addon-props-combinations copied to clipboard

Does not include Typescript typing

Open mattfelten opened this issue 6 years ago • 3 comments

We are running Typscript in Storybook 5 and I'm getting this when trying to set up this addon.

storybook:  TS7016: Could not find a declaration file for module 'react-storybook-addon-props-combinations'. '/Users/mattfelten/.../node_modules/react-storybook-addon-props-combinations/dist/index.js' implicitly has an 'any' type.
storybook:  Try `npm install @types/react-storybook-addon-props-combinations` if it exists or add a new declaration (.d.ts) file containing `declare module 'react-storybook-addon-props-combinations';`

Any plans on creating typings for this?

mattfelten avatar May 14 '19 00:05 mattfelten

I got around it by following this guide for creating your own typings file for third-party modules, but it'd be great if this was already included.

mattfelten avatar May 14 '19 00:05 mattfelten

@mattfelten mind sharing your solution?

schonert avatar May 17 '19 06:05 schonert

Sure. I added ./.types/react-storybook-addon-props-combinations/index.d.ts that only contains

declare module 'react-storybook-addon-props-combinations';

And then made sure that the ./.types is being loaded in tsconfig.json as a typeRoot.

The link I posted earlier walked me through it.

mattfelten avatar May 17 '19 19:05 mattfelten