"use strict";
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 __values = (this && this.__values) || function(o) {
    var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
    if (m) return m.call(o);
    if (o && typeof o.length === "number") return {
        next: function () {
            if (o && i >= o.length) o = void 0;
            return { value: o && o[i++], done: !o };
        }
    };
    throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.NotificationServiceServerImpl = void 0;
var inversify_1 = require("inversify");
var NotificationServiceServerImpl = /** @class */ (function () {
    function NotificationServiceServerImpl() {
        this.clients = [];
    }
    NotificationServiceServerImpl.prototype.notifyIndexUpdated = function () {
        this.clients.forEach(function (client) { return client.notifyIndexUpdated(); });
    };
    NotificationServiceServerImpl.prototype.notifyDaemonStarted = function () {
        this.clients.forEach(function (client) { return client.notifyDaemonStarted(); });
    };
    NotificationServiceServerImpl.prototype.notifyDaemonStopped = function () {
        this.clients.forEach(function (client) { return client.notifyDaemonStopped(); });
    };
    NotificationServiceServerImpl.prototype.notifyPlatformInstalled = function (event) {
        this.clients.forEach(function (client) { return client.notifyPlatformInstalled(event); });
    };
    NotificationServiceServerImpl.prototype.notifyPlatformUninstalled = function (event) {
        this.clients.forEach(function (client) { return client.notifyPlatformUninstalled(event); });
    };
    NotificationServiceServerImpl.prototype.notifyLibraryInstalled = function (event) {
        this.clients.forEach(function (client) { return client.notifyLibraryInstalled(event); });
    };
    NotificationServiceServerImpl.prototype.notifyLibraryUninstalled = function (event) {
        this.clients.forEach(function (client) { return client.notifyLibraryUninstalled(event); });
    };
    NotificationServiceServerImpl.prototype.notifyAttachedBoardsChanged = function (event) {
        this.clients.forEach(function (client) { return client.notifyAttachedBoardsChanged(event); });
    };
    NotificationServiceServerImpl.prototype.notifyConfigChanged = function (event) {
        this.clients.forEach(function (client) { return client.notifyConfigChanged(event); });
    };
    NotificationServiceServerImpl.prototype.notifyRecentSketchesChanged = function (event) {
        this.clients.forEach(function (client) { return client.notifyRecentSketchesChanged(event); });
    };
    NotificationServiceServerImpl.prototype.setClient = function (client) {
        this.clients.push(client);
    };
    NotificationServiceServerImpl.prototype.disposeClient = function (client) {
        var index = this.clients.indexOf(client);
        if (index === -1) {
            console.warn("Could not dispose notification service client. It was not registered.");
            return;
        }
        this.clients.splice(index, 1);
    };
    NotificationServiceServerImpl.prototype.dispose = function () {
        var e_1, _a;
        try {
            for (var _b = __values(this.clients), _c = _b.next(); !_c.done; _c = _b.next()) {
                var client = _c.value;
                this.disposeClient(client);
            }
        }
        catch (e_1_1) { e_1 = { error: e_1_1 }; }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
            }
            finally { if (e_1) throw e_1.error; }
        }
        this.clients.length = 0;
    };
    NotificationServiceServerImpl = __decorate([
        inversify_1.injectable()
    ], NotificationServiceServerImpl);
    return NotificationServiceServerImpl;
}());
exports.NotificationServiceServerImpl = NotificationServiceServerImpl;
//# sourceMappingURL=notification-service-server.js.map