@blacklizard/inertia-express 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,495 @@
1
+ import { AlwaysProp, ComputeCacheKeyInput, DeepMergeProp, DeferredProp, INERTIA_HEADERS, INERTIA_LOCATION_STATUS, INERTIA_REDIRECT_STATUS, InertiaPage, InertiaRequestInfo, LazyProp, MergeProp, OptionalProp, PageProps, RenderOptions, SharedPropsInput, SsrCacheEntry, SsrCacheStore, ValidationErrors, VersionResolver, always, canonicalStringify, computeSsrCacheKey, deepMerge, defer, encodePageScript, lazy, merge, optional } from "../core/index.js";
2
+ import { NextFunction, Request, Response } from "express";
3
+
4
+ //#region src/express/edge-cache.d.ts
5
+ /**
6
+ * Decision returned by an `edgeCache` policy. Returning `null` (or a
7
+ * negative number) opts out of edge caching — no `Cache-Control` is set
8
+ * beyond what your handler set itself.
9
+ */
10
+ interface EdgeCacheDecision {
11
+ /** `s-maxage` value for shared/CDN caches, in seconds. */
12
+ sMaxAge: number;
13
+ /** `max-age` for the browser cache. Default 0 (revalidate immediately). */
14
+ maxAge?: number;
15
+ /**
16
+ * `stale-while-revalidate` window. Lets CDNs serve a slightly stale
17
+ * response while fetching a fresh one in the background.
18
+ */
19
+ staleWhileRevalidate?: number;
20
+ /**
21
+ * Additional `Vary` values. The middleware always emits `Vary: Accept,
22
+ * X-Inertia` — this lets you append more (e.g. `Cookie`, `Accept-Language`).
23
+ */
24
+ vary?: string[];
25
+ }
26
+ /**
27
+ * Per-response edge-cache decision: receives the request, response, and
28
+ * resolved page, returns an {@link EdgeCacheDecision} or `null` to opt out.
29
+ */
30
+ type EdgeCachePolicy = (input: {
31
+ req: Request;
32
+ res: Response;
33
+ page: InertiaPage;
34
+ }) => EdgeCacheDecision | null;
35
+ /**
36
+ * Apply an edge-cache decision to the response. Called automatically by
37
+ * the middleware when an `edgeCache` policy is configured. Exported so
38
+ * you can call it from custom code paths too.
39
+ *
40
+ * No-op when `decision` is `null`, when `sMaxAge <= 0`, or when the response
41
+ * is 3xx+ (4xx/5xx must not be cached at the edge). The middleware also skips
42
+ * Inertia XHR responses before calling this — that filter lives at the call
43
+ * site, not here, since `applyEdgeCache` only sees the decision + status.
44
+ *
45
+ * `Vary` values from the decision are merged into the existing header,
46
+ * de-duplicated by trimmed string.
47
+ *
48
+ * @param decision Policy output (or `null` to opt out).
49
+ * @param res Outgoing Express response (mutated: sets `Cache-Control`, `Vary`).
50
+ */
51
+ declare function applyEdgeCache(decision: EdgeCacheDecision | null, res: Response): void;
52
+ //#endregion
53
+ //#region src/express/types.d.ts
54
+ /**
55
+ * Pluggable hook for rendering the page object into the final HTTP body
56
+ * for non-Inertia (i.e. first-load HTML) requests.
57
+ *
58
+ * Adapters can wire this to a template engine. When omitted, a minimal
59
+ * default HTML shell is used.
60
+ */
61
+ type RootViewRenderer = (input: RootViewInput) => string | Promise<string>;
62
+ /**
63
+ * Argument passed to a {@link RootViewRenderer}.
64
+ */
65
+ interface RootViewInput {
66
+ page: InertiaPage;
67
+ req: Request;
68
+ res: Response;
69
+ }
70
+ /**
71
+ * Output shape from an SSR renderer. Compatible with the format used by the
72
+ * official `@inertiajs/{vue3,react,svelte}/server` packages.
73
+ *
74
+ * `body` may contain either:
75
+ * - the *inner* HTML of the root element (recommended), or
76
+ * - the full root element plus the page `<script>` tag (what the Inertia v3
77
+ * SSR servers emit) — in which case set `bodyIsFullRoot: true` so the
78
+ * default root view does not wrap it again.
79
+ *
80
+ * `head` may be a string of `<meta>`/`<title>`/`<link>` tags, or an array
81
+ * of strings (Inertia's standard SSR servers return arrays).
82
+ */
83
+ interface SsrResult {
84
+ body: string;
85
+ head?: string | string[];
86
+ bodyIsFullRoot?: boolean;
87
+ }
88
+ /**
89
+ * Pluggable SSR renderer. Return `null` to skip SSR for this request (e.g.
90
+ * client-only fallback while the SSR server is unavailable).
91
+ */
92
+ type SsrRenderer = (input: SsrRendererInput) => Promise<SsrResult | null>;
93
+ /**
94
+ * Argument passed to an {@link SsrRenderer}.
95
+ */
96
+ interface SsrRendererInput {
97
+ page: InertiaPage;
98
+ req: Request;
99
+ res: Response;
100
+ }
101
+ /**
102
+ * Configuration for the SSR view cache.
103
+ *
104
+ * On a non-Inertia GET that produces a cache hit, the middleware skips the
105
+ * SSR call entirely and reuses the stored `{ head, body }`. On a miss, the
106
+ * SSR renderer runs and the result is written back to the store.
107
+ *
108
+ * Cache writes are fire-and-forget — failures are logged via `onError` (if
109
+ * provided) but never block the response.
110
+ */
111
+ interface InertiaCacheOptions {
112
+ /** The store implementation. See `createMemoryCacheStore` and `@blacklizard/inertia-cache-redis`. */
113
+ store: SsrCacheStore;
114
+ /** TTL for cache entries in seconds. Default 300. */
115
+ ttlSeconds?: number;
116
+ /** Cache key prefix / namespace. Default `"inertia:ssr"`. */
117
+ keyPrefix?: string;
118
+ /**
119
+ * Decide per request whether the response is cacheable. Return `false`
120
+ * to bypass cache entirely (no read, no write). Default: cache only
121
+ * non-Inertia GET requests on 200 responses. Auth-bound responses,
122
+ * flash data, error Pages should typically opt out here.
123
+ */
124
+ vary?: (input: {
125
+ req: Request;
126
+ page: InertiaPage;
127
+ }) => boolean;
128
+ /**
129
+ * Optional extra discriminator added to the cache key — useful for
130
+ * locale, theme, A/B bucket, etc. Two requests with the same component
131
+ * + props but different discriminators get separate cache entries.
132
+ */
133
+ discriminator?: (req: Request) => string | undefined;
134
+ /** Called when a cache get/set/delete operation throws. Cache failures are non-fatal. */
135
+ onError?: (op: 'get' | 'set' | 'delete', err: unknown) => void;
136
+ }
137
+ /**
138
+ * Configuration for the Inertia Express middleware. All fields optional.
139
+ */
140
+ interface InertiaMiddlewareOptions {
141
+ /**
142
+ * Asset version. When the client sends a stale `X-Inertia-Version`
143
+ * header on a GET, the middleware responds with 409 + `X-Inertia-Location`
144
+ * to force a full reload.
145
+ *
146
+ * Also incorporated into SSR cache keys so a deploy that bumps the
147
+ * version atomically retires every existing cache entry.
148
+ */
149
+ version?: VersionResolver<Request>;
150
+ /**
151
+ * Globally shared props merged into every page's props. May be a static
152
+ * object or a function that receives the current request.
153
+ *
154
+ * Per-page props passed to `res.inertia(component, props)` override
155
+ * shared props on key collisions.
156
+ */
157
+ sharedProps?: SharedPropsInput<Request>;
158
+ /**
159
+ * Custom root-view renderer for non-Inertia (first-load) responses.
160
+ * Receives the resolved page object and must return a complete HTML doc.
161
+ */
162
+ rootView?: RootViewRenderer;
163
+ /**
164
+ * Optional SSR hook. When provided, the middleware calls it on
165
+ * non-Inertia (HTML) responses to obtain a pre-rendered `{ head, body }`
166
+ * which is exposed to `rootView` via `res.locals.ssr` and inlined into
167
+ * the default root view if no custom `rootView` is set.
168
+ *
169
+ * Returning `null` from the hook skips SSR for that request — useful
170
+ * for client-only fallback when SSR is unavailable.
171
+ */
172
+ ssr?: SsrRenderer;
173
+ /**
174
+ * Optional view cache. Layered on top of the SSR hook so cached HTML can
175
+ * be served without invoking the SSR renderer at all. See
176
+ * {@link InertiaCacheOptions}.
177
+ */
178
+ cache?: InertiaCacheOptions;
179
+ /**
180
+ * Optional CDN edge-cache policy. Applies `Cache-Control` headers to
181
+ * non-Inertia responses according to the returned decision. Always
182
+ * skipped for Inertia (XHR) responses. Default: no edge caching.
183
+ */
184
+ edgeCache?: EdgeCachePolicy;
185
+ /**
186
+ * If true, merge session-stored validation errors and flash data into the
187
+ * shared props automatically, exposed as the `errors` and `flash` props.
188
+ * Both are read-once — cleared from the session after being read. Explicit
189
+ * `sharedProps` keys win on collision. Off by default.
190
+ */
191
+ flashFromSession?: boolean;
192
+ }
193
+ /**
194
+ * Per-response options accepted as the third argument to `res.inertia()`.
195
+ * Extends the core {@link RenderOptions} (clearHistory / encryptHistory).
196
+ */
197
+ interface InertiaResponseOptions extends RenderOptions {
198
+ /**
199
+ * Override the URL used in the page object. Defaults to `req.originalUrl`.
200
+ */
201
+ url?: string;
202
+ }
203
+ /**
204
+ * Render an Inertia page. Returns Promise so handlers can `await` it,
205
+ * but it also calls the underlying Express response methods so
206
+ * `return res.inertia(...)` works in Express handlers.
207
+ */
208
+ type ResInertiaApi = <TProps extends PageProps>(component: string, props?: TProps, options?: InertiaResponseOptions) => Promise<void>;
209
+ /** Helper to declare typed redirects on the response. */
210
+ type InertiaLocation = (url: string) => void;
211
+ declare module 'express-serve-static-core' {
212
+ interface Request {
213
+ /** Parsed Inertia request info, populated by the middleware. */
214
+ inertia?: InertiaRequestInfo;
215
+ /**
216
+ * `connect-flash`-compatible flash API. This package replaces
217
+ * `connect-flash` — see {@link InertiaMiddlewareOptions.flashFromSession}.
218
+ *
219
+ * - `req.flash()` — read and clear every flash bucket.
220
+ * - `req.flash(type)` — read and clear one type's bucket.
221
+ * - `req.flash(type, msg)` — append a message, return the new count.
222
+ * - `req.flash(type, format, ...args)` — append a `util.format`ed message.
223
+ */
224
+ flash: {
225
+ (): Record<string, string[]>;
226
+ (type: string): string[];
227
+ (type: string, message: string | string[]): number;
228
+ (type: string, format: string, ...args: unknown[]): number;
229
+ };
230
+ }
231
+ interface Response {
232
+ /**
233
+ * Render an Inertia page. See {@link ResInertiaApi}.
234
+ */
235
+ inertia: ResInertiaApi;
236
+ /**
237
+ * Trigger an external redirect via the Inertia-Location protocol.
238
+ * Sends 409 with `X-Inertia-Location` for Inertia requests; sends a
239
+ * normal 302 for plain browser requests.
240
+ */
241
+ inertiaLocation: InertiaLocation;
242
+ /**
243
+ * Share validation errors with the client. Helper around setting
244
+ * `req.session.errors`, but framework-agnostic (no session required).
245
+ */
246
+ inertiaErrors: (errors: ValidationErrors, bag?: string) => void;
247
+ /**
248
+ * Stash flash data for the next request. Stored in `req.session.flash`
249
+ * and surfaced as the `flash` shared prop when `flashFromSession` is
250
+ * enabled. Replaces any flash already queued for this redirect.
251
+ * No-ops when no session is wired.
252
+ */
253
+ inertiaFlash: (data: Record<string, unknown>) => void;
254
+ }
255
+ }
256
+ //#endregion
257
+ //#region src/express/middleware.d.ts
258
+ /**
259
+ * Create the Inertia.js Express middleware.
260
+ *
261
+ * The middleware:
262
+ * - Parses Inertia headers into `req.inertia`.
263
+ * - Adds `req.flash(type?, msg?)` — a `connect-flash`-compatible API.
264
+ * - Adds `res.inertia(component, props, options)`.
265
+ * - Adds `res.inertiaLocation(url)` for external redirects.
266
+ * - Adds `res.inertiaErrors(errors, bag?)` to flash validation errors.
267
+ * - Adds `res.inertiaFlash(data)` to flash arbitrary data.
268
+ * - Auto-promotes redirects after PUT/PATCH/DELETE to 303 for Inertia visits.
269
+ *
270
+ * Mount before your route handlers:
271
+ *
272
+ * ```ts
273
+ * app.use(inertia({ rootView: ..., sharedProps: ... }));
274
+ * ```
275
+ *
276
+ * @param options Middleware configuration; defaults to an empty object.
277
+ */
278
+ declare function inertia(options?: InertiaMiddlewareOptions): (req: Request, res: Response, next: NextFunction) => void;
279
+ //#endregion
280
+ //#region src/express/memory-store.d.ts
281
+ /**
282
+ * In-process LRU + TTL cache for SSR responses.
283
+ *
284
+ * Suitable as L1 cache in front of Redis (`@blacklizard/inertia-cache-redis`)
285
+ * or by itself for low-traffic / single-instance deployments.
286
+ *
287
+ * Notes:
288
+ * - Bounded by entry count (`max`), not bytes. Keep it conservative.
289
+ * - TTL is enforced lazily on `get()` — expired entries are removed at
290
+ * read time and never returned.
291
+ * - Not safe across processes. For multi-pod web tiers, layer Redis on top.
292
+ */
293
+ interface MemoryCacheStoreOptions {
294
+ /** Maximum number of entries before LRU eviction kicks in. Default 500. */
295
+ max?: number;
296
+ }
297
+ /**
298
+ * Build an in-process LRU + TTL {@link SsrCacheStore}. See
299
+ * {@link MemoryCacheStoreOptions} for the full contract.
300
+ *
301
+ * @param options Store configuration; defaults applied when omitted.
302
+ */
303
+ declare function createMemoryCacheStore(options?: MemoryCacheStoreOptions): SsrCacheStore;
304
+ //#endregion
305
+ //#region src/express/prerender.d.ts
306
+ /**
307
+ * Inputs to {@link prerender}.
308
+ */
309
+ interface PrerenderOptions {
310
+ /** Origin to fetch from, e.g. `http://127.0.0.1:3000`. */
311
+ baseUrl: string;
312
+ /** List of paths to render. Each must start with `/`. */
313
+ routes: string[];
314
+ /** Output mode. Default `"warmup"`. */
315
+ mode?: 'static' | 'warmup' | 'both';
316
+ /** Output directory for static HTML. Required when mode includes `"static"`. */
317
+ outDir?: string;
318
+ /** Concurrency limit. Default 4. */
319
+ concurrency?: number;
320
+ /** Per-request timeout, ms. Default 30000. */
321
+ timeoutMs?: number;
322
+ /** Extra request headers (auth, host override, A/B bucket pinning, etc.). */
323
+ headers?: Record<string, string>;
324
+ /** Optional fetch override (for testing). */
325
+ fetch?: typeof fetch;
326
+ }
327
+ /**
328
+ * Per-route outcome from a prerender run. `status` is `null` and `error` is
329
+ * populated when the request failed before producing a response.
330
+ */
331
+ interface PrerenderRouteResult {
332
+ route: string;
333
+ status: number | null;
334
+ bytes: number;
335
+ outputPath?: string;
336
+ error?: string;
337
+ durationMs: number;
338
+ }
339
+ /**
340
+ * Aggregate result returned by {@link prerender}. `ok + failed === total`;
341
+ * a route counts as `ok` when it returned a 2xx/3xx status and no error.
342
+ */
343
+ interface PrerenderSummary {
344
+ total: number;
345
+ ok: number;
346
+ failed: number;
347
+ results: PrerenderRouteResult[];
348
+ }
349
+ /**
350
+ * Run the prerender pipeline. Programmatic entry-point for the
351
+ * `bin/inertia-prerender` CLI.
352
+ *
353
+ * Two output modes (which can be combined via `"both"`):
354
+ *
355
+ * - **`warmup`** (default) — fetches each route, discards the body. Use to
356
+ * populate the SSR view cache after a deploy so the first real visitor
357
+ * doesn't pay the SSR latency cost.
358
+ * - **`static`** — fetches each route and writes the response body to
359
+ * `<outDir>/<route>/index.html`. Serve those files directly via
360
+ * nginx/CDN, bypassing Express entirely.
361
+ *
362
+ * Bounded-concurrency: `concurrency` workers consume routes from a shared
363
+ * counter; the returned `results` preserve input order. Failures on
364
+ * individual routes never halt the run — the per-route summary lets a CI
365
+ * step choose to fail-loud.
366
+ *
367
+ * @param options Pipeline configuration — see {@link PrerenderOptions}.
368
+ */
369
+ declare function prerender(options: PrerenderOptions): Promise<PrerenderSummary>;
370
+ //#endregion
371
+ //#region src/express/response.d.ts
372
+ interface RenderContext {
373
+ options: InertiaMiddlewareOptions;
374
+ }
375
+ /**
376
+ * Send the Inertia version-mismatch response: 409 with `X-Inertia-Location`
377
+ * pointing back at the same URL so the client performs a hard reload.
378
+ *
379
+ * @param res Outgoing Express response.
380
+ * @param url Location to send the client to (typically the requested URL).
381
+ */
382
+ declare function sendVersionMismatch(res: Response, url: string): void;
383
+ /**
384
+ * Send an external Inertia redirect. For Inertia (XHR) requests this returns
385
+ * 409 + `X-Inertia-Location` so the client performs a window.location nav.
386
+ * For plain browser requests it falls back to a normal 302 redirect.
387
+ *
388
+ * @param req Incoming Express request; `req.inertia` is reused when present.
389
+ * @param res Outgoing Express response.
390
+ * @param target Destination URL.
391
+ */
392
+ declare function sendInertiaLocation(req: Request, res: Response, target: string): void;
393
+ /**
394
+ * Build and send an Inertia response. Handles version-mismatch detection,
395
+ * partial-reload filtering, JSON vs HTML, SSR, view caching, and edge
396
+ * cache headers. The status code already on `res` (e.g. `res.status(404)`)
397
+ * is preserved on both the JSON and HTML branches.
398
+ *
399
+ * @param req Incoming Express request.
400
+ * @param res Outgoing Express response.
401
+ * @param ctx Render context carrying the middleware options.
402
+ * @param component Inertia component name to render.
403
+ * @param props Page-specific props (merged with shared props).
404
+ * @param options Optional per-response overrides (url, clearHistory, encryptHistory).
405
+ */
406
+ declare function sendInertiaResponse(req: Request, res: Response, ctx: RenderContext, component: string, props: PageProps, options?: InertiaResponseOptions): Promise<void>;
407
+ //#endregion
408
+ //#region src/express/ssr-fetcher.d.ts
409
+ /**
410
+ * Inputs to {@link createInertiaSsrFetcher}.
411
+ */
412
+ interface InertiaSsrFetcherOptions {
413
+ /** SSR endpoint URL — typically your internal LB DNS, e.g. `http://ssr.internal/render`. */
414
+ url: string;
415
+ /** Per-attempt timeout in milliseconds. Default 5000. */
416
+ timeoutMs?: number;
417
+ /** Number of retry attempts after the first failure. Default 2 (so up to 3 total tries). */
418
+ retries?: number;
419
+ /** Initial backoff in ms; doubles per retry. Default 100. */
420
+ retryBaseMs?: number;
421
+ /**
422
+ * Circuit breaker: open after this many consecutive failures.
423
+ * Set to `0` (or `Infinity`) to disable. Default 5.
424
+ */
425
+ breakerThreshold?: number;
426
+ /** How long the breaker stays open before allowing one probe. Default 30000. */
427
+ breakerCooldownMs?: number;
428
+ /** Failure mode. Default `"client"`. */
429
+ fallback?: 'client' | 'throw';
430
+ /** Override fetch implementation (testing). */
431
+ fetch?: typeof fetch;
432
+ /** Extra headers sent with each render request. */
433
+ headers?: Record<string, string>;
434
+ }
435
+ /**
436
+ * Build an {@link SsrRenderer} that POSTs the page object to a separate Node
437
+ * SSR process (or load-balanced pool) and returns the rendered
438
+ * `{ head, body }`.
439
+ *
440
+ * Matches the wire protocol used by `@inertiajs/{vue3,react,svelte}/server`
441
+ * `createServer()`: `POST <url>` with `application/json` body containing the
442
+ * page object, response is `{ head: string[], body: string }`.
443
+ *
444
+ * Adds production hardening on top of the bare protocol:
445
+ * - Per-attempt timeout (default 5000ms) via `AbortController`.
446
+ * - Recursive retry with exponential backoff (`retryBaseMs * 2^attempt`).
447
+ * - Circuit breaker — opens after `breakerThreshold` consecutive failed
448
+ * *requests* (not attempts); half-opens after `breakerCooldownMs` so a
449
+ * probe request can re-close it on success.
450
+ * - `fallback`: `"client"` returns an empty SSR result so the client
451
+ * renders alone; `"throw"` rethrows so Express's error handler can react.
452
+ *
453
+ * @param options Fetcher configuration — see {@link InertiaSsrFetcherOptions}.
454
+ */
455
+ declare function createInertiaSsrFetcher(options: InertiaSsrFetcherOptions): SsrRenderer;
456
+ //#endregion
457
+ //#region src/express/vite-manifest.d.ts
458
+ /**
459
+ * Inputs to {@link viteManifestVersion}.
460
+ */
461
+ interface ViteManifestVersionOptions {
462
+ /** Path to `manifest.json`. */
463
+ manifestPath: string;
464
+ /**
465
+ * If `true` (default), the manifest is re-read on every call when its
466
+ * mtime has advanced. Set to `false` to read once on boot — slightly
467
+ * faster but requires a process restart to pick up new builds.
468
+ */
469
+ watchMtime?: boolean;
470
+ }
471
+ /**
472
+ * Build a stable asset version from a Vite-generated `manifest.json`.
473
+ *
474
+ * Compatible with both `@inertiajs/vite-plugin` output and the standard
475
+ * `--manifest` option from `vite build`. The returned function is suitable
476
+ * to pass directly as the `version` option of the Inertia middleware.
477
+ *
478
+ * Strategy:
479
+ * - Read the manifest file.
480
+ * - Hash a canonicalized list of `(key -> file)` entries (only the `file`
481
+ * field per entry, so unrelated manifest metadata never perturbs the hash).
482
+ * - Cache the result; re-read only after the file's mtime changes (when
483
+ * `watchMtime` is true) or never re-read (when false).
484
+ * - Returns `null` when the manifest file is absent or unparseable.
485
+ *
486
+ * A new manifest (different hashed output paths) yields a new version, which
487
+ * the middleware embeds in the SSR cache key — so a deploy atomically
488
+ * invalidates every existing cache entry.
489
+ *
490
+ * @param options Path to the manifest plus the mtime-watch flag.
491
+ */
492
+ declare function viteManifestVersion(options: ViteManifestVersionOptions): () => Promise<string | null>;
493
+ //#endregion
494
+ export { type AlwaysProp, type ComputeCacheKeyInput, type DeepMergeProp, type DeferredProp, type EdgeCacheDecision, type EdgeCachePolicy, INERTIA_HEADERS, INERTIA_LOCATION_STATUS, INERTIA_REDIRECT_STATUS, type InertiaCacheOptions, type InertiaMiddlewareOptions, type InertiaPage, type InertiaRequestInfo, type InertiaResponseOptions, type InertiaSsrFetcherOptions, type LazyProp, type MemoryCacheStoreOptions, type MergeProp, type OptionalProp, type PageProps, type PrerenderOptions, type PrerenderRouteResult, type PrerenderSummary, type RootViewInput, type RootViewRenderer, type SharedPropsInput, type SsrCacheEntry, type SsrCacheStore, type SsrRenderer, type SsrRendererInput, type SsrResult, type ValidationErrors, type VersionResolver, type ViteManifestVersionOptions, always, applyEdgeCache, canonicalStringify, computeSsrCacheKey, createInertiaSsrFetcher, createMemoryCacheStore, deepMerge, inertia as default, inertia, defer, encodePageScript, lazy, merge, optional, prerender, sendInertiaLocation, sendInertiaResponse, sendVersionMismatch, viteManifestVersion };
495
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/express/edge-cache.ts","../../src/express/types.ts","../../src/express/middleware.ts","../../src/express/memory-store.ts","../../src/express/prerender.ts","../../src/express/response.ts","../../src/express/ssr-fetcher.ts","../../src/express/vite-manifest.ts"],"mappings":";;;;;;AASA;;;UAAiB,iBAAA;EAEf;EAAA,OAAA;EAOA;EALA,MAAA;EAUI;AAAA;AAON;;EAZE,oBAAA;EAY2C;;;;EAP3C,IAAA;AAAA;;;;;KAOU,eAAA,IAAmB,KAAA;EAAS,GAAA,EAAK,OAAA;EAAS,GAAA,EAAK,QAAA;EAAU,IAAA,EAAM,WAAA;AAAA,MAAkB,iBAAA;AAAiB;AAkB9G;;;;;;;;;AAAgF;;;;AC3BhF;;ADS8G,iBAkB9F,cAAA,CAAe,QAAA,EAAU,iBAAA,SAA0B,GAAA,EAAK,QAAQ;;;;AAvChF;;;;;;KCYY,gBAAA,IAAoB,KAAA,EAAO,aAAA,cAA2B,OAAO;;;ADEnE;UCGW,aAAA;EACf,IAAA,EAAM,WAAA;EACN,GAAA,EAAK,OAAA;EACL,GAAA,EAAK,QAAA;AAAA;;;;;;;;;;;;;;UAgBU,SAAA;EACf,IAAA;EACA,IAAA;EACA,cAAA;AAAA;;;;;KAOU,WAAA,IAAe,KAAA,EAAO,gBAAA,KAAqB,OAAA,CAAQ,SAAA;ADPiB;;;AAAA,UCY/D,gBAAA;EACf,IAAA,EAAM,WAAA;EACN,GAAA,EAAK,OAAA;EACL,GAAA,EAAK,QAAA;AAAA;;;;;AA1CkE;AAKzE;;;;;UAkDiB,mBAAA;EA/CK;EAiDpB,KAAA,EAAO,aAAA;EAnDP;EAqDA,UAAA;EApDA;EAsDA,SAAA;EArDA;;;AAAoB;AAgBtB;;EA4CE,IAAA,IAAQ,KAAA;IAAS,GAAA,EAAK,OAAA;IAAgB,IAAA,EAAM,WAAA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