diff --git a/types/storybook-addon-jsx/index.d.ts b/types/storybook-addon-jsx/index.d.ts index 80ec756d3a..0bd019abeb 100644 --- a/types/storybook-addon-jsx/index.d.ts +++ b/types/storybook-addon-jsx/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for storybook-addon-jsx 5.3 +// Type definitions for storybook-addon-jsx 5.4 // Project: https://github.com/storybooks/storybook // Definitions by: James Newell // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -8,7 +8,13 @@ import '@storybook/react'; import { ReactNode } from 'react'; declare module '@storybook/react' { + interface Options { + skip?: number; + enableBeautify?: boolean; + onBeforeRender?: (domString: string) => string; + } + interface Story { - addWithJSX(kind: string, fn: () => ReactNode): Story; + addWithJSX(kind: string, fn: () => ReactNode, options?: Options): Story; } } diff --git a/types/storybook-addon-jsx/storybook-addon-jsx-tests.tsx b/types/storybook-addon-jsx/storybook-addon-jsx-tests.tsx index b0edecc897..9413ffc251 100644 --- a/types/storybook-addon-jsx/storybook-addon-jsx-tests.tsx +++ b/types/storybook-addon-jsx/storybook-addon-jsx-tests.tsx @@ -8,3 +8,19 @@ const { Component } = React; storiesOf('Component', module) .addWithJSX('simple info', () => Click the "?" mark at top-right to view the info.); + +storiesOf('Component with options', module) + .addWithJSX('simple info', () => + Click the "?" mark at top-right to view the info., + { + skip: 2, + enableBeautify: false, + onBeforeRender: (str) => '' + }); + +storiesOf('Component with partial options', module) + .addWithJSX('simple info', () => + Click the "?" mark at top-right to view the info., + { + skip: 2 + });