import { Placement, InputGroupProps } from '@chakra-ui/react';
declare type SelectProps<OptionItem extends object | string> = ({
    multiple?: false;
    options: OptionItem[];
    placeholder?: string;
    placement?: Placement;
    disabled?: boolean;
    isLoading?: boolean;
    onChange?: (selected: OptionItem | undefined) => void;
    value?: OptionItem;
    itemToString?: (item: OptionItem) => string;
    renderLabel?: (item: OptionItem) => JSX.Element;
} & Omit<InputGroupProps, 'onChange'>) | ({
    multiple: true;
    options: OptionItem[];
    placeholder?: string;
    placement?: Placement;
    disabled?: boolean;
    isLoading?: boolean;
    onChange?: (selected: OptionItem[] | undefined) => void;
    value?: OptionItem[];
    itemToString?: (item: OptionItem) => string;
    renderLabel?: (item: OptionItem) => JSX.Element;
} & Omit<InputGroupProps, 'onChange'>);
/**
 *
 * usage
 * 1. single select
 * 單選時 value, onChange 的參數不是 Array，是單一的 option
 * ```
 * const options = ['a','b','c']
 * <Select
 *  options={options}
 *  value={options[0]}
 *  onChange={option => console.log(option)}
 * />
 * ```
 * 2. multiple select
 * 多選時 value, onChange 的參數都是 Array, options
 * ```
 * const options = ['a','b','c']
 * <Select
 *  multiple // 必傳
 *  options={options}
 *  value={[options[0]]}
 *  onChange={options => console.log(options)}
 * />
 * ```
 * 3. object option
 * 當 option 是 object 時，必須傳入`itemToString`
 * `itemToString` 需要回傳 option 的唯一識別值，用來當作 key, 判斷異同用等等用
 * ```
 * const options = [{name: 'a'}, {name: 'b'}, {name: 'c'}]
 * <Select
 *  options={options}
 *  value={options[0]}
 *  onChange={options => console.log(options)}
 *  itemToString={option => option.name} // 必傳
 *  // renderLabel={option => option.name} 可傳入 `renderLabel` 來根據 option  render 選項文字｀
 * />
 * ```
 */
declare const Select: <OptionItem extends string | object>(props: SelectProps<OptionItem>) => JSX.Element;
export default Select;
