"use strict";
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __param = (this && this.__param) || function (paramIndex, decorator) {
    return function (target, key) { decorator(target, key, paramIndex); }
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.BackendApplication = void 0;
var inversify_1 = require("inversify");
var contribution_provider_1 = require("@theia/core/lib/common/contribution-provider");
var backend_application_1 = require("@theia/core/lib/node/backend-application");
var BackendApplication = /** @class */ (function (_super) {
    __extends(BackendApplication, _super);
    function BackendApplication(contributionsProvider, cliParams) {
        var _this = _super.call(this, contributionsProvider, cliParams) || this;
        _this.contributionsProvider = contributionsProvider;
        _this.cliParams = cliParams;
        // Workaround for Electron not installing a handler to ignore SIGPIPE
        // (https://github.com/electron/electron/issues/13254)
        // From VS Code: https://github.com/microsoft/vscode/blob/d0c90c9f3ea8d34912194176241503a44b3abd80/src/bootstrap.js#L31-L37
        process.on('SIGPIPE', function () { return console.error(new Error('Unexpected SIGPIPE signal.')); });
        return _this;
    }
    BackendApplication = __decorate([
        inversify_1.injectable(),
        __param(0, inversify_1.inject(contribution_provider_1.ContributionProvider)), __param(0, inversify_1.named(backend_application_1.BackendApplicationContribution)),
        __param(1, inversify_1.inject(backend_application_1.BackendApplicationCliContribution)),
        __metadata("design:paramtypes", [Object, backend_application_1.BackendApplicationCliContribution])
    ], BackendApplication);
    return BackendApplication;
}(backend_application_1.BackendApplication));
exports.BackendApplication = BackendApplication;
//# sourceMappingURL=backend-application.js.map