import { __decorate, __metadata } from "tslib";
import { RuntimeConfig } from '@codeblitzjs/ide-sumi-core';
import { Autowired, Injectable } from '@opensumi/di';
import { BrowserModule, Domain, KeybindingContribution } from '@opensumi/ide-core-browser';
import { CodeBlitzCommandContribution } from '../commands';
import { ExtensionActivateContribution } from '../extension/extension.contribution';
let CodeBlitzContribution = class CodeBlitzContribution {
    registerKeybindings(keybindings) {
        var _a;
        // 自定义注销的快捷键
        if (this.runtimeConfig.unregisterKeybindings) {
            this.runtimeConfig.unregisterKeybindings.forEach((binding) => {
                keybindings.unregisterKeybinding(binding);
            });
        }
        if ((_a = this.runtimeConfig.registerKeybindings) === null || _a === void 0 ? void 0 : _a.length) {
            keybindings.registerKeybindings(this.runtimeConfig.registerKeybindings);
        }
    }
};
__decorate([
    Autowired(RuntimeConfig),
    __metadata("design:type", Object)
], CodeBlitzContribution.prototype, "runtimeConfig", void 0);
CodeBlitzContribution = __decorate([
    Domain(KeybindingContribution)
], CodeBlitzContribution);
let CodeBlitzModule = class CodeBlitzModule extends BrowserModule {
    constructor() {
        super(...arguments);
        this.providers = [
            ExtensionActivateContribution,
            CodeBlitzCommandContribution,
            CodeBlitzContribution,
        ];
    }
};
CodeBlitzModule = __decorate([
    Injectable()
], CodeBlitzModule);
export { CodeBlitzModule };
//# sourceMappingURL=codeblitz.module.js.map