import { HTMLAttributes, MouseEventHandler, ReactElement, ReactNode } from "react"; import { NavigationOptions, NavigationTarget, Navigator, Params, RouterError, SearchParams, State } from "@real-router/core"; //#region src/types.d.ts interface RouteState
{ route: State
| undefined; previousRoute?: State | undefined; } type RouteContext
= RouteState
& {
navigator: Navigator;
};
/**
* Props shared by both `` forms — everything except the mutually-exclusive
* navigation-target channels. `routeOptions` / `hash` stay here (they apply to
* both forms; hash is not part of `NavigationTarget` — #532).
*/
interface LinkCommonProps extends HTMLAttributes {
routeName: string;
routeParams?: P;
/**
* Query (search) params for the link's target (RFC-4 M2, #1548) — the path/
* query split's view-layer channel, parallel to `routeParams`. Feeds the URL's
* query string on click and `href`, and (with `ignoreQueryParams={false}`)
* the active-state check.
*/
routeSearch?: SearchParams;
to?: never;
}
/**
* Descriptor form (RFC-4 M2 B2, #1548): `to={{ name, params?, search? }}` — a
* single `NavigationTarget`, mutually exclusive with the channel props above.
*/
interface LinkDescriptorProps {
to: NavigationTarget ;
routeName?: never;
routeParams?: never;
routeSearch?: never;
}
type LinkProps = LinkCommonProps & (LinkChannelProps | LinkDescriptorProps );
//#endregion
//#region src/components/RouterErrorBoundary.d.ts
interface RouterErrorBoundaryProps {
readonly children: ReactNode;
readonly fallback: (error: RouterError, resetError: () => void) => ReactNode;
readonly onError?: (error: RouterError, toRoute: State | null, fromRoute: State | null) => void;
}
declare function RouterErrorBoundary({ children, fallback, onError }: RouterErrorBoundaryProps): ReactElement;
//#endregion
export { RouteContext as i, RouterErrorBoundaryProps as n, LinkProps as r, RouterErrorBoundary as t };
//# sourceMappingURL=RouterErrorBoundary-DZI_DkW5.d.ts.map