/// import { States } from '../../core/types'; import { ListBoxProps } from 'react-aria-components'; import type { Key as AriaKey } from 'react-aria-components'; export interface DropdownOption { id: AriaKey; label: string; value?: T; disabled?: boolean; color?: string; icon?: string; groupName?: string; } type CommonDropdownPillProps = { options?: DropdownOption[]; placeholder?: string; title?: string; supportTitle?: string; leftIcon?: React.ReactNode; rightIcon?: React.ReactNode; rightChild?: React.ReactNode; onLeftIconHover?: (e: React.MouseEvent) => void; onRightIconHover?: (e: React.MouseEvent) => void; onCreateOption?: (str: string) => void; onClear?: () => void; isRequired?: boolean; disabled?: boolean; errorMessage?: string; className?: string; style?: React.CSSProperties; state?: States; isSmall?: boolean; isPill?: boolean; containerProps?: React.HTMLAttributes; menuProps?: Omit, 'children' | 'items' | 'selectedKeys' | 'disabledKeys'>; }; export type SingleSelectProps = { value?: AriaKey; onChange?: (value: T, option?: DropdownOption) => void; } & CommonDropdownPillProps; export type MultiSelectProps = { value?: AriaKey[]; onChange?: (values: T[], options?: DropdownOption[]) => void; } & CommonDropdownPillProps; export type DropdownPillProps = SingleSelectProps | MultiSelectProps; /** * A helper function to tell if the component should be in single-select or multi-select mode. * Also, the TS engine will understand whether the argument of onChange is a single value or an array, * by looking at the props.value type. That's why we can use props.onChange easily after isMulti check in callOnChangeWithKeys fn. */ export declare function isMultiSelectProps(props: DropdownPillProps): props is MultiSelectProps; export {};