"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.initNodeThreadAPIProxy = initNodeThreadAPIProxy;
exports.initWorkerThreadAPIProxy = initWorkerThreadAPIProxy;
const vscode_1 = require("../../../common/vscode");
const main_thread_connection_1 = require("./main.thread.connection");
const main_thread_debug_1 = require("./main.thread.debug");
const main_thread_tasks_1 = require("./main.thread.tasks");
const main_thread_terminal_1 = require("./main.thread.terminal");
const main_thread_tests_1 = require("./main.thread.tests");
const main_thread_treeview_1 = require("./main.thread.treeview");
const main_thread_window_1 = require("./main.thread.window");
const main_thread_window_state_1 = require("./main.thread.window-state");
function initNodeThreadAPIProxy(rpcProtocol, injector, extensionService) {
    rpcProtocol.set(vscode_1.MainThreadAPIIdentifier.MainThreadExtensionService, extensionService);
    const MainThreadTreeViewAPI = injector.get(main_thread_treeview_1.MainThreadTreeView, [rpcProtocol, 'node']);
    const MainThreadWindowStateAPI = injector.get(main_thread_window_state_1.MainThreadWindowState, [rpcProtocol]);
    const MainThreadWindowAPI = injector.get(main_thread_window_1.MainThreadWindow, [rpcProtocol]);
    const MainThreadConnectionAPI = injector.get(main_thread_connection_1.MainThreadConnection, [rpcProtocol]);
    const MainThreadDebugAPI = injector.get(main_thread_debug_1.MainThreadDebug, [rpcProtocol, MainThreadConnectionAPI]);
    const MainThreadTerminalAPI = injector.get(main_thread_terminal_1.MainThreadTerminal, [rpcProtocol]);
    const MainThreadTasksAPI = injector.get(main_thread_tasks_1.MainThreadTasks, [rpcProtocol]);
    const MainthreadTestAPI = injector.get(main_thread_tests_1.MainThreadTestsImpl, [rpcProtocol]);
    rpcProtocol.set(vscode_1.MainThreadAPIIdentifier.MainThreadTreeView, MainThreadTreeViewAPI);
    rpcProtocol.set(vscode_1.MainThreadAPIIdentifier.MainThreadWindowState, MainThreadWindowStateAPI);
    rpcProtocol.set(vscode_1.MainThreadAPIIdentifier.MainThreadWindow, MainThreadWindowAPI);
    rpcProtocol.set(vscode_1.MainThreadAPIIdentifier.MainThreadConnection, MainThreadConnectionAPI);
    rpcProtocol.set(vscode_1.MainThreadAPIIdentifier.MainThreadDebug, MainThreadDebugAPI);
    rpcProtocol.set(vscode_1.MainThreadAPIIdentifier.MainThreadTerminal, MainThreadTerminalAPI);
    rpcProtocol.set(vscode_1.MainThreadAPIIdentifier.MainThreadTasks, MainThreadTasksAPI);
    rpcProtocol.set(vscode_1.MainThreadAPIIdentifier.MainThreadTests, MainthreadTestAPI);
    return () => {
        MainThreadTreeViewAPI.dispose();
        MainThreadWindowStateAPI.dispose();
        MainThreadWindowAPI.dispose();
        MainThreadConnectionAPI.dispose();
        MainThreadDebugAPI.dispose();
        MainThreadTerminalAPI.dispose();
        MainThreadTasksAPI.dispose();
        MainthreadTestAPI.dispose();
    };
}
function initWorkerThreadAPIProxy(rpcProtocol, injector, extensionService) {
    rpcProtocol.set(vscode_1.MainThreadAPIIdentifier.MainThreadExtensionService, extensionService);
    const MainThreadTreeViewAPI = injector.get(main_thread_treeview_1.MainThreadTreeView, [rpcProtocol, 'worker']);
    rpcProtocol.set(vscode_1.MainThreadAPIIdentifier.MainThreadTreeView, MainThreadTreeViewAPI);
    return () => {
        MainThreadTreeViewAPI.dispose();
    };
}
//# sourceMappingURL=main.thread.api.impl.js.map