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