Skip to content

[Feature]: Typescript - Add typings to both <Template> and <Story> args #68

@AcePetrucci

Description

@AcePetrucci

Describe the bug

Whenever I use both the <Template> and <Story> components, it would be great to be able to set the expected type of let:args.

Ex:

<script lang="ts">
  import Choice from './Choice.svelte';
  import choiceProps from './choiceProps.ts';
</script>

<Template let:args id="ChoiceTemplate">
  // Ideally I would have the option to set that args has the choiceProps type
  <Choice {...args} />
</Template>

<Story
  id="ChoiceStory"
  name="Choice"
  template="ChoiceTemplate"
  args={{
    choiceText: 'Choice 1',
    value: 'choice-1',
    name: 'choice-1'
  }} // Same thing here
/>

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions