From 1b2a38c6c41bf40b2a5f7ae180a46b26052657e7 Mon Sep 17 00:00:00 2001 From: Joscha Feth Date: Tue, 6 Jun 2017 00:36:30 +0200 Subject: [PATCH 1/3] Remove typings --- app/react/package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/app/react/package.json b/app/react/package.json index ba33902bf77d..012abcefdbe1 100644 --- a/app/react/package.json +++ b/app/react/package.json @@ -4,7 +4,6 @@ "description": "Storybook for React: Develop React Component in isolation with Hot Reloading.", "license": "MIT", "main": "dist/client/index.js", - "typings": "./config/storybook.d.ts", "bin": { "build-storybook": "./dist/server/build.js", "start-storybook": "./dist/server/index.js", From 20b0322792851bfc4088adf9c42c0ddb0ee627fa Mon Sep 17 00:00:00 2001 From: Joscha Feth Date: Tue, 6 Jun 2017 00:37:13 +0200 Subject: [PATCH 2/3] Delete storybook.d.ts --- app/react/config/storybook.d.ts | 30 ------------------------------ 1 file changed, 30 deletions(-) delete mode 100644 app/react/config/storybook.d.ts diff --git a/app/react/config/storybook.d.ts b/app/react/config/storybook.d.ts deleted file mode 100644 index a7c34ab3c8b6..000000000000 --- a/app/react/config/storybook.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -declare var module: any; // dangerous - -type RenderFunction = Function; - -interface StoryDecorator { - (story: RenderFunction, context: { kind: string, story: string }): Object | null; -} - -interface Story { - add (storyName: string, callback: Function): Story; - addDecorator (decorator: StoryDecorator): Story; -} - -export function addDecorator(decorator: StoryDecorator): void; -export function configure(fn: Function, module: any): void; -export function linkTo(name: string, ...params: any[]): void; -export function storiesOf(name: string, module: any): Story; -export function action(name: string, ...params: any[]): any; - -type StoryObject = { - name: string, - render: RenderFunction, -}; - -type StoryBucket = { - kind: string, - stories: StoryObject[], -}; - -export function getStorybook(): StoryBucket[]; From 5013dda61af2f8964f5f691cb11b0a9a608e8d1c Mon Sep 17 00:00:00 2001 From: Joscha Feth Date: Tue, 6 Jun 2017 23:35:42 +0200 Subject: [PATCH 3/3] Add hint about TS definitions --- app/react/README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/react/README.md b/app/react/README.md index 31131395211d..573ea112c831 100644 --- a/app/react/README.md +++ b/app/react/README.md @@ -35,6 +35,10 @@ Here are some featured storybooks that you can reference to see how Storybook wo - [Demo of React Dates](http://airbnb.io/react-dates/) - [source](https://github.com/airbnb/react-dates) - [Demo of React Native Web](http://necolas.github.io/react-native-web/storybook/) - [source](https://github.com/necolas/react-native-web) +## Typescript + +If you are using Typescript, make sure you have the type definitions installed via `yarn add @types/node @types/react @types/storybook__react --dev`. + ## Docs - [Basics](https://storybook.js.org/docs/react-storybook/basics/introduction)