/** * Class responsible for all of the Selection-related operations on merged cells. * * @private * @class SelectionCalculations */ import type { HotInstance } from '../../../core/types'; import type { default as CellRange } from '../../../3rdparty/walkontable/src/cell/range'; import type MergedCellCoords from '../cellCoords'; import type MergedCellsCollection from '../cellsCollection'; /** * Minimal interface that SelectionCalculations requires from the MergeCells plugin. */ interface MergeCellsPluginRef { hot: HotInstance; mergedCellsCollection: MergedCellsCollection; } /** * Handles all selection-related calculations for merged cells, such as class name generation and full-selection detection. */ declare class SelectionCalculations { /** * Reference to the Merge Cells plugin. * * @type {MergeCells} */ plugin: MergeCellsPluginRef; /** * Reference to the Handsontable instance. * * @type {Handsontable} */ hot: HotInstance; /** * Class name used for fully selected merged cells. * * @type {string} */ fullySelectedMergedCellClassName: string; /** * Initializes the selection calculations helper with a reference to the MergeCells plugin instance. */ constructor(plugin: MergeCellsPluginRef); /** * Generate an additional class name for the entirely-selected merged cells. * * @param {number} currentRow Visual row index of the currently processed cell. * @param {number} currentColumn Visual column index of the currently cell. * @param {Array} cornersOfSelection Array of the current selection in a form of `[startRow, startColumn, endRow, endColumn]`. * @param {number|undefined} layerLevel Number indicating which layer of selection is currently processed. * @returns {string|undefined} A `String`, which will act as an additional `className` to be added to the currently processed cell. */ getSelectedMergedCellClassName(currentRow: number, currentColumn: number, cornersOfSelection: number[], layerLevel: number | undefined): string | undefined; /** * Check if the provided merged cell is fully selected (by one or many layers of selection). * * @param {MergedCellCoords} mergedCell The merged cell to be processed. * @param {CellRange[]} selectionRangesArray Array of selection ranges. * @returns {boolean} */ isMergeCellFullySelected(mergedCell: MergedCellCoords, selectionRangesArray: CellRange[]): boolean; /** * Generate an array of the entirely-selected merged cells' class names. * * @returns {string[]} An `Array` of `String`s. Each of these strings will act like class names to be removed from all the cells in the table. */ getSelectedMergedCellClassNameToRemove(): string[]; } export default SelectionCalculations;