import type { ElementTarget } from "../use-target-element/index.js"; export interface UseInfiniteScrollOptions { /** * Whether to trigger the first load immediately * * @defaultValue true */ immediate?: boolean; /** * distance from the bottom of the scroll container * * @defaultValue 0 */ distance?: number; /** * scroll direction * * @defaultValue 'bottom' */ direction?: 'top' | 'bottom' | 'left' | 'right'; /** * interval between each scroll event * * @defaultValue 100 */ interval?: number; /** * check if can load more */ canLoadMore?: (previousReturn: R | undefined) => boolean; /** * scroll event callback */ onScroll?: (event: Event) => void; } export interface UseInfiniteScrollReturns { /** * Loading state * * @deprecated use `loading` instead */ isLoading: boolean; /** * Loading state * * @since 1.7.0 */ loading: boolean; /** * Load done state */ isLoadDone: boolean; /** * Load more function * * @since 1.7.0 */ loadMore: () => Promise; /** * Calculate the current scroll position to determine whether to load more */ calculate(): void; /** * Reset the state to the initial state. * * @since 1.7.0 */ reset(): void; } /** * A React Hook that allows you to use infinite scroll in your components. */ export declare function useInfiniteScroll(target: ElementTarget, onLoadMore: (previousReturn: R | undefined) => R | Promise, options?: UseInfiniteScrollOptions): UseInfiniteScrollReturns;