UNPKG

@visactor/vtable

Version:

canvas table width high performance

45 lines (34 loc) 1.67 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: !0 }), exports.clearAll = exports.aggregator = exports.editor = exports.chartModule = exports.icon = exports.theme = void 0; const icons_1 = require("./icons"), themes_1 = require("./themes/themes"), chartModule_1 = require("./chartModule"), 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(chartModule_1.chartTypes, name, chartModule) : chartModule_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(chartModule_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