diff --git a/types/storybook__addon-info/index.d.ts b/types/storybook__addon-info/index.d.ts index c616933b8f..ebef2fed73 100644 --- a/types/storybook__addon-info/index.d.ts +++ b/types/storybook__addon-info/index.d.ts @@ -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 // Mattias Wikstrom @@ -29,6 +29,6 @@ export interface Options { maxPropStringLength?: number; } -export function withInfo(textOrOptions: string | Options): (storyFn: RenderFunction) => (context?: object) => React.ReactElement; +export function withInfo(textOrOptions?: string | Options): (storyFn: RenderFunction) => (context?: object) => React.ReactElement; export function setDefaults(newDefaults: Options): Options; diff --git a/types/storybook__addon-info/storybook__addon-info-tests.tsx b/types/storybook__addon-info/storybook__addon-info-tests.tsx index b51a48c4cc..46fd799314 100644 --- a/types/storybook__addon-info/storybook__addon-info-tests.tsx +++ b/types/storybook__addon-info/storybook__addon-info-tests.tsx @@ -12,6 +12,11 @@ setDefaults({ }); storiesOf('Component', module) + .add('no info', + withInfo()(() => + Click the "?" mark at top-right to view the info. + ) + ) .add('simple info', withInfo('doc string about my component')(() => Click the "?" mark at top-right to view the info.