| 1 |
|
| 2 | import { EntryContext } from "./entry.js";
|
| 3 | import { ReactElement } from "react";
|
| 4 |
|
| 5 | //#region lib/dom/ssr/server.d.ts
|
| 6 | /**
|
| 7 | * @category Types
|
| 8 | */
|
| 9 | interface ServerRouterProps {
|
| 10 | /**
|
| 11 | * The entry context containing the manifest, route modules, and other data
|
| 12 | * needed for rendering.
|
| 13 | */
|
| 14 | context: EntryContext;
|
| 15 | /**
|
| 16 | * The URL of the request being handled.
|
| 17 | */
|
| 18 | url: string | URL;
|
| 19 | /**
|
| 20 | * An optional `nonce` for [Content Security Policy (CSP)](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CSP)
|
| 21 | * compliance. This is applied to inline scripts rendered by React Router and
|
| 22 | * used as the default for nonce-aware components such as {@link Links | `<Links>`},
|
| 23 | * {@link Scripts | `<Scripts>`}, and {@link ScrollRestoration | `<ScrollRestoration>`}
|
| 24 | * when they do not provide their own `nonce`.
|
| 25 | */
|
| 26 | nonce?: string;
|
| 27 | }
|
| 28 | /**
|
| 29 | * The server entry point for a React Router app in Framework Mode. This
|
| 30 | * component is used to generate the HTML in the response from the server. See
|
| 31 | * [`entry.server.tsx`](../framework-conventions/entry.server.tsx).
|
| 32 | *
|
| 33 | * @public
|
| 34 | * @category Framework Routers
|
| 35 | * @mode framework
|
| 36 | * @param props Props
|
| 37 | * @param {ServerRouterProps.context} props.context n/a
|
| 38 | * @param {ServerRouterProps.nonce} props.nonce n/a
|
| 39 | * @param {ServerRouterProps.url} props.url n/a
|
| 40 | * @returns A React element that represents the server-rendered application.
|
| 41 | */
|
| 42 | declare function ServerRouter({
|
| 43 | context,
|
| 44 | url,
|
| 45 | nonce
|
| 46 | }: ServerRouterProps): ReactElement;
|
| 47 | //#endregion
|
| 48 | export { ServerRouter, ServerRouterProps }; |
| \ | No newline at end of file |