| 1 |
|
| 2 | import { DataRouteObject, RouteBranch, RouteManifest } from "../../router/utils.js";
|
| 3 | import { StaticHandlerContext } from "../../router/router.js";
|
| 4 | import { RouteModules } from "./routeModules.js";
|
| 5 | import { EntryRoute } from "./routes.js";
|
| 6 | import { ServerBuild } from "../../server-runtime/build.js";
|
| 7 |
|
| 8 |
|
| 9 | type SerializedError = {
|
| 10 | message: string;
|
| 11 | stack?: string;
|
| 12 | };
|
| 13 | interface FrameworkContextObject {
|
| 14 | manifest: AssetsManifest;
|
| 15 | routeModules: RouteModules;
|
| 16 | criticalCss?: CriticalCss;
|
| 17 | serverHandoffString?: string;
|
| 18 | future: FutureConfig;
|
| 19 | ssr: boolean;
|
| 20 | isSpaMode: boolean;
|
| 21 | routeDiscovery: ServerBuild["routeDiscovery"];
|
| 22 | nonce?: string;
|
| 23 | serializeError?(error: Error): SerializedError;
|
| 24 | renderMeta?: {
|
| 25 | didRenderScripts?: boolean;
|
| 26 | streamCache?: Record<number, Promise<void> & {
|
| 27 | result?: {
|
| 28 | done: boolean;
|
| 29 | value: string;
|
| 30 | };
|
| 31 | error?: unknown;
|
| 32 | }>;
|
| 33 | };
|
| 34 | }
|
| 35 | interface EntryContext extends FrameworkContextObject {
|
| 36 | branches: RouteBranch<DataRouteObject>[];
|
| 37 | staticHandlerContext: StaticHandlerContext;
|
| 38 | serverHandoffStream?: ReadableStream<Uint8Array>;
|
| 39 | }
|
| 40 | type FutureConfig = Record<string, never>;
|
| 41 | type CriticalCss = string | {
|
| 42 | rel: "stylesheet";
|
| 43 | href: string;
|
| 44 | };
|
| 45 | interface AssetsManifest {
|
| 46 | entry: {
|
| 47 | imports: string[];
|
| 48 | module: string;
|
| 49 | };
|
| 50 | routes: RouteManifest<EntryRoute>;
|
| 51 | url: string;
|
| 52 | version: string;
|
| 53 | hmr?: {
|
| 54 | timestamp?: number;
|
| 55 | runtime: string;
|
| 56 | };
|
| 57 | sri?: Record<string, string> | true;
|
| 58 | }
|
| 59 |
|
| 60 | export { AssetsManifest, CriticalCss, EntryContext, FrameworkContextObject, FutureConfig }; |
| \ | No newline at end of file |