import './components-CjQijYga.mjs'; import * as React from 'react'; import { a_ as RouteManifest, a$ as ServerRouteModule, Y as MiddlewareEnabled, u as unstable_RouterContextProvider, X as AppLoadContext, ak as LoaderFunctionArgs, ab as ActionFunctionArgs, y as RouteModules, a4 as StaticHandlerContext, H as HydrationState, a0 as DataRouteObject, j as ClientLoaderFunction, aj as HTMLFormMethod, ah as FormEncType, a as RelativeRoutingType, aL as PageLinkDescriptor, T as To, b0 as History, a3 as GetScrollRestorationKeyFunction, e as RouterInit, F as FutureConfig$1, D as DataStrategyFunction, P as PatchRoutesOnNavigationFunction, z as NavigateOptions, a5 as Fetcher, f as RouteObject, R as Router, J as SerializeFrom, B as BlockerFunction, c as Location, b1 as CreateStaticHandlerOptions$1, a1 as StaticHandler } from './route-data-CqEmXQub.mjs'; 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 ? unstable_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; } 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; unstable_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; } 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 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; } 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"; /** * Renders all of the `` tags created by the route module * [`links`](../../start/framework/route-module#links) export. You should render * it inside the `` of your document. * * @example * import { Links } from "react-router"; * * export default function Root() { * return ( * * * * * * * ); * } * * @public * @category Components * @mode framework * @returns A collection of React elements for `` tags */ declare function Links(): React.JSX.Element; /** * Renders `` tags for modules and data of * another page to enable an instant navigation to that page. * [``](../../components/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 props.page The absolute path of the page to prefetch, e.g. `/absolute/path`. * @param props.linkProps Additional props to spread onto the * [``](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/link) * tags, such as `crossOrigin`, `integrity`, `rel`, etc. * @returns A collection of React elements for `` tags */ declare function PrefetchPageLinks({ page, ...linkProps }: PageLinkDescriptor): React.JSX.Element | null; /** * Renders all the `` tags created by the route module * [`meta`](../../start/framework/route-module#meta) exports. You should render * it inside the `` of your HTML. * * @example * import { Meta } from "react-router"; * * export default function Root() { * return ( * * * * * * ); * } * * @public * @category Components * @mode framework * @returns A collection of React elements for `` 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 `