import type { HotInstance } from '../../../core/types'; import { LinkedPhysicalIndexToValueMap as IndexToValueMap } from '../../../translations'; /** * @private * @class BaseComponent */ export declare class BaseComponent { /** * The Handsontable instance. * * @type {Core} */ hot: HotInstance | null; /** * The component uniq id. * * @type {string} */ id: string; /** * List of registered component UI elements. * * @type {Array} */ elements: unknown[]; /** * Flag which determines if element is hidden. * * @type {boolean} */ hidden: boolean; /** * The component states id. * * @type {string} */ stateId: string; /** * Index map which stores component states for each column. * * @type {LinkedPhysicalIndexToValueMap|null} */ state: IndexToValueMap | null; /** * Initializes the filter component with a Handsontable instance, assigns the component ID, and optionally registers a column index map for stateful components. */ constructor(hotInstance: HotInstance, { id, stateless }: { id: string; stateless?: boolean; }); /** * Gets the list of elements from which the component is built. * * @returns {BaseUI[]} */ getElements(): unknown[]; /** * Reset elements to its initial state. */ reset(): void; /** * Hide component. */ hide(): void; /** * Show component. */ show(): void; /** * Check if component is hidden. * * @returns {boolean} */ isHidden(): boolean; /** * Restores the component state from the given physical column index. The method * internally calls the `setState` method. The state then is individually processed * by each component. * * @param {number} physicalColumn The physical column index. */ restoreState(physicalColumn: number): void; /** * The custom logic for component state restoring. */ setState(_value?: unknown): void; /** * Saves the component state to the given physical column index. The method * internally calls the `getState` method, which returns the current state of * the component. * * @param {number} physicalColumn The physical column index. */ saveState(physicalColumn: number): void; /** * The custom logic for component state gathering (for stateful components). */ getState(): Record | string; /** * Returns the menu item descriptor for this component (used to add it to the dropdown menu). * * @returns {object} */ getMenuItemDescriptor(): Record; /** * Destroy element. */ destroy(): void; } export interface BaseComponent { addLocalHook(key: string, callback: Function): this; removeLocalHook(key: string, callback: Function): this; runLocalHooks(key: string, ...args: unknown[]): void; clearLocalHooks(): this; }