import type { Unstable_RscEnhancer } from 'waku/minimal/client'; import type { PrefetchOptions } from './client-core-utils/caches.js'; import type { NavigationHref } from './isomorphic-utils/build-route-href.js'; import type { RouteProps } from './isomorphic-utils/route-path.js'; export { ErrorBoundary } from './client-core-utils/error-boundary.js'; export { useParams as useParams_UNSTABLE } from './client-core-utils/route-hooks.js'; export { useSearch as useSearch_UNSTABLE, useSetSearch as useSetSearch_UNSTABLE, } from './client-core-utils/search.js'; export { Slice } from './client-core-utils/slice.js'; export { Link, useNavigationStatus as useNavigationStatus_UNSTABLE, } from './client-utils/link.js'; export type { LinkProps } from './client-utils/link.js'; type NavigateOptions = { /** * Whether the link should scroll on navigation. * - `true`: always scroll * - `false`: never scroll * - `undefined`: scroll on path/hash change (not on query-only change) */ scroll?: boolean; /** * Commit instantly: paint the cached shell + its `` fallbacks right * away and stream the dynamic parts in, instead of waiting for the response. */ unstable_instant?: boolean; /** * Called when a newer navigation, such as a `` click, another `push`, * `reload()`, or back/forward, cancels this one while its response is pending. * An instant navigation can already have painted its shell. Accepted * responses are not cancelled while their components finish rendering. */ unstable_onSuperseded?: () => void; }; /** * Resolves once the requested navigation has been handled: after its response * when the route needs one, right away when it does not, and when a newer * navigation supersedes it (see `unstable_onSuperseded`). Rejects and leaves * the page as it is when the href is on another origin. Rejects and reports * through the router error boundary when the route fetch fails, including an * HTTP 404 without a custom page. A network HTTP 404 follows the custom page * before this resolves. A streamed redirect or not-found intent can be * handled after this resolves, including handing an absolute redirect to the * browser. It does not wait for React to render, so the address bar may still * show the previous URL. * After a browser handoff, recovery from a cancelled departure requires a new * navigation or reload. Use a native anchor for cancelable document navigation. */ type Navigate = (to: NavigationHref, options?: NavigateOptions) => Promise; /** * Fetches whatever it is given, including the route already on screen, so it * can warm the cache for a later reload. `` prefetching is automatic and * skips a target the router is already showing. */ type Prefetch = (to: NavigationHref, options?: PrefetchOptions) => void; /** * Current route fields plus navigation helpers (`push`, `replace`, `reload`, * `back`, `forward`, `prefetch`). * * `push` / `replace` settle as described on their return type: handled * navigation, not paint-finished. `reload` refetches the current location. * `prefetch` warms a route for a later navigation or reload; `` * prefetching is automatic and skips the route already on screen. */ export declare function useRouter(): { push: Navigate; replace: Navigate; reload: () => Promise; back: () => void; forward: () => void; prefetch: Prefetch; path: string; query: string; hash: string; }; /** * Client router root. Each instance provides navigation state to its * descendants. Instances can start from different `initialRoute` values, but * navigation uses the document's shared URL and history. Server function * calls use the most recently mounted Minimal Root. `initialRoute` defaults * to the current browser location. */ export declare function Router({ initialRoute, unstable_routeInterceptor, unstable_rscEnhancers, }: { initialRoute?: RouteProps; /** * Initial input and transport enhancers, last entry outermost. Snapshotted * once per mount; keep the array reference stable across renders, including * initial Suspense retries. Create it before rendering React and remount to * change it with a new array. Router redirect and server function routing wrap this * list, so result caches here do not retain their reconciled metadata. */ unstable_rscEnhancers?: readonly Unstable_RscEnhancer[]; /** * Intercepts browser history navigation (back/forward) before it commits; * programmatic navigation and `Link` clicks are not intercepted. Return * `false` to ignore the pop (the address bar has already moved); otherwise * return the route to render. */ unstable_routeInterceptor?: (route: RouteProps) => RouteProps | false; }): import("react").JSX.Element; export declare function INTERNAL_ServerRouter({ route }: { route: RouteProps; }): import("react").JSX.Element;