import type { HotInstance } from '../core/types'; /** * Manages the browser's focus in the table to achieve correct behavior for screen readers and * IME editors. */ type FocusMode = 'cell' | 'mixed'; /** * Manages browser focus within the grid to ensure correct behavior for keyboard navigation, * screen readers, and IME text composition. */ export declare class FocusGridManager { #private; /** * Initializes the manager with a reference to the Handsontable instance. */ constructor(hotInstance: HotInstance); /** * Registers hooks to track selection changes and apply focus logic based on the configured focus mode. */ init(): void; /** * Checks whether the browser focus currently sits inside the grid's root wrapper or portal. * The state comes from focus events observed within the grid's own DOM tree, so it stays * correct in environments where `document.activeElement` cannot be resolved through foreign * shadow boundaries. * * @returns {boolean} */ hasBrowserFocus(): boolean; /** * Checks whether the given focused element proves that the browser focus left the grid. * Focus counts as foreign when the element is focusable, holds the browser focus, and is * neither a part of the grid or its portal, nor one of the shadow hosts the grid is rendered * within, nor the document body (a click on a non-focusable area keeps the focus where it * was). Sandboxed hosts (e.g. Salesforce Lightning Web Security) hide the real focused * element behind the host chain, so a focused ancestor host cannot prove the focus left the * grid - only an unrelated element can. * * The check mirrors the scope-deactivation rule in the focus scope manager (`scopeManager` * unlistens when a focus event lands outside every scope). Sandboxed hosts retarget the * window-level focus events that rule depends on, so the mouseup path re-applies the same * rule from the deepest reachable focused element. On a regular page both mechanisms agree - * this adds no behavior that the scope manager does not already provide there. * * @param {HTMLElement | null} element The deepest reachable focused element. * @returns {boolean} */ isForeignFocusTarget(element: HTMLElement | null): boolean; /** * Get the current focus mode. * * @returns {'cell' | 'mixed'} */ getFocusMode(): FocusMode; /** * Set the focus mode. * * @param {'cell' | 'mixed'} focusMode The new focus mode. */ setFocusMode(focusMode: FocusMode): void; /** * Get the delay after which the focus will change from the cell elements to the active editor's `TEXTAREA` * element if the focus mode is set to 'mixed'. * * @returns {number} Delay in milliseconds. */ getRefocusDelay(): number; /** * Set the delay after which the focus will change from the cell elements to the active editor's `TEXTAREA` * element if the focus mode is set to 'mixed'. * * @param {number} delay Delay in milliseconds. */ setRefocusDelay(delay: number): void; /** * Set the function to be used as the "refocus element" getter. It should return a focusable HTML element. * * @param {Function} getRefocusElementFunction The refocus element getter. */ setRefocusElementGetter(getRefocusElementFunction: () => HTMLElement): void; /** * Suspend automatic focus management until `resume()` is called. While suspended, an * externally focused element (input, textarea, select, or contenteditable located outside * Handsontable) keeps the browser focus when a programmatic selection is applied, and the * editor textarea is not auto-refocused (`imeFastEdit`). Used by `selectCells()` when * `changeListener` is `false`. Note: an `activeElement` of `
` or an `