From 2affa979fb875ff6c3ff7d5e00f0c696e183e54a Mon Sep 17 00:00:00 2001 From: Mattias Wikstrom Date: Tue, 14 Nov 2017 11:15:08 +0100 Subject: [PATCH] update storybook__addon-info types to match implementation --- types/storybook__addon-info/index.d.ts | 5 ++++- .../storybook__addon-info/storybook__addon-info-tests.tsx | 7 ++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/types/storybook__addon-info/index.d.ts b/types/storybook__addon-info/index.d.ts index 68179af293..c42c8d359a 100644 --- a/types/storybook__addon-info/index.d.ts +++ b/types/storybook__addon-info/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for @storybook/addon-info 3.2 // Project: https://github.com/storybooks/storybook // Definitions by: Mark Kornblum +// Mattias Wikstrom // 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; + +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 562727c6fa..b51a48c4cc 100644 --- a/types/storybook__addon-info/storybook__addon-info-tests.tsx +++ b/types/storybook__addon-info/storybook__addon-info-tests.tsx @@ -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')(() =>