mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-18 12:33:17 +08:00
Add withMarkdownNotes to storybook__addon-notes
Adding the option from https://github.com/storybooks/storybook/pull/2946/files
This commit is contained in:
2
types/storybook__addon-notes/index.d.ts
vendored
2
types/storybook__addon-notes/index.d.ts
vendored
@@ -1,6 +1,7 @@
|
||||
// Type definitions for @storybook/addon-notes 3.3
|
||||
// Project: https://github.com/storybooks/storybook
|
||||
// Definitions by: Joscha Feth <https://github.com/joscha>
|
||||
// A.MacLeay <https://github.com/amacleay>
|
||||
// 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<HTMLDivElement> {
|
||||
notes?: string;
|
||||
|
||||
@@ -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')(
|
||||
() => (<div>my component</div>)
|
||||
)
|
||||
)
|
||||
.add('with withMarkdownNotes',
|
||||
withMarkdownNotes(SIMPLE_MARKDOWN)(
|
||||
() => (<div>my component</div>)
|
||||
)
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user