import type { IUiAutocompleteOption, IUiAutocompleteSection } from "./types.js"; type LoadResult = { sections: IUiAutocompleteSection[]; hasNextPage?: boolean; }; /** @internal */ export type AsyncListSourceLoader = (search: string, page: number) => Promise>; /** @internal */ export interface IUseAsyncListSourceOptions { debounceMs: number; } /** * `loadingMore` keeps prior pages visible while the next page is in flight; * `error` blanks out the list. * * @internal */ export type AsyncListStatus = "loading" | "loadingMore" | "idle" | "error"; /** @internal */ export interface IAsyncListSource { inputValue: string; setInputValue: (next: string) => void; sections: IUiAutocompleteSection[]; status: AsyncListStatus; hasNextPage: boolean; loadMore: () => void; reset: () => void; /** Re-run the current page-0 query — used to recover from an error state. */ retry: () => void; /** Increments on each page-0 load; lets callers tag per-query synthetic rows. */ generation: number; } /** * Async data source for an autocomplete-shaped picker: debounce via * `useDebouncedState`, fetching with stale-result protection via * `useCancelablePromise`, section merge on pagination. * * @internal */ export declare function useAsyncListSource(loadOptions: AsyncListSourceLoader, { debounceMs }: IUseAsyncListSourceOptions): IAsyncListSource; export {}; //# sourceMappingURL=useAsyncListSource.d.ts.map