`}.
+
+ ```tsx
+ import { Await, useAsyncError } from "react-router"
+
+ function ErrorElement() {
+ const error = useAsyncError();
+ return (
+ Uh Oh, something went wrong! {error.message}
+ );
+ }
+
+ // somewhere in your app
+ }
+ />
+ ```
+
+ @category Hooks
+ */
+declare function useAsyncError(): unknown;
+/**
+ * Allow the application to block navigations within the SPA and present the
+ * user a confirmation dialog to confirm the navigation. Mostly used to avoid
+ * using half-filled form data. This does not handle hard-reloads or
+ * cross-origin navigations.
+ *
+ * @category Hooks
+ */
+declare function useBlocker(shouldBlock: boolean | BlockerFunction): Blocker;
+
+interface StaticRouterProps {
+ basename?: string;
+ children?: React.ReactNode;
+ location: Partial | string;
+}
+/**
+ * A `` that may not navigate to any other location. This is useful
+ * on the server where there is no stateful UI.
+ *
+ * @category Component Routers
+ */
+declare function StaticRouter({ basename, children, location: locationProp, }: StaticRouterProps): React.JSX.Element;
+interface StaticRouterProviderProps {
+ context: StaticHandlerContext;
+ router: Router;
+ hydrate?: boolean;
+ nonce?: string;
+}
+/**
+ * A Data Router that may not navigate to any other location. This is useful
+ * on the server where there is no stateful UI.
+ *
+ * @category Component Routers
+ */
+declare function StaticRouterProvider({ context, router, hydrate, nonce, }: StaticRouterProviderProps): React.JSX.Element;
+type CreateStaticHandlerOptions = Omit;
+/**
+ * @category Utils
+ */
+declare function createStaticHandler(routes: RouteObject[], opts?: CreateStaticHandlerOptions): StaticHandler;
+/**
+ * @category Data Routers
+ */
+declare function createStaticRouter(routes: RouteObject[], context: StaticHandlerContext, opts?: {
+ future?: Partial;
+}): Router;
+
+interface ServerRouterProps {
+ context: EntryContext;
+ url: string | URL;
+ nonce?: string;
+}
+/**
+ * The entry point for a Remix app when it is rendered on the server (in
+ * `app/entry.server.js`). This component is used to generate the HTML in the
+ * response from the server.
+ *
+ * @category Components
+ */
+declare function ServerRouter({ context, url, nonce, }: ServerRouterProps): ReactElement;
+
+interface StubRouteExtensions {
+ Component?: React.ComponentType<{
+ params: ReturnType;
+ loaderData: ReturnType;
+ actionData: ReturnType;
+ matches: ReturnType;
+ }>;
+ HydrateFallback?: React.ComponentType<{
+ params: ReturnType;
+ loaderData: ReturnType;
+ actionData: ReturnType;
+ }>;
+ ErrorBoundary?: React.ComponentType<{
+ params: ReturnType;
+ loaderData: ReturnType;
+ actionData: ReturnType;
+ error: ReturnType;
+ }>;
+ loader?: LoaderFunction;
+ action?: ActionFunction;
+ children?: StubRouteObject[];
+ meta?: MetaFunction;
+ links?: LinksFunction;
+}
+interface StubIndexRouteObject extends Omit, StubRouteExtensions {
+}
+interface StubNonIndexRouteObject extends Omit, StubRouteExtensions {
+}
+type StubRouteObject = StubIndexRouteObject | StubNonIndexRouteObject;
+interface RoutesTestStubProps {
+ /**
+ * The initial entries in the history stack. This allows you to start a test with
+ * multiple locations already in the history stack (for testing a back navigation, etc.)
+ * The test will default to the last entry in initialEntries if no initialIndex is provided.
+ * e.g. initialEntries={["/home", "/about", "/contact"]}
+ */
+ initialEntries?: InitialEntry[];
+ /**
+ * The initial index in the history stack to render. This allows you to start a test at a specific entry.
+ * It defaults to the last entry in initialEntries.
+ * e.g.
+ * initialEntries: ["/", "/events/123"]
+ * initialIndex: 1 // start at "/events/123"
+ */
+ initialIndex?: number;
+ /**
+ * Used to set the route's initial loader and action data.
+ * e.g. hydrationData={{
+ * loaderData: { "/contact": { locale: "en-US" } },
+ * actionData: { "/login": { errors: { email: "invalid email" } }}
+ * }}
+ */
+ hydrationData?: HydrationState;
+ /**
+ * Future flags mimicking the settings in react-router.config.ts
+ */
+ future?: Partial;
+}
+/**
+ * @category Utils
+ */
+declare function createRoutesStub(routes: StubRouteObject[], unstable_getContext?: () => unstable_InitialContext): ({ initialEntries, initialIndex, hydrationData, future, }: RoutesTestStubProps) => React.JSX.Element;
+
+interface CookieSignatureOptions {
+ /**
+ * An array of secrets that may be used to sign/unsign the value of a cookie.
+ *
+ * The array makes it easy to rotate secrets. New secrets should be added to
+ * the beginning of the array. `cookie.serialize()` will always use the first
+ * value in the array, but `cookie.parse()` may use any of them so that
+ * cookies that were signed with older secrets still work.
+ */
+ secrets?: string[];
+}
+type CookieOptions = ParseOptions & SerializeOptions & CookieSignatureOptions;
+/**
+ * A HTTP cookie.
+ *
+ * A Cookie is a logical container for metadata about a HTTP cookie; its name
+ * and options. But it doesn't contain a value. Instead, it has `parse()` and
+ * `serialize()` methods that allow a single instance to be reused for
+ * parsing/encoding multiple different values.
+ *
+ * @see https://remix.run/utils/cookies#cookie-api
+ */
+interface Cookie {
+ /**
+ * The name of the cookie, used in the `Cookie` and `Set-Cookie` headers.
+ */
+ readonly name: string;
+ /**
+ * True if this cookie uses one or more secrets for verification.
+ */
+ readonly isSigned: boolean;
+ /**
+ * The Date this cookie expires.
+ *
+ * Note: This is calculated at access time using `maxAge` when no `expires`
+ * option is provided to `createCookie()`.
+ */
+ readonly expires?: Date;
+ /**
+ * Parses a raw `Cookie` header and returns the value of this cookie or
+ * `null` if it's not present.
+ */
+ parse(cookieHeader: string | null, options?: ParseOptions): Promise;
+ /**
+ * Serializes the given value to a string and returns the `Set-Cookie`
+ * header.
+ */
+ serialize(value: any, options?: SerializeOptions): Promise;
+}
+/**
+ * Creates a logical container for managing a browser cookie from the server.
+ */
+declare const createCookie: (name: string, cookieOptions?: CookieOptions) => Cookie;
+type IsCookieFunction = (object: any) => object is Cookie;
+/**
+ * Returns true if an object is a Remix cookie container.
+ *
+ * @see https://remix.run/utils/cookies#iscookie
+ */
+declare const isCookie: IsCookieFunction;
+
+type RequestHandler = (request: Request, loadContext?: MiddlewareEnabled extends true ? unstable_InitialContext : AppLoadContext) => Promise;
+type CreateRequestHandlerFunction = (build: ServerBuild | (() => ServerBuild | Promise), mode?: string) => RequestHandler;
+declare const createRequestHandler: CreateRequestHandlerFunction;
+
+/**
+ * An object of name/value pairs to be used in the session.
+ */
+interface SessionData {
+ [name: string]: any;
+}
+/**
+ * Session persists data across HTTP requests.
+ *
+ * @see https://reactrouter.com/explanation/sessions-and-cookies#sessions
+ */
+interface Session {
+ /**
+ * A unique identifier for this session.
+ *
+ * Note: This will be the empty string for newly created sessions and
+ * sessions that are not backed by a database (i.e. cookie-based sessions).
+ */
+ readonly id: string;
+ /**
+ * The raw data contained in this session.
+ *
+ * This is useful mostly for SessionStorage internally to access the raw
+ * session data to persist.
+ */
+ readonly data: FlashSessionData;
+ /**
+ * Returns `true` if the session has a value for the given `name`, `false`
+ * otherwise.
+ */
+ has(name: (keyof Data | keyof FlashData) & string): boolean;
+ /**
+ * Returns the value for the given `name` in this session.
+ */
+ get(name: Key): (Key extends keyof Data ? Data[Key] : undefined) | (Key extends keyof FlashData ? FlashData[Key] : undefined) | undefined;
+ /**
+ * Sets a value in the session for the given `name`.
+ */
+ set(name: Key, value: Data[Key]): void;
+ /**
+ * Sets a value in the session that is only valid until the next `get()`.
+ * This can be useful for temporary values, like error messages.
+ */
+ flash(name: Key, value: FlashData[Key]): void;
+ /**
+ * Removes a value from the session.
+ */
+ unset(name: keyof Data & string): void;
+}
+type FlashSessionData = Partial