| 1 |
|
| 2 | import { ActionFunctionArgs, LoaderFunctionArgs, RouterContextProvider } from "../router/utils.js";
|
| 3 | import { AssetsManifest, CriticalCss, EntryContext, FutureConfig } from "../dom/ssr/entry.js";
|
| 4 | import { ServerRouteManifest } from "./routes.js";
|
| 5 | import { ServerInstrumentation } from "../router/instrumentation.js";
|
| 6 |
|
| 7 |
|
| 8 | type OptionalCriticalCss = CriticalCss | undefined;
|
| 9 | |
| 10 | |
| 11 |
|
| 12 | interface ServerBuild {
|
| 13 | entry: {
|
| 14 | module: ServerEntryModule;
|
| 15 | };
|
| 16 | routes: ServerRouteManifest;
|
| 17 | assets: AssetsManifest;
|
| 18 | basename?: string;
|
| 19 | publicPath: string;
|
| 20 | assetsBuildDirectory: string;
|
| 21 | future: FutureConfig;
|
| 22 | ssr: boolean;
|
| 23 | unstable_getCriticalCss?: (args: {
|
| 24 | pathname: string;
|
| 25 | }) => OptionalCriticalCss | Promise<OptionalCriticalCss>;
|
| 26 | |
| 27 | |
| 28 |
|
| 29 | isSpaMode: boolean;
|
| 30 | prerender: string[];
|
| 31 | routeDiscovery: {
|
| 32 | mode: "lazy" | "initial";
|
| 33 | manifestPath: string;
|
| 34 | };
|
| 35 | allowedActionOrigins?: string[] | false;
|
| 36 | }
|
| 37 | interface HandleDocumentRequestFunction {
|
| 38 | (request: Request, responseStatusCode: number, responseHeaders: Headers, context: EntryContext, loadContext: RouterContextProvider): Promise<Response> | Response;
|
| 39 | }
|
| 40 | interface HandleDataRequestFunction {
|
| 41 | (response: Response, args: {
|
| 42 | request: LoaderFunctionArgs["request"] | ActionFunctionArgs["request"];
|
| 43 | context: LoaderFunctionArgs["context"] | ActionFunctionArgs["context"];
|
| 44 | params: LoaderFunctionArgs["params"] | ActionFunctionArgs["params"];
|
| 45 | }): Promise<Response> | Response;
|
| 46 | }
|
| 47 | interface HandleErrorFunction {
|
| 48 | (error: unknown, args: {
|
| 49 | request: LoaderFunctionArgs["request"] | ActionFunctionArgs["request"];
|
| 50 | context: LoaderFunctionArgs["context"] | ActionFunctionArgs["context"];
|
| 51 | params: LoaderFunctionArgs["params"] | ActionFunctionArgs["params"];
|
| 52 | }): void;
|
| 53 | }
|
| 54 | |
| 55 | |
| 56 | |
| 57 |
|
| 58 | interface ServerEntryModule {
|
| 59 | default: HandleDocumentRequestFunction;
|
| 60 | handleDataRequest?: HandleDataRequestFunction;
|
| 61 | handleError?: HandleErrorFunction;
|
| 62 | instrumentations?: ServerInstrumentation[];
|
| 63 | streamTimeout?: number;
|
| 64 | }
|
| 65 |
|
| 66 | export { HandleDataRequestFunction, HandleDocumentRequestFunction, HandleErrorFunction, ServerBuild, ServerEntryModule }; |
| \ | No newline at end of file |