export interface InfiniteScrollOptions { hasMore: boolean; loadMore: () => Promise; rootMargin?: string; threshold?: number; } export interface InfiniteScrollResult { ref: (el: Element | null) => void; loading: boolean; error: any; } /** * A hook that implements infinite scrolling using Intersection Observer. * Triggers loadMore when the target element becomes visible. * * @param opts Configuration options * @returns Object with ref callback, loading state, and error state * * @example * const { ref, loading } = useInfiniteScroll({ * hasMore: true, * loadMore: () => fetchNextPage(), * }); * * return ( *
* {items.map(item => )} *
{loading ? 'Loading...' : null}
*
* ); */ export declare function useInfiniteScroll(opts: InfiniteScrollOptions): InfiniteScrollResult;