import { DataSourceState, IEditable, IHasCaption, IHasRawProps, IModal, PickerBaseOptions, PickerBaseProps, PickerFooterProps, DataRowProps, SortingOption } from '@epam/uui-core'; import { Dispatch, ReactNode, SetStateAction } from 'react'; export interface UsePickerInputStateProps extends UsePickerStateProps { } export interface PickerInputState extends PickerState { opened: boolean; setOpened: Dispatch>; isSearchChanged: boolean; setIsSearchChanged: Dispatch>; } export interface UsePickerStateProps { dataSourceState?: Partial; } export interface PickerState { dataSourceState: DataSourceState; setDataSourceState: Dispatch>; showSelected: boolean; setShowSelected: Dispatch>; } export type PickerListBaseProps = PickerBaseProps & { /** * Number of default items to show initially, when nothing is selected. * @default 10 */ maxDefaultItems?: number; /** * Maximum total number of items to show, including selected * @default 50 */ maxTotalItems?: number; /** * Ids of items to show first. * If not specified, top props.maxDefaultItems will be shown according to the DataSource sorting settings (default is 10) */ defaultIds?: TId[]; /** If provided, top picks will be automatically adjusted based on last user selection, and stored as user setting under provided key */ settingsKey?: string; sortBy?(item: TItem, sorting: SortingOption): string; /** Render callback for list row. * For modal row, use renderRow prop. * * If omitted, PickerListRow component will be rendered. */ renderListRow?: (props: DataRowProps) => ReactNode; }; export type UsePickerListProps = PickerListBaseProps & TProps & {}; export interface PickerModalOptions extends IHasRawProps> { /** Render callback for custom filters block. This block will be rendered befor the items list. If omitted, nothing will be rendered. */ renderFilter?(editableFilter: IEditable): React.ReactNode; /** Render callback for modal footer. If omitted, default footer will be rendered. */ renderFooter?: (props: PickerFooterProps & Partial>) => React.ReactNode; /** * If true, prevent modal window closing by click outside modal * @default false */ disallowClickOutside?: boolean; /** Disallow to clear Picker value */ disableClear?: boolean; } export type PickerModalScalarProps = ({ selectionMode: 'single'; valueType: 'id'; initialValue: TId; } & IModal) | ({ selectionMode: 'single'; valueType: 'entity'; initialValue: TItem; } & IModal); export type PickerModalArrayProps = ({ selectionMode: 'multi'; valueType: 'id'; initialValue: TId[]; } & IModal) | ({ selectionMode: 'multi'; valueType: 'entity'; initialValue: TItem[]; } & IModal); export type UsePickerModalProps = PickerBaseOptions & IHasCaption & (PickerModalScalarProps | PickerModalArrayProps) & PickerModalOptions; //# sourceMappingURL=types.d.ts.map