From 6880fc1de70d5071e4f520aa2ab23f50601671e7 Mon Sep 17 00:00:00 2001 From: Tomas Trescak Date: Tue, 3 May 2016 16:17:24 +1000 Subject: [PATCH 1/4] Added typings --- lib/storybook.d.ts | 8 ++++++++ package.json | 1 + 2 files changed, 9 insertions(+) create mode 100644 lib/storybook.d.ts diff --git a/lib/storybook.d.ts b/lib/storybook.d.ts new file mode 100644 index 000000000000..3f0486e9e4db --- /dev/null +++ b/lib/storybook.d.ts @@ -0,0 +1,8 @@ +declare module "@kadira/storybook" { + interface Story { + add (storyName: string, callback: Function): Story; + } + + export function storiesOf(name: string, module: any): Story; + export function action(name: string): void; +} diff --git a/package.json b/package.json index 49a9da76e8ec..5c9947c75277 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ "type": "git", "url": "https://github.com/kadirahq/react-storybook.git" }, + "typings": "./lib/storybook.d.ts", "license": "MIT", "options": { "mocha": "--require scripts/mocha_runner src/**/__tests__/**/*.js" From 43477657a80d9d3981f19e3c1bc94c092076b918 Mon Sep 17 00:00:00 2001 From: Tomas Trescak Date: Tue, 3 May 2016 16:44:02 +1000 Subject: [PATCH 2/4] Added typings --- lib/storybook.d.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/storybook.d.ts b/lib/storybook.d.ts index 3f0486e9e4db..60efaeb3ca5b 100644 --- a/lib/storybook.d.ts +++ b/lib/storybook.d.ts @@ -1,8 +1,10 @@ +declare var module: any; // dangerous + declare module "@kadira/storybook" { interface Story { add (storyName: string, callback: Function): Story; } export function storiesOf(name: string, module: any): Story; - export function action(name: string): void; + export function action(name: string, ...params: any[]): Function; } From fc5d7d1ce2058c343e0e29d43010225bb4b64d4e Mon Sep 17 00:00:00 2001 From: Tomas Trescak Date: Tue, 3 May 2016 19:25:53 +1000 Subject: [PATCH 3/4] Renamed lib to config --- {lib => config}/storybook.d.ts | 0 package.json | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename {lib => config}/storybook.d.ts (100%) diff --git a/lib/storybook.d.ts b/config/storybook.d.ts similarity index 100% rename from lib/storybook.d.ts rename to config/storybook.d.ts diff --git a/package.json b/package.json index 5c9947c75277..37f9a8279399 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "type": "git", "url": "https://github.com/kadirahq/react-storybook.git" }, - "typings": "./lib/storybook.d.ts", + "typings": "./config/storybook.d.ts", "license": "MIT", "options": { "mocha": "--require scripts/mocha_runner src/**/__tests__/**/*.js" From ea35e472dd8970d77d61d6dbaf72700090f8cc42 Mon Sep 17 00:00:00 2001 From: Tomas Trescak Date: Thu, 5 May 2016 12:11:46 +1000 Subject: [PATCH 4/4] Updated the type definitions to reflect the module structure. --- config/storybook.d.ts | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/config/storybook.d.ts b/config/storybook.d.ts index 60efaeb3ca5b..e1a997b9be8b 100644 --- a/config/storybook.d.ts +++ b/config/storybook.d.ts @@ -1,10 +1,8 @@ declare var module: any; // dangerous -declare module "@kadira/storybook" { - interface Story { - add (storyName: string, callback: Function): Story; - } - - export function storiesOf(name: string, module: any): Story; - export function action(name: string, ...params: any[]): Function; +interface Story { + add (storyName: string, callback: Function): Story; } + +export function storiesOf(name: string, module: any): Story; +export function action(name: string, ...params: any[]): Function;