mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-08 11:11:53 +08:00
Migrate core-events to TypeScript
This commit is contained in:
parent
fe43e42180
commit
cb49bec312
@ -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"
|
||||
}
|
||||
|
@ -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;
|
8
lib/core-events/tsconfig.json
Normal file
8
lib/core-events/tsconfig.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"rootDir": "./src"
|
||||
},
|
||||
"include": ["src/**/*"],
|
||||
"exclude": []
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user