import { FiltersMap, OptionalFiltersMap, PickerEvents, SelectionStatus, selectionStatusWixPatternsPreset } from '@wix/bex-core'; import { CollectionConfigWithConditionals } from '@wix/bex-core/react'; import { PickerModalState } from '../usePickerModal'; export type SelectionStatusPreset = keyof typeof selectionStatusWixPatternsPreset; export interface PickerSelection { /** * @deprecated * Use `values` prop instead, i.e: values: [{value: {id: 'VALUE_ID'}, status: 'checked'}] */ selectedValues?: (T | string)[]; /** * @deprecated * Use `defaultStatus` prop instead, i.e: defaultStatus: 'checked' - this means "Select All" */ isSelectAll?: boolean; /** * @deprecated * Use `values` prop instead, i.e: values: [{value: {id: 'VALUE_ID'}, status: 'unchecked'}] */ uncheckedValues?: (T | string)[]; /** * @deprecated * Use `values` prop instead, i.e: values: [{value: {id: 'VALUE_ID'}, status: 'indeterminate'}] */ partiallySelectedIds?: (T | string)[]; /** * Initial selected values. Using this prop it's possible to specify the initial status of each pre-selected value. */ values?: { status: SelectionStatus | SelectionStatusPreset; value: T; }[]; /** * Forces this status on all items and all future items that will be loaded to the picker when scrolling. * To exclude specific items, use this prop in combination with `values` prop. */ defaultStatus?: SelectionStatus | SelectionStatusPreset; /** Additional step data, assigned with data returned from `onBeforeSelectAdditionalStep` */ additionalStepData?: unknown; } export interface UsePickerContentParamsBase { /** The modal state object passed from `` */ modalState: PickerModalState; /** * Optional callbacks for various events of the picker content lifecycle * Extends [CollectionEvents](/pages/cairo/?path=/story/common-hooks--usecollection) * `onReady` - when picker content is ready * `onInitialFetchError` - when there's an error loading the picker. When the callback returns a promise, the initial loader will keep showing until the promise is resolved (useful for cases of redirect to login for example). * `onItemSelectClick` - when clicking on an item checkbox / radio button */ events?: PickerEvents; /** * Sets initial selection to the picker. Either:
* - `boolean` - Sets the first item as selected. * - `function` - A predicate for items to be selected in the picker. * - `object` (Older API, new API below) * - `selectedValues` - Specific selection * - `isSelectAll` - All selected * - `uncheckedValues` - Optional unchecked items * - `partiallySelectedIds` - Items that should have 3rd indeterminate status * - `object` (New API) * - `values` - Initial selected values. Using this prop it's possible to specify the initial status of each pre-selected value. * - `defaultStatus` - Forces this status on all items and all future items that will be loaded to the picker when scrolling. */ initialSelect?: true | ((item: T, index: number) => boolean) | PickerSelection; } export type UsePickerContentParams = Omit, 'fetchData' | 'limit' | 'paginationMode' | 'queryName'> & UsePickerContentParamsBase; export declare function usePickerContent(params: UsePickerContentParams): UsePickerContentParams; //# sourceMappingURL=usePickerContent.d.ts.map