From 7ab34424ebf9a7d3f4caa42f18abe1575b1c4fb8 Mon Sep 17 00:00:00 2001 From: Kyle Gach Date: Thu, 25 Jan 2024 13:25:19 -0700 Subject: [PATCH] Merge pull request #25300 from storybookjs/fix-type-custom-stories Docs: Fix types in custom stories implementation snippet (cherry picked from commit 7ecf05e5f5b27872c478134f7345a87f9beb63cc) --- docs/snippets/common/main-config-stories-with-logic.ts.mdx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/snippets/common/main-config-stories-with-logic.ts.mdx b/docs/snippets/common/main-config-stories-with-logic.ts.mdx index 9fc8480c6656..33937cf12fef 100644 --- a/docs/snippets/common/main-config-stories-with-logic.ts.mdx +++ b/docs/snippets/common/main-config-stories-with-logic.ts.mdx @@ -3,14 +3,15 @@ // Replace your-framework with the framework you are using (e.g., react-webpack5, vue3-vite) import type { StorybookConfig } from '@storybook/your-framework'; +import type { StoriesEntry } from '@storybook/types'; -async function findStories() { +async function findStories(): Promise { // your custom logic returns a list of files } const config: StorybookConfig = { framework: '@storybook/your-framework', - stories: async (list) => [ + stories: async (list: StoriesEntry[]) => [ ...list, // 👇 Add your found stories to the existing list of story files ...(await findStories()),