import type { DependencyList } from 'react'; import type { BasicTarget } from '../utils/domTarget'; export type Data = { list: any[]; [key: string]: any; }; export type Service = (currentData?: TData) => Promise; export interface InfiniteScrollResult { data: TData; loading: boolean; loadingMore: boolean; noMore: boolean; loadMore: () => void; loadMoreAsync: () => Promise; reload: () => void; reloadAsync: () => Promise; cancel: () => void; mutate: (data?: TData) => void; } export interface InfiniteScrollOptions { target?: BasicTarget; isNoMore?: (data?: TData) => boolean; threshold?: number; manual?: boolean; reloadDeps?: DependencyList; onBefore?: () => void; onSuccess?: (data: TData) => void; onError?: (e: Error) => void; onFinally?: (data?: TData, e?: Error) => void; }