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

Typescript: restrict sub-components of Stories to be only Story #74

Open
tobiasdiez opened this issue Sep 8, 2023 · 0 comments
Open
Labels
status: blocked type: enhancement Improving upon an existing feature

Comments

@tobiasdiez
Copy link
Owner

tobiasdiez commented Sep 8, 2023

For type checking, we should define the types for the Stories and Story components (and defineArgs etc commands if added in the future). -> This is done already.

According to vuejs/core#7982 (comment), it should be possible to restrict the sub-components, but volar doesn't support this as of now, see vuejs/language-tools#3552 (maybe refs vuejs/core#8015):

defineSlots<{
    default(): Story[]
  }>()

Not sure how to easily define the type for Story though: vuejs/core#9178

@tobiasdiez tobiasdiez added the type: enhancement Improving upon an existing feature label Sep 8, 2023
@tobiasdiez tobiasdiez changed the title Add types for Stories and Story component Typescript: restrict sub-components of Stories to be only Story Oct 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: blocked type: enhancement Improving upon an existing feature
Projects
None yet
Development

No branches or pull requests

1 participant