import type { HotInstance } from './core/types'; import type { GridSettings } from './core/settings'; import type { CellProperties } from './settings'; import type { default as SelectionManager } from './selection/selection'; import type { BaseEditor } from './editors/baseEditor'; import EventManager from './eventManager'; /** * Manages the lifecycle of cell editors — opening, closing, and delegating keyboard events to * the active editor during user interaction with the grid. */ declare class EditorManager { #private; /** * Instance of {@link Handsontable}. * * @private * @type {Handsontable} */ hot: HotInstance; /** * Reference to an instance's private GridSettings object. * * @private * @type {GridSettings} */ tableMeta: GridSettings; /** * Instance of {@link Selection}. * * @private * @type {Selection} */ selection: SelectionManager; /** * Instance of {@link EventManager}. * * @private * @type {EventManager} */ eventManager: EventManager; /** * Determines if EditorManager is destroyed. * * @private * @type {boolean} */ destroyed: boolean; /** * A reference to an instance of the activeEditor. * * @private * @type {BaseEditor} */ activeEditor: BaseEditor | undefined; /** * Keeps a reference to the cell's properties object. * * @type {object} */ cellProperties: CellProperties; /** * @param {Core} hotInstance The Handsontable instance. * @param {TableMeta} tableMeta The table meta instance. * @param {Selection} selection The selection instance. */ constructor(hotInstance: HotInstance, tableMeta: GridSettings, selection: SelectionManager); /** * Get active editor. * * @returns {BaseEditor} */ getActiveEditor(): BaseEditor | undefined; /** * Prepare text input to be displayed at given grid cell. */ prepareEditor(): void; /** * Check is editor is opened/showed. * * @returns {boolean} */ isEditorOpened(): boolean | undefined; /** * Open editor with initial value. * * @param {null|string} newInitialValue New value from which editor will start if handled property it's not the `null`. * @param {Event} event The event object. * @param {boolean} [enableFullEditMode=false] When true, an editor works in full editing mode. Mode disallows closing an editor * when arrow keys are pressed. */ openEditor(newInitialValue: string | null, event: Event, enableFullEditMode?: boolean): void; /** * Close editor, finish editing cell. * * @param {boolean} restoreOriginalValue If `true`, then closes editor without saving value from the editor into a cell. * @param {boolean} isCtrlPressed If `true`, then editor will save value to each cell in the last selected range. * @param {Function} callback The callback function, fired after editor closing. */ closeEditor(restoreOriginalValue?: boolean, isCtrlPressed?: boolean, callback?: Function): void; /** * Close editor and save changes. * * @param {boolean} isCtrlPressed If `true`, then editor will save value to each cell in the last selected range. */ closeEditorAndSaveChanges(isCtrlPressed?: boolean): void; /** * Close editor and restore original value. * * @param {boolean} isCtrlPressed Indication of whether the CTRL button is pressed. */ closeEditorAndRestoreOriginalValue(isCtrlPressed: boolean): void; /** * Clears reference to an instance of the active editor. * * @private */ clearActiveEditor(): void; /** * Checks if the currently selected cell (pointed by selection highlight coords) is editable. * Editable cell is when: * - the cell has defined an editor type; * - the cell is not marked as read-only; * - the cell is not hidden. * * @private * @returns {boolean} */ isCellEditable(): boolean; /** * Controls selection's behavior after clicking `Enter`. * * @private * @param {KeyboardEvent} event The keyboard event object. */ moveSelectionAfterEnter(event: KeyboardEvent): void; /** * Destroy the instance. */ destroy(): void; } export default EditorManager;