/
types-7-0.ts
28 lines (23 loc) · 1001 Bytes
/
types-7-0.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import type { JSXElementConstructor } from 'react';
import type { Args } from '@storybook/csf';
import type { StoryObj } from './types-6-0';
import type { ComponentStoryObj } from './types-6-3';
export type { StoryFn, StoryObj, Meta } from './types-6-0';
export type { ComponentStoryFn, ComponentStoryObj, ComponentMeta } from './types-6-3';
// NOTE these types are reversed from the way they are in types-6-0 and types-6-3
/**
* Story function that represents a CSFv3 component example.
*
* @see [Named Story exports](https://storybook.js.org/docs/formats/component-story-format/#named-story-exports)
*/
export type Story<TArgs = Args> = StoryObj<TArgs>;
/**
* For the common case where a (CSFv3) story is a simple component that receives args as props:
*
* ```tsx
* const MyStory: ComponentStory<typeof Button> = {
* args: { buttonArg1: 'val' },
* }
* ```
*/ export type ComponentStory<T extends keyof JSX.IntrinsicElements | JSXElementConstructor<any>> =
ComponentStoryObj<T>;