Skip to content

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

@tobiasdiez

Description

@tobiasdiez

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions