import { ComponentInternalInstance, Ref } from 'vue'; import { PageCursor } from './typedef'; declare type InfiniteScrollingReachBottomOptions = { type: 'reach-bottom'; threshold?: number; }; declare type InfiniteScrollingIntersectionOptions = { type: 'intersection'; /** * 触发器dom */ target?: Ref; /** * 监控根元素,没有就是document的viewport */ root?: Ref; }; export declare type InfiniteScrollingOptions = InfiniteScrollingReachBottomOptions | InfiniteScrollingIntersectionOptions; export declare const useInfiniteScrolling: (resFetch: (cursor: string) => Promise, resp2res: (resp: T) => R, opt: InfiniteScrollingOptions) => { /** * 用于进行动态添加监视目标 */ observe(ref: Element | ComponentInternalInstance | null): void; abort: () => void; load: import("vue").ComputedRef; next: (idx?: number | undefined) => Promise; res: import("vue").ComputedRef<(R extends object ? import("./readonly").DeepReadonly : R) | undefined>; loading: import("vue").ComputedRef; cursorStack: readonly string[]; reset: (params?: boolean | import("./makeAsyncIterator").ResetParams) => Promise; [Symbol.asyncIterator]: () => { next: () => Promise<{ done: boolean; value: NonNullable; }>; }; iter: import("./readonly").DeepReadonly<{ [Symbol.asyncIterator]: () => { next: () => Promise<{ done: boolean; value: NonNullable; }>; }; }>; }; export {};