Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: [ts-migration] lib/core #9870

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 8 additions & 3 deletions lib/core/src/client/manager/provider.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
import { Provider } from '@storybook/ui';
import addons from '@storybook/addons';
import addons, { AddonStore } from '@storybook/addons';
import createChannel from '@storybook/channel-postmessage';
import Events from '@storybook/core-events';
import Channel from '@storybook/channels';

export default class ReactProvider extends Provider {
addons: AddonStore;

channel: Channel;

constructor() {
super();

Expand All @@ -16,15 +21,15 @@ export default class ReactProvider extends Provider {
this.channel = channel;
}

getElements(type) {
getElements(type: string) {
return this.addons.getElements(type);
}

getConfig() {
return this.addons.getConfig();
}

handleAPI(api) {
handleAPI(api: any) {
this.addons.loadAddons(api);
}
}
4 changes: 2 additions & 2 deletions lib/ui/src/provider.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
export default class Provider {
getElements() {
getElements(type: string) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fyi @ndelangen I had to modify the signature of getElements and handleAPI because every class that has extended this base class had these arguments implemented

I hope that's ok?

throw new Error('Provider.getElements() is not implemented!');
}

handleAPI() {
handleAPI(api: any) {
throw new Error('Provider.handleAPI() is not implemented!');
}

Expand Down