-
-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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
addon-actions doesn't have a TS declaration file #1159
Comments
Yes I have the same issue, I also tried to do something similar because the Readme.md in
But there is no *.d.ts file Which also makes me wonder which is the right way to use actions Since you can also import it directly from I tried like this but like the ticket #1153 the actions are not being logged. |
(not sure if we are considering lack of TS support a bug or not at this point) |
@tmeasday seems like enough people are using it that it's close enough 😄 |
@shilman Sure, I would be happy to help... do you have a IRC channel or how can I join your slack channel? |
@tmeasday I would say that more and more people are going to start using TypeScript https://trends.google.com/trends/explore?date=all&q=TypeScript |
@leonidaX slack is here. we are excited and grateful for your help! 🎉 |
I created an example project with storybook typescript and less https://github.com/leonidax/storybook-ts-less-example |
Thanks for creating a repo @leonidaX . I checked it out and answered your question on #1153 As for the lack of typescript definitions on the actions package, here's the story:
And for the followup, I think we should have a uniform way to support Typescript in Storybook packages so that all I'd like to close this issue and continue the discussion in #1166. @leonidaX @Keats are you OK with that? |
PS - as a temporary workaround you can add a type definition to your project, which I did successfully in @leonidaX 's project: declare module "@storybook/addon-actions" {
export function action(name: string, ...params: any[]): any;
} |
Yes I did something like that directly in the module but I suppose I can put it in a global.d.ts while the proper fix gets it to a released version. Im ok with closing this ticket and moving the conversation to #1166 Thanks for all the help :) |
Thanks @leonidaX ! Would have no idea what's going on without your sample repo. Super helpful!! 🏅🏆 👏 |
Which means trying to import
{ action }
will result in:The text was updated successfully, but these errors were encountered: