import { R as RouteObject, a as RouterInit, F as FutureConfig$1, H as HydrationState, I as InitialEntry, D as DataStrategyFunction, P as PatchRoutesOnNavigationFunction, b as Router$1, T as To, c as RelativeRoutingType, N as NonIndexRouteObject, L as LazyRouteFunction, d as IndexRouteObject, e as Location, A as Action, f as Navigator, g as RouteMatch, h as RouteManifest, S as ServerRouteModule, M as MiddlewareEnabled, u as unstable_RouterContextProvider, i as AppLoadContext, j as LoaderFunctionArgs, k as ActionFunctionArgs, l as StaticHandlerContext, m as RouteModules, n as DataRouteObject, C as ClientLoaderFunction, o as ParamParseKey, p as Path, q as PathPattern, r as PathMatch, s as NavigateOptions, t as Params$1, v as Navigation, U as UIMatch, w as SerializeFrom, B as BlockerFunction, x as Blocker, y as HTMLFormMethod, z as FormEncType, E as PageLinkDescriptor, G as History, J as GetScrollRestorationKeyFunction, K as Fetcher, O as StaticHandler, Q as CreateStaticHandlerOptions$1, V as unstable_InitialContext, W as LoaderFunction, X as ActionFunction, Y as MetaFunction, Z as LinksFunction, _ as Equal, $ as RouterState } from './route-data-B9_30zbP.js'; export { az as ClientActionFunction, aA as ClientActionFunctionArgs, aB as ClientLoaderFunctionArgs, ax as DataRouteMatch, a6 as DataStrategyFunctionArgs, a7 as DataStrategyMatch, a8 as DataStrategyResult, aa as ErrorResponse, ab as FormMethod, aI as Future, a0 as GetScrollPositionFunction, aC as HeadersArgs, aD as HeadersFunction, aG as HtmlLinkDescriptor, an as IDLE_BLOCKER, am as IDLE_FETCHER, al as IDLE_NAVIGATION, aH as LinkDescriptor, aE as MetaArgs, aF as MetaDescriptor, a1 as NavigationStates, ay as PatchRoutesOnNavigationFunctionArgs, ad as PathParam, ae as RedirectFunction, a5 as RevalidationState, a4 as RouterFetchOptions, a3 as RouterNavigateOptions, a2 as RouterSubscriber, ag as ShouldRevalidateFunction, ah as ShouldRevalidateFunctionArgs, aO as UNSAFE_DataRouterContext, aP as UNSAFE_DataRouterStateContext, a9 as UNSAFE_DataWithResponseInit, aN as UNSAFE_ErrorResponseImpl, aQ as UNSAFE_FetchersContext, aR as UNSAFE_LocationContext, aS as UNSAFE_NavigationContext, aT as UNSAFE_RouteContext, aU as UNSAFE_ViewTransitionContext, aK as UNSAFE_createBrowserHistory, aM as UNSAFE_createRouter, aL as UNSAFE_invariant, aj as createPath, ao as data, ap as generatePath, aq as isRouteErrorResponse, ar as matchPath, as as matchRoutes, ak as parsePath, at as redirect, au as redirectDocument, av as replace, aw as resolvePath, ac as unstable_MiddlewareFunction, af as unstable_RouterContext, aJ as unstable_SerializesTo, ai as unstable_createContext } from './route-data-B9_30zbP.js'; import * as React from 'react'; import { ReactElement } from 'react'; import { ParseOptions, SerializeOptions } from 'cookie'; export { ParseOptions as CookieParseOptions, SerializeOptions as CookieSerializeOptions } from 'cookie'; /** * @private */ declare function mapRouteProperties(route: RouteObject): Partial & { hasErrorBoundary: boolean; }; declare const hydrationRouteProperties: (keyof RouteObject)[]; interface MemoryRouterOpts { /** * Basename path for the application. */ basename?: string; /** * Function to provide the initial context values for all client side navigations/fetches */ unstable_getContext?: RouterInit["unstable_getContext"]; /** * Future flags to enable for the router. */ future?: Partial; /** * Hydration data to initialize the router with if you have already performed * data loading on the server. */ hydrationData?: HydrationState; /** * Initial entires in the in-memory history stack */ initialEntries?: InitialEntry[]; /** * Index of `initialEntries` the application should initialize to */ initialIndex?: number; /** * Override the default data strategy of loading in parallel. * Only intended for advanced usage. */ dataStrategy?: DataStrategyFunction; /** * Lazily define portions of the route tree on navigations. */ patchRoutesOnNavigation?: PatchRoutesOnNavigationFunction; } /** * Create a new data router that manages the application path using an in-memory * history stack. Useful for non-browser environments without a DOM API. * * @category Data Routers */ declare function createMemoryRouter( /** * Application routes */ routes: RouteObject[], /** * Router options */ opts?: MemoryRouterOpts): Router$1; interface RouterProviderProps { router: Router$1; flushSync?: (fn: () => unknown) => undefined; } /** * Given a Remix Router instance, render the appropriate UI */ declare function RouterProvider({ router, flushSync: reactDomFlushSyncImpl, }: RouterProviderProps): React.ReactElement; /** * @category Types */ interface MemoryRouterProps { basename?: string; children?: React.ReactNode; initialEntries?: InitialEntry[]; initialIndex?: number; } /** * A `` that stores all entries in memory. * * @category Component Routers */ declare function MemoryRouter({ basename, children, initialEntries, initialIndex, }: MemoryRouterProps): React.ReactElement; /** * @category Types */ interface NavigateProps { to: To; replace?: boolean; state?: any; relative?: RelativeRoutingType; } /** * A component-based version of {@link useNavigate} to use in a [`React.Component * Class`](https://reactjs.org/docs/react-component.html) where hooks are not * able to be used. * * It's recommended to avoid using this component in favor of {@link useNavigate} * * @category Components */ declare function Navigate({ to, replace, state, relative, }: NavigateProps): null; /** * @category Types */ interface OutletProps { /** Provides a context value to the element tree below the outlet. Use when the parent route needs to provide values to child routes. ```tsx ``` Access the context with {@link useOutletContext}. */ context?: unknown; } /** Renders the matching child route of a parent route or nothing if no child route matches. ```tsx import { Outlet } from "react-router" export default function SomeParent() { return (

Parent Content

); } ``` @category Components */ declare function Outlet(props: OutletProps): React.ReactElement | null; /** * @category Types */ interface PathRouteProps { caseSensitive?: NonIndexRouteObject["caseSensitive"]; path?: NonIndexRouteObject["path"]; id?: NonIndexRouteObject["id"]; lazy?: LazyRouteFunction; loader?: NonIndexRouteObject["loader"]; action?: NonIndexRouteObject["action"]; hasErrorBoundary?: NonIndexRouteObject["hasErrorBoundary"]; shouldRevalidate?: NonIndexRouteObject["shouldRevalidate"]; handle?: NonIndexRouteObject["handle"]; index?: false; children?: React.ReactNode; element?: React.ReactNode | null; hydrateFallbackElement?: React.ReactNode | null; errorElement?: React.ReactNode | null; Component?: React.ComponentType | null; HydrateFallback?: React.ComponentType | null; ErrorBoundary?: React.ComponentType | null; } /** * @category Types */ interface LayoutRouteProps extends PathRouteProps { } /** * @category Types */ interface IndexRouteProps { caseSensitive?: IndexRouteObject["caseSensitive"]; path?: IndexRouteObject["path"]; id?: IndexRouteObject["id"]; lazy?: LazyRouteFunction; loader?: IndexRouteObject["loader"]; action?: IndexRouteObject["action"]; hasErrorBoundary?: IndexRouteObject["hasErrorBoundary"]; shouldRevalidate?: IndexRouteObject["shouldRevalidate"]; handle?: IndexRouteObject["handle"]; index: true; children?: undefined; element?: React.ReactNode | null; hydrateFallbackElement?: React.ReactNode | null; errorElement?: React.ReactNode | null; Component?: React.ComponentType | null; HydrateFallback?: React.ComponentType | null; ErrorBoundary?: React.ComponentType | null; } type RouteProps = PathRouteProps | LayoutRouteProps | IndexRouteProps; /** * Configures an element to render when a pattern matches the current location. * It must be rendered within a {@link Routes} element. Note that these routes * do not participate in data loading, actions, code splitting, or any other * route module features. * * @category Components */ declare function Route$1(_props: RouteProps): React.ReactElement | null; /** * @category Types */ interface RouterProps { basename?: string; children?: React.ReactNode; location: Partial | string; navigationType?: Action; navigator: Navigator; static?: boolean; } /** * Provides location context for the rest of the app. * * Note: You usually won't render a `` directly. Instead, you'll render a * router that is more specific to your environment such as a `` * in web browsers or a `` for server rendering. * * @category Components */ declare function Router({ basename: basenameProp, children, location: locationProp, navigationType, navigator, static: staticProp, }: RouterProps): React.ReactElement | null; /** * @category Types */ interface RoutesProps { /** * Nested {@link Route} elements */ children?: React.ReactNode; /** * The location to match against. Defaults to the current location. */ location?: Partial | string; } /** Renders a branch of {@link Route | ``} that best matches the current location. Note that these routes do not participate in data loading, actions, code splitting, or any other route module features. ```tsx import { Routes, Route } from "react-router" } /> } /> }> ``` @category Components */ declare function Routes({ children, location, }: RoutesProps): React.ReactElement | null; interface AwaitResolveRenderFunction { (data: Awaited): React.ReactNode; } /** * @category Types */ interface AwaitProps { /** When using a function, the resolved value is provided as the parameter. ```tsx [2] {(resolvedReviews) => } ``` When using React elements, {@link useAsyncValue} will provide the resolved value: ```tsx [2] function Reviews() { const resolvedReviews = useAsyncValue() return
...
} ``` */ children: React.ReactNode | AwaitResolveRenderFunction; /** The error element renders instead of the children when the promise rejects. ```tsx Oops} resolve={reviewsPromise} > ``` To provide a more contextual error, you can use the {@link useAsyncError} in a child component ```tsx } resolve={reviewsPromise} > function ReviewsError() { const error = useAsyncError() return
Error loading reviews: {error.message}
} ``` If you do not provide an errorElement, the rejected value will bubble up to the nearest route-level {@link NonIndexRouteObject#ErrorBoundary | ErrorBoundary} and be accessible via {@link useRouteError} hook. */ errorElement?: React.ReactNode; /** Takes a promise returned from a {@link LoaderFunction | loader} value to be resolved and rendered. ```jsx import { useLoaderData, Await } from "react-router" export async function loader() { let reviews = getReviews() // not awaited let book = await getBook() return { book, reviews, // this is a promise } } export default function Book() { const { book, reviews, // this is the same promise } = useLoaderData() return (

{book.title}

{book.description}

}>
); } ``` */ resolve: Resolve; } /** Used to render promise values with automatic error handling. ```tsx import { Await, useLoaderData } from "react-router"; export function loader() { // not awaited const reviews = getReviews() // awaited (blocks the transition) const book = await fetch("/api/book").then((res) => res.json()) return { book, reviews } } function Book() { const { book, reviews } = useLoaderData(); return (

{book.title}

{book.description}

}> Could not load reviews 😬
} children={(resolvedReviews) => ( )} /> ); } ``` **Note:** `` expects to be rendered inside of a `` @category Components */ declare function Await({ children, errorElement, resolve, }: AwaitProps): React.JSX.Element; /** * Creates a route config from a React "children" object, which is usually * either a `` element or an array of them. Used internally by * `` to create a route config from its children. * * @category Utils */ declare function createRoutesFromChildren(children: React.ReactNode, parentPath?: number[]): RouteObject[]; /** * Create route objects from JSX elements instead of arrays of objects */ declare let createRoutesFromElements: typeof createRoutesFromChildren; /** * Renders the result of `matchRoutes()` into a React element. * * @category Utils */ declare function renderMatches(matches: RouteMatch[] | null): React.ReactElement | null; 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; declare const SingleFetchRedirectSymbol: unique symbol; declare function getTurboStreamSingleFetchDataStrategy(getRouter: () => Router$1, manifest: AssetsManifest, routeModules: RouteModules, ssr: boolean, basename: string | undefined): DataStrategyFunction; declare function decodeViaTurboStream(body: ReadableStream, global: Window | typeof globalThis): Promise<{ done: Promise; value: unknown; }>; /** * The mode to use when running the server. */ declare enum ServerMode { Development = "development", Production = "production", Test = "test" } /** Resolves a URL against the current location. ```tsx import { useHref } from "react-router" function SomeComponent() { let href = useHref("some/where"); // "/resolved/some/where" } ``` @category Hooks */ declare function useHref(to: To, { relative }?: { relative?: RelativeRoutingType; }): string; /** * Returns true if this component is a descendant of a Router, useful to ensure * a component is used within a Router. * * @category Hooks */ declare function useInRouterContext(): boolean; /** Returns the current {@link Location}. This can be useful if you'd like to perform some side effect whenever it changes. ```tsx import * as React from 'react' import { useLocation } from 'react-router' function SomeComponent() { let location = useLocation() React.useEffect(() => { // Google Analytics ga('send', 'pageview') }, [location]); return ( // ... ); } ``` @category Hooks */ declare function useLocation(): Location; /** * Returns the current navigation action which describes how the router came to * the current location, either by a pop, push, or replace on the history stack. * * @category Hooks */ declare function useNavigationType(): Action; /** * Returns a PathMatch object if the given pattern matches the current URL. * This is useful for components that need to know "active" state, e.g. * ``. * * @category Hooks */ declare function useMatch, Path extends string>(pattern: PathPattern | Path): PathMatch | null; /** * The interface for the navigate() function returned from useNavigate(). */ interface NavigateFunction { (to: To, options?: NavigateOptions): void | Promise; (delta: number): void | Promise; } /** Returns a function that lets you navigate programmatically in the browser in response to user interactions or effects. ```tsx import { useNavigate } from "react-router"; function SomeComponent() { let navigate = useNavigate(); return (