7.0.7 • Published 7 months ago

@types/storybook-addon-jsx v7.0.7

Weekly downloads
3,916
License
MIT
Repository
github
Last release
7 months ago

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

// Type definitions for storybook-addon-jsx 7.0
// Project: https://github.com/storybookjs/addon-jsx
// Definitions by: James Newell <https://github.com/jameslnewell>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 3.1

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

Credits

These definitions were written by James Newell.

7.0.7

7 months ago

7.0.6

7 months ago

7.0.5

8 months ago

7.0.4

2 years ago

7.0.3

2 years ago

7.0.2

3 years ago

7.0.1

5 years ago

7.0.0

5 years ago

5.4.3

5 years ago

5.4.2

5 years ago

5.4.1

5 years ago

5.4.0

6 years ago

5.3.1

6 years ago

5.3.0

6 years ago