import type { IUiAutocompleteOption, IUiAutocompleteSection } from "./types.js";
type LoadResult<T extends IUiAutocompleteOption> = {
    sections: IUiAutocompleteSection<T>[];
    hasNextPage?: boolean;
};
/** @internal */
export type AsyncListSourceLoader<T extends IUiAutocompleteOption> = (search: string, page: number) => Promise<LoadResult<T>>;
/** @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<T extends IUiAutocompleteOption> {
    inputValue: string;
    setInputValue: (next: string) => void;
    sections: IUiAutocompleteSection<T>[];
    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<T extends IUiAutocompleteOption>(loadOptions: AsyncListSourceLoader<T>, { debounceMs }: IUseAsyncListSourceOptions): IAsyncListSource<T>;
export {};
//# sourceMappingURL=useAsyncListSource.d.ts.map