import { type ReactElement } from "react"; import type { DataArgs, PathWithData, PathWithoutData, RouteProps } from "../types"; /** * Render-prop component scoped to a single href. Provides `active` and * `pending` state so only the element the user clicked shows a spinner * while the route's `data` function is running. * * Pass `replace` to navigate by replacing the current history entry instead * of pushing a new one — useful for canonicalisation and login redirects. * * @example * ```tsx * * {route => ( * * User 1 {route.pending ? : null} * * )} * * ``` */ export declare function Route({ href, active, replace, children, }: RouteProps): ReactElement; /** * Define a strongly-typed route. Infers param types from the URL pattern * literal and the `data` function's return type for the `data` argument * in `match`. Wrap each route literal in `route({ ... })` so the data → * match.data flow stays typed. * * @example * ```tsx * route({ * name: "user", * url: "/users/:id", * async data({ params, signal }) { * return await fetchUser(params.id, { signal }); * }, * match({ status, params, data }) { * if (status === "loading") return ; * if (status === "error") return ; * return ; * }, * }) * ``` */ export declare function route) => unknown, const K extends string = never>(definition: PathWithData): PathWithData; export declare function route(definition: PathWithoutData): PathWithoutData;