import React, { type ForwardRefExoticComponent, type RefAttributes } from "react"; import { type LocationStateEntry } from "./location-state.js"; /** * State value or getter function for just-in-time state resolution (legacy) */ export type StateOrGetter = T | (() => T); /** * State prop type for Link component * - LocationStateEntry[]: Type-safe state entries (always lazy) * - StateOrGetter: Legacy format for backwards compatibility */ export type LinkState = LocationStateEntry[] | StateOrGetter; /** * Prefetch strategy for the Link component * - "hover": Prefetch on mouse enter (uses native ) * - "viewport": Prefetch when link enters viewport (not yet implemented) * - "hybrid": Hover on desktop, viewport on mobile (not yet implemented) * - "none": No prefetching (default) */ export type PrefetchStrategy = "hover" | "viewport" | "hybrid" | "none"; /** * Link component props */ export interface LinkProps extends Omit, "href"> { /** * The URL to navigate to (typically from router.reverse()) */ to: string; /** * Replace current history entry instead of pushing */ replace?: boolean; /** * Scroll to top after navigation (default: true) */ scroll?: boolean; /** * Force full document navigation instead of SPA */ reloadDocument?: boolean; /** * Prefetch strategy for the link destination * @default "none" */ prefetch?: PrefetchStrategy; /** * State to pass to history.pushState/replaceState. * Accessible via useLocationState() hook. * * @example * ```tsx * // Type-safe state with createLocationState (recommended) * const ProductState = createLocationState((p: Product) => ({ name: p.name })); * View * * // Multiple typed states * Checkout * * // Legacy: static state * View * * // Legacy: dynamic state (called at click time) * ({ scrollY: window.scrollY })}>View * ``` */ state?: LinkState; children: React.ReactNode; } /** * Type-safe Link component for SPA navigation * * Works with router.reverse() for type-safe URLs: * ```tsx * * View Product * * ``` * * Also supports regular URLs: * ```tsx * About * External * ``` */ export declare const Link: ForwardRefExoticComponent>; //# sourceMappingURL=Link.d.ts.map