UNPKG

2.44 kBTypeScriptView Raw
1import { Addon_ClientStoryApi, Addon_Loadable, Args, ComponentAnnotations, AnnotatedStoryFn, StoryAnnotations, StrictArgs, DecoratorFunction, LoaderFunction, StoryContext as StoryContext$1, ProjectAnnotations } from '@storybook/types';
2export { ArgTypes, Args, Parameters, StrictArgs } from '@storybook/types';
3import { H as HtmlRenderer } from './types-a021d1c4.js';
4import '@storybook/docs-tools';
5
6interface ClientApi extends Addon_ClientStoryApi<HtmlRenderer['storyResult']> {
7 configure(loader: Addon_Loadable, module: NodeModule): void;
8 forceReRender(): void;
9 raw: () => any;
10}
11declare const storiesOf: ClientApi['storiesOf'];
12declare const configure: ClientApi['configure'];
13declare const forceReRender: ClientApi['forceReRender'];
14declare const raw: ClientApi['raw'];
15
16/**
17 * Metadata to configure the stories for a component.
18 *
19 * @see [Default export](https://storybook.js.org/docs/formats/component-story-format/#default-export)
20 */
21type Meta<TArgs = Args> = ComponentAnnotations<HtmlRenderer, TArgs>;
22/**
23 * Story function that represents a CSFv2 component example.
24 *
25 * @see [Named Story exports](https://storybook.js.org/docs/formats/component-story-format/#named-story-exports)
26 */
27type StoryFn<TArgs = Args> = AnnotatedStoryFn<HtmlRenderer, TArgs>;
28/**
29 * Story function that represents a CSFv3 component example.
30 *
31 * @see [Named Story exports](https://storybook.js.org/docs/formats/component-story-format/#named-story-exports)
32 */
33type StoryObj<TArgs = Args> = StoryAnnotations<HtmlRenderer, TArgs>;
34/**
35 * @deprecated Use `StoryFn` instead.
36 * Use `StoryObj` if you want to migrate to CSF3, which uses objects instead of functions to represent stories.
37 * You can read more about the CSF3 format here: https://storybook.js.org/blog/component-story-format-3-0/
38 *
39 * Story function that represents a CSFv2 component example.
40 *
41 * @see [Named Story exports](https://storybook.js.org/docs/formats/component-story-format/#named-story-exports)
42 */
43type Story<TArgs = Args> = StoryFn<TArgs>;
44type Decorator<TArgs = StrictArgs> = DecoratorFunction<HtmlRenderer, TArgs>;
45type Loader<TArgs = StrictArgs> = LoaderFunction<HtmlRenderer, TArgs>;
46type StoryContext<TArgs = StrictArgs> = StoryContext$1<HtmlRenderer, TArgs>;
47type Preview = ProjectAnnotations<HtmlRenderer>;
48
49export { Decorator, HtmlRenderer, Loader, Meta, Preview, Story, StoryContext, StoryFn, StoryObj, configure, forceReRender, raw, storiesOf };