@visactor/vtable
Version:
canvas table width high performance
44 lines (32 loc) • 1.32 kB
JavaScript
import { icons as iconPlugins } from "./icons";
import { themes as themePlugins } from "./themes/themes";
import { chartTypes as chartTypePlugins } from "./chartModule";
import { editors } from "./edit/editors";
import { registeredAggregators } from "./ts-types/dataset/aggregation";
function register(obj, name, value) {
const old = obj[name];
return obj[name] = value, old;
}
export function theme(name, theme) {
return null != theme ? register(themePlugins, name, theme) : themePlugins[name];
}
export function icon(name, icon) {
return null != icon ? register(iconPlugins, name, icon) : iconPlugins[name];
}
export function chartModule(name, chartModule) {
return null != chartModule ? register(chartTypePlugins, name, chartModule) : chartTypePlugins[name];
}
export function editor(name, editor) {
return null != editor ? register(editors, name, editor) : editors[name];
}
export function aggregator(aggregationType, aggregation) {
null != aggregation && register(registeredAggregators, aggregationType, aggregation);
}
function clear(obj) {
for (const key in obj) delete obj[key];
}
export function clearAll() {
clear(themePlugins), clear(iconPlugins), clear(chartTypePlugins), clear(editors),
clear(registeredAggregators);
}
//# sourceMappingURL=register.js.map