import { ai as HTMLFormMethod, ag as FormEncType, k as RelativeRoutingType, by as RouteManifest, bz as ServerRouteModule, O as MiddlewareEnabled, K as RouterContextProvider, J as AppLoadContext, ak as LoaderFunctionArgs, ab as ActionFunctionArgs, f as RouteModules, H as HydrationState, a0 as DataRouteObject, W as ClientLoaderFunction, a4 as StaticHandlerContext, bb as PageLinkDescriptor, T as To, bA as History, a3 as GetScrollRestorationKeyFunction, Z as RouterInit, bB as FutureConfig$1, g as DataStrategyFunction, $ as PatchRoutesOnNavigationFunction, h as NavigateOptions, a5 as Fetcher, r as RouteObject, e as Router, j as SerializeFrom, B as BlockerFunction, a as Location, bC as CreateStaticHandlerOptions$1, a1 as StaticHandler } from './routeModules-BmVo7q9e.js'; import * as React from 'react'; type ParamKeyValuePair = [string, string]; type URLSearchParamsInit = string | ParamKeyValuePair[] | Record | URLSearchParams; /** Creates a URLSearchParams object using the given initializer. This is identical to `new URLSearchParams(init)` except it also supports arrays as values in the object form of the initializer instead of just strings. This is convenient when you need multiple values for a given key, but don't want to use an array initializer. For example, instead of: ```tsx let searchParams = new URLSearchParams([ ['sort', 'name'], ['sort', 'price'] ]); ``` you can do: ``` let searchParams = createSearchParams({ sort: ['name', 'price'] }); ``` @category Utils */ declare function createSearchParams(init?: URLSearchParamsInit): URLSearchParams; type JsonObject = { [Key in string]: JsonValue; } & { [Key in string]?: JsonValue | undefined; }; type JsonArray = JsonValue[] | readonly JsonValue[]; type JsonPrimitive = string | number | boolean | null; type JsonValue = JsonPrimitive | JsonObject | JsonArray; type SubmitTarget = HTMLFormElement | HTMLButtonElement | HTMLInputElement | FormData | URLSearchParams | JsonValue | null; /** * Submit options shared by both navigations and fetchers */ interface SharedSubmitOptions { /** * The HTTP method used to submit the form. Overrides `
`. * Defaults to "GET". */ method?: HTMLFormMethod; /** * The action URL path used to submit the form. Overrides ``. * Defaults to the path of the current route. */ action?: string; /** * The encoding used to submit the form. Overrides ``. * Defaults to "application/x-www-form-urlencoded". */ encType?: FormEncType; /** * Determines whether the form action is relative to the route hierarchy or * the pathname. Use this if you want to opt out of navigating the route * hierarchy and want to instead route based on /-delimited URL segments */ relative?: RelativeRoutingType; /** * In browser-based environments, prevent resetting scroll after this * navigation when using the component */ preventScrollReset?: boolean; /** * Enable flushSync for this submission's state updates */ flushSync?: boolean; } /** * Submit options available to fetchers */ interface FetcherSubmitOptions extends SharedSubmitOptions { } /** * Submit options available to navigations */ interface SubmitOptions extends FetcherSubmitOptions { /** * Set `true` to replace the current entry in the browser's history stack * instead of creating a new one (i.e. stay on "the same page"). Defaults * to `false`. */ replace?: boolean; /** * State object to add to the history stack entry for this navigation */ state?: any; /** * Indicate a specific fetcherKey to use when using navigate=false */ fetcherKey?: string; /** * navigate=false will use a fetcher instead of a navigation */ navigate?: boolean; /** * Enable view transitions on this submission navigation */ viewTransition?: boolean; } type ServerRouteManifest = RouteManifest>; interface ServerRoute extends Route { children: ServerRoute[]; module: ServerRouteModule; } type OptionalCriticalCss = CriticalCss | undefined; /** * The output of the compiler for the server build. */ interface ServerBuild { entry: { module: ServerEntryModule; }; routes: ServerRouteManifest; assets: AssetsManifest; basename?: string; publicPath: string; assetsBuildDirectory: string; future: FutureConfig; ssr: boolean; unstable_getCriticalCss?: (args: { pathname: string; }) => OptionalCriticalCss | Promise; /** * @deprecated This is now done via a custom header during prerendering */ isSpaMode: boolean; prerender: string[]; routeDiscovery: { mode: "lazy" | "initial"; manifestPath: string; }; } interface HandleDocumentRequestFunction { (request: Request, responseStatusCode: number, responseHeaders: Headers, context: EntryContext, loadContext: MiddlewareEnabled extends true ? RouterContextProvider : AppLoadContext): Promise | Response; } interface HandleDataRequestFunction { (response: Response, args: LoaderFunctionArgs | ActionFunctionArgs): Promise | Response; } interface HandleErrorFunction { (error: unknown, args: LoaderFunctionArgs | ActionFunctionArgs): void; } /** * A module that serves as the entry point for a Remix app during server * rendering. */ interface ServerEntryModule { default: HandleDocumentRequestFunction; handleDataRequest?: HandleDataRequestFunction; handleError?: HandleErrorFunction; streamTimeout?: number; } interface Route { index?: boolean; caseSensitive?: boolean; id: string; parentId?: string; path?: string; } interface EntryRoute extends Route { hasAction: boolean; hasLoader: boolean; hasClientAction: boolean; hasClientLoader: boolean; hasClientMiddleware: boolean; hasErrorBoundary: boolean; imports?: string[]; css?: string[]; module: string; clientActionModule: string | undefined; clientLoaderModule: string | undefined; clientMiddlewareModule: string | undefined; hydrateFallbackModule: string | undefined; parentId?: string; } declare function createClientRoutesWithHMRRevalidationOptOut(needsRevalidation: Set, manifest: RouteManifest, routeModulesCache: RouteModules, initialState: HydrationState, ssr: boolean, isSpaMode: boolean): DataRouteObject[]; declare function createClientRoutes(manifest: RouteManifest, routeModulesCache: RouteModules, initialState: HydrationState | null, ssr: boolean, isSpaMode: boolean, parentId?: string, routesByParentId?: Record[]>, needsRevalidation?: Set): DataRouteObject[]; declare function shouldHydrateRouteLoader(routeId: string, clientLoader: ClientLoaderFunction | undefined, hasLoader: boolean, isSpaMode: boolean): boolean; type SerializedError = { message: string; stack?: string; }; interface FrameworkContextObject { manifest: AssetsManifest; routeModules: RouteModules; criticalCss?: CriticalCss; serverHandoffString?: string; future: FutureConfig; ssr: boolean; isSpaMode: boolean; routeDiscovery: ServerBuild["routeDiscovery"]; serializeError?(error: Error): SerializedError; renderMeta?: { didRenderScripts?: boolean; streamCache?: Record & { result?: { done: boolean; value: string; }; error?: unknown; }>; }; } interface EntryContext extends FrameworkContextObject { staticHandlerContext: StaticHandlerContext; serverHandoffStream?: ReadableStream; } interface FutureConfig { unstable_subResourceIntegrity: boolean; v8_middleware: boolean; } type CriticalCss = string | { rel: "stylesheet"; href: string; }; interface AssetsManifest { entry: { imports: string[]; module: string; }; routes: RouteManifest; url: string; version: string; hmr?: { timestamp?: number; runtime: string; }; sri?: Record | true; } declare const FrameworkContext: React.Context; /** * Defines the discovery behavior of the link: * * - "render" - default, discover the route when the link renders * - "none" - don't eagerly discover, only discover if the link is clicked */ type DiscoverBehavior = "render" | "none"; /** * Defines the prefetching behavior of the link: * * - "none": Never fetched * - "intent": Fetched when the user focuses or hovers the link * - "render": Fetched when the link is rendered * - "viewport": Fetched when the link is in the viewport */ type PrefetchBehavior = "intent" | "render" | "none" | "viewport"; /** * Props for the {@link Links} component. * * @category Types */ interface LinksProps { /** * A [`nonce`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/nonce) * attribute to render on the [``](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link) * element */ nonce?: string | undefined; } /** * Renders all the [``](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link) * tags created by the route module's [`links`](../../start/framework/route-module#links) * export. You should render it inside the [``](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/head) * of your document. * * @example * import { Links } from "react-router"; * * export default function Root() { * return ( * * * * * * * ); * } * * @public * @category Components * @mode framework * @param props Props * @param {LinksProps.nonce} props.nonce n/a * @returns A collection of React elements for [``](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link) * tags */ declare function Links({ nonce }: LinksProps): React.JSX.Element; /** * Renders [``](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLinkElement/rel) * tags for modules and data of another page to enable an instant navigation to * that page. [``](./Link#prefetch) uses this internally, but you * can render it to prefetch a page for any other reason. * * For example, you may render one of this as the user types into a search field * to prefetch search results before they click through to their selection. * * @example * import { PrefetchPageLinks } from "react-router"; * * * * @public * @category Components * @mode framework * @param props Props * @param {PageLinkDescriptor.page} props.page n/a * @param props.linkProps Additional props to spread onto the [``](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link) * tags, such as [`crossOrigin`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLinkElement/crossOrigin), * [`integrity`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLinkElement/integrity), * [`rel`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLinkElement/rel), * etc. * @returns A collection of React elements for [``](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link) * tags */ declare function PrefetchPageLinks({ page, ...linkProps }: PageLinkDescriptor): React.JSX.Element | null; /** * Renders all the [``](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta) * tags created by the route module's [`meta`](../../start/framework/route-module#meta) * export. You should render it inside the [``](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/head) * of your document. * * @example * import { Meta } from "react-router"; * * export default function Root() { * return ( * * * * * * ); * } * * @public * @category Components * @mode framework * @returns A collection of React elements for [``](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta) * tags */ declare function Meta(): React.JSX.Element; /** * A couple common attributes: * * - `` for hosting your static assets on a different * server than your app. * - `` to support a [content security policy for scripts](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/script-src) * with [nonce-sources](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/Sources#sources) * for your [`