diff --git a/types/storybook__react/index.d.ts b/types/storybook__react/index.d.ts index 3aa3445f61..91b686ffcf 100644 --- a/types/storybook__react/index.d.ts +++ b/types/storybook__react/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/storybooks/storybook // Definitions by: Joscha Feth // Anton Izmailov +// Dan Dean // 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; } diff --git a/types/storybook__react/storybook__react-tests.tsx b/types/storybook__react/storybook__react-tests.tsx index 12edecb219..ba19df798e 100644 --- a/types/storybook__react/storybook__react-tests.tsx +++ b/types/storybook__react/storybook__react-tests.tsx @@ -30,6 +30,7 @@ storiesOf('withAnyAddon', module) .addWithSideEffect('more', () =>
) .add('another story', () =>
) .add('to Storybook as Array', () => [
,
]) + .add('and a story with additional parameters', () =>
, { parameter: 'foo' }) .addWithSideEffect('even more', () =>
); // configure