import { SelectProps as AntSelectProps } from 'antd'; import { LabeledValue } from 'antd/lib/select'; import React, { ReactNode } from 'react'; import { InputFieldError } from '../../../utilities'; type DynamicValue = P extends 'single' ? T | null : T[]; export interface SelectProps | unknown, P extends 'single' | 'multiple' = 'single'> extends Omit, 'onChange' | 'options' | 'labelInValue' | 'optionLabelProp' | 'disabled' | 'size' | 'allowClear' | 'value' | 'mode'> { /** * if `error` property provided, regardless of its value, the error gap is applied to component. */ error?: InputFieldError; /** * pass this prop to only show negative border */ hasError?: boolean; hasErrorMessage?: boolean; height?: number | string; underlined?: boolean; label?: string; labelOffset?: number; labelExtraNode?: ReactNode; labelExtractor?: (item: T) => ReactNode | string; valueExtractor?: (item: T) => string; tagExtractor?: (item: T) => string; disableExtractor?: (item: T) => boolean; options?: T[]; showSearch?: boolean; renderItem?: (item: T, index: number, isActive: boolean) => React.ReactNode; onClickItem?: (value: SelectOption) => void; renderSelectedItem?: (item: T) => React.ReactNode; onChange?: (value?: DynamicValue) => void; onChangeValue?(value: DynamicValue): void; selectedValue?: DynamicValue; value?: DynamicValue; wrapperClassName?: string; disabled?: boolean; allowClear?: boolean; required?: boolean; lang?: 'fa' | 'en'; noContentFoundMessage?: string; labelPosition?: 'vertical' | 'horizontal'; size?: 'small' | 'medium'; footer?: ReactNode; header?: ReactNode; infinite?: SelectInfinite; /** * `selectedValue` has more priority than `value`. if `selectedValue` provided the select component ignores the `value`. */ addonBefore?: ReactNode; addonAfter?: ReactNode; } export declare const SELECT_POPUP_HEIGHT = 200; export type DefaultSelectOption = { label?: ReactNode; value: any; }; type SelectInfinite = { total?: number; fetchNextPage: () => void; hasMore: boolean; }; export type SelectOption = T | null | undefined; export {};