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