UNPKG

787 BTypeScriptView Raw
1import { ComponentProps, JSXElementConstructor } from 'react';
2import type { Story, Meta } from './types-6-0';
3export * from './types-6-0';
4/**
5 * For the common case where a component's stories are simple components that receives args as props:
6 *
7 * ```tsx
8 * export default { ... } as ComponentMeta<typeof Button>;
9 * ```
10 */
11export declare type ComponentMeta<T extends keyof JSX.IntrinsicElements | JSXElementConstructor<any>> = Meta<ComponentProps<T>>;
12/**
13 * For the common case where a story is a simple component that receives args as props:
14 *
15 * ```tsx
16 * const Template: ComponentStory<typeof Button> = (args) => <Button {...args} />
17 * ```
18 */
19export declare type ComponentStory<T extends keyof JSX.IntrinsicElements | JSXElementConstructor<any>> = Story<ComponentProps<T>>;