From 2446ec4afb7bbcdbd5109f22b10b3a8de5a65ad0 Mon Sep 17 00:00:00 2001 From: Joscha Feth Date: Fri, 23 Jun 2017 01:22:36 +0200 Subject: [PATCH] add package @storybook/addon-notes --- types/storybook__addon-notes/index.d.ts | 20 ++++++++++++++++ .../storybook__addon-notes-tests.tsx | 13 ++++++++++ types/storybook__addon-notes/tsconfig.json | 24 +++++++++++++++++++ types/storybook__addon-notes/tslint.json | 1 + 4 files changed, 58 insertions(+) create mode 100644 types/storybook__addon-notes/index.d.ts create mode 100644 types/storybook__addon-notes/storybook__addon-notes-tests.tsx create mode 100644 types/storybook__addon-notes/tsconfig.json create mode 100644 types/storybook__addon-notes/tslint.json diff --git a/types/storybook__addon-notes/index.d.ts b/types/storybook__addon-notes/index.d.ts new file mode 100644 index 0000000000..dd39d700d6 --- /dev/null +++ b/types/storybook__addon-notes/index.d.ts @@ -0,0 +1,20 @@ +// Type definitions for @storybook/addon-notes 3.0 +// Project: https://github.com/storybooks/storybook +// Definitions by: Joscha Feth +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// TODO: Once TS2.3 is released, +// https://github.com/Microsoft/TypeScript/issues/14819 should be fixed. +// Then, upgrade this package's typescript version to 2.3 and +// Remove the `declare module` wrapper. +// tslint:disable-next-line no-single-declare-module +declare module '@storybook/addon-notes' { + import * as React from 'react'; + + interface WithNotesProps extends React.HTMLProps { + notes?: string; + } + + const WithNotes: React.StatelessComponent; +} diff --git a/types/storybook__addon-notes/storybook__addon-notes-tests.tsx b/types/storybook__addon-notes/storybook__addon-notes-tests.tsx new file mode 100644 index 0000000000..554253952f --- /dev/null +++ b/types/storybook__addon-notes/storybook__addon-notes-tests.tsx @@ -0,0 +1,13 @@ +/// + +import * as React from 'react'; + +import { storiesOf } from '@storybook/react'; +import { WithNotes } from '@storybook/addon-notes'; + +storiesOf('Component', module) + .add('with some emoji', () => ( + + my component + + )); diff --git a/types/storybook__addon-notes/tsconfig.json b/types/storybook__addon-notes/tsconfig.json new file mode 100644 index 0000000000..3b87db180c --- /dev/null +++ b/types/storybook__addon-notes/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "dom", + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "jsx": "react", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "storybook__addon-notes-tests.tsx" + ] +} diff --git a/types/storybook__addon-notes/tslint.json b/types/storybook__addon-notes/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/storybook__addon-notes/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }