/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/
import * as Types from '../../../base/common/types';
import * as Assert from '../../../base/common/assert';
var RegistryImpl = /** @class */ (function () {
    function RegistryImpl() {
        this.data = new Map();
    }
    RegistryImpl.prototype.add = function (id, data) {
        Assert.ok(Types.isString(id));
        Assert.ok(Types.isObject(data));
        Assert.ok(!this.data.has(id), 'There is already an extension with this id');
        this.data.set(id, data);
    };
    RegistryImpl.prototype.knows = function (id) {
        return this.data.has(id);
    };
    RegistryImpl.prototype.as = function (id) {
        return this.data.get(id) || null;
    };
    return RegistryImpl;
}());
export var Registry = new RegistryImpl();
