import { SBType, SBScalarType } from './SBType'; export * from './SBType'; export declare type StoryId = string; export declare type ComponentId = string; export declare type ComponentTitle = string; export declare type StoryName = string; export declare type StoryKind = ComponentTitle; export interface StoryIdentifier { componentId: ComponentId; title: ComponentTitle; kind: ComponentTitle; id: StoryId; name: StoryName; story: StoryName; } export declare type Parameters = { [name: string]: any; }; export interface InputType { name?: string; description?: string; defaultValue?: any; type?: SBType | SBScalarType['name']; [key: string]: any; } export interface StrictInputType extends InputType { name: string; type?: SBType; } export declare type Args = { [name: string]: any; }; export declare type ArgTypes = { [name in keyof TArgs]: InputType; }; export declare type StrictArgTypes = { [name in keyof TArgs]: StrictInputType; }; export declare type Globals = { [name: string]: any; }; export declare type GlobalTypes = { [name: string]: InputType; }; export declare type StrictGlobalTypes = { [name: string]: StrictInputType; }; export declare type AnyFramework = { component: unknown; storyResult: unknown; }; export declare type StoryContextForEnhancers = StoryIdentifier & { component?: TFramework['component']; subcomponents?: Record; parameters: Parameters; initialArgs: TArgs; argTypes: StrictArgTypes; }; export declare type ArgsEnhancer = (context: StoryContextForEnhancers) => TArgs; export declare type ArgTypesEnhancer = ((context: StoryContextForEnhancers) => StrictArgTypes) & { secondPass?: boolean; }; export declare type StoryContextUpdate = { args?: TArgs; globals?: Globals; [key: string]: any; }; export declare type ViewMode = 'story' | 'docs'; export declare type StoryContextForLoaders = StoryContextForEnhancers & Required> & { hooks: unknown; viewMode: ViewMode; originalStoryFn: StoryFn; }; export declare type LoaderFunction = (context: StoryContextForLoaders) => Promise>; export declare type StoryContext = StoryContextForLoaders & { loaded: Record; abortSignal: AbortSignal; canvasElement: HTMLElement; }; export declare type PlayFunction = (context: StoryContext) => Promise | void; export declare type PartialStoryFn = (update?: StoryContextUpdate) => TFramework['storyResult']; export declare type LegacyStoryFn = (context: StoryContext) => TFramework['storyResult']; export declare type ArgsStoryFn = (args: TArgs, context: StoryContext) => TFramework['storyResult']; export declare type StoryFn = LegacyStoryFn | ArgsStoryFn; export declare type DecoratorFunction = (fn: PartialStoryFn, c: StoryContext) => TFramework['storyResult']; export declare type DecoratorApplicator = (storyFn: LegacyStoryFn, decorators: DecoratorFunction[]) => LegacyStoryFn; export declare type BaseAnnotations = { decorators?: DecoratorFunction[]; parameters?: Parameters; args?: Partial; argTypes?: Partial>; loaders?: LoaderFunction[]; render?: ArgsStoryFn; play?: PlayFunction; }; export declare type ProjectAnnotations = BaseAnnotations & { argsEnhancers?: ArgsEnhancer[]; argTypesEnhancers?: ArgTypesEnhancer[]; globals?: Globals; globalTypes?: GlobalTypes; applyDecorators?: DecoratorApplicator; }; declare type StoryDescriptor = string[] | RegExp; export declare type ComponentAnnotations = BaseAnnotations & { title?: ComponentTitle; id?: ComponentId; includeStories?: StoryDescriptor; excludeStories?: StoryDescriptor; component?: TFramework['component']; subcomponents?: Record; }; export declare type StoryAnnotations = BaseAnnotations & { name?: StoryName; storyName?: StoryName; story?: Omit, 'story'>; }; export declare type LegacyAnnotatedStoryFn = StoryFn & StoryAnnotations; export declare type LegacyStoryAnnotationsOrFn = LegacyAnnotatedStoryFn | StoryAnnotations; export declare type AnnotatedStoryFn = ArgsStoryFn & StoryAnnotations; export declare type StoryAnnotationsOrFn = AnnotatedStoryFn | StoryAnnotations;