import type { NavigationOptions, NavigationTarget, Params, Router, SearchParams, State } from "@real-router/core"; /** * Resolved navigation channels for a `` — the single `{ name, params, * search }` shape every adapter feeds into `buildHref` / `navigateWithHash` / * the active-route source, regardless of which prop form the consumer used. */ export interface ResolvedLinkTarget { name: string; params: Params | undefined; search: SearchParams | undefined; } /** * Collapses a ``'s two prop forms (RFC-4 M2 B2, #1548) into one channel * triple: * * - **Descriptor** — `to={{ name, params?, search? }}` (a `NavigationTarget`). * - **Channel props** — `routeName` + `routeParams?` + `routeSearch?`. * * The forms are mutually exclusive: the TS union on each adapter's `LinkProps` * rejects mixing them at compile time, and this helper is the runtime backstop — * when `to` is present it **wins**, and a `dev`-visible `console.warn` fires if * channel props were also supplied (a JS consumer, an object spread, or an * adapter without a strict union can still slip both through). `routeOptions` / * `hash` are separate props under BOTH forms (hash is not part of * `NavigationTarget` — #532), so they are resolved by the caller, not here. */ export declare function resolveLinkTarget(to: NavigationTarget | undefined, routeName: string, routeParams: Params | undefined, routeSearch: SearchParams | undefined): ResolvedLinkTarget; export declare function shouldNavigate(evt: MouseEvent): boolean; /** * Does an anchor's `target` send this navigation somewhere the router cannot * follow? (#1834) * * `target` names the browsing context the author wants the URL loaded into. * Three values are the router's — absent, empty, `_self` — and every other one * goes to the browser, the only thing that can resolve a context name. * Intercepting instead is how a `` ends up reloading the * same tab rather than opening a new one. React Router's * `shouldProcessLinkClick` and TanStack Router's `handleClick` split the same * way; neither reproduces browsing contexts inside the router, and neither does * this. * * ⚠ The split is by SPELLING, not by where the value resolves to, and three * spellings resolve back to this context anyway: `_parent` and `_top` fall back * to `_self` in a document with no ancestor, and `_SELF` matches `_self` * ASCII-case-insensitively (MDN, `` § target). All three are handed to the * browser, which reaches the right destination by a full page load instead of a * transition. Resolving them properly means reproducing frame ancestry and * keyword folding here; both reference routers decline, and the cost is a page * load rather than a wrong destination. * * ⚠ Ask this only about an ``. On a `