import { ReactElement, RefObject } from 'react';
import { SelectFieldOption, SelectFieldProps } from '../types';
/**
 * Metadata about list sections for rendering purposes.
 * Used by both SelectFieldList and MultiSelectFieldList to render section headers and dividers.
 * @property type - The type of section ("pinned" for pinned options, "group" for grouped options)
 * @property label - Section label (e.g., "Recent", "Favorites", or group name)
 * @property startIndex - Index in downshiftItems where this section starts
 * @property endIndex - Index where this section ends (exclusive)
 * @property loading - Whether this section is still loading its options (pinned sections only)
 */
export type SectionMeta = {
    type: "pinned" | "group";
    label: string;
    startIndex: number;
    endIndex: number;
    loading?: boolean;
};
export type SelectFieldBaseInternalProps = {
    id: string;
    helperUid: string;
    selectedOption: SelectFieldOption | null;
    onSelectedOptionChange: (option: SelectFieldOption | null) => void;
    displayAs: "popover" | "dialog";
    isDisabledOrReadOnly: boolean;
    disabled?: boolean;
    readOnly?: boolean;
    required?: boolean;
    placeholder?: string;
    size?: "small" | "medium" | "large";
    error?: boolean | string | ReactElement | string[];
    hasHelperText: boolean;
    disableClearButton: boolean;
    prefix?: string | ReactElement;
    suffix?: string | ReactElement;
    label: string;
    labelNode?: React.ReactNode;
    hideLabel?: boolean;
    hint?: ReactElement | string;
    errorMessages?: string | ReactElement | string[];
    warning?: string | string[];
    description?: ReactElement | string;
    className?: string;
    style?: React.CSSProperties;
    layoutStyles?: React.CSSProperties;
    pinned?: SelectFieldProps["pinned"];
    groupToString?: (groupValue: string | number) => string;
    groupSorter?: (a: string | number, b: string | number) => number;
    virtualize?: boolean;
    options: SelectFieldOption[];
    loading: boolean;
    loadingMore: boolean;
    hasMore: boolean;
    loadOptions: (searchValue: string, opts?: {
        initial?: boolean;
    }) => Promise<void>;
    loadMore: (searchValue: string) => Promise<void>;
    initialLoad: "immediate" | "open";
    initialLoadPerformed: boolean;
    setInitialLoadPerformed: (val: boolean) => void;
    inputWrapperRef: RefObject<HTMLDivElement>;
};
export type SelectFieldComboboxInternalProps = SelectFieldBaseInternalProps & {
    debounceMs: number;
};
/**
 * Loose prop getter types compatible with both downshift's useCombobox and useSelect.
 * Using `any` for the return types is intentional: the actual runtime shapes are identical
 * between the two hooks, but their compile-time generic types diverge.
 */
export type GetMenuPropsFn = (...args: any[]) => any;
export type GetItemPropsFn = (...args: any[]) => any;
export type GetLabelPropsFn = (...args: any[]) => any;
