import type { default as CellCoords } from '../../3rdparty/walkontable/src/cell/coords'; import type { default as CellRange } from '../../3rdparty/walkontable/src/cell/range'; import type { SelectionTableProps } from '../types'; import type SelectionRange from '../range'; /** * The BaseTransformation class implements algorithms for transforming coordinates based on current settings * passed to the Handsontable. The class performs the calculations based on the renderable indexes. * * Transformation is always applied relative to the currently active selection layer. * * The class operates on a table size defined by the renderable indexes. If the `navigableHeaders` * option is enabled, the table size is increased by the number of row and/or column headers. * Because the headers are treated as cells as part of the table size (indexes always go from 0 to N), * the algorithm can be written as simply as possible (without new if's that distinguish the headers * logic). * * @class BaseTransformation * @private */ export declare class BaseTransformation { #private; /** * Triggers registered local hook callbacks for the given hook name, passing any additional arguments. */ runLocalHooks: (...args: unknown[]) => void; /** * Registers a local hook callback for the given hook name on this transformation instance. */ addLocalHook: (...args: unknown[]) => object; /** * An object containing the table API methods and settings. * * @type {SelectionTableProps} */ tableApi: SelectionTableProps; /** * Initializes the transformation module with the selection range collection and the table API reference. */ constructor(range: SelectionRange, tableApi: SelectionTableProps); /** * Sets the currently active selection layer index. * * @param {number} layerIndex The layer index to set as active. */ setActiveLayerIndex(layerIndex: number): void; /** * Gets the currently active selection layer range. * * @returns {CellRange} */ getCurrentSelection(): CellRange; /** * Selects cell relative to the current cell (if possible). * * @param {number} rowDelta Rows number to move, value can be passed as negative number. * @param {number} colDelta Columns number to move, value can be passed as negative number. * @param {boolean} [createMissingRecords=false] If `true` the new rows/columns will be created if necessary. Otherwise, row/column will * be created according to `minSpareRows/minSpareCols` settings of Handsontable. * @returns {{selectionLayer: number, visualCoords: CellCoords}} Visual coordinates with selection layer after transformation. */ transformStart(rowDelta: number, colDelta: number, createMissingRecords?: boolean): { selectionLayer: number; visualCoords: CellCoords; }; /** * Sets selection end cell relative to the current selection end cell (if possible). * * @param {number} rowDelta Rows number to move, value can be passed as negative number. * @param {number} colDelta Columns number to move, value can be passed as negative number. * @returns {{selectionLayer: number, visualCoords: CellCoords}} Visual coordinates with selection layer after transformation. */ transformEnd(rowDelta: number, colDelta: number): { selectionLayer: number; visualCoords: CellCoords; }; /** * Abstract method that child classes must implement to calculate offset coordinates based on * the current processed selection layer. */ calculateOffset(): { x: number; y: number; }; /** * Abstract method that child classes must implement to provide the count of renderable rows * based on their specific transformation logic. */ countRenderableRows(): number; /** * Abstract method that child classes must implement to provide the count of renderable columns * based on their specific transformation logic. */ countRenderableColumns(): number; /** * Determines whether selection layer switching should occur during transformation. * Child classes can override this method to control the behavior. */ shouldSwitchSelectionLayer(): boolean; }