import { CellProperties } from './types'; /** * Utility class for table DOM manipulation operations. * All methods are static and handle table structure modifications, * cell merging/splitting, and property management. */ export declare class TableDOMUtils { /** * Get the table element containing a cell * @param cell - The table cell element * @returns The parent table element or null if not found */ static getTableFromCell(cell: HTMLTableCellElement): HTMLTableElement | null; /** * Get the row and column index of a cell within its table * @param cell - The table cell element * @returns Object with row and col indices, or {row: -1, col: -1} if not found */ static getCellPosition(cell: HTMLTableCellElement): { row: number; col: number; }; /** * Insert a column at the specified index * @param table - The table element * @param colIndex - The column index to insert at * @param position - Whether to insert 'before' or 'after' the specified column */ static insertColumn(table: HTMLTableElement, colIndex: number, position: 'before' | 'after'): void; /** * Delete a column at the specified index * @param table - The table element * @param colIndex - The column index to delete * @returns false if this is the last column (table should be deleted), true otherwise */ static deleteColumn(table: HTMLTableElement, colIndex: number): boolean; /** * Insert a row at the specified index * @param table - The table element * @param rowIndex - The row index to insert at * @param position - Whether to insert 'before' or 'after' the specified row */ static insertRow(table: HTMLTableElement, rowIndex: number, position: 'before' | 'after'): void; /** * Delete a row at the specified index * @param table - The table element * @param rowIndex - The row index to delete * @returns false if this is the last row (table should be deleted), true otherwise */ static deleteRow(table: HTMLTableElement, rowIndex: number): boolean; /** * Toggle header row on/off * Converts first row to/from header row with thead/th elements * @param table - The table element */ static toggleHeaderRow(table: HTMLTableElement): void; /** * Merge cells in a direction * @param cell - The cell to merge from * @param direction - Direction to merge: 'up', 'down', 'left', or 'right' * @returns true if merge was successful, false otherwise */ static mergeCells(cell: HTMLTableCellElement, direction: 'up' | 'down' | 'left' | 'right'): boolean; /** * Split a merged cell * @param cell - The cell to split * @param direction - Direction to split: 'horizontal' (colspan) or 'vertical' (rowspan) * @returns true if split was successful, false otherwise */ static splitCell(cell: HTMLTableCellElement, direction: 'horizontal' | 'vertical'): boolean; /** * Check if cells can be merged in a direction * @param cell - The cell to check * @param direction - Direction to check: 'up', 'down', 'left', or 'right' * @returns true if merge is possible, false otherwise */ static canMerge(cell: HTMLTableCellElement, direction: 'up' | 'down' | 'left' | 'right'): boolean; /** * Apply cell properties to a cell * @param cell - The cell to apply properties to * @param properties - The properties to apply */ static applyCellProperties(cell: HTMLTableCellElement, properties: CellProperties): void; /** * Extract cell properties from a cell * @param cell - The cell to extract properties from * @returns The extracted cell properties */ static extractCellProperties(cell: HTMLTableCellElement): CellProperties; }