Skip to content

Commit

Permalink
Merge pull request #99 from ComponentDriven/kasper/canvas
Browse files Browse the repository at this point in the history
Add canvas prop to the context
  • Loading branch information
kasperpeulen authored Jul 2, 2024
2 parents d841bb4 + ba76785 commit 8b81c0b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
"@storybook/eslint-config-storybook"
],
"rules": {
"@typescript-eslint/no-empty-interface": "off",
"import/no-unresolved": "error",
"jest/expect-expect": [
"warn",
Expand Down
15 changes: 7 additions & 8 deletions src/story.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,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 @@ -270,19 +272,16 @@ export interface StoryContext<TRenderer extends Renderer = Renderer, TArgs = Arg
viewMode: ViewMode;
step: StepFunction<TRenderer, TArgs>;
context: this;
canvas: Canvas;
}

/** @deprecated Use {@link StoryContext} instead. */
export type StoryContextForLoaders<
TRenderer extends Renderer = Renderer,
TArgs = Args
> = StoryContext<TRenderer, TArgs>;
export interface StoryContextForLoaders<TRenderer extends Renderer = Renderer, TArgs = Args>
extends StoryContext<TRenderer, TArgs> {}

/** @deprecated Use {@link StoryContext} instead. */
export type PlayFunctionContext<TRenderer extends Renderer = Renderer, TArgs = Args> = StoryContext<
TRenderer,
TArgs
>;
export interface PlayFunctionContext<TRenderer extends Renderer = Renderer, TArgs = Args>
extends StoryContext<TRenderer, TArgs> {}

export type StepLabel = string;

Expand Down

0 comments on commit 8b81c0b

Please sign in to comment.