Skip to content

Commit

Permalink
Merge pull request #22771 from specialdoom/my-first-storybook-contrib…
Browse files Browse the repository at this point in the history
…ution

type: update `Addon_BaseAnnotations` type
  • Loading branch information
ndelangen authored and shilman committed Jun 4, 2023
1 parent 0161e33 commit 87f7d64
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions code/lib/types/src/modules/addons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,11 @@ export type Addon_BaseDecorators<StoryFnReturnType> = Array<
(story: () => StoryFnReturnType, context: Addon_StoryContext) => StoryFnReturnType
>;

export interface Addon_BaseAnnotations<TArgs, StoryFnReturnType> {
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)
Expand Down Expand Up @@ -192,12 +196,12 @@ export interface Addon_BaseAnnotations<TArgs, StoryFnReturnType> {
/**
* 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<TRenderer>) => StoryFnReturnType;

/**
* Function that is executed after the story is rendered.
*/
play?: (context: Addon_StoryContext) => Promise<void> | void;
play?: (context: Addon_StoryContext<TRenderer>) => Promise<void> | void;
}

export interface Addon_Annotations<TArgs, StoryFnReturnType>
Expand Down

0 comments on commit 87f7d64

Please sign in to comment.