import type { HotInstance } from '../../core/types'; import type { CellProperties } from '../../settings'; export declare const EDITOR_TYPE = "base"; export declare const EDITOR_STATE: Readonly<{ VIRGIN: "STATE_VIRGIN"; EDITING: "STATE_EDITING"; WAITING: "STATE_WAITING"; FINISHED: "STATE_FINISHED"; }>; /** * @class BaseEditor */ export declare class BaseEditor { #private; /** * Returns the unique editor type identifier for the base editor. */ static get EDITOR_TYPE(): string; /** * A reference to the source instance of the Handsontable. * * @type {Handsontable} */ hot: HotInstance; /** * Editor's state. * * @type {string} */ state: string; /** * Flag to store information about editor's opening status. * * @private * * @type {boolean} */ _opened: boolean; /** * Defines the editor's editing mode. When false, then an editor works in fast editing mode. * * @private * * @type {boolean} */ _fullEditMode: boolean; /** * Callback to call after closing editor. * * @type {Function} */ _closeCallback: ((result: boolean) => void) | null; /** * Flag to specify if the editor should be closed after data change. * * @type {boolean} */ _closeAfterDataChange: boolean; /** * Currently rendered cell's TD element. * * @type {HTMLTableCellElement} */ TD: HTMLTableCellElement | null; /** * Visual row index. * * @type {number} */ row: number | null; /** * Visual column index. * * @type {number} */ col: number | null; /** * Column property name or a column index, if datasource is an array of arrays. * * @type {number|string} */ prop: number | string | null; /** * Original cell's value. * * @type {*} */ originalValue: unknown; /** * Object containing the cell's properties. * * @type {object} */ cellProperties: CellProperties; /** * Internal storage map for hook callbacks registered on this editor instance. */ _hooksStorage: Record; /** * Registers a hook callback for the given hook name on this editor instance. */ addHook: (...args: unknown[]) => unknown; /** * Removes all hook callbacks registered under the given key on this editor instance. */ removeHooksByKey: (...args: unknown[]) => unknown; /** * Removes all hook callbacks registered on this editor instance. */ clearHooks: (...args: unknown[]) => unknown; /** * @param {Handsontable} hotInstance A reference to the source instance of the Handsontable. */ constructor(hotInstance: HotInstance); /** * Fires callback after closing editor. * * @private * @param {boolean} result The editor value. */ _fireCallbacks(result: boolean): void; /** * Initializes an editor's intance. */ init(): void; /** * Required method to get current value from editable element. */ getValue(): unknown; /** * Required method to set new value into editable element. */ setValue(_value?: unknown): void; /** * Required method to open editor. */ open(_event?: Event): void; /** * Required method to close editor. */ close(): void; /** * Required method to focus editor. */ focus(): void; /** * Prepares editor's meta data. * * @param {number} row The visual row index. * @param {number} col The visual column index. * @param {number|string} prop The column property (passed when datasource is an array of objects). * @param {HTMLTableCellElement} td The rendered cell element. * @param {*} value The rendered value. * @param {object} cellProperties The cell meta object (see {@link Core#getCellMeta}). */ prepare(row: number, col: number, prop: string | number, td: HTMLTableCellElement, value: unknown, cellProperties: CellProperties): void; /** * Fallback method to provide extendable editors in ES5. * * @returns {Function} */ extend(): unknown; /** * Saves value from editor into data storage. * * @param {*} value The editor value. * @param {boolean} ctrlDown If `true`, applies value to each cell in the last selected range. */ saveValue(value: unknown, ctrlDown?: boolean): void; /** * Begins editing on a highlighted cell and hides fillHandle corner if was present. * * @param {*} newInitialValue The initial editor value. * @param {Event} event The keyboard event object. */ beginEditing(newInitialValue?: unknown, event?: Event): void; /** * Finishes editing and start saving or restoring process for editing cell or last selected range. * * @param {boolean} restoreOriginalValue If true, then closes editor without saving value from the editor into a cell. * @param {boolean} ctrlDown If true, then saveValue will save editor's value to each cell in the last selected range. * @param {Function} callback The callback function, fired after editor closing. */ finishEditing(restoreOriginalValue?: boolean, ctrlDown?: boolean, callback?: Function): void; /** * Finishes editing without saving value. */ cancelChanges(): void; /** * Verifies result of validation or closes editor if user's cancelled changes. * * @param {boolean|undefined} result If `false` and the cell using allowInvalid option, * then an editor won't be closed until validation is passed. */ discardEditor(result?: boolean): void; /** * Switch editor into full edit mode. In this state navigation keys don't close editor. This mode is activated * automatically after hit ENTER or F2 key on the cell or while editing cell press F2 key. */ enableFullEditMode(): void; /** * Checks if editor is in full edit mode. * * @returns {boolean} */ isInFullEditMode(): boolean; /** * Returns information whether the editor is open. * * @returns {boolean} */ isOpened(): boolean; /** * Refreshes the editor's value from the source data. Overridden in editors that support it. */ refreshValue?(): void; /** * Returns information whether the editor is waiting, eg.: for async validation. * * @returns {boolean} */ isWaiting(): boolean; /** * Gets the object that provides information about the edited cell size and its position * relative to the table viewport. * * The rectangle has six integer properties: * - `top` The top position relative to the table viewport * - `start` The left (or right in RTL) position relative to the table viewport * - `width` The cell's current width; * - `maxWidth` The maximum cell's width after which the editor goes out of the table viewport * - `height` The cell's current height; * - `maxHeight` The maximum cell's height after which the editor goes out of the table viewport * * @returns {{top: number, start: number, width: number, maxWidth: number, height: number, maxHeight: number} | undefined} */ getEditedCellRect(): { top: number; start: number; width: number; maxWidth: number; height: number; maxHeight: number; } | undefined; /** * Gets className of the edited cell if exist. * * @returns {string} */ getEditedCellsLayerClass(): string; /** * Gets HTMLTableCellElement of the edited cell if exist. * * @returns {HTMLTableCellElement|null} */ getEditedCell(): HTMLTableCellElement | null; /** * Returns name of the overlay, where editor is placed. * * @private * @returns {string} */ checkEditorSection(): string; }