Skip to content

Commit

Permalink
Make mount a method
Browse files Browse the repository at this point in the history
  • Loading branch information
kasperpeulen committed May 31, 2024
1 parent 89e16ed commit 381fe2e
Showing 1 changed file with 48 additions and 48 deletions.
96 changes: 48 additions & 48 deletions src/story.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,45 +67,45 @@ type Control =
| ControlType
| false
| (ControlBase &
(
| ControlBase
| {
type: 'color';
/**
* @see https://storybook.js.org/docs/api/arg-types#controlpresetcolors
*/
presetColors?: string[];
}
| {
type: 'file';
/**
* @see https://storybook.js.org/docs/api/arg-types#controlaccept
*/
accept?: string;
}
| {
type: 'inline-check' | 'radio' | 'inline-radio' | 'select' | 'multi-select';
/**
* @see https://storybook.js.org/docs/api/arg-types#controllabels
*/
labels?: { [options: string]: string };
}
| {
type: 'number' | 'range';
/**
* @see https://storybook.js.org/docs/api/arg-types#controlmax
*/
max?: number;
/**
* @see https://storybook.js.org/docs/api/arg-types#controlmin
*/
min?: number;
/**
* @see https://storybook.js.org/docs/api/arg-types#controlstep
*/
step?: number;
}
));
(

Check failure on line 70 in src/story.ts

View workflow job for this annotation

GitHub Actions / test

Insert `··`
| ControlBase

Check failure on line 71 in src/story.ts

View workflow job for this annotation

GitHub Actions / test

Insert `··`
| {

Check failure on line 72 in src/story.ts

View workflow job for this annotation

GitHub Actions / test

Insert `··`
type: 'color';

Check failure on line 73 in src/story.ts

View workflow job for this annotation

GitHub Actions / test

Insert `····`
/**

Check failure on line 74 in src/story.ts

View workflow job for this annotation

GitHub Actions / test

Insert `····`
* @see https://storybook.js.org/docs/api/arg-types#controlpresetcolors

Check failure on line 75 in src/story.ts

View workflow job for this annotation

GitHub Actions / test

Insert `····`
*/

Check failure on line 76 in src/story.ts

View workflow job for this annotation

GitHub Actions / test

Replace `·········` with `·············`
presetColors?: string[];

Check failure on line 77 in src/story.ts

View workflow job for this annotation

GitHub Actions / test

Insert `····`
}

Check failure on line 78 in src/story.ts

View workflow job for this annotation

GitHub Actions / test

Insert `····`
| {

Check failure on line 79 in src/story.ts

View workflow job for this annotation

GitHub Actions / test

Insert `··`
type: 'file';
/**
* @see https://storybook.js.org/docs/api/arg-types#controlaccept
*/
accept?: string;
}
| {
type: 'inline-check' | 'radio' | 'inline-radio' | 'select' | 'multi-select';
/**
* @see https://storybook.js.org/docs/api/arg-types#controllabels
*/
labels?: { [options: string]: string };
}
| {
type: 'number' | 'range';
/**
* @see https://storybook.js.org/docs/api/arg-types#controlmax
*/
max?: number;
/**
* @see https://storybook.js.org/docs/api/arg-types#controlmin
*/
min?: number;
/**
* @see https://storybook.js.org/docs/api/arg-types#controlstep
*/
step?: number;
}
));

export interface InputType {
/**
Expand Down Expand Up @@ -261,24 +261,24 @@ export type BeforeEach<TRenderer extends Renderer = Renderer, TArgs = Args> = (

export interface StoryContext<TRenderer extends Renderer = Renderer, TArgs = Args>
extends StoryContextForEnhancers<TRenderer, TArgs>,
Required<StoryContextUpdate<TArgs>> {
Required<StoryContextUpdate<TArgs>> {
hooks: unknown;
viewMode: ViewMode;
originalStoryFn: StoryFn<TRenderer>;
loaded: Record<string, any>;
abortSignal: AbortSignal;
canvasElement: TRenderer['canvasElement'];
step: StepFunction<TRenderer, TArgs>;
mount: () => Promise<void>;
mount(): Promise<void>;
}

// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface StoryContextForLoaders<TRenderer extends Renderer = Renderer, TArgs = Args>
extends StoryContext<TRenderer, TArgs> {}
extends StoryContext<TRenderer, TArgs> { }

// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface PlayFunctionContext<TRenderer extends Renderer = Renderer, TArgs = Args>
extends StoryContext<TRenderer, TArgs> {}
extends StoryContext<TRenderer, TArgs> { }

export type StepLabel = string;

Expand Down Expand Up @@ -336,8 +336,8 @@ export type BaseAnnotations<TRenderer extends Renderer = Renderer, TArgs = Args>
* @see [Decorators](https://storybook.js.org/docs/addons/introduction/#1-decorators)
*/
decorators?:
| DecoratorFunction<TRenderer, Simplify<TArgs>>[]
| DecoratorFunction<TRenderer, Simplify<TArgs>>;
| DecoratorFunction<TRenderer, Simplify<TArgs>>[]
| DecoratorFunction<TRenderer, Simplify<TArgs>>;

/**
* Custom metadata for a story.
Expand Down Expand Up @@ -543,10 +543,10 @@ export type ArgsFromMeta<TRenderer extends Renderer, Meta> = Meta extends {
decorators?: (infer Decorators)[] | infer Decorators;
}
? Simplify<
RemoveIndexSignature<
RArgs & DecoratorsArgs<TRenderer, Decorators> & LoaderArgs<TRenderer, Loaders>
>
RemoveIndexSignature<
RArgs & DecoratorsArgs<TRenderer, Decorators> & LoaderArgs<TRenderer, Loaders>
>
>
: unknown;

type DecoratorsArgs<TRenderer extends Renderer, Decorators> = UnionToIntersection<
Expand Down

0 comments on commit 381fe2e

Please sign in to comment.