server.d.ts 1.6 KB

12345678910111213141516171819202122232425262728293031
  1. import * as React from "react";
  2. import type { Router as RemixRouter, StaticHandlerContext, CreateStaticHandlerOptions as RouterCreateStaticHandlerOptions, FutureConfig as RouterFutureConfig } from "@remix-run/router";
  3. import type { FutureConfig, Location, RouteObject } from "react-router-dom";
  4. export interface StaticRouterProps {
  5. basename?: string;
  6. children?: React.ReactNode;
  7. location: Partial<Location> | string;
  8. future?: Partial<FutureConfig>;
  9. }
  10. /**
  11. * A `<Router>` that may not navigate to any other location. This is useful
  12. * on the server where there is no stateful UI.
  13. */
  14. export declare function StaticRouter({ basename, children, location: locationProp, future, }: StaticRouterProps): React.JSX.Element;
  15. export { StaticHandlerContext };
  16. export interface StaticRouterProviderProps {
  17. context: StaticHandlerContext;
  18. router: RemixRouter;
  19. hydrate?: boolean;
  20. nonce?: string;
  21. }
  22. /**
  23. * A Data Router that may not navigate to any other location. This is useful
  24. * on the server where there is no stateful UI.
  25. */
  26. export declare function StaticRouterProvider({ context, router, hydrate, nonce, }: StaticRouterProviderProps): React.JSX.Element;
  27. type CreateStaticHandlerOptions = Omit<RouterCreateStaticHandlerOptions, "detectErrorBoundary" | "mapRouteProperties">;
  28. export declare function createStaticHandler(routes: RouteObject[], opts?: CreateStaticHandlerOptions): import("@remix-run/router").StaticHandler;
  29. export declare function createStaticRouter(routes: RouteObject[], context: StaticHandlerContext, opts?: {
  30. future?: Partial<Pick<RouterFutureConfig, "v7_partialHydration" | "v7_relativeSplatPath">>;
  31. }): RemixRouter;