import type { HotInstance } from '../../core/types'; import type { CellProperties } from '../../settings'; import { BaseEditor } from '../baseEditor'; import EventManager from '../../eventManager'; export declare const EDITOR_TYPE = "text"; /** * @private * @class TextEditor */ export declare class TextEditor extends BaseEditor { /** * Returns the unique editor type identifier for the text editor. */ static get EDITOR_TYPE(): string; /** * Instance of {@link EventManager}. * * @private * @type {EventManager} */ eventManager: EventManager; /** * Autoresize instance. Automagically resizes editor after changes. * * @private * @type {Function} */ autoResize: { init: (elementToObserve: HTMLElement, config: Record, doObserve?: boolean) => void; resize: () => void; unObserve(): void; }; /** * An TEXTAREA element. * * @private * @type {HTMLTextAreaElement} */ TEXTAREA: HTMLTextAreaElement | HTMLInputElement; /** * Style declaration object of the TEXTAREA element. * * @private * @type {CSSStyleDeclaration} */ textareaStyle: CSSStyleDeclaration; /** * Parent element of the TEXTAREA. * * @private * @type {HTMLDivElement} */ TEXTAREA_PARENT: HTMLElement; /** * Style declaration object of the TEXTAREA_PARENT element. * * @private * @type {CSSStyleDeclaration} */ textareaParentStyle: CSSStyleDeclaration; /** * Z-index class style for the editor. * * @private * @type {string} */ layerClass: string; /** * @param {Core} hotInstance The Handsontable instance. */ constructor(hotInstance: HotInstance); /** * Gets current value from editable element. * * @returns {number} */ getValue(): unknown; /** * Sets new value into editable element. * * @param {*} newValue The editor value. */ setValue(newValue?: unknown): void; /** * Opens the editor and adjust its size. */ open(): void; /** * Closes the editor. */ close(): 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; /** * Begins editing on a highlighted cell and hides fillHandle corner if was present. * * @param {*} newInitialValue The editor initial value. * @param {Event} event The keyboard event object. */ beginEditing(newInitialValue?: unknown, event?: Event): void; /** * Sets focus state on the select element. */ focus(): void; /** * Creates an editor's elements and adds necessary CSS classnames. * * @param {string} type The type of the element to create. */ createElements(type?: string): void; /** * Moves an editable element out of the viewport, but element must be able to hold focus for IME support. * * @private */ hideEditableElement(): void; /** * Resets an editable element position. * * @private */ showEditableElement(): void; /** * Refreshes editor's value using source data. * * @private */ refreshValue(): void; /** * Refreshes editor's size and position. * * @private * @param {boolean} force Indicates if the refreshing editor dimensions should be triggered. */ refreshDimensions(force?: boolean): void; /** * Binds events and hooks. * * @private */ bindEvents(): void; /** * Destroys the internal event manager and clears attached hooks. * * @private */ destroy(): void; /** * Register shortcuts responsible for handling editor. * * @private */ registerShortcuts(): void; /** * Unregister shortcuts responsible for handling editor. * * @private */ unregisterShortcuts(): void; }