-
-
Notifications
You must be signed in to change notification settings - Fork 9.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing type definitions for Addon-Docs #8183
Comments
this error appears when u import components to the .ts or .tsx files. use mdx file. |
Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks! |
Hmmm I'm unsure about how we can export typings for each In a nutshell, we try to create an alias for TS types from |
No one loves having their own // in a file called typings/addonDocs.d.ts
declare module '@storybook/addon-docs/blocks' {
/** Delete this type once storybook adds the real type, tracked in issue https://github.com/storybookjs/storybook/issues/8183 */
export const Title: ()=> JSX.Element;
/** Delete this type once storybook adds the real type, tracked in issue https://github.com/storybookjs/storybook/issues/8183 */
export const Subtitle: ()=> JSX.Element;
/** Delete this type once storybook adds the real type, tracked in issue https://github.com/storybookjs/storybook/issues/8183 */
export const Description: ()=> JSX.Element;
/** Delete this type once storybook adds the real type, tracked in issue https://github.com/storybookjs/storybook/issues/8183 */
export const Primary: ()=> JSX.Element;
/** Delete this type once storybook adds the real type, tracked in issue https://github.com/storybookjs/storybook/issues/8183 */
export const Props: ()=> JSX.Element;
/** Delete this type once storybook adds the real type, tracked in issue https://github.com/storybookjs/storybook/issues/8183 */
export const Stories: ()=> JSX.Element;
} |
I met a similar issue when I import
|
w00t!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.0.0-alpha.36 containing PR #10441 that references this issue. Upgrade today to try it out! You can find this prerelease on the Closing this issue. Please re-open if you think there's still more to do. |
|
@doublejosh please upgrade node to 10.17 or higher. |
Describe the bug
Trying to use addon-docs in a typescript storybook results in error:
Could not find a declaration file for module '@storybook/addon-docs/blocks'
To Reproduce
Import a Preview / Meta / Story component from
@storybook/addon-docs/blocks
in a Component.stories.tsx file.Expected behavior
Compiler should be able to find type definitions for exported components from
@storybook/addon-docs/blocks
Screenshots
NA
Code snippets
NA
System:
System:
OS: macOS Mojave 10.14.3
CPU: (8) x64 Intel(R) Core(TM) i5-8259U CPU @ 2.30GHz
Binaries:
Node: 10.16.0 - ~/.nvm/versions/node/v10.16.0/bin/node
Yarn: 1.17.3 - ~/.nvm/versions/node/v10.16.0/bin/yarn
npm: 6.9.0 - ~/.nvm/versions/node/v10.16.0/bin/npm
Browsers:
Chrome: 77.0.3865.90
Firefox: 68.0
Safari: 12.0.3
npmGlobalPackages:
@storybook/cli: 5.2.1
Additional context
using VSCode 1.38.0
The text was updated successfully, but these errors were encountered: