From 87f7d643319783e9fc50456f28b01b55957c673d Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Tue, 30 May 2023 15:26:29 +0200 Subject: [PATCH] Merge pull request #22771 from specialdoom/my-first-storybook-contribution type: update `Addon_BaseAnnotations` type --- code/lib/types/src/modules/addons.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/code/lib/types/src/modules/addons.ts b/code/lib/types/src/modules/addons.ts index 424fa80579c5..f4085d06d170 100644 --- a/code/lib/types/src/modules/addons.ts +++ b/code/lib/types/src/modules/addons.ts @@ -162,7 +162,11 @@ export type Addon_BaseDecorators = Array< (story: () => StoryFnReturnType, context: Addon_StoryContext) => StoryFnReturnType >; -export interface Addon_BaseAnnotations { +export interface Addon_BaseAnnotations< + TArgs, + StoryFnReturnType, + TRenderer extends Renderer = Renderer +> { /** * Dynamic data that are provided (and possibly updated by) Storybook and its addons. * @see [Arg story inputs](https://storybook.js.org/docs/react/api/csf#args-story-inputs) @@ -192,12 +196,12 @@ export interface Addon_BaseAnnotations { /** * Define a custom render function for the story(ies). If not passed, a default render function by the framework will be used. */ - render?: (args: TArgs, context: Addon_StoryContext) => StoryFnReturnType; + render?: (args: TArgs, context: Addon_StoryContext) => StoryFnReturnType; /** * Function that is executed after the story is rendered. */ - play?: (context: Addon_StoryContext) => Promise | void; + play?: (context: Addon_StoryContext) => Promise | void; } export interface Addon_Annotations