/** * react-fetch v1.49.0 * * Copyright (c) resourge. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */ import { type VisitedUrl } from '../useOnScroll/types'; import { type ElementWithScrollTo } from '../useOnScroll/useOnScroll'; export interface InfiniteScrollRestoration { (behavior: ScrollBehavior): void; getPage: () => VisitedUrl; setPage: (page: number, perPage: number) => void; } /** * Method to restore scroll. * If return `ref` is not set, it will assume window * @param scrollRestorationId * @example * ```Typescript // useAction will probably be from a navigation/router package // Ex: import { useAction } from '@resourge/react-router'; const action = useAction(); // 'action' must be 'pop' for restoration to work; const [scrollRestoration, ref] = useInfiniteScrollRestoration(action); const {} = useInfiniteLoading( async () => { return HttpService.get("url") }, { initialState: [], scrollRestoration } ); ``` */ export declare const useInfiniteScrollRestoration: ( /** * Action defines if scroll restoration can be executed. * Only on 'pop' will the scroll be restored. */ action: string, /** * Unique id categorizing current component. Must be the same between render or component changes for scroll restoration to work. */ scrollRestorationId?: string) => readonly [(behavior?: ScrollBehavior) => void, import("node_modules/@types/react").RefObject, (event: React.UIEvent) => void];