@visactor/vtable
Version:
canvas table width high performance
45 lines (34 loc) • 1.69 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: !0
}), exports.clearAll = exports.aggregator = exports.editor = exports.chartModule = exports.icon = exports.theme = void 0;
const icons_1 = require("./plugins/icons"), themes_1 = require("./plugins/themes"), chartModules_1 = require("./plugins/chartModules"), editors_1 = require("./edit/editors"), aggregation_1 = require("./ts-types/dataset/aggregation");
function register(obj, name, value) {
const old = obj[name];
return obj[name] = value, old;
}
function theme(name, theme) {
return null != theme ? register(themes_1.themes, name, theme) : themes_1.themes[name];
}
function icon(name, icon) {
return null != icon ? register(icons_1.icons, name, icon) : icons_1.icons[name];
}
function chartModule(name, chartModule) {
return null != chartModule ? register(chartModules_1.chartTypes, name, chartModule) : chartModules_1.chartTypes[name];
}
function editor(name, editor) {
return null != editor ? register(editors_1.editors, name, editor) : editors_1.editors[name];
}
function aggregator(aggregationType, aggregation) {
null != aggregation && register(aggregation_1.registeredAggregators, aggregationType, aggregation);
}
function clear(obj) {
for (const key in obj) delete obj[key];
}
function clearAll() {
clear(themes_1.themes), clear(icons_1.icons), clear(chartModules_1.chartTypes),
clear(editors_1.editors), clear(aggregation_1.registeredAggregators);
}
exports.theme = theme, exports.icon = icon, exports.chartModule = chartModule, exports.editor = editor,
exports.aggregator = aggregator, exports.clearAll = clearAll;
//# sourceMappingURL=register.js.map