From 381fe2e7e1ca497ed580a1bb6b77c413c76fd14d Mon Sep 17 00:00:00 2001 From: Kasper Peulen Date: Fri, 31 May 2024 10:13:09 +0200 Subject: [PATCH] Make mount a method --- src/story.ts | 96 ++++++++++++++++++++++++++-------------------------- 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/src/story.ts b/src/story.ts index f5d5e50..93c5ecc 100644 --- a/src/story.ts +++ b/src/story.ts @@ -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; - } - )); + ( + | 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; + } + )); export interface InputType { /** @@ -261,7 +261,7 @@ export type BeforeEach = ( export interface StoryContext extends StoryContextForEnhancers, - Required> { + Required> { hooks: unknown; viewMode: ViewMode; originalStoryFn: StoryFn; @@ -269,16 +269,16 @@ export interface StoryContext; - mount: () => Promise; + mount(): Promise; } // eslint-disable-next-line @typescript-eslint/no-empty-interface export interface StoryContextForLoaders - extends StoryContext {} + extends StoryContext { } // eslint-disable-next-line @typescript-eslint/no-empty-interface export interface PlayFunctionContext - extends StoryContext {} + extends StoryContext { } export type StepLabel = string; @@ -336,8 +336,8 @@ export type BaseAnnotations * @see [Decorators](https://storybook.js.org/docs/addons/introduction/#1-decorators) */ decorators?: - | DecoratorFunction>[] - | DecoratorFunction>; + | DecoratorFunction>[] + | DecoratorFunction>; /** * Custom metadata for a story. @@ -543,10 +543,10 @@ export type ArgsFromMeta = Meta extends { decorators?: (infer Decorators)[] | infer Decorators; } ? Simplify< - RemoveIndexSignature< - RArgs & DecoratorsArgs & LoaderArgs - > + RemoveIndexSignature< + RArgs & DecoratorsArgs & LoaderArgs > + > : unknown; type DecoratorsArgs = UnionToIntersection<