import { ComponentPropsWithRef, ComponentType, ReactNode } from 'react'; import { HttpMethod } from './generated.js'; export type NavLinkProps = Omit, "href"> & { href: string; /** Non-GET methods need an adapter (e.g. Inertia); the default anchor always GETs. */ method?: HttpMethod; }; export type NavigationVisitOptions = { preserveScroll?: boolean; preserveState?: boolean; }; export type NavigateListener = () => void; export type NavigationAdapter = { Link: ComponentType; visit: (url: string, options?: NavigationVisitOptions) => void; reload: () => void; /** * The current location's path without query or hash. Defaults to * `window.location.pathname`, which is undefined while rendering on the server. */ currentUrl?: string; /** Subscribes to completed navigations and returns the unsubscribe. */ onNavigate?: (listener: NavigateListener) => () => void; }; export type Navigation = Required> & { currentUrl: string | undefined; }; export declare const defaultNavigation: NavigationAdapter; /** * Seeds how links and programmatic visits navigate for everything below it. * Without a provider, links render as plain anchors and visits are full page * loads; the Lattice runtime seeds an Inertia-backed adapter for SPA * navigation. */ export declare function NavigationProvider({ adapter, children, }: { adapter: NavigationAdapter; children: ReactNode; }): import("react").JSX.Element; export declare function useNavigation(): Navigation;