UNPKG

@etsoo/editor

Version:

ETSOO Free WYSIWYG HTML Editor

85 lines (84 loc) 2 kB
/** * Virtual table manipulation */ export declare class VirtualTable { private table; /** * Virtual tables */ static tables: VirtualTable[]; private columns; private rows; private cells; /** * HTML DOM Table */ get HTMLTable(): HTMLTableElement; /** * Constructor * @param table HTML table */ constructor(table: HTMLTableElement); private reset; /** * Insert column to the right * @param cell Current cell */ addColumnAfter(cell: HTMLTableCellElement): void; /** * Insert column to the left * @param cell Current cell */ addColumnBefore(cell: HTMLTableCellElement): void; /** * Add row below * @param cell Current cell */ addRowAfter(cell: HTMLTableCellElement): void; /** * Add row above * @param cell Current cell */ addRowBefore(cell: HTMLTableCellElement): void; /** * Get cell index * @param tr Current row * @param cell Cell * @returns Cell index */ getCellIndex(tr: HTMLTableRowElement, cell: HTMLTableCellElement): number; /** * Get cell index * @param cell Cell * @returns Cell index */ getCellIndexDirect(cell: HTMLTableCellElement): number; getNearCells(cell: HTMLTableCellElement): HTMLTableCellElement[]; private fixSpan; /** * Remove column * @param cell Current cell */ removeColumn(cell: HTMLTableCellElement): void; /** * Remove cell * @param cell Current cell */ removeRow(cell: HTMLTableCellElement): void; /** * Remove table */ removeTable(): void; /** * Split cell * @param cell Current cell * @param isRow Split to rows? * @param qty Qty */ splitCell(cell: HTMLTableCellElement, isRow: boolean, qty: number): void; /** * Merge cells * @param cells Cells to merge */ mergeCells(cells: HTMLTableCellElement[]): void; }