From 4220a44c86a0380316f3194c606c671005e31586 Mon Sep 17 00:00:00 2001 From: Kasper Peulen Date: Thu, 27 Oct 2022 15:24:59 +0200 Subject: [PATCH] Make StoryObj work the same as ComponentStoryObj did (so non strict) --- code/renderers/react/src/public-types.test.tsx | 2 +- code/renderers/react/src/public-types.ts | 6 +----- code/renderers/svelte/src/public-types.test.ts | 2 +- code/renderers/svelte/src/public-types.ts | 6 +----- 4 files changed, 4 insertions(+), 12 deletions(-) diff --git a/code/renderers/react/src/public-types.test.tsx b/code/renderers/react/src/public-types.test.tsx index 51b0eb6e37e4..1711434494b2 100644 --- a/code/renderers/react/src/public-types.test.tsx +++ b/code/renderers/react/src/public-types.test.tsx @@ -79,7 +79,7 @@ describe('Args can be provided in multiple ways', () => { }); test('Component can be used as generic parameter for StoryObj', () => { - type Expected = ReactStory; + type Expected = ReactStory>; expectTypeOf>().toEqualTypeOf(); }); }); diff --git a/code/renderers/react/src/public-types.ts b/code/renderers/react/src/public-types.ts index 811ca5ed5bff..6a7350fd10ef 100644 --- a/code/renderers/react/src/public-types.ts +++ b/code/renderers/react/src/public-types.ts @@ -53,11 +53,7 @@ export type StoryObj = TMetaOrCmpOrArgs extends { > : never : TMetaOrCmpOrArgs extends ComponentType - ? StoryAnnotations< - ReactFramework, - ComponentProps, - ComponentProps - > + ? StoryAnnotations> : StoryAnnotations; type ActionArgs = { diff --git a/code/renderers/svelte/src/public-types.test.ts b/code/renderers/svelte/src/public-types.test.ts index 79663ebd8e1e..a0edd3d36151 100644 --- a/code/renderers/svelte/src/public-types.test.ts +++ b/code/renderers/svelte/src/public-types.test.ts @@ -141,7 +141,7 @@ describe('StoryObj', () => { SvelteStory< Button, { disabled: boolean; label: string }, - { disabled: boolean; label: string } + { disabled?: boolean; label?: string } > >(); }); diff --git a/code/renderers/svelte/src/public-types.ts b/code/renderers/svelte/src/public-types.ts index 2e3d7a9443cf..4040033a7f57 100644 --- a/code/renderers/svelte/src/public-types.ts +++ b/code/renderers/svelte/src/public-types.ts @@ -49,11 +49,7 @@ export type StoryObj = MetaOrCmpOrArgs extends { > : never : MetaOrCmpOrArgs extends SvelteComponentTyped - ? StoryAnnotations< - SvelteFramework, - ComponentProps, - ComponentProps - > + ? StoryAnnotations, ComponentProps> : StoryAnnotations; export type DecoratorFn = DecoratorFunction;