update storybook__addon-info types to match implementation

This commit is contained in:
Mattias Wikstrom
2017-11-14 11:15:08 +01:00
parent 8ca6a6e423
commit 2affa979fb
2 changed files with 10 additions and 2 deletions

View File

@@ -1,6 +1,7 @@
// Type definitions for @storybook/addon-info 3.2
// Project: https://github.com/storybooks/storybook
// Definitions by: Mark Kornblum <https://github.com/mkornblum>
// Mattias Wikstrom <https://github.com/fyrkant>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.4
@@ -18,7 +19,7 @@ export interface Options {
header?: boolean;
inline?: boolean;
source?: boolean;
propTables?: JSX.Element[];
propTables?: JSX.Element[] | false;
propTablesExclude?: JSX.Element[];
styles?: object;
marksyConf?: object;
@@ -29,3 +30,5 @@ export interface Options {
}
export function withInfo(textOrOptions: string | Options): (storyFn: RenderFunction) => () => React.ReactElement<WrapStoryProps>;
export function setDefaults(newDefaults: Options): Options;

View File

@@ -2,10 +2,15 @@
import * as React from 'react';
import { storiesOf } from '@storybook/react';
import { withInfo } from '@storybook/addon-info';
import { setDefaults, withInfo } from '@storybook/addon-info';
const { Component } = React;
setDefaults({
inline: false,
propTables: false
});
storiesOf('Component', module)
.add('simple info',
withInfo('doc string about my component')(() =>