The function withInfo in @storybook/addon-info should accept 0 or 1 argument (#27733)

* The function withInfo in @storybook/addon-info should be able to accept no arguments.

* The function withInfo in @storybook/addon-info should be able to accept no arguments.

* The function withInfo in @storybook/addon-info should be able to accept no arguments.

* Corrected the version number of @storybook/addon-info. This type definition was only tested with version 3.4.8 of @storybook/addon-info

* Corrected the version number of @storybook/addon-info. This type definition was only tested with version 3.4.8 of @storybook/addon-info
This commit is contained in:
ncochard
2018-08-01 11:35:36 -07:00
committed by Sheetal Nandi
parent 459a7bd262
commit 67403cebf2
2 changed files with 7 additions and 2 deletions
+2 -2
View File
@@ -1,4 +1,4 @@
// Type definitions for @storybook/addon-info 3.2
// Type definitions for @storybook/addon-info 3.4
// Project: https://github.com/storybooks/storybook
// Definitions by: Mark Kornblum <https://github.com/mkornblum>
// Mattias Wikstrom <https://github.com/fyrkant>
@@ -29,6 +29,6 @@ export interface Options {
maxPropStringLength?: number;
}
export function withInfo(textOrOptions: string | Options): (storyFn: RenderFunction) => (context?: object) => React.ReactElement<WrapStoryProps>;
export function withInfo(textOrOptions?: string | Options): (storyFn: RenderFunction) => (context?: object) => React.ReactElement<WrapStoryProps>;
export function setDefaults(newDefaults: Options): Options;
@@ -12,6 +12,11 @@ setDefaults({
});
storiesOf('Component', module)
.add('no info',
withInfo()(() =>
<Component>Click the "?" mark at top-right to view the info.</Component>
)
)
.add('simple info',
withInfo('doc string about my component')(() =>
<Component>Click the "?" mark at top-right to view the info.</Component>