From 180465b7b03a7dd8648dc999e9b6f5e873a5ddf2 Mon Sep 17 00:00:00 2001 From: Valentin Palkovic Date: Mon, 13 May 2024 11:50:47 +0200 Subject: [PATCH 1/2] Add typing for NextImage to main framework options type --- code/frameworks/nextjs/src/types.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/frameworks/nextjs/src/types.ts b/code/frameworks/nextjs/src/types.ts index 4707d03d27e8..a294dc365ced 100644 --- a/code/frameworks/nextjs/src/types.ts +++ b/code/frameworks/nextjs/src/types.ts @@ -8,13 +8,14 @@ import type { BuilderOptions, TypescriptOptions as TypescriptOptionsBuilder, } from '@storybook/builder-webpack5'; +import type * as NextImage from 'next/image'; type FrameworkName = '@storybook/nextjs'; type BuilderName = '@storybook/builder-webpack5'; export type FrameworkOptions = ReactOptions & { nextConfigPath?: string; - + image?: NextImage.ImageProps; builder?: BuilderOptions; }; From e21f7d49734a0fad43d9f2d9783464589dfeb6e7 Mon Sep 17 00:00:00 2001 From: Valentin Palkovic Date: Mon, 13 May 2024 15:04:37 +0200 Subject: [PATCH 2/2] Update NextImage type in framework options to make all keys partial --- code/frameworks/nextjs/src/types.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/frameworks/nextjs/src/types.ts b/code/frameworks/nextjs/src/types.ts index a294dc365ced..9ff68f830b28 100644 --- a/code/frameworks/nextjs/src/types.ts +++ b/code/frameworks/nextjs/src/types.ts @@ -15,7 +15,7 @@ type BuilderName = '@storybook/builder-webpack5'; export type FrameworkOptions = ReactOptions & { nextConfigPath?: string; - image?: NextImage.ImageProps; + image?: Partial; builder?: BuilderOptions; };