1 | "use strict";
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 | Object.defineProperty(exports, "__esModule", { value: true });
|
18 | const inversify_1 = require("inversify");
|
19 | const uuid_1 = require("uuid");
|
20 | const contribution_provider_1 = require("../common/contribution-provider");
|
21 | const proxy_factory_1 = require("../common/messaging/proxy-factory");
|
22 | const electron_token_1 = require("../electron-common/electron-token");
|
23 | const electron_main_window_service_1 = require("../electron-common/electron-main-window-service");
|
24 | const electron_main_application_1 = require("./electron-main-application");
|
25 | const electron_main_window_service_impl_1 = require("./electron-main-window-service-impl");
|
26 | const electron_messaging_contribution_1 = require("./messaging/electron-messaging-contribution");
|
27 | const electron_messaging_service_1 = require("./messaging/electron-messaging-service");
|
28 | const electron_connection_handler_1 = require("../electron-common/messaging/electron-connection-handler");
|
29 | const electron_security_token_service_1 = require("./electron-security-token-service");
|
30 | const theia_electron_window_1 = require("./theia-electron-window");
|
31 | const electron_api_main_1 = require("./electron-api-main");
|
32 | const electronSecurityToken = { value: (0, uuid_1.v4)() };
|
33 |
|
34 | global[electron_token_1.ElectronSecurityToken] = electronSecurityToken;
|
35 | exports.default = new inversify_1.ContainerModule(bind => {
|
36 | bind(electron_main_application_1.ElectronMainApplication).toSelf().inSingletonScope();
|
37 | bind(electron_messaging_contribution_1.ElectronMessagingContribution).toSelf().inSingletonScope();
|
38 | bind(electron_token_1.ElectronSecurityToken).toConstantValue(electronSecurityToken);
|
39 | bind(electron_security_token_service_1.ElectronSecurityTokenService).toSelf().inSingletonScope();
|
40 | (0, contribution_provider_1.bindContributionProvider)(bind, electron_connection_handler_1.ElectronConnectionHandler);
|
41 | (0, contribution_provider_1.bindContributionProvider)(bind, electron_messaging_service_1.ElectronMessagingService.Contribution);
|
42 | (0, contribution_provider_1.bindContributionProvider)(bind, electron_main_application_1.ElectronMainApplicationContribution);
|
43 | bind(electron_main_application_1.ElectronMainApplicationContribution).toService(electron_messaging_contribution_1.ElectronMessagingContribution);
|
44 | bind(electron_api_main_1.TheiaMainApi).toSelf().inSingletonScope();
|
45 | bind(electron_main_application_1.ElectronMainApplicationContribution).toService(electron_api_main_1.TheiaMainApi);
|
46 | bind(electron_main_window_service_1.ElectronMainWindowService).to(electron_main_window_service_impl_1.ElectronMainWindowServiceImpl).inSingletonScope();
|
47 | bind(electron_connection_handler_1.ElectronConnectionHandler).toDynamicValue(context => new proxy_factory_1.RpcConnectionHandler(electron_main_window_service_1.electronMainWindowServicePath, () => context.container.get(electron_main_window_service_1.ElectronMainWindowService))).inSingletonScope();
|
48 | bind(electron_main_application_1.ElectronMainProcessArgv).toSelf().inSingletonScope();
|
49 | bind(theia_electron_window_1.TheiaElectronWindow).toSelf();
|
50 | bind(theia_electron_window_1.TheiaElectronWindowFactory).toFactory(({ container }) => (options, config) => {
|
51 | const child = container.createChild();
|
52 | child.bind(theia_electron_window_1.TheiaBrowserWindowOptions).toConstantValue(options);
|
53 | child.bind(theia_electron_window_1.WindowApplicationConfig).toConstantValue(config);
|
54 | return child.get(theia_electron_window_1.TheiaElectronWindow);
|
55 | });
|
56 | });
|
57 |
|
\ | No newline at end of file |