Skip to content

Commit

Permalink
Merge pull request #753 from joscha/patch-1
Browse files Browse the repository at this point in the history
Add typescript definitions for getStorybook()
  • Loading branch information
ndelangen authored Apr 20, 2017
2 parents 54bcb7e + fdcdf61 commit d919b03
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion packages/react-storybook/config/storybook.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
declare var module: any; // dangerous

type RenderFunction = Function;

interface StoryDecorator {
(story: Function, context: { kind: string, story: string }): Object | null;
(story: RenderFunction, context: { kind: string, story: string }): Object | null;
}

interface Story {
Expand All @@ -10,6 +12,19 @@ interface 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[];

0 comments on commit d919b03

Please sign in to comment.