import type CellCoords from '../cell/coords'; import type CellRange from '../cell/range'; /** * The Selection class allows highlighting (by applying CSS class) the table's cells or headers * and setting up the borders if defined in the settings. * * The Selection coordinates may point to the cells (positive numbers) or headers (negative numbers). * * @class Selection */ declare class Selection { /** * @type {Record} */ settings: Record; /** * @type {CellRange | null} */ cellRange: CellRange | null; /** * @type {Record} */ _localHooks: Record; /** * Adds a local hook callback to the hooks registry. * @param {string} key - The hook key identifier. * @param {(...args: unknown[]) => void} callback - The callback function to register. * @returns {this} */ addLocalHook: (key: string, callback: (...args: unknown[]) => void) => this; /** * Removes a local hook callback from the hooks registry. * @param {string} key - The hook key identifier. * @param {Function} callback - The callback function to unregister. * @returns {this} */ removeLocalHook: (key: string, callback: Function) => this; /** * Runs all local hook callbacks registered for the given key. * @param {string} key - The hook key identifier. * @param {...unknown[]} args - Arguments to pass to the hook callbacks. */ runLocalHooks: (key: string, ...args: unknown[]) => void; /** * Clears all local hooks from the registry. * @returns {this} */ clearLocalHooks: () => this; /** * @param {object} settings The selection settings object. @todo type. * @param {CellRange} cellRange The cell range instance. */ constructor(settings: Record, cellRange?: CellRange | null); /** * Checks if selection is empty. * * @returns {boolean} */ isEmpty(): boolean; /** * Adds a cell coords to the selection. * * @param {CellCoords} coords The cell coordinates to add. * @returns {Selection} */ add(coords: CellCoords): this; /** * If selection range from or to property equals oldCoords, replace it with newCoords. Return boolean * information about success. * * @param {CellCoords} oldCoords An old cell coordinates to replace. * @param {CellCoords} newCoords The new cell coordinates. * @returns {boolean} */ replace(oldCoords: CellCoords, newCoords: CellCoords): boolean; /** * Clears selection. * * @returns {Selection} */ clear(): this; /** * Returns the top left (or top right in RTL) and bottom right (or bottom left in RTL) selection coordinates. * * @returns {number[]} Returns array of coordinates for example `[1, 1, 5, 5]`. */ getCorners(): [number, number, number, number]; /** * Destroys the instance. */ destroy(): void; } export default Selection;