Skip to content

Commit

Permalink
Merge pull request #5140 from dandean/ts-migration/core-events
Browse files Browse the repository at this point in the history
Migrate @storybook/core-events to TypeScript
  • Loading branch information
ndelangen committed Jan 5, 2019
2 parents 5108da8 + 008ae8a commit 58b755c
Show file tree
Hide file tree
Showing 5 changed files with 2,979 additions and 16 deletions.
15 changes: 0 additions & 15 deletions lib/core-events/index.js

This file was deleted.

6 changes: 5 additions & 1 deletion lib/core-events/package.json
Expand Up @@ -13,8 +13,12 @@
"type": "git",
"url": "https://github.com/storybooks/storybook.git"
},
"scripts": {
"prepare": "node ../../scripts/prepare.js"
},
"license": "MIT",
"main": "index.js",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"publishConfig": {
"access": "public"
}
Expand Down
17 changes: 17 additions & 0 deletions lib/core-events/src/index.ts
@@ -0,0 +1,17 @@
enum events {
CHANNEL_CREATED = 'channelCreated',
GET_CURRENT_STORY = 'getCurrentStory',
SET_CURRENT_STORY = 'setCurrentStory',
GET_STORIES = 'getStories',
SET_STORIES = 'setStories',
SELECT_STORY = 'selectStory',
APPLY_SHORTCUT = 'applyShortcut',
STORY_ADDED = 'storyAdded',
FORCE_RE_RENDER = 'forceReRender',
REGISTER_SUBSCRIPTION = 'registerSubscription',
STORY_RENDERED = 'storyRendered',
STORY_ERRORED = 'storyErrored',
STORY_THREW_EXCEPTION = 'storyThrewException',
}

export default events;
8 changes: 8 additions & 0 deletions lib/core-events/tsconfig.json
@@ -0,0 +1,8 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"rootDir": "./src"
},
"include": ["src/**/*"],
"exclude": []
}

0 comments on commit 58b755c

Please sign in to comment.