import type { HotInstance } from '../../core/types'; import type { CellProperties } from '../../settings'; import { TextEditor } from '../textEditor'; export declare const EDITOR_TYPE = "handsontable"; /** * @private * @class HandsontableEditor */ export declare class HandsontableEditor extends TextEditor { /** * Returns the unique editor type identifier for the Handsontable editor. */ static get EDITOR_TYPE(): string; /** * The internal Handsontable instance used as the editor's dropdown. * * @type {Core} */ htEditor: HotInstance; /** * The container element for the internal Handsontable instance. * * @type {HTMLElement} */ htContainer: HTMLElement; /** * The options object for the internal Handsontable instance. * * @type {object} */ htOptions: 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; /** * The flag determining if the editor is flipped vertically (rendered on * the top of the edited cell) or not. * * @type {boolean} */ isFlippedVertically: boolean; /** * The flag determining if the editor is flipped horizontally (rendered on * the inline start of the edited cell) or not. * * @type {boolean} */ isFlippedHorizontally: boolean; /** * Opens the editor and adjust its size. */ open(): void; /** * Closes the editor. */ close(): void; /** * Prepares editor's meta data and configuration of the internal Handsontable's instance. * * @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; /** * Begins editing on a highlighted cell and hides fillHandle corner if was present. * * @param {*} newInitialValue The editor initial value. * @param {*} event The keyboard event object. */ beginEditing(newInitialValue?: unknown, event?: Event): void; /** * Creates an editor's elements and adds necessary CSS classnames. */ createElements(): 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?: () => void): void; /** * Calculates the space above and below the editor and flips it vertically if needed. * * @private * @returns {{ isFlipped: boolean, spaceAbove: number, spaceBelow: number}} */ flipDropdownVerticallyIfNeeded(): { isFlipped: boolean; spaceAbove: number; spaceBelow: number; }; /** * Adjusts the editor's container to flip vertically, positioning it from * the bottom to the top of the edited cell. * * @private */ flipDropdownVertically(): void; /** * Adjusts the editor's container to unflip vertically, positioning it from * the top to the bottom of the edited cell. * * @private */ unflipDropdownVertically(): void; /** * Calculates the space above and below the editor and flips it vertically if needed. * * @private * @returns {{ isFlipped: boolean, spaceInlineStart: number, spaceInlineEnd: number}} */ flipDropdownHorizontallyIfNeeded(): { isFlipped: boolean; spaceInlineStart: number; spaceInlineEnd: number; }; /** * Adjusts the editor's container to flip horizontally, positioning it from * the inline end (right) to the inline start (left) of the edited cell. * * @private */ flipDropdownHorizontally(): void; /** * Adjusts the editor's container to unflip horizontally, positioning it from * the inline start (left) to the inline end (right) of the edited cell. * * @private */ unflipDropdownHorizontally(): void; /** * Return the DOM height of the editor's container. * * @returns {number} */ getDropdownHeight(): number; /** * Return the DOM width of the editor's container. * * @returns {number} */ getDropdownWidth(): number; /** * Calculates the proposed/target editor width that should be set once the editor is opened. * The method may be overwritten in the child class to provide a custom size logic. * * @returns {number} */ getTargetDropdownWidth(): number; /** * Calculates the proposed/target editor height that should be set once the editor is opened. * The method may be overwritten in the child class to provide a custom size logic. * * @returns {number} */ getTargetDropdownHeight(): number; /** * Assigns afterDestroy callback to prevent memory leaks. * * @private */ assignHooks(): void; /** * Register shortcuts responsible for handling editor. * * @private */ registerShortcuts(): void; /** * Unregister shortcuts responsible for handling editor. * * @private */ unregisterShortcuts(): void; }