Skip to content

Commit

Permalink
fix type errors
Browse files Browse the repository at this point in the history
  • Loading branch information
JReinhold committed Oct 16, 2024
1 parent 4326acd commit 4d1ba45
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/runtime/create-runtime-stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ export const createRuntimeStories = (Stories: Component, meta: Meta<Cmp>) => {
logger.error(`Error in mounting stories ${e.toString()}`, e);
}

const stories: Record<string, StoryObj<StoryRenderer>> = {};
const stories: Record<string, StoryObj<typeof StoryRenderer>> = {};

for (const [exportName, story] of repository.stories) {
const storyObj: StoryObj<StoryRenderer> = {
const storyObj: StoryObj<typeof StoryRenderer> = {
...story,
// @ts-expect-error WARN: Here we are attempting to convert every `StoryCmp` into `StoryObj`, and the types are different
render: (args, storyContext) => ({
Expand Down
4 changes: 2 additions & 2 deletions tests/stories/Comparison.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ const meta = {
csf: { table: { disable: true } },
},
tags: ['autodocs', '!dev'],
} satisfies Meta<Comparison>;
} satisfies Meta<typeof Comparison>;

export default meta;

type Story = StoryObj<Comparison>;
type Story = StoryObj<typeof Comparison>;

export const Default: Story = {
args: { csf: 'regular' },
Expand Down
2 changes: 1 addition & 1 deletion tests/stories/LegacyStory.stories.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
title: 'LegacyStory',
component: LegacyStory,
tags: ['autodocs'],
} satisfies Meta<LegacyStory>;
} satisfies Meta<typeof LegacyStory>;
let count = 0;
Expand Down
2 changes: 1 addition & 1 deletion tests/stories/LegacyTemplate.stories.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
title: 'LegacyTemplate',
component: LegacyTemplate,
tags: ['autodocs'],
} satisfies Meta<LegacyTemplate>;
} satisfies Meta<typeof LegacyTemplate>;
</script>

<script lang="ts">
Expand Down
2 changes: 1 addition & 1 deletion tests/stories/LegacyWithInstance.stories.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
title: 'LegacyTemplateWithInstance',
component: LegacyTemplate,
tags: ['autodocs'],
} satisfies Meta<LegacyTemplate>;
} satisfies Meta<typeof LegacyTemplate>;
let count = $state(0);
Expand Down

0 comments on commit 4d1ba45

Please sign in to comment.