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'; export declare const SELECTION_TYPE_UNRECOGNIZED = 0; export declare const SELECTION_TYPE_EMPTY = 1; export declare const SELECTION_TYPE_ARRAY = 2; export declare const SELECTION_TYPE_OBJECT = 3; export declare const SELECTION_TYPES: number[]; /** * Detect selection schema structure. * * @param {*} selectionRanges The selected range or and array of selected ranges. This type of data is produced by * `hot.getSelected()`, `hot.getSelectedLast()`, `hot.getSelectedRange()` * and `hot.getSelectedRangeLast()` methods. * @param {symbol} _callSymbol The symbol object which indicates source of the helper invocation. * @returns {number} Returns a number that specifies the type of detected selection schema. If selection schema type * is unrecognized than it returns `0`. */ export declare function detectSelectionType(selectionRanges: unknown, _callSymbol?: symbol): number; interface NormalizeOptions { createCellCoords: (row: number, col: number) => CellCoords; createCellRange: (highlight: CellCoords, from: CellCoords, to: CellCoords) => CellRange; keepDirection?: boolean; propToCol?: (prop: string | number) => number; } /** * Factory function designed for normalization data schema from different data structures of the selection ranges. * * @param {number} type Selection type which will be processed. * @param {object} options The normalization options. * @param {function(number, number): CellCoords} options.createCellCoords The factory function that returns an instance of the `CellCoords` class. * @param {function(CellCoords, CellCoords, CellCoords): CellRange} options.createCellRange The factory function that returns an instance of the `CellRange` class. * @param {boolean} [options.keepDirection=false] If `true`, the coordinates which contain the direction of the * selected cells won't be changed. Otherwise, the selection will be * normalized to values starting from top-left to bottom-right. * @param {Function} [options.propToCol] Pass the converting function (usually `datamap.propToCol`) if the column * defined as props should be normalized to the numeric values. * @returns {number[]} Returns normalized data about selected range as an array (`[rowStart, columnStart, rowEnd, columnEnd]`). */ export declare function normalizeSelectionFactory(type: number, { createCellCoords, createCellRange, keepDirection, propToCol, }?: NormalizeOptions): (selection: unknown) => CellRange; /** * Function transform selection ranges (produced by `hot.getSelected()` and `hot.getSelectedRange()`) to normalized * data structure. It merges repeated ranges into consecutive coordinates. The returned structure * contains an array of arrays. The single item contains at index 0 visual column index from the selection was * started and at index 1 distance as a count of selected columns. * * @param {Core} hotInstance The Handsontable instance. * @returns {Array[]} Returns an array of arrays with ranges defines in that schema: * `[[visualColumnStart, distance], [visualColumnStart, distance], ...]`. * The column distances are always created starting from the left (zero index) to the * right (the latest column index). */ export declare function transformSelectionToColumnDistance(hotInstance: HotInstance): number[][]; /** * Function transform selection ranges (produced by `hot.getSelected()` and `hot.getSelectedRange()`) to normalized * data structure. It merges repeated ranges into consecutive coordinates. The returned structure * contains an array of arrays. The single item contains at index 0 visual column index from the selection was * started and at index 1 distance as a count of selected columns. * * @param {Core} hotInstance The Handsontable instance. * @returns {Array[]} Returns an array of arrays with ranges defines in that schema: * `[[visualColumnStart, distance], [visualColumnStart, distance], ...]`. * The column distances are always created starting from the left (zero index) to the * right (the latest column index). */ export declare function transformSelectionToRowDistance(hotInstance: HotInstance): number[][]; export {};