mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-13 22:40:50 +08:00
update storybook__addon-info types to match implementation
This commit is contained in:
5
types/storybook__addon-info/index.d.ts
vendored
5
types/storybook__addon-info/index.d.ts
vendored
@@ -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;
|
||||
|
||||
@@ -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')(() =>
|
||||
|
||||
Reference in New Issue
Block a user