all files / src/widgets/ widgetPluginRegistry.ts

89.47% Statements 17/19
57.14% Branches 4/7
100% Functions 5/5
100% Lines 16/16
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29                         
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
var __extends = (this && this.__extends) || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var pluginRegistry_1 = require("../pluginApi/pluginRegistry");
var widgetPluginFactory_1 = require("./widgetPluginFactory");
/**
 * Describes how we expect the plugin module to be
 */
var WidgetPluginRegistry = (function (_super) {
    __extends(WidgetPluginRegistry, _super);
    function WidgetPluginRegistry(store) {
        _super.call(this, store);
    }
    WidgetPluginRegistry.prototype.createPluginFromModule = function (module) {
        console.assert(_.isObject(module.TYPE_INFO), "Missing TYPE_INFO on datasource module. Every module must export TYPE_INFO");
        return new widgetPluginFactory_1.default(module.TYPE_INFO.type, this.store);
    };
    return WidgetPluginRegistry;
}(pluginRegistry_1.default));
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = WidgetPluginRegistry;