mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 14:57:10 +00:00
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:
Vendored
+2
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user