Skip to content
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

type: update Addon_BaseAnnotations type #22771

Merged

Conversation

specialdoom
Copy link
Contributor

@specialdoom specialdoom commented May 24, 2023

What I did

I've added extra type variable for the Addon_BaseAnnotations which is related to the renderer that it's going to be passed to Addon_StoryContext. These types are used inside @storybook/addon-svelte-csf addon for the StoryProps type where play function it's included.

Using the current implementation of the @storybook/addon-svelte-csf the play function has the Addon_StoryContext with default type variable TRenderer equal to Renderer which has canvasElement property as unknown. I'm adding the extra type variable to be able to specify the Renederer so I can have a known type for the canvasElement property. The svelte-check command it's returning an error because of the unknown type of the canvasElement property.

If this PR will be merged there is going to be another PR on the @storybook/addon-svelte-csf which it's going to use the new Addon_BaseAnnotations type.
e.g.

interface StoryProps extends Addon_BaseAnnotations<T1, T2, WebRenderer> { ... }

Current usage of Addon_BaseAnnotation in @storybook/addon-svelte-csf here .

How to reproduce issue https://stackblitz.com/github/StefanIlieP5/svelte-storybook7

  1. Run npm run check command

["other"]

@ndelangen ndelangen self-assigned this May 25, 2023
@ndelangen ndelangen added patch:yes Bugfix & documentation PR that need to be picked to main branch bug labels May 25, 2023
@specialdoom
Copy link
Contributor Author

specialdoom commented May 30, 2023

Is something stopping us from merging this PR if everything is alright? I would like to add the change on the addon repo as well. Sorry for pushing...

@ndelangen ndelangen merged commit 4c3a09a into storybookjs:next May 30, 2023
48 checks passed
@shilman shilman added the patch:done Patch/release PRs already cherry-picked to main/release branch label Jun 4, 2023
shilman pushed a commit that referenced this pull request Jun 4, 2023
…ution

type: update `Addon_BaseAnnotations` type
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug patch:done Patch/release PRs already cherry-picked to main/release branch patch:yes Bugfix & documentation PR that need to be picked to main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants