diff --git a/types/storybook__addon-notes/index.d.ts b/types/storybook__addon-notes/index.d.ts index e8b6f5934a..1332cfcf7e 100644 --- a/types/storybook__addon-notes/index.d.ts +++ b/types/storybook__addon-notes/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for @storybook/addon-notes 3.3 // Project: https://github.com/storybooks/storybook // Definitions by: Joscha Feth +// A.MacLeay // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 @@ -8,6 +9,7 @@ import * as React from 'react'; import { RenderFunction } from '@storybook/react'; export function withNotes(textOrOptions: string | object): (getStory: RenderFunction) => RenderFunction; +export function withMarkdownNotes(text: string): (getStory: RenderFunction) => RenderFunction; export interface WithNotesProps extends React.HTMLProps { notes?: string; diff --git a/types/storybook__addon-notes/storybook__addon-notes-tests.tsx b/types/storybook__addon-notes/storybook__addon-notes-tests.tsx index 2ad783cc5d..cf3108fc6d 100644 --- a/types/storybook__addon-notes/storybook__addon-notes-tests.tsx +++ b/types/storybook__addon-notes/storybook__addon-notes-tests.tsx @@ -1,7 +1,13 @@ import * as React from 'react'; import { storiesOf } from '@storybook/react'; -import { withNotes, WithNotes } from '@storybook/addon-notes'; +import { withNotes, withMarkdownNotes, WithNotes } from '@storybook/addon-notes'; + +const SIMPLE_MARKDOWN = ` +## Markdown for component + +A very simple component with markdown notes +`; storiesOf('Component', module) .add('with some emoji', () => ( @@ -13,4 +19,9 @@ storiesOf('Component', module) withNotes('A very simple component')( () => (
my component
) ) + ) + .add('with withMarkdownNotes', + withMarkdownNotes(SIMPLE_MARKDOWN)( + () => (
my component
) + ) );