import { ContainerModule, interfaces } from '@theia/core/shared/inversify';
import { WidgetFactory, bindViewContribution } from '@theia/core/lib/browser';
import { DesignPanelContribution } from './design-panel-contribution';
import { DesignPanelWidget } from './design-panel-widget';

export default new ContainerModule((bind: interfaces.Bind) => {
    bindViewContribution(bind, DesignPanelContribution);

    bind(DesignPanelWidget).toSelf();
    bind(WidgetFactory).toDynamicValue(ctx => ({
        id: DesignPanelWidget.ID,
        createWidget: () => ctx.container.get<DesignPanelWidget>(DesignPanelWidget),
    })).inSingletonScope();
});
