/** * Props for ScrollRestoration component */ export interface ScrollRestorationProps { /** * Custom function to determine the scroll restoration key. * By default, uses a unique key per history entry (location.key). * * Return location.pathname to restore scroll based on path * (useful for keeping scroll position on the same page). * * @example * ```tsx * // Restore based on pathname (same URL = same scroll) * location.pathname} * /> * * // Restore based on unique history entry (default) * location.key} * /> * ``` */ getKey?: (location: { pathname: string; search: string; hash: string; key: string; }) => string; } /** * ScrollRestoration component * * Enables scroll position restoration across navigations: * - Saves scroll positions to sessionStorage * - Restores scroll on back/forward navigation * - Scrolls to top on new navigation * - Supports hash link scrolling * * Should be rendered once in your app, typically in the root layout. * * @example * ```tsx * // In your root layout * export default function RootLayout({ children }) { * return ( * * * * {children} * * * ); * } * ``` */ export declare function ScrollRestoration({ getKey }: ScrollRestorationProps): null; /** * Hook to initialize scroll restoration * * Alternative to the ScrollRestoration component for more control. * * @example * ```tsx * function App() { * useScrollRestoration(); * return
...
; * } * ``` */ export declare function useScrollRestoration(options?: { getKey?: ScrollRestorationProps["getKey"]; }): void; //# sourceMappingURL=ScrollRestoration.d.ts.map