define(["require", "exports", "@syncfusion/ej2-base", "../base/enum"], function (require, exports, ej2_base_1, enum_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var RendererFactory = (function () {
function RendererFactory() {
this.rendererMap = {};
}
RendererFactory.prototype.addRenderer = function (name, type) {
var rName = ej2_base_1.getEnumValue(enum_1.RenderType, name);
if (ej2_base_1.isNullOrUndefined(this.rendererMap["" + rName])) {
this.rendererMap["" + rName] = type;
}
};
RendererFactory.prototype.getRenderer = function (name) {
var rName = ej2_base_1.getEnumValue(enum_1.RenderType, name);
if (ej2_base_1.isNullOrUndefined(this.rendererMap["" + rName])) {
throw "The renderer " + rName + " is not found";
}
else {
return this.rendererMap["" + rName];
}
};
RendererFactory.prototype.destroy = function () {
this.rendererMap = {};
};
return RendererFactory;
}());
exports.RendererFactory = RendererFactory;
});
|