import { createUniComponentFromWebComponent } from '../../../_common/components/uni-component/uni-component.js';
export class ColumnRendererHelper {
    constructor() {
        this._columns = new Map();
    }
    register(renderer) {
        const columns = this._columns;
        if (columns.has(renderer.type)) {
            throw new Error('cannot register twice for ' + renderer.type);
        }
        columns.set(renderer.type, renderer);
    }
    get(type) {
        const renderer = this._columns.get(type);
        if (!renderer) {
            throw new Error(`cannot find renderer of ${type}`);
        }
        return renderer;
    }
    list() {
        return Array.from(this._columns.values());
    }
}
export const columnRenderer = new ColumnRendererHelper();
export const createFromBaseCellRenderer = (renderer) => {
    return createUniComponentFromWebComponent(renderer);
};
//# sourceMappingURL=renderer.js.map