import type { Span } from '@sentry/core'; import type { RouterState } from 'react-router'; /** * Resolves a navigate argument to a pathname string. * * React Router's navigate() accepts a string, number, or a To object ({ pathname, search, hash }). * All fields in the To object are optional (Partial), so we need to detect object args * to avoid "[object Object]" transaction names. */ export declare function resolveNavigateArg(target: unknown): string; /** * Resolves a navigate argument to the full destination path, preserving `search`/`hash` from a * To object. Unlike `resolveNavigateArg` (used for span/route naming, which should stay a bare * path), this is used to derive `url.full`/`url.path`, which should reflect the actual * destination the user is navigating to, including any query string. */ export declare function resolveNavigateUrl(target: unknown): string; /** * Resolves a navigate argument to an absolute URL for `url.full`/`url.path`, correctly handling * relative targets (no leading slash) by resolving them against the current URL instead of the * document origin alone. */ export declare function resolveNavigateAbsoluteUrl(target: unknown, currentUrl?: string): string; /** * Updates a navigation span's name and `url.path`/`url.full` from the current `location`. */ export declare function updateNavigationSpanUrlFromLocation(span: Span): void; export declare function normalizePathname(pathname: string): string; export declare function getParameterizedRoute(routerState: RouterState): string; /** * Updates a navigation span's URL attributes and parameterizes its name from the router state. * Used after numeric navigations (`navigate(-1)` / `navigate(1)`) where route hooks may not * supply a pattern (e.g. index routes). * * `url.path` reflects raw `location.pathname` (may include a trailing slash when the server * redirects index routes), while `url.template` is normalized without trailing slashes. */ export declare function finalizeNavigationSpanFromRouterState(span: Span, routerState: RouterState): void; /** * Finalizes a navigation span after numeric navigation using the hydrated data router when * available, otherwise falls back to URL attributes from `location` alone. */ export declare function finalizeNavigationSpanFromHydratedRouter(span: Span): void; //# sourceMappingURL=utils.d.ts.map