From a0d47c6b68f64d9206f685d2bb8d679c3e9480e9 Mon Sep 17 00:00:00 2001 From: Munir Ahmed Elsangedy Date: Thu, 4 Jan 2018 20:06:31 -0200 Subject: [PATCH] Update storybook__addon-notes (#22669) * Update storybook__addon-notes This implementation is deprecated in version 3.3.3 * Update storybook__addon-notes-tests.tsx --- types/storybook__addon-notes/index.d.ts | 5 ++++- .../storybook__addon-notes-tests.tsx | 9 +++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/types/storybook__addon-notes/index.d.ts b/types/storybook__addon-notes/index.d.ts index 4ba96ed38f..c5af7a9134 100644 --- a/types/storybook__addon-notes/index.d.ts +++ b/types/storybook__addon-notes/index.d.ts @@ -1,10 +1,13 @@ -// Type definitions for @storybook/addon-notes 3.0 +// Type definitions for @storybook/addon-notes 3.3.3 // Project: https://github.com/storybooks/storybook // Definitions by: Joscha Feth // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 import * as React from 'react'; +import { RenderFunction } from '@storybook/react'; + +export function withNotes(textOrOptions: string | object): (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 efd71d9771..2ad783cc5d 100644 --- a/types/storybook__addon-notes/storybook__addon-notes-tests.tsx +++ b/types/storybook__addon-notes/storybook__addon-notes-tests.tsx @@ -1,11 +1,16 @@ import * as React from 'react'; import { storiesOf } from '@storybook/react'; -import { WithNotes } from '@storybook/addon-notes'; +import { withNotes, WithNotes } from '@storybook/addon-notes'; storiesOf('Component', module) .add('with some emoji', () => ( my component - )); + )) + .add('with withNotes', + withNotes('A very simple component')( + () => (
my component
) + ) + );