Skip to content

Commit

Permalink
Export CleanupCallback type
Browse files Browse the repository at this point in the history
  • Loading branch information
kasperpeulen committed Apr 11, 2024
1 parent 941efd8 commit 4a5a941
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/story.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,11 +248,12 @@ export type LoaderFunction<TRenderer extends Renderer = Renderer, TArgs = Args>
context: StoryContextForLoaders<TRenderer, TArgs>
) => Promise<Record<string, any> | void> | Record<string, any> | void;

export type Awaitable<T> = T | PromiseLike<T>;
type Awaitable<T> = T | PromiseLike<T>;
export type CleanupCallback = (() => Awaitable<unknown>) | void;

export type BeforeEach<TRenderer extends Renderer = Renderer, TArgs = Args> = (
context: StoryContextForLoaders<TRenderer, TArgs>
) => Awaitable<(() => Awaitable<unknown>) | void>;
) => Awaitable<CleanupCallback>;

export interface StoryContext<TRenderer extends Renderer = Renderer, TArgs = Args>
extends StoryContextForLoaders<TRenderer, TArgs> {
Expand Down

0 comments on commit 4a5a941

Please sign in to comment.