/** * Routing hooks backed by the context every Ruvyxa route bundle provides. * * The context object is created on `globalThis` rather than exported from a * module because the generated route entry has to provide it without importing * this package — an app may render plain React pages and never install * `@ruvyxa/react`. Both sides reach the same object through * `globalThis.__RUVYXA_ROUTE_CONTEXT__`, so provider and consumer match * whichever module happens to load first. */ import { type Context } from 'react'; import { type RouteContextValue, type RuvyxaRouter } from './router.js'; import type { RouteParams } from '@ruvyxa/core/route-match'; import type { FlightValue } from '@ruvyxa/core/server'; /** The React context a Ruvyxa route bundle populates for the active route. */ export declare const RouteContext: Context; /** * Read the active route context. * * Falls back to the router snapshot so a component rendered outside a Ruvyxa * route tree — a test harness, a portal, a standalone story — still sees the * current URL instead of throwing. */ export declare function useRouteContext(): RouteContextValue; /** The current pathname, without search string or hash. */ export declare function usePathname(): string; /** Parameters extracted from the matched route pattern. */ export declare function useParams(): RouteParams; /** * The current query string as a `URLSearchParams`. * * Reads from the router rather than the route context: a server render cannot * see the query string in every deployment target, so this returns an empty * set during SSR and the real values once hydrated. Routing that must be * identical in the server HTML belongs in the path, not the query. * * A new `URLSearchParams` is built per render because it is mutable; handing * out a shared one would let a caller mutate another component's view of the * URL. */ export declare function useSearchParams(): URLSearchParams; /** The matched route pattern, e.g. `/blog/[slug]`. */ export declare function useSelectedRoute(): string; /** * Read the public server-component payload attached to the current soft navigation. * * The value is absent on routes that do not export `flight`, and on the first * server-rendered document unless the host supplied an inline payload. */ export declare function useFlight(): T | undefined; /** * Imperative navigation. * * `pending` is `true` while a navigation waits on a route bundle, which is the * hook a progress bar or a disabled submit button subscribes to. */ export declare function useRouter(): RuvyxaRouter; //# sourceMappingURL=route-context.d.ts.map