Fix the signaure of @storybook/react .add() method

The `add` method takes an optional 3rd `paramters` option which
is used to configure globally installed addons for the current
story.
This commit is contained in:
Dan Dean
2018-11-05 12:11:22 -08:00
parent 5c203c8c61
commit 31ddd01c07
2 changed files with 3 additions and 1 deletions
+2 -1
View File
@@ -2,6 +2,7 @@
// Project: https://github.com/storybooks/storybook
// Definitions by: Joscha Feth <https://github.com/joscha>
// Anton Izmailov <https://github.com/wapgear>
// Dan Dean <https://github.com/dandean>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
@@ -16,7 +17,7 @@ export type StoryDecorator = (story: RenderFunction, context: { kind: string, st
export interface Story {
readonly kind: string;
add(storyName: string, callback: RenderFunction): this;
add(storyName: string, callback: RenderFunction, parameters?: { [key: string]: any }): this;
addDecorator(decorator: StoryDecorator): this;
}
@@ -30,6 +30,7 @@ storiesOf<AnyAddon>('withAnyAddon', module)
.addWithSideEffect('more', () => <div/>)
.add('another story', () => <div/>)
.add('to Storybook as Array', () => [<div />, <div />])
.add('and a story with additional parameters', () => <div/>, { parameter: 'foo' })
.addWithSideEffect('even more', () => <div/>);
// configure