import type { CellProperties } from '../../settings'; import { HandsontableEditor } from '../handsontableEditor'; export declare const EDITOR_TYPE = "autocomplete"; type ChoiceArray = unknown[]; /** * @private * @class AutocompleteEditor */ export declare class AutocompleteEditor extends HandsontableEditor { #private; /** * Returns the unique editor type identifier for the autocomplete editor. */ static get EDITOR_TYPE(): string; /** * Query string to turn available values over. * * @type {string} */ query: string | null; /** * Contains stripped choices. * * @type {string[]} */ strippedChoices: ChoiceArray; /** * Contains raw choices. * * @type {Array} */ rawChoices: ChoiceArray; /** * Gets current value from editable element. * * @returns {string} */ getValue(): unknown; /** * Creates an editor's elements and adds necessary CSS classnames. */ createElements(): void; /** * Prepares editor's metadata 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; /** * Opens the editor and adjust its size and internal Handsontable's instance. */ open(): void; /** * Closes the editor. */ close(): 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; /** * Prepares choices list based on applied argument. * * @param {string} query The query. */ queryChoices(query: string): void; /** * Updates list of the possible completions to choose. * * @param {Array} choicesList The choices list to process. */ updateChoicesList(choicesList: ChoiceArray): 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; }; /** * Checks if the internal table should generate scrollbar or could be rendered without it. * * @private * @param {number} spaceAvailable The free space as height defined in px available for dropdown list. */ limitDropdownIfNeeded(spaceAvailable: number): void; /** * Updates width and height of the internal Handsontable's instance. * * @private */ updateDropdownDimensions(): void; /** * Sets new height of the internal Handsontable's instance. * * @private * @param {number} height The new dropdown height. */ setDropdownHeight(height: number): void; /** * Creates new selection on specified row index, or deselects selected cells. * * @private * @param {number|undefined} index The visual row index. */ highlightBestMatchingChoice(index: number | undefined): void; /** * 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} */ getTargetEditorHeight(): 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} */ getTargetEditorWidth(): number; /** * Sanitizes value from potential dangerous tags. * * @private * @param {string} value The value to sanitize. * @returns {string} */ stripValueIfNeeded(value: unknown): unknown; /** * Sanitizes an array of the values from potential dangerous tags. * * @private * @param {string[]} values The value to sanitize. * @returns {Array} */ stripValuesIfNeeded(values: unknown[]): unknown[]; /** * OnBeforeKeyDown callback. * * @private * @param {KeyboardEvent} event The keyboard event object. */ onBeforeKeyDown(event: KeyboardEvent): void; } export {};