import type { default as Table } from './baseTable'; import type CellCoords from '../cell/coords'; /** * Cell / header DOM-access queries, mixed into every `Table` type. */ export interface CellAccess { getCell(coords: { row: number | null; col: number | null; }): HTMLElement | number; getRow(rowIndex: number): HTMLTableRowElement | false; getColumnHeader(col: number, level?: number): HTMLElement | undefined; getColumnHeaders(column: number): HTMLTableCellElement[]; getRowHeader(row: number, level?: number): HTMLElement | undefined; getRowHeaders(row: number): ChildNode[]; getCoords(TD: HTMLTableCellElement | HTMLElement): CellCoords | null; getTrForRow(row: number): HTMLTableRowElement; } declare const cellAccess: { /** * Returns the TD element for the provided coordinates (from the rendered DOM) if it is rendered on * the screen, or the exit code otherwise (a negative number when the coordinates are out of the * rendered viewport). The exit codes are checked in the order the arguments are given. Thus, if both * the row and the column coords are out of the rendered bounds, the method returns the error code for * the row. * * @param {CellCoords} coords The cell coordinates. * @returns {HTMLElement|number} HTMLElement on success or Number one of the exit codes on error: * -1 row before viewport * -2 row after viewport * -3 column before viewport * -4 column after viewport. * @this Table */ getCell(this: Table, coords: { row: number | null; col: number | null; }): HTMLElement | number; /** * Get the DOM element of the row with the provided index. * * @param {number} rowIndex Row index. * @returns {HTMLTableRowElement|boolean} Return the row's DOM element or `false` if the row with the * provided index doesn't exist. * @this Table */ getRow(this: Table, rowIndex: number): HTMLTableRowElement | false; /** * GetColumnHeader. * * @param {number} col Column index. * @param {number} [level=0] Header level (0 = most distant to the table). * @returns {object} HTMLElement on success or undefined on error. * @this Table */ getColumnHeader(this: Table, col: number, level?: number): HTMLElement | undefined; /** * Gets all columns headers (TH elements) from the table. * * @param {number} column A source column index. * @returns {HTMLTableCellElement[]} * @this Table */ getColumnHeaders(this: Table, column: number): HTMLTableCellElement[]; /** * GetRowHeader. * * @param {number} row Row index. * @param {number} [level=0] Header level (0 = most distant to the table). * @returns {HTMLElement} HTMLElement on success or Number one of the exit codes on error: `null table * doesn't have row headers`. * @this Table */ getRowHeader(this: Table, row: number, level?: number): HTMLElement | undefined; /** * Gets all rows headers (TH elements) from the table. * * @param {number} row A source row index. * @returns {HTMLTableCellElement[]} * @this Table */ getRowHeaders(this: Table, row: number): ChildNode[]; /** * Returns cell coords object for a given TD (or a child element of a TD element). * * @param {HTMLTableCellElement} TD A cell DOM element (or a child of one). * @returns {CellCoords|null} The coordinates of the provided TD element (or the closest TD element) or * null, if the provided element is not applicable. * @this Table */ getCoords(this: Table, TD: HTMLTableCellElement | HTMLElement): CellCoords | null; /** * Returns the TR element for the provided visual row index. * * @param {number} row The visual row index. * @returns {HTMLTableRowElement} * @this Table */ getTrForRow(this: Table, row: number): HTMLTableRowElement; }; export { cellAccess };