Migrate core-events to TypeScript

This commit is contained in:
Dan Dean 2019-01-03 16:00:17 -08:00
parent fe43e42180
commit cb49bec312
4 changed files with 3010 additions and 2 deletions

View File

@ -14,7 +14,8 @@
"url": "https://github.com/storybooks/storybook.git"
},
"license": "MIT",
"main": "index.js",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"publishConfig": {
"access": "public"
}

View File

@ -1,4 +1,20 @@
module.exports = {
export interface CoreEvents {
CHANNEL_CREATED: string;
GET_CURRENT_STORY: string;
SET_CURRENT_STORY: string;
GET_STORIES: string;
SET_STORIES: string;
SELECT_STORY: string;
APPLY_SHORTCUT: string;
STORY_ADDED: string;
FORCE_RE_RENDER: string;
REGISTER_SUBSCRIPTION: string;
STORY_RENDERED: string;
STORY_ERRORED: string;
STORY_THREW_EXCEPTION: string;
}
const events: CoreEvents = {
CHANNEL_CREATED: 'channelCreated',
GET_CURRENT_STORY: 'getCurrentStory',
SET_CURRENT_STORY: 'setCurrentStory',
@ -13,3 +29,5 @@ module.exports = {
STORY_ERRORED: 'storyErrored',
STORY_THREW_EXCEPTION: 'storyThrewException',
};
export default events;

View File

@ -0,0 +1,8 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"rootDir": "./src"
},
"include": ["src/**/*"],
"exclude": []
}

2981
yarn.lock

File diff suppressed because it is too large Load Diff