1 | import { Addon, StoryId, StoryName, StoryKind, ViewMode, StoryFn, Parameters, Args, ArgTypes, StoryApi, DecoratorFunction, LoaderFunction, StoryContext } from '@storybook/addons';
|
2 | import { AnyFramework, StoryIdentifier, ProjectAnnotations } from '@storybook/csf';
|
3 | import { RenderContext } from '@storybook/store';
|
4 | import { StoryStore, HooksContext } from '@storybook/store';
|
5 | export { SBType, SBScalarType, SBArrayType, SBObjectType, SBEnumType, SBIntersectionType, SBUnionType, SBOtherType, } from '@storybook/csf';
|
6 | export interface ErrorLike {
|
7 | message: string;
|
8 | stack: string;
|
9 | }
|
10 | export interface StoryMetadata {
|
11 | parameters?: Parameters;
|
12 | decorators?: DecoratorFunction[];
|
13 | loaders?: LoaderFunction[];
|
14 | }
|
15 | export declare type ArgTypesEnhancer = (context: StoryContext) => ArgTypes;
|
16 | export declare type ArgsEnhancer = (context: StoryContext) => Args;
|
17 | declare type StorySpecifier = StoryId | {
|
18 | name: StoryName;
|
19 | kind: StoryKind;
|
20 | } | '*';
|
21 | export interface StoreSelectionSpecifier {
|
22 | storySpecifier: StorySpecifier;
|
23 | viewMode: ViewMode;
|
24 | singleStory?: boolean;
|
25 | args?: Args;
|
26 | globals?: Args;
|
27 | }
|
28 | export interface StoreSelection {
|
29 | storyId: StoryId;
|
30 | viewMode: ViewMode;
|
31 | }
|
32 | export declare type AddStoryArgs = StoryIdentifier & {
|
33 | storyFn: StoryFn<any>;
|
34 | parameters?: Parameters;
|
35 | decorators?: DecoratorFunction[];
|
36 | loaders?: LoaderFunction[];
|
37 | };
|
38 | export declare type StoreItem = StoryIdentifier & {
|
39 | parameters: Parameters;
|
40 | getDecorated: () => StoryFn<any>;
|
41 | getOriginal: () => StoryFn<any>;
|
42 | applyLoaders: () => Promise<StoryContext>;
|
43 | playFunction: (context: StoryContext) => Promise<void> | void;
|
44 | storyFn: StoryFn<any>;
|
45 | unboundStoryFn: StoryFn<any>;
|
46 | hooks: HooksContext<AnyFramework>;
|
47 | args: Args;
|
48 | initialArgs: Args;
|
49 | argTypes: ArgTypes;
|
50 | };
|
51 | export declare type PublishedStoreItem = StoreItem & {
|
52 | globals: Args;
|
53 | };
|
54 | export interface StoreData {
|
55 | [key: string]: StoreItem;
|
56 | }
|
57 | export interface ClientApiParams {
|
58 | storyStore: StoryStore<AnyFramework>;
|
59 | decorateStory?: ProjectAnnotations<AnyFramework>['applyDecorators'];
|
60 | noStoryModuleAddMethodHotDispose?: boolean;
|
61 | }
|
62 | export declare type ClientApiReturnFn<StoryFnReturnType> = (...args: any[]) => StoryApi<StoryFnReturnType>;
|
63 | export { StoryApi, DecoratorFunction };
|
64 | export interface ClientApiAddon<StoryFnReturnType = unknown> extends Addon {
|
65 | apply: (a: StoryApi<StoryFnReturnType>, b: any[]) => any;
|
66 | }
|
67 | export interface ClientApiAddons<StoryFnReturnType> {
|
68 | [key: string]: ClientApiAddon<StoryFnReturnType>;
|
69 | }
|
70 | export interface GetStorybookStory {
|
71 | name: string;
|
72 | render: StoryFn;
|
73 | }
|
74 | export interface GetStorybookKind {
|
75 | kind: string;
|
76 | fileName: string;
|
77 | stories: GetStorybookStory[];
|
78 | }
|
79 | export declare type RenderContextWithoutStoryContext = Pick<RenderContext, Exclude<keyof RenderContext, 'storyContext'>>;
|