UNPKG

1.29 kBTypeScriptView Raw
1import React, { ReactElement } from 'react';
2import { Options } from 'react-element-to-jsx-string';
3import { StoryContext, PartialStoryFn } from '@storybook/csf';
4import { ReactFramework } from '..';
5declare type JSXOptions = Options & {
6 /** How many wrappers to skip when rendering the jsx */
7 skip?: number;
8 /** Whether to show the function in the jsx tab */
9 showFunctions?: boolean;
10 /** Whether to format HTML or Vue markup */
11 enableBeautify?: boolean;
12 /** Override the display name used for a component */
13 displayName?: string | Options['displayName'];
14 /** Deprecated: A function ran after the story is rendered */
15 onBeforeRender?(dom: string): string;
16 /** A function ran after a story is rendered (prefer this over `onBeforeRender`) */
17 transformSource?(dom: string, context?: StoryContext<ReactFramework>): string;
18};
19/** Apply the users parameters and render the jsx for a story */
20export declare const renderJsx: (code: React.ReactElement, options: JSXOptions) => string;
21export declare const skipJsxRender: (context: StoryContext<ReactFramework>) => any;
22export declare const jsxDecorator: (storyFn: PartialStoryFn<ReactFramework>, context: StoryContext<ReactFramework>) => import("../preview/types").StoryFnReactReturnType;
23export {};