import { UIEvent } from 'react';
import { UseInfiniteComboboxProps, ComboboxProps } from './ComboboxTypes';
/**
* Hook for implementing infinite scroll functionality in combobox components.
*
* Features:
* - Automatic pagination with scroll-based loading
* - Configurable query triggers (input change, selection change, scroll)
* - Debounced query execution to prevent excessive API calls
* - Automatic retry logic with exponential backoff
* - Support for both single and multiple selection modes
* - Customizable scroll threshold for triggering new queries
* - Loading state management with deferred updates
* - Automatic detection of pagination end
* - Support for initial items or query-based initialization
*
* @param options Configuration options for the infinite combobox
* @returns Object containing comboboxProps and contentProps for use with Combobox component
*
* @example
* const { comboboxProps, contentProps } = useInfiniteCombobox({
* initialItems: [],
* initialPage: 0,
* initialLoading: true,
* query: async ({ page, inputValue, selectedItems }) => {
* return await fetchItems({
* page,
* pageSize: 25,
* searchTerm: inputValue,
* excludeIds: selectedItems.map(item => item.id),
* });
* },
* });
*
* return (
*
*
*
* {({ items }) => (
*
* {items.map((item, i) => (
*
* {item.name}
*
* ))}
*
* )}
*
*
* );
*/
export declare function useInfiniteCombobox- ({ query, queryInitialItems, initialItems, initialPage, initialLoading, initialInputValue, defaultInputValue, initialSelectedItem, defaultSelectedItem, initialSelectedItems, defaultSelectedItems, updateOnInputValueChange, updateOnSelectedItemChange, updateOnSelectedItemsChange, queryOnFirstRender, shouldTriggerQuery: shouldTriggerQueryProp, }: UseInfiniteComboboxProps
- ): {
comboboxProps: {
items: Item[];
loading: boolean;
initialInputValue: string | undefined;
defaultInputValue: string | undefined;
initialSelectedItem: Item | null | undefined;
defaultSelectedItem: Item | null | undefined;
initialSelectedItems: Item[] | undefined;
defaultSelectedItems: Item[] | undefined;
disableFilter: boolean;
onStateChange: (changes: Parameters>[0]) => void;
};
contentProps: {
onScroll: (e: UIEvent) => void;
scrollerRef: import('react').RefObject;
};
};