import type { ComponentChild, JSX } from 'preact';
import type { FieldChildProps } from '../Field/Field.types';
export interface SelectItem {
    disabled?: boolean;
    icon?: JSX.Element;
    id: string;
    name: string;
    description?: string;
    selectedOptionName?: string;
    className?: string;
}
export interface AddressSpecificSelectItem extends SelectItem {
    text?: string;
    type?: string;
    addressAmount?: string;
    highlight?: string;
}
interface BaseSelectProps extends Partial<FieldChildProps> {
    filterable?: boolean | 'prefiltered';
    isInvalid?: boolean;
    items: ReadonlyArray<SelectItem>;
    excludedValues?: ReadonlyArray<SelectItem>;
    name: string;
    'aria-label'?: string;
    placeholder?: string;
    readonly?: boolean;
    enableTracking?: boolean;
    maxVisibleItems?: number;
    getSearchItem?: (item: SelectItem) => ComponentChild;
    onBlur?: (e: FocusEvent) => void;
    /** toggles minimal styling, useful for when embedded in an {@link InputGroup} */
    minimal?: boolean;
    /**
     * The props below are pertinent mainly to {@link SearchAddress}
     */
    text?: string;
    setText?: (text: string) => void;
    behaviour?: 'textIsData' | 'textIsFilter';
    showList?: boolean;
    setShowList?: (showList: boolean) => void;
    loading?: boolean;
}
interface SingleSelectOnChangeTarget {
    value: string;
    name: string;
}
interface MultiSelectOnChangeTarget {
    value: string[];
    name: string;
}
export interface SingleSelectOnChangeProps {
    target: SingleSelectOnChangeTarget;
}
export interface MultiSelectOnChangeProps {
    target: MultiSelectOnChangeTarget;
}
interface SingleSelectProps extends BaseSelectProps {
    isMulti?: false;
    /**
     * can either define a selected {@link SelectItem}
     * or a `string` id, in which case we will fish through `items` to find the item with the matching id
     */
    selected: SelectItem | string | undefined;
    /** @deprecated use {@link SingleSelectProps.onSelect} instead */
    onChange?: (e: SingleSelectOnChangeProps) => void;
    onSelect?: (selected: SelectItem) => void;
}
interface MultiSelectProps extends BaseSelectProps {
    isMulti: true;
    /**
     * can either define selected {@link SelectItem}s
     * or `string` ids, in which case we will fish through `items` to find items with the matching ids
     */
    selected: SelectItem[] | string[] | undefined;
    /** @deprecated use {@link MultiSelectProps.onSelect} instead */
    onChange?: (e: MultiSelectOnChangeProps) => void;
    onSelect?: (selected: SelectItem[]) => void;
}
export type SelectProps = SingleSelectProps | MultiSelectProps;
export {};
