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