import type { WalkontableInstance } from '../types'; import type { EngineContext } from '../wire'; import type Settings from '../settings'; import type { RowRangeQuery, ColumnRangeQuery } from './rangeQuery/renderedRange'; import { type CellAccess } from './cellAccess'; import { type DomScaffold } from './domScaffold'; import { type SizeGetters } from '../axisSizing/sizeGetters'; import { type ViewportPredicates } from './rangeQuery/viewportPredicates'; import type ColumnFilter from '../filter/column'; import type RowFilter from '../filter/row'; import { Renderer } from '../render'; import ColumnUtils from '../axisSizing/columnUtils'; import RowUtils from '../axisSizing/rowUtils'; /** * Assembles the Table module's dependencies from the engine composition context. Shared by the * master table, every overlay clone table, and the `RowUtils`/`ColumnUtils`/range-query mixins. * * Everything the table once received as separate constructor arguments (facade getter, DOM roots, * settings) is folded in here. The volatile viewport calculators are intentionally NOT exposed — the * `calculatedRows`/`calculatedColumns` mixins read the current calculator off `getWtViewport()`, so * there is no stale-reference risk across draws. * * @param {EngineContext} ctx The engine composition context. * @returns {object} The Table dependency set. */ export declare function createTableDeps(ctx: EngineContext): { wot: WalkontableInstance; facadeGetter: Function; wtSettings: Settings; rootDocument: Document; rootTable: HTMLTableElement; geometryReader: import("../domMeasure/geometryReader").GeometryReader; rowSizeSource: import("../axisSizing/axisSizeSource").RowSizeSource; columnSizeSource: import("../axisSizing/axisSizeSource").AxisSizeSource; getWtTable: () => Table; getWtViewport: () => import("../viewport/viewport").default; getWtOverlays: () => import("../overlay/overlays").default; getSelectionManager: () => import("../selection").SelectionManager; getCloneSource: () => WalkontableInstance; getParentTableOffset: () => { top: number; left: number; } | number; getColumnHeaders: () => Function[]; getRowHeaders: () => Function[]; isDrawn: () => boolean; setDrawn: (value: boolean) => void; }; /** * The Table module dependencies, inferred from `createTableDeps`. */ export type TableDeps = ReturnType; /** * @todo These mixes are never added to the class Table, however their members are used here. * @todo Continue: Potentially it works only, because some of these mixes are added to every inherited class. * @todo Refactoring, move code from `if(this.isMaster)` into MasterTable, and others like that. * @mixes stickyColumnsStart * @mixes stickyRowsBottom * @mixes stickyRowsTop * @mixes calculatedRows * @mixes calculatedColumns * @abstract */ declare class Table { #private; /** * The walkontable settings. * * @protected * @type {Settings} */ wtSettings: Settings; /** * The table body element (TBODY). * * @type {HTMLTableSectionElement | null} */ TBODY: HTMLTableSectionElement | null; /** * The table head element (THEAD). * * @type {HTMLTableSectionElement | null} */ THEAD: HTMLTableSectionElement | null; /** * The column group element (COLGROUP). * * @type {HTMLTableColElement | null} */ COLGROUP: HTMLTableColElement | null; /** * Indicates if the table has height bigger than 0px. * * @type {boolean} */ hasTableHeight: boolean; /** * Indicates if the table has width bigger than 0px. * * @type {boolean} */ hasTableWidth: boolean; /** * Indicates if the table is visible. By visible, it means that the holder * element has CSS 'display' property different than 'none'. * * @type {boolean} */ isTableVisible: boolean; /** * The offset of the table element. * * @type {number | { top: number; left: number }} */ tableOffset: number | { top: number; left: number; }; /** * The offset of the holder element. * * @type {number | { top: number; left: number }} */ holderOffset: number | { top: number; left: number; }; /** * The borders holder element. * * @type {HTMLElement} */ bordersHolder?: HTMLElement; /** * Indicates if this instance is of type MasterTable (i.e. it is NOT an overlay). * * @type {boolean} */ isMaster: boolean; /** * The name of the table (overlay name or 'master'). * * @type {string} */ name: string; /** * Read-only access to the dependencies, for the range-query mixins (`calculatedRows`/ * `calculatedColumns`/`stickyRows*`/`stickyColumns*`) and `RowUtils`/`ColumnUtils`, which are * defined outside this class and so cannot reach the private `#deps`. * * @returns {TableDeps} */ get deps(): TableDeps; /** * Function which returns the proper facade. * * @type {Function} */ facadeGetter: Function; /** * The Walkontable instance (legacy alias for instance). * * @type {WalkontableInstance} */ wot: WalkontableInstance; /** * The table element. * * @type {HTMLTableElement} */ TABLE: HTMLTableElement; /** * The spreader element. * * @type {HTMLElement} */ spreader: HTMLElement; /** * The hider element. * * @type {HTMLElement} */ hider: HTMLElement; /** * The holder element. * * @type {HTMLElement} */ holder: HTMLElement; /** * The root element. * * @type {HTMLElement} */ wtRootElement: HTMLElement; /** * The row filter. * * @type {RowFilter | null} */ rowFilter: RowFilter | null; /** * The column filter. * * @type {ColumnFilter | null} */ columnFilter: ColumnFilter | null; /** * Indicates if the header width should be corrected. * * @type {boolean} */ correctHeaderWidth: boolean; /** * The row utilities. * * @type {RowUtils} */ rowUtils: RowUtils; /** * The column utilities. * * @type {ColumnUtils} */ columnUtils: ColumnUtils; /** * The table renderer. * * @type {Renderer} */ tableRenderer: Renderer; /** * Aligns overlays with the trimming container. * * @returns {void} */ alignOverlaysWithTrimmingContainer(): void; /** * * @abstract * @param {TableDeps} deps The table module dependencies. * @param {'master'|CLONE_TYPES_ENUM} name Overlay name. */ constructor(deps: TableDeps, name: string); /** * Returns a boolean that is true if this Table represents a specific overlay, identified by the overlay name. * For MasterTable, it returns false. * * @param {string} overlayTypeName The overlay type. * @returns {boolean} */ is(overlayTypeName: string): boolean; /** * Redraws the table. * * @param {boolean} [fastDraw=false] If TRUE, will try to avoid full redraw and only update the border positions. * If FALSE or UNDEFINED, will perform a full redraw. * @returns {Table} */ draw(fastDraw?: boolean): this; /** * Modify row header widths provided by user in class contructor. * * @private * @param {Function | number | null} rowHeaderWidthFactory The function which can provide default width values for rows.. * @returns {number} */ _modifyRowHeaderWidth(rowHeaderWidthFactory: ((...args: unknown[]) => number | number[]) | number | null): number | number[]; /** * Correct row header width if necessary. * * @private * @param {number | null} width The width to process. * @returns {number} */ _correctRowHeaderWidth(width: number | null): number; /** * Destroys the table instance. Overridden by MasterTable to release DOM resources. */ destroy(): void; } interface Table extends RowRangeQuery, ColumnRangeQuery, CellAccess, DomScaffold, SizeGetters, ViewportPredicates { } export default Table;