Installation
npm install --save @types/storybook-addon-jsx
Summary
This package contains type definitions for storybook-addon-jsx (https://github.com/storybookjs/addon-jsx).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/storybook-addon-jsx.
index.d.ts
import { DecoratorFunction, Parameters, StoryApi } from "@storybook/addons";
import { ReactElement, ReactNode } from "react";
export type displayNameFunc = (element: ReactElement) => string;
export interface AddonParameters {
skip?: number | undefined;
enableBeautify?: boolean | undefined;
onBeforeRender?: ((domString: string) => string) | undefined;
displayName?: string | displayNameFunc | undefined;
}
export type AddWithJSXFunc<StoryFnReturnType> = (
kind: string,
fn: () => ReactNode,
options?: AddonParameters,
) => StoryApi<StoryFnReturnType>;
declare module "@storybook/addons" {
interface ClientStoryApi<StoryFnReturnType = unknown> {
storiesOf(kind: string, module: NodeModule):
& StoryApi<StoryFnReturnType>
& { addWithJSX: AddWithJSXFunc<StoryFnReturnType> };
addDecorator(decorator: DecoratorFunction<StoryFnReturnType>): StoryApi<StoryFnReturnType>;
addParameters(parameter: Parameters & { jsx: AddonParameters }): StoryApi<StoryFnReturnType>;
}
}
export const jsxDecorator: DecoratorFunction<ReactElement<unknown>>;
Additional Details
- Last updated: Tue, 07 Nov 2023 15:11:36 GMT
- Dependencies: @storybook/addons, @storybook/react, @types/react
Credits
These definitions were written by James Newell.