Skip to content

Commit

Permalink
Add canvas property to context that can be implemented by addons such…
Browse files Browse the repository at this point in the history
… as @storybook/test
  • Loading branch information
kasperpeulen committed Jun 26, 2024
1 parent b13ced2 commit d6ab1d5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/story.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,8 @@ export type BeforeEach<TRenderer extends Renderer = Renderer, TArgs = Args> = (
context: StoryContext<TRenderer, TArgs>
) => Awaitable<CleanupCallback | void>;

export interface Canvas {}

export interface StoryContext<TRenderer extends Renderer = Renderer, TArgs = Args>
extends StoryContextForEnhancers<TRenderer, TArgs>,
Required<StoryContextUpdate<TArgs>> {
Expand All @@ -271,6 +273,7 @@ export interface StoryContext<TRenderer extends Renderer = Renderer, TArgs = Arg
viewMode: ViewMode;
step: StepFunction<TRenderer, TArgs>;
context: this;
canvas: Canvas;
}

/** @deprecated Use {@link StoryContext} instead. */
Expand Down

0 comments on commit d6ab1d5

Please sign in to comment.