import type { SpectrumTextFieldProps } from '@adobe/react-spectrum'; import { type KeyedItem } from '@deephaven/utils'; import type { DOMRefValue } from '@react-types/shared'; /** * Creates validation props for a Spectrum field. If `isValid` is true, returns * empty props. If false, returns { errorMessage, validationState: 'invalid' } * @param isValid Whether props represent valid state * @param errorMessage Error message in the case `isValid` is false */ export declare function createValidationProps(isValid: boolean, errorMessage: string): Pick; /** * Extract DOM node from React Spectrum component ref. * @param ref */ export declare function extractSpectrumHTMLElement(ref: DOMRefValue | null): HTMLElement | null; /** * Extract lastElementChild from DOM element for given React Spectrum component * ref. * @param ref */ export declare function extractSpectrumLastChildHTMLElement(ref: DOMRefValue | null): HTMLElement | null; /** * Find the popover associated with a given Spectrum ComboBox ref. * @param ref The ref to the Spectrum ComboBox component */ export declare function findSpectrumComboBoxScrollArea(ref: DOMRefValue | null): HTMLElement | null; /** * Find the popover associated with a given Spectrum Picker ref. * @param ref The ref to the Spectrum Picker component */ export declare function findSpectrumPickerScrollArea(ref: DOMRefValue | null): HTMLElement | null; /** * Find the popover associated with a given Spectrum component ref. * @param ref The ref to the Spectrum component * @param triggerElementType The type of element that triggers the popover */ export declare function findSpectrumPopoverScrollArea(ref: DOMRefValue | null, triggerElementType: K): HTMLElement | null; /** * Get the position of a selected item in a list of keyed items. The position is * based on the index, item height, and top offset. * @param keyedItems The list of keyed items * @param itemHeight The height of each item * @param selectedKey The key of the selected item * @param topOffset The offset from the top of the list (e.g. if there is top * padding surrounding the entire list) */ export declare function getPositionOfSelectedItem({ keyedItems, itemHeight, selectedKey, topOffset, }: { keyedItems: KeyedItem<{ key?: TKey; }, TKey>[]; itemHeight: number; selectedKey: TKey | null | undefined; topOffset: number; }): Promise; /** * Returns the given object if it is an HTMLElement. Otherwise returns null. * @param maybeHTMLElement */ export declare function identityExtractHTMLElement(maybeHTMLElement: T): HTMLElement | null; //# sourceMappingURL=SpectrumUtils.d.ts.map