import type { default as CellRange } from '../../3rdparty/walkontable/src/cell/range'; import { BasePlugin } from '../base'; export declare const PLUGIN_KEY = "autofill"; export declare const PLUGIN_PRIORITY = 20; /** * This plugin provides "drag-down" and "copy-down" functionalities, both operated using the small square in the right * bottom of the cell selection. * * "Drag-down" expands the value of the selected cells to the neighbouring cells when you drag the small * square in the corner. * * "Copy-down" copies the value of the selection to all empty cells below when you double click the small square. * * @class Autofill * @plugin Autofill */ export declare class Autofill extends BasePlugin { #private; /** * Returns the plugin key used to identify this plugin in Handsontable settings. */ static get PLUGIN_KEY(): string; /** * Returns the priority order used to determine the order in which plugins are initialized. */ static get PLUGIN_PRIORITY(): number; /** * Returns the setting keys that trigger a plugin update when changed via `updateSettings`. */ static get SETTING_KEYS(): string[]; /** * Returns the default settings applied when the plugin is enabled without explicit configuration. */ static get DEFAULT_SETTINGS(): { direction: string | undefined; autoInsertRow: boolean; }; /** * Returns validator functions for each plugin setting to verify their values are valid before applying them. */ static get SETTINGS_VALIDATORS(): { direction: (value: unknown) => boolean; autoInsertRow: (value: unknown) => value is boolean; }; /** * Specifies if adding new row started. * * @private * @type {boolean} */ addingStarted: boolean; /** * Specifies if there was mouse down on the cell corner. * * @private * @type {boolean} */ mouseDownOnCellCorner: boolean; /** * Specifies if mouse was dragged outside Handsontable. * * @private * @type {boolean} */ mouseDragOutside: boolean; /** * Specifies how many cell levels were dragged using the handle. * * @private * @type {boolean} */ handleDraggedCells: number; /** * Specifies allowed directions of drag (`'horizontal'` or '`vertical`'). * * @private * @type {string[]} */ directions: string[]; /** * Specifies if can insert new rows if needed. * * @private * @type {boolean} */ autoInsertRow: boolean; /** * Checks if the plugin is enabled in the Handsontable settings. * * @returns {boolean} */ isEnabled(): boolean; /** * Enables the plugin functionality for this Handsontable instance. */ enablePlugin(): void; /** * Updates the plugin's state. * * This method is executed when [`updateSettings()`](@/api/core.md#updatesettings) is invoked with any of the following configuration options: * - `autofill` * - [`fillHandle`](@/api/options.md#fillhandle) */ updatePlugin(): void; /** * Disables the plugin functionality for this Handsontable instance. */ disablePlugin(): void; /** * Gets selection data. * * @private * @param {boolean} [useSource=false] If `true`, returns copyable source data instead of copyable data. * @returns {object[]} Ranges Array of objects with properties `startRow`, `startCol`, `endRow` and `endCol`. */ getSelectionData(useSource?: boolean): unknown[][]; /** * Try to apply fill values to the area in fill border, omitting the selection border. * * @private * @returns {boolean} Reports if fill was applied. * * @fires Hooks#modifyAutofillRange * @fires Hooks#beforeAutofill * @fires Hooks#afterAutofill */ fillIn(): boolean; /** * Add new row. * * @private */ addRow(): void; /** * Add new rows if they are needed to continue auto-filling values. * * @private */ addNewRowIfNeeded(): void; /** * Get index of last adjacent filled in row. * * @private * @param {Array} cornersOfSelectedCells Indexes of selection corners. * @returns {number} Gives number greater than or equal to zero when selection adjacent can be applied. * Or -1 when selection adjacent can't be applied. */ getIndexOfLastAdjacentFilledInRow(cornersOfSelectedCells: number[]): number | undefined; /** * Adds a selection from the start area to the specific row index. * * @private * @param {Array} selectStartArea Selection area from which we start to create more comprehensive selection. * @param {number} rowIndex The row index into the selection will be added. */ addSelectionFromStartAreaToSpecificRowIndex(selectStartArea: number[], rowIndex: number): void; /** * Sets selection based on passed corners. * * When `sourceRange` is provided, the active cell (`from`) is anchored to the corner * of the merged selection that wasn't extended by the autofill drag. This keeps the * highlight at its pre-fill position instead of flipping to the top-start corner, * matching Google Sheets and Excel behavior. * * @private * @param {Array} cornersOfArea An array witch defines selection. * @param {CellRange} [sourceRange] Pre-fill selection range used to preserve the * original `from` corner orientation. */ setSelection(cornersOfArea: number[], sourceRange?: CellRange): void; /** * Try to select cells down to the last row in the left column and then returns if selection was applied. * * @private * @returns {boolean} */ selectAdjacent(): boolean; /** * Resets selection of dragged area. * * @private */ resetSelectionOfDraggedArea(): void; /** * Redraws borders. * * @private * @param {CellCoords} cellCoords `CellCoords` coord object. */ redrawBorders(cellCoords: { row: number | null; col: number | null; }): void; /** * Get if mouse was dragged outside. * * @private * @param {MouseEvent} event `mousemove` event properties. * @returns {boolean} */ getIfMouseWasDraggedOutside(event: Pick): boolean; /** * Bind the events used by the plugin. * * @private */ registerEvents(): void; /** * Destroys the plugin instance. */ destroy(): void; }