import type { HotInstance } from '../../../core/types'; import { BaseComponent } from './_base'; import { InputUI } from '../ui/input'; import { SelectUI } from '../ui/select'; import type { BaseUI } from '../ui/_base'; interface ConditionDescriptor { key?: string; name?: string; inputsCount?: number; [key: string]: unknown; } /** * @private * @class ConditionComponent */ export declare class ConditionComponent extends BaseComponent { #private; /** * Narrowed element list — ConditionComponent only ever holds SelectUI and InputUI instances. */ elements: BaseUI[]; /** * The name of the component. * * @type {string} */ name: string | (() => string); /** * @type {boolean} */ addSeparator: boolean; /** * Initializes the condition component with the given ID, display name, separator flag, and optional menu container. */ constructor(hotInstance: HotInstance, options: { id: string; name: string | (() => string); addSeparator: boolean; menuContainer?: HTMLElement; }); /** * Register all necessary hooks. * * @private */ registerHooks(): void; /** * Set state of the component. * * @param {object} value State to restore. */ setState(value?: { command: ConditionDescriptor; args: unknown[]; }): void; /** * Export state of the component (get selected filter and filter arguments). * * @returns {object} Returns object where `command` key keeps used condition filter and `args` key its arguments. */ getState(): { command: ConditionDescriptor; args: unknown[]; }; /** * Update state of component. * * @param {object} condition The condition object. * @param {object} condition.command The command object with condition name as `key` property. * @param {Array} condition.args An array of values to compare. * @param {number} column Physical column index. */ updateState(condition: { name: string; args: unknown[]; } | null, column: number): void; /** * Get select element. * * @returns {SelectUI} */ getSelectElement(): SelectUI; /** * Get input element. * * @param {number} index Index an array of elements. * @returns {InputUI} */ getInputElement(index?: number): InputUI; /** * Get input elements. * * @returns {Array} */ getInputElements(): InputUI[]; /** * Get menu object descriptor. * * @returns {object} */ getMenuItemDescriptor(): { key: string; name: string | (() => string); isCommand: boolean; disableSelection: boolean; hidden: () => boolean; renderer: (hot: HotInstance, wrapper: HTMLTableCellElement, row: number, col: number, prop: string | number, value: string) => HTMLTableCellElement; }; /** * Reset elements to their initial state. */ reset(): void; } export {};