UNPKG

1.37 kBTypeScriptView Raw
1import { FunctionComponent, ReactNode, ElementType, ComponentProps } from 'react';
2import { Story as PureStory } from '@storybook/components';
3import { StoryId, StoryAnnotations, AnyFramework } from '@storybook/csf';
4import { Story as StoryType } from '@storybook/store';
5import { DocsContextProps } from './DocsContext';
6export declare const storyBlockIdFromId: (storyId: string) => string;
7declare type PureStoryProps = ComponentProps<typeof PureStory>;
8declare type CommonProps = StoryAnnotations & {
9 height?: string;
10 inline?: boolean;
11};
12declare type StoryDefProps = {
13 name: string;
14 children: ReactNode;
15};
16declare type StoryRefProps = {
17 id?: string;
18};
19declare type StoryImportProps = {
20 name: string;
21 story: ElementType;
22};
23export declare type StoryProps = (StoryDefProps | StoryRefProps | StoryImportProps) & CommonProps;
24export declare const lookupStoryId: (storyName: string, { mdxStoryNameToKey, mdxComponentAnnotations }: DocsContextProps) => string;
25export declare const getStoryId: (props: StoryProps, context: DocsContextProps) => StoryId;
26export declare const getStoryProps: <TFramework extends AnyFramework>({ height, inline }: StoryProps, story: StoryType<TFramework>, context: DocsContextProps<TFramework>, onStoryFnCalled: () => void) => PureStoryProps;
27declare const Story: FunctionComponent<StoryProps>;
28export { Story };