import { ConnectionHandler, JsonRpcConnectionHandler } from "@theia/core"; import { ContainerModule } from "inversify"; import { StorjWidgetBackendService, STORJ_WIDGET_BACKEND_PATH, } from "../common/protocol"; import { StorjWidgetBackendServiceImpl } from "./storj-widget-backend-service"; export default new ContainerModule((bind) => { bind(StorjWidgetBackendService) .to(StorjWidgetBackendServiceImpl) .inSingletonScope(); bind(ConnectionHandler) .toDynamicValue( (ctx) => new JsonRpcConnectionHandler(STORJ_WIDGET_BACKEND_PATH, () => { return ctx.container.get( StorjWidgetBackendService ); }) ) .inSingletonScope(); });