import { InputController } from './inputController'; export type DropdownEntry = { key?: string; value?: string; } | string; /** * Renders and manages the dropdown list used by the `MultiSelectEditor`. * Responsible for rendering checkbox rows and emitting hooks when values change. * * @private * @class DropdownController */ export declare class DropdownController { #private; /** * Internal storage map for local hook callbacks mixed in at runtime. */ _localHooks: Record; /** * Registers a local hook callback for the given key on this controller. */ addLocalHook: (key: string, callback: Function) => this; /** * Removes a specific local hook callback for the given key. */ removeLocalHook: (key: string, callback: Function) => this; /** * Runs all local hook callbacks registered under the given key, passing any extra arguments. */ runLocalHooks: (key: string, ...args: unknown[]) => void; /** * Removes all local hook callbacks registered on this controller. */ clearLocalHooks: () => this; /** * Creates a dropdown renderer attached to the provided container. * * @param {HTMLDivElement} containerElement Host element created by the editor. * @param {string} instanceId Handsontable instance id. */ constructor(containerElement: HTMLDivElement, instanceId: string); /** * Builds required DOM elements and inserts them into the container. */ init(): void; /** * Stores the maximum number of visible rows used when constraining the dropdown's rendered height. */ setVisibleRowsNumberSetting(visibleRowsNumber: number): void; /** * Stores a comparator function applied to the source entries before rendering; pass null to remove sorting. */ setSourceSortFunction(sourceSortFunction: ((entries: DropdownEntry[]) => DropdownEntry[]) | null): void; /** * Shows or hides the search input and separator elements and toggles the input controller's listener. */ setSearchInputVisibility(searchInput?: boolean): void; /** * Populates the dropdown with provided entries and marks selected ones. * * @param {string[]|object[]} entries Collection of primitive values or `[value, label]` tuples. * @param {Array<*>} [checkedValues=[]] Values that should be rendered as checked. */ fillDropdown(entries: DropdownEntry[], checkedValues?: unknown[]): void; /** * Controls dropdown height based on entry count and configured visible rows. * * @param {object} availableSpace Available space object. * @param {boolean} noFlip If true, the dropdown will not be flipped vertically. */ updateDimensions(availableSpace: { spaceAbove: number; spaceBelow: number; cellHeight: number; }, noFlip?: boolean): void; /** * Returns the pixel width of the dropdown list element, or 0 if the list is not yet mounted. */ getDropdownWidth(): number; /** * Unchecks all checkboxes in the dropdown list. */ deselectAllItems(): void; /** * Focuses the first item in the dropdown list if at least one entry exists. */ focusFirstItem(): void; /** * Focuses the dropdown item at the given absolute index. */ focusItem(index: number): void; /** * Moves focus to the previous item, or to the search input when already at the first item. */ focusPreviousItem(): void; /** * Moves focus to the next item in the list, stopping at the last entry. */ focusNextItem(): void; /** * Transfers DOM focus to the search input element. */ focusSearchInput(): void; /** * Clears all dropdown items, resets internal cache state, clears the search input value, and resets container styles. */ reset(): void; /** * Returns true when the dropdown is currently rendered above the edited cell instead of below. */ isFlippedVertically(): boolean; /** * Calculates the total pixel height of the dropdown including the item list and search input wrapper. */ getHeight(maxRowsCalculation?: boolean, outerWidth?: boolean): number; /** * Returns the InputController instance that manages the search input, or null if not yet initialized. */ getInputController(): InputController | null; /** * Removes all list items from the dropdown, unregisters their event listeners, and clears the checkbox listener cache. */ removeAllDropdownItems(): void; /** * Disables all unchecked checkboxes in the dropdown and sets the internal disabled flag. */ disableCheckboxes(): void; /** * Re-enables all checkboxes in the dropdown and clears the internal disabled flag. */ enableCheckboxes(): void; }