UNPKG

storybook-react-rsbuild

Version:

Storybook for React and Rsbuild: Develop React components in isolation with Hot Reloading.

53 lines (50 loc) 2.05 kB
import { PluginOptions } from '@storybook/react-docgen-typescript-plugin'; import { BuilderOptions, StorybookConfigRsbuild, TypescriptOptions as TypescriptOptions$1 } from 'storybook-builder-rsbuild'; import { StorybookConfig as StorybookConfig$1, TypescriptOptions } from 'storybook/internal/types'; type FrameworkName = 'storybook-react-rsbuild'; type BuilderName = 'storybook-builder-rsbuild'; type FrameworkOptions = { builder?: BuilderOptions; strictMode?: boolean; /** * Use React's legacy root API to mount components * @description * React has introduced a new root API with React 18.x to enable a whole set of new features (e.g. concurrent features) * If this flag is true, the legacy Root API is used to mount components to make it easier to migrate step by step to React 18. * @default false */ legacyRootApi?: boolean; }; type TypescriptOptionsReact = { /** * Sets the type of Docgen when working with React and TypeScript * * @default `'react-docgen'` */ reactDocgen: 'react-docgen-typescript' | 'react-docgen' | false; /** * Configures `react-docgen-typescript-plugin` * * @default * @see https://github.com/storybookjs/storybook/blob/next/code/builders/builder-webpack5/src/config/defaults.js#L4-L6 */ reactDocgenTypescriptOptions: PluginOptions; }; type StorybookConfigFramework = { framework: FrameworkName | { name: FrameworkName; options: FrameworkOptions; }; core?: StorybookConfig$1['core'] & { builder?: BuilderName | { name: BuilderName; options: BuilderOptions; }; }; typescript?: Partial<TypescriptOptions & TypescriptOptions$1 & TypescriptOptionsReact>; }; /** * The interface for Storybook configuration in `main.ts` files. */ type StorybookConfig = Omit<StorybookConfig$1, keyof StorybookConfigRsbuild | keyof StorybookConfigFramework> & StorybookConfigRsbuild & StorybookConfigFramework; export { FrameworkOptions, StorybookConfig };