mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 06:47:03 +00:00
[storybook-addon-jsx] Add 3rd param for addWithJSX
This commit is contained in:
Vendored
+8
-2
@@ -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 <https://github.com/jameslnewell>
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,3 +8,19 @@ const { Component } = React;
|
||||
storiesOf('Component', module)
|
||||
.addWithJSX('simple info', () =>
|
||||
<Component>Click the "?" mark at top-right to view the info.</Component>);
|
||||
|
||||
storiesOf('Component with options', module)
|
||||
.addWithJSX('simple info', () =>
|
||||
<Component>Click the "?" mark at top-right to view the info.</Component>,
|
||||
{
|
||||
skip: 2,
|
||||
enableBeautify: false,
|
||||
onBeforeRender: (str) => ''
|
||||
});
|
||||
|
||||
storiesOf('Component with partial options', module)
|
||||
.addWithJSX('simple info', () =>
|
||||
<Component>Click the "?" mark at top-right to view the info.</Component>,
|
||||
{
|
||||
skip: 2
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user