"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MainThreadExtenderService = exports.MainThreadExtenderContribution = exports.IMainThreadExtenderService = void 0;
const tslib_1 = require("tslib");
const di_1 = require("@opensumi/di");
const ide_core_common_1 = require("@opensumi/ide-core-common");
exports.IMainThreadExtenderService = Symbol('IMainThreadExtenderService');
exports.MainThreadExtenderContribution = Symbol('MainThreadExtenderContribution');
let MainThreadExtenderService = class MainThreadExtenderService {
    constructor() {
        this.registry = [];
    }
    registerMainThreadExtender(extender) {
        this.registry.push(extender);
        return ide_core_common_1.Disposable.create(() => {
            const index = this.registry.indexOf(extender);
            if (index !== -1) {
                this.registry.splice(index, 1);
            }
        });
    }
    getMainThreadExtenders() {
        return this.registry;
    }
};
exports.MainThreadExtenderService = MainThreadExtenderService;
exports.MainThreadExtenderService = MainThreadExtenderService = tslib_1.__decorate([
    (0, di_1.Injectable)()
], MainThreadExtenderService);
//# sourceMappingURL=main.thread.extender.js.map