UNPKG

1.56 kBTypeScriptView Raw
1import type { ComponentType } from 'react';
2import type { Args, ComponentAnnotations, StoryAnnotations, AnnotatedStoryFn } from '@storybook/csf';
3import type { StoryFnReactReturnType } from './types';
4export type { Args, ArgTypes, Parameters, StoryContext } from '@storybook/csf';
5export declare type ReactFramework = {
6 component: ComponentType<any>;
7 storyResult: StoryFnReactReturnType;
8};
9/**
10 * Metadata to configure the stories for a component.
11 *
12 * @see [Default export](https://storybook.js.org/docs/formats/component-story-format/#default-export)
13 */
14export declare type Meta<TArgs = Args> = ComponentAnnotations<ReactFramework, TArgs>;
15/**
16 * Story function that represents a CSFv2 component example.
17 *
18 * @see [Named Story exports](https://storybook.js.org/docs/formats/component-story-format/#named-story-exports)
19 */
20export declare type StoryFn<TArgs = Args> = AnnotatedStoryFn<ReactFramework, TArgs>;
21/**
22 * Story function that represents a CSFv3 component example.
23 *
24 * @see [Named Story exports](https://storybook.js.org/docs/formats/component-story-format/#named-story-exports)
25 */
26export declare type StoryObj<TArgs = Args> = StoryAnnotations<ReactFramework, TArgs>;
27/**
28 * Story function that represents a CSFv2 component example.
29 *
30 * @see [Named Story exports](https://storybook.js.org/docs/formats/component-story-format/#named-story-exports)
31 *
32 * NOTE that in Storybook 7.0, this type will be renamed to `StoryFn` and replaced by the current `StoryObj` type.
33 *
34 */
35export declare type Story<TArgs = Args> = StoryFn<TArgs>;