"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MainThreadTheming = void 0;
const tslib_1 = require("tslib");
const di_1 = require("@opensumi/di");
const ide_connection_1 = require("@opensumi/ide-connection");
const ide_theme_1 = require("@opensumi/ide-theme");
const vscode_1 = require("../../../common/vscode");
let MainThreadTheming = class MainThreadTheming {
    constructor(rpcProtocol) {
        this.rpcProtocol = rpcProtocol;
        this.proxy = this.rpcProtocol.getProxy(vscode_1.ExtHostAPIIdentifier.ExtHostTheming);
        this._themeChangeListener = this._themeService.onThemeChange((e) => {
            this.proxy.$onColorThemeChange(e.type);
        });
        this.proxy.$onColorThemeChange(this._themeService.getCurrentThemeSync().type);
    }
    dispose() {
        this._themeChangeListener.dispose();
    }
};
exports.MainThreadTheming = MainThreadTheming;
tslib_1.__decorate([
    (0, di_1.Autowired)(ide_theme_1.IThemeService),
    tslib_1.__metadata("design:type", Object)
], MainThreadTheming.prototype, "_themeService", void 0);
exports.MainThreadTheming = MainThreadTheming = tslib_1.__decorate([
    (0, di_1.Injectable)({ multiple: true }),
    tslib_1.__param(0, (0, di_1.Optional)(ide_connection_1.IRPCProtocol)),
    tslib_1.__metadata("design:paramtypes", [Object])
], MainThreadTheming);
//# sourceMappingURL=main.thread.theming.js.map