import { NodesPool } from '../utils/nodesPool.mjs';
/**
 * Base renderer class, abstract logic for specialized renderers.
 *
 * @class BaseRenderer
 */ export class BaseRenderer {
    /**
   * Sets the table renderer instance to the current renderer.
   *
   * @param {TableRenderer} table The TableRenderer instance.
   */ setTable(table) {
        if (this.nodesPool) {
            this.nodesPool.setRootDocument(table.rootDocument);
        }
        this.table = table;
    }
    /**
   * Renders the contents to the elements.
   */ render() {}
    constructor(nodeType, rootNode){
        /**
   * Factory for newly created DOM elements.
   *
   * @type {NodesPool|null}
   */ this.nodesPool = null;
        /**
   * The instance of the Table class, a wrapper for all renderers and holder for properties describe table state.
   *
   * @type {TableRenderer}
   */ this.table = null;
        /**
   * Counter of nodes already added.
   *
   * @type {number}
   */ this.renderedNodes = 0;
        this.nodesPool = typeof nodeType === 'string' ? new NodesPool(nodeType) : null;
        this.nodeType = nodeType;
        this.rootNode = rootNode;
    }
}
