import type { HotInstance } from '../../core/types'; import type { default as CellCoords } from '../../3rdparty/walkontable/src/cell/coords'; import type { default as CellRange } from '../../3rdparty/walkontable/src/cell/range'; /** * The `MergedCellCoords` class represents a single merged cell. * * @private * @class MergedCellCoords */ declare class MergedCellCoords { #private; /** * The index of the topmost merged cell row. * * @type {number} */ row: number; /** * The index of the leftmost column. * * @type {number} */ col: number; /** * The `rowspan` value of the merged cell. * * @type {number} */ rowspan: number; /** * The `colspan` value of the merged cell. * * @type {number} */ colspan: number; /** * `true` only if the merged cell is bound to be removed. * * @type {boolean} */ removed: boolean; /** * The CellCoords function factory. * * @type {Function} */ cellCoordsFactory: (row: number, col: number) => CellCoords; /** * The CellRange function factory. * * @type {Function} */ cellRangeFactory: (highlight: CellCoords, from: CellCoords, to: CellCoords) => CellRange; /** * Initializes the merged cell coordinates with its top-left position, span dimensions, and factories for creating cell coordinate and range objects. */ constructor(row: number, column: number, rowspan: number, colspan: number, cellCoordsFactory: (row: number, col: number) => CellCoords, cellRangeFactory: (highlight: CellCoords, from: CellCoords, to: CellCoords) => CellRange); /** * Get a warning message for when the declared merged cell data contains negative values. * * @param {{ row: number, col: number, rowspan: number, colspan: number }} mergedCell Object containing information * about the merged cells that was about to be added. * @returns {string} */ static NEGATIVE_VALUES_WARNING({ row, col, rowspan, colspan }: { row: number; col: number; rowspan: number; colspan: number; }): string; /** * Get a warning message for when the declared merged cell data contains values exceeding the table limits. * * @param {{ row: number, col: number, rowspan: number, colspan: number }} mergedCell Object containing information * about the merged cells that was about to be added. * @returns {string} */ static IS_OUT_OF_BOUNDS_WARNING({ row, col }: { row: number; col: number; }): string; /** * Get a warning message for when the declared merged cell data represents a single cell. * * @param {{ row: number, col: number, rowspan: number, colspan: number }} mergedCell Object containing information * about the merged cells that was about to be added. * @returns {string} */ static IS_SINGLE_CELL({ row, col }: { row: number; col: number; }): string; /** * Get a warning message for when the declared merged cell data contains "colspan" or "rowspan", that equals 0. * * @param {{ row: number, col: number, rowspan: number, colspan: number }} mergedCell Object containing information * about the merged cells that was about to be added. * @returns {string} */ static ZERO_SPAN_WARNING({ row, col }: { row: number; col: number; }): string; /** * Check whether the values provided for a merged cell contain any negative values. * * @param {{ row: number, col: number, rowspan: number, colspan: number }} mergedCell Object containing information * about the merged cells that was about to be added. * @returns {boolean} */ static containsNegativeValues({ row, col, rowspan, colspan }: { row: number; col: number; rowspan: number; colspan: number; }): boolean; /** * Check whether the provided merged cell information object represents a single cell. * * @private * @param {{ row: number, col: number, rowspan: number, colspan: number }} mergedCell Object containing information * about the merged cells that was about to be added. * @returns {boolean} */ static isSingleCell({ rowspan, colspan }: { rowspan: number; colspan: number; }): boolean; /** * Check whether the provided merged cell information object contains a rowspan or colspan of 0. * * @private * @param {{ row: number, col: number, rowspan: number, colspan: number }} mergedCell Object containing information * about the merged cells that was about to be added. * @returns {boolean} */ static containsZeroSpan({ rowspan, colspan }: { rowspan: number; colspan: number; }): boolean; /** * Check whether the provided merged cell object is to be declared out of bounds of the table. * * @param {object} mergeCell Object containing the `row`, `col`, `rowspan` and `colspan` properties. * @param {number} rowCount Number of rows in the table. * @param {number} columnCount Number of rows in the table. * @returns {boolean} */ static isOutOfBounds(mergeCell: { row: number; col: number; rowspan: number; colspan: number; }, rowCount: number, columnCount: number): boolean; /** * Sanitize (prevent from going outside the boundaries) the merged cell. * * @param {Core} hotInstance The Handsontable instance. */ normalize(hotInstance: HotInstance): void; /** * Returns `true` if the provided coordinates are inside the merged cell. * * @param {number} row The row index. * @param {number} column The column index. * @returns {boolean} */ includes(row: number, column: number): boolean; /** * Returns `true` if the provided `column` property is within the column span of the merged cell. * * @param {number} column The column index. * @returns {boolean} */ includesHorizontally(column: number): boolean; /** * Returns `true` if the provided `row` property is within the row span of the merged cell. * * @param {number} row Row index. * @returns {boolean} */ includesVertically(row: number): boolean; /** * Shift (and possibly resize, if needed) the merged cell. * * @param {Array} shiftVector 2-element array containing the information on the shifting in the `x` and `y` axis. * @param {number} indexOfChange Index of the preceding change. * @returns {boolean} Returns `false` if the whole merged cell was removed. */ shift(shiftVector: number[], indexOfChange: number): boolean; /** * Check if the second provided merged cell is "farther" in the provided direction. * * @param {MergedCellCoords} mergedCell The merged cell to check. * @param {string} direction Drag direction. * @returns {boolean|null} `true` if the second provided merged cell is "farther". */ isFarther(mergedCell: MergedCellCoords | null, direction: string): boolean | null; /** * Get the bottom row index of the merged cell. * * @returns {number} */ getLastRow(): number; /** * Get the rightmost column index of the merged cell. * * @returns {number} */ getLastColumn(): number; /** * Get the range coordinates of the merged cell. * * @returns {CellRange} */ getRange(): CellRange; } export default MergedCellCoords;