/** * Move focus to the top of the page when the route changes, the standard * single-page-app technique for announcing a navigation to screen-reader and * keyboard users. The target is the page's `

`, or its `
` landmark on * a page that has none. `` owns the heading but is router-agnostic, so the * caller supplies the route signal. * * On each change the target is made focusable (`tabIndex={-1}`) and focused. * The initial mount is skipped, so the first paint never steals focus. When * there is no `

` to find (an `aria-label`-only ``), the target is the * page's `
` landmark, which `` always renders. A `tabIndex` passed * to `` is left as it is. * * Call it from a component inside `` that persists across navigations * (the layout / shell level): the skip is per-mount, so one that remounts per * route never fires. The heading has to be mounted when the effect runs, so a * `` behind a `React.lazy` boundary can still be loading. That route * falls back to its `<main>`, which is unnamed unless the page also carries an * `aria-label`, so hoist the title above the boundary for lazy routes. * * @param routeKey - A value that changes on navigation, usually the pathname. * * @example * ```tsx * // At the shell level, where <Page> stays mounted across routes: * const PageFocus = ({ pathname }: { pathname: string }) => { * usePageFocus(pathname); * return null; * }; * * <Page> * <PageFocus pathname={location.pathname} /> * <Outlet /> * </Page> * ``` */ export declare const usePageFocus: (routeKey: string) => void;