@elurjs/kit 2.4.4

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.
Files changed (255) hide show
  1. package/CHANGELOG.md +874 -0
  2. package/LICENSE +21 -0
  3. package/README.md +1330 -0
  4. package/bin/elur-kit.js +54 -0
  5. package/dist/lib/action/define.d.cts +72 -0
  6. package/dist/lib/action/define.d.ts +72 -0
  7. package/dist/lib/action/error-store.d.cts +29 -0
  8. package/dist/lib/action/error-store.d.ts +29 -0
  9. package/dist/lib/action/index.cjs +1 -0
  10. package/dist/lib/action/index.d.cts +64 -0
  11. package/dist/lib/action/index.d.ts +64 -0
  12. package/dist/lib/action/index.js +2 -0
  13. package/dist/lib/action/origin.d.cts +20 -0
  14. package/dist/lib/action/origin.d.ts +20 -0
  15. package/dist/lib/action/scan.d.cts +28 -0
  16. package/dist/lib/action/scan.d.ts +28 -0
  17. package/dist/lib/action/server.d.cts +30 -0
  18. package/dist/lib/action/server.d.ts +30 -0
  19. package/dist/lib/action-BB6N5yD-.js +111 -0
  20. package/dist/lib/action-BB6N5yD-.js.map +1 -0
  21. package/dist/lib/action-DZHihU3Z.cjs +2 -0
  22. package/dist/lib/action-DZHihU3Z.cjs.map +1 -0
  23. package/dist/lib/adapters/bun.cjs +30 -0
  24. package/dist/lib/adapters/bun.cjs.map +1 -0
  25. package/dist/lib/adapters/bun.d.cts +13 -0
  26. package/dist/lib/adapters/bun.d.ts +13 -0
  27. package/dist/lib/adapters/bun.js +65 -0
  28. package/dist/lib/adapters/bun.js.map +1 -0
  29. package/dist/lib/adapters/index.cjs +0 -0
  30. package/dist/lib/adapters/index.d.cts +30 -0
  31. package/dist/lib/adapters/index.d.ts +30 -0
  32. package/dist/lib/adapters/index.js +0 -0
  33. package/dist/lib/adapters/netlify.cjs +10 -0
  34. package/dist/lib/adapters/netlify.cjs.map +1 -0
  35. package/dist/lib/adapters/netlify.d.cts +13 -0
  36. package/dist/lib/adapters/netlify.d.ts +13 -0
  37. package/dist/lib/adapters/netlify.js +51 -0
  38. package/dist/lib/adapters/netlify.js.map +1 -0
  39. package/dist/lib/adapters/node.cjs +46 -0
  40. package/dist/lib/adapters/node.cjs.map +1 -0
  41. package/dist/lib/adapters/node.d.cts +13 -0
  42. package/dist/lib/adapters/node.d.ts +13 -0
  43. package/dist/lib/adapters/node.js +105 -0
  44. package/dist/lib/adapters/node.js.map +1 -0
  45. package/dist/lib/adapters/shared.d.cts +17 -0
  46. package/dist/lib/adapters/shared.d.ts +17 -0
  47. package/dist/lib/adapters/vercel.cjs +2 -0
  48. package/dist/lib/adapters/vercel.cjs.map +1 -0
  49. package/dist/lib/adapters/vercel.d.cts +9 -0
  50. package/dist/lib/adapters/vercel.d.ts +9 -0
  51. package/dist/lib/adapters/vercel.js +62 -0
  52. package/dist/lib/adapters/vercel.js.map +1 -0
  53. package/dist/lib/build/build.d.cts +83 -0
  54. package/dist/lib/build/build.d.ts +83 -0
  55. package/dist/lib/build/document-shell.d.cts +48 -0
  56. package/dist/lib/build/document-shell.d.ts +48 -0
  57. package/dist/lib/build/transform-source.d.cts +26 -0
  58. package/dist/lib/build/transform-source.d.ts +26 -0
  59. package/dist/lib/build/vite-build.d.cts +78 -0
  60. package/dist/lib/build/vite-build.d.ts +78 -0
  61. package/dist/lib/cache/policy.d.cts +25 -0
  62. package/dist/lib/cache/policy.d.ts +25 -0
  63. package/dist/lib/cache.d.cts +13 -0
  64. package/dist/lib/cache.d.ts +13 -0
  65. package/dist/lib/capabilities-C0TDQoMY.cjs +2 -0
  66. package/dist/lib/capabilities-C0TDQoMY.cjs.map +1 -0
  67. package/dist/lib/capabilities-C7txofmY.js +45 -0
  68. package/dist/lib/capabilities-C7txofmY.js.map +1 -0
  69. package/dist/lib/cli/commands.d.cts +15 -0
  70. package/dist/lib/cli/commands.d.ts +15 -0
  71. package/dist/lib/cli.cjs +5132 -0
  72. package/dist/lib/cli.cjs.map +1 -0
  73. package/dist/lib/cli.d.cts +30 -0
  74. package/dist/lib/cli.d.ts +30 -0
  75. package/dist/lib/cli.js +5131 -0
  76. package/dist/lib/cli.js.map +1 -0
  77. package/dist/lib/collections-Dbc8aRLf.js +233 -0
  78. package/dist/lib/collections-Dbc8aRLf.js.map +1 -0
  79. package/dist/lib/collections-VDy5g9p8.cjs +13 -0
  80. package/dist/lib/collections-VDy5g9p8.cjs.map +1 -0
  81. package/dist/lib/config/index.cjs +2 -0
  82. package/dist/lib/config/index.cjs.map +1 -0
  83. package/dist/lib/config/index.d.cts +100 -0
  84. package/dist/lib/config/index.d.ts +100 -0
  85. package/dist/lib/config/index.js +122 -0
  86. package/dist/lib/config/index.js.map +1 -0
  87. package/dist/lib/content/collections.d.cts +69 -0
  88. package/dist/lib/content/collections.d.ts +69 -0
  89. package/dist/lib/content/frontmatter.d.cts +20 -0
  90. package/dist/lib/content/frontmatter.d.ts +20 -0
  91. package/dist/lib/content/index.cjs +2 -0
  92. package/dist/lib/content/index.cjs.map +1 -0
  93. package/dist/lib/content/index.d.cts +5 -0
  94. package/dist/lib/content/index.d.ts +5 -0
  95. package/dist/lib/content/index.js +28 -0
  96. package/dist/lib/content/index.js.map +1 -0
  97. package/dist/lib/content/markdown.d.cts +6 -0
  98. package/dist/lib/content/markdown.d.ts +6 -0
  99. package/dist/lib/content/raw.d.cts +9 -0
  100. package/dist/lib/content/raw.d.ts +9 -0
  101. package/dist/lib/content/schema.d.cts +14 -0
  102. package/dist/lib/content/schema.d.ts +14 -0
  103. package/dist/lib/errors-0X7pCFNU.cjs +2 -0
  104. package/dist/lib/errors-0X7pCFNU.cjs.map +1 -0
  105. package/dist/lib/errors-ePYxDlhU.js +70 -0
  106. package/dist/lib/errors-ePYxDlhU.js.map +1 -0
  107. package/dist/lib/errors.d.cts +84 -0
  108. package/dist/lib/errors.d.ts +84 -0
  109. package/dist/lib/hydrate-8a3TbQbs.cjs +2 -0
  110. package/dist/lib/hydrate-8a3TbQbs.cjs.map +1 -0
  111. package/dist/lib/hydrate-CgZGrTxF.js +126 -0
  112. package/dist/lib/hydrate-CgZGrTxF.js.map +1 -0
  113. package/dist/lib/image/index.cjs +2 -0
  114. package/dist/lib/image/index.cjs.map +1 -0
  115. package/dist/lib/image/index.d.cts +37 -0
  116. package/dist/lib/image/index.d.ts +37 -0
  117. package/dist/lib/image/index.js +49 -0
  118. package/dist/lib/image/index.js.map +1 -0
  119. package/dist/lib/image/pipeline.d.cts +37 -0
  120. package/dist/lib/image/pipeline.d.ts +37 -0
  121. package/dist/lib/image/registry.cjs +2 -0
  122. package/dist/lib/image/registry.cjs.map +1 -0
  123. package/dist/lib/image/registry.d.cts +26 -0
  124. package/dist/lib/image/registry.d.ts +26 -0
  125. package/dist/lib/image/registry.js +23 -0
  126. package/dist/lib/image/registry.js.map +1 -0
  127. package/dist/lib/image/service.cjs +2 -0
  128. package/dist/lib/image/service.cjs.map +1 -0
  129. package/dist/lib/image/service.d.cts +164 -0
  130. package/dist/lib/image/service.d.ts +164 -0
  131. package/dist/lib/image/service.js +308 -0
  132. package/dist/lib/image/service.js.map +1 -0
  133. package/dist/lib/index.cjs +1 -0
  134. package/dist/lib/index.cjs.map +1 -0
  135. package/dist/lib/index.d.cts +38 -0
  136. package/dist/lib/index.d.ts +38 -0
  137. package/dist/lib/index.js +1 -0
  138. package/dist/lib/index.js.map +1 -0
  139. package/dist/lib/integrations/hooks.d.cts +58 -0
  140. package/dist/lib/integrations/hooks.d.ts +58 -0
  141. package/dist/lib/integrations/index.cjs +1 -0
  142. package/dist/lib/integrations/index.d.cts +18 -0
  143. package/dist/lib/integrations/index.d.ts +18 -0
  144. package/dist/lib/integrations/index.js +2 -0
  145. package/dist/lib/integrations-7dpN1RYB.js +35 -0
  146. package/dist/lib/integrations-7dpN1RYB.js.map +1 -0
  147. package/dist/lib/integrations-DDqfWjvH.cjs +2 -0
  148. package/dist/lib/integrations-DDqfWjvH.cjs.map +1 -0
  149. package/dist/lib/interpolation-plugin-Bt-KRKVY.js +365 -0
  150. package/dist/lib/interpolation-plugin-Bt-KRKVY.js.map +1 -0
  151. package/dist/lib/interpolation-plugin-CMPCDlVJ.cjs +31 -0
  152. package/dist/lib/interpolation-plugin-CMPCDlVJ.cjs.map +1 -0
  153. package/dist/lib/island/generate-entry.d.cts +27 -0
  154. package/dist/lib/island/generate-entry.d.ts +27 -0
  155. package/dist/lib/island/hydrate.d.cts +33 -0
  156. package/dist/lib/island/hydrate.d.ts +33 -0
  157. package/dist/lib/island/index.cjs +1 -0
  158. package/dist/lib/island/index.d.cts +2 -0
  159. package/dist/lib/island/index.d.ts +2 -0
  160. package/dist/lib/island/index.js +1 -0
  161. package/dist/lib/island/island.d.cts +32 -0
  162. package/dist/lib/island/island.d.ts +32 -0
  163. package/dist/lib/island/scan.d.cts +14 -0
  164. package/dist/lib/island/scan.d.ts +14 -0
  165. package/dist/lib/manifest/index.cjs +3 -0
  166. package/dist/lib/manifest/index.cjs.map +1 -0
  167. package/dist/lib/manifest/index.d.cts +18 -0
  168. package/dist/lib/manifest/index.d.ts +18 -0
  169. package/dist/lib/manifest/index.js +110 -0
  170. package/dist/lib/manifest/index.js.map +1 -0
  171. package/dist/lib/middleware/index.d.cts +56 -0
  172. package/dist/lib/middleware/index.d.ts +56 -0
  173. package/dist/lib/middleware/stream-boundary.d.cts +53 -0
  174. package/dist/lib/middleware/stream-boundary.d.ts +53 -0
  175. package/dist/lib/node-http-DRAUhO0c.js +617 -0
  176. package/dist/lib/node-http-DRAUhO0c.js.map +1 -0
  177. package/dist/lib/node-http-DhxguYyz.cjs +13 -0
  178. package/dist/lib/node-http-DhxguYyz.cjs.map +1 -0
  179. package/dist/lib/render/render-to-string.d.cts +12 -0
  180. package/dist/lib/render/render-to-string.d.ts +12 -0
  181. package/dist/lib/render/ssr-flag.d.cts +4 -0
  182. package/dist/lib/render/ssr-flag.d.ts +4 -0
  183. package/dist/lib/route-scanner-JY6YrNH5.cjs +2 -0
  184. package/dist/lib/route-scanner-JY6YrNH5.cjs.map +1 -0
  185. package/dist/lib/route-scanner-XcLId7lK.js +100 -0
  186. package/dist/lib/route-scanner-XcLId7lK.js.map +1 -0
  187. package/dist/lib/router/client.cjs +2 -0
  188. package/dist/lib/router/client.cjs.map +1 -0
  189. package/dist/lib/router/client.d.cts +47 -0
  190. package/dist/lib/router/client.d.ts +47 -0
  191. package/dist/lib/router/client.js +298 -0
  192. package/dist/lib/router/client.js.map +1 -0
  193. package/dist/lib/router/route-scanner.d.cts +50 -0
  194. package/dist/lib/router/route-scanner.d.ts +50 -0
  195. package/dist/lib/runtime/capabilities.d.cts +47 -0
  196. package/dist/lib/runtime/capabilities.d.ts +47 -0
  197. package/dist/lib/runtime/context.d.cts +140 -0
  198. package/dist/lib/runtime/context.d.ts +140 -0
  199. package/dist/lib/runtime/handler.d.cts +39 -0
  200. package/dist/lib/runtime/handler.d.ts +39 -0
  201. package/dist/lib/runtime/index.cjs +1 -0
  202. package/dist/lib/runtime/index.d.cts +6 -0
  203. package/dist/lib/runtime/index.d.ts +6 -0
  204. package/dist/lib/runtime/index.js +4 -0
  205. package/dist/lib/runtime/node-http.d.cts +2 -0
  206. package/dist/lib/runtime/node-http.d.ts +2 -0
  207. package/dist/lib/runtime/security-headers.d.cts +13 -0
  208. package/dist/lib/runtime/security-headers.d.ts +13 -0
  209. package/dist/lib/runtime/static.d.cts +1 -0
  210. package/dist/lib/runtime/static.d.ts +1 -0
  211. package/dist/lib/runtime-CrH5X-Es.cjs +2 -0
  212. package/dist/lib/runtime-CrH5X-Es.cjs.map +1 -0
  213. package/dist/lib/runtime-Ds2-wH6P.js +520 -0
  214. package/dist/lib/runtime-Ds2-wH6P.js.map +1 -0
  215. package/dist/lib/scan-CY2O9ty6.cjs +2 -0
  216. package/dist/lib/scan-CY2O9ty6.cjs.map +1 -0
  217. package/dist/lib/scan-CjMUgnsd.js +22 -0
  218. package/dist/lib/scan-CjMUgnsd.js.map +1 -0
  219. package/dist/lib/scan-DXzYtmRQ.cjs +2 -0
  220. package/dist/lib/scan-DXzYtmRQ.cjs.map +1 -0
  221. package/dist/lib/scan-Dn93ycXG.js +33 -0
  222. package/dist/lib/scan-Dn93ycXG.js.map +1 -0
  223. package/dist/lib/seo/index.cjs +10 -0
  224. package/dist/lib/seo/index.cjs.map +1 -0
  225. package/dist/lib/seo/index.d.cts +99 -0
  226. package/dist/lib/seo/index.d.ts +99 -0
  227. package/dist/lib/seo/index.js +41 -0
  228. package/dist/lib/seo/index.js.map +1 -0
  229. package/dist/lib/shared-CfqOLsKj.cjs +183 -0
  230. package/dist/lib/shared-CfqOLsKj.cjs.map +1 -0
  231. package/dist/lib/shared-DU3iQgr7.js +236 -0
  232. package/dist/lib/shared-DU3iQgr7.js.map +1 -0
  233. package/dist/lib/ssr/match.d.cts +25 -0
  234. package/dist/lib/ssr/match.d.ts +25 -0
  235. package/dist/lib/ssr/render.d.cts +62 -0
  236. package/dist/lib/ssr/render.d.ts +62 -0
  237. package/dist/lib/ssr/server.d.cts +41 -0
  238. package/dist/lib/ssr/server.d.ts +41 -0
  239. package/dist/lib/ssr/stream.d.cts +48 -0
  240. package/dist/lib/ssr/stream.d.ts +48 -0
  241. package/dist/lib/stream-CpOG052V.js +104 -0
  242. package/dist/lib/stream-CpOG052V.js.map +1 -0
  243. package/dist/lib/stream-DmZjYqHm.cjs +17 -0
  244. package/dist/lib/stream-DmZjYqHm.cjs.map +1 -0
  245. package/dist/lib/types.d.cts +97 -0
  246. package/dist/lib/types.d.ts +97 -0
  247. package/dist/lib/vite/index.cjs +2 -0
  248. package/dist/lib/vite/index.cjs.map +1 -0
  249. package/dist/lib/vite/index.d.cts +41 -0
  250. package/dist/lib/vite/index.d.ts +41 -0
  251. package/dist/lib/vite/index.js +229 -0
  252. package/dist/lib/vite/index.js.map +1 -0
  253. package/dist/lib/vite/interpolation-plugin.d.cts +64 -0
  254. package/dist/lib/vite/interpolation-plugin.d.ts +64 -0
  255. package/package.json +292 -0
@@ -0,0 +1,50 @@
1
+ /** A page route discovered by the scanner. */
2
+ export interface PageRoute {
3
+ /** URL path, e.g. "/blog/:slug". */
4
+ path: string;
5
+ /** File system path to the page.ts module. */
6
+ pagePath: string;
7
+ /** File system path to the page.data.ts module, if any. */
8
+ dataPath?: string;
9
+ /** File system path to the page.action.ts module, if any. */
10
+ actionPath?: string;
11
+ /** Ordered list of layout.ts modules from root to leaf. */
12
+ layouts: string[];
13
+ /** File system path to the loading.ts module, if any. */
14
+ loadingPath?: string;
15
+ /** Dynamic parameter names extracted from the path. */
16
+ params: string[];
17
+ /** Whether the route has an optional catch-all segment. */
18
+ optionalCatchAll?: boolean;
19
+ /**
20
+ * Named slot modules discovered in the same directory as the page.
21
+ * Keyed by slot name (filename without `.slot.ts` suffix).
22
+ * (v2.1 — Fix #2: Layout Slots)
23
+ */
24
+ slots?: Record<string, string>;
25
+ }
26
+ /** An API route discovered by the scanner. */
27
+ export interface ApiRoute {
28
+ /** URL path, e.g. "/api/posts". */
29
+ path: string;
30
+ /** File system path to the route.ts module. */
31
+ routePath: string;
32
+ /** Dynamic parameter names extracted from the path. */
33
+ params: string[];
34
+ }
35
+ /** Result of scanning the app directory. */
36
+ export interface ScannedRoutes {
37
+ pages: PageRoute[];
38
+ api: ApiRoute[];
39
+ /** Optional 404 error page. */
40
+ error404?: PageRoute;
41
+ /** Optional 500 error page. */
42
+ error500?: PageRoute;
43
+ }
44
+ /**
45
+ * Scans an app directory for Elur Kit file-based routes.
46
+ *
47
+ * @param appDir Absolute path to the app directory (e.g. "src/app").
48
+ * @returns Discovered page and API routes.
49
+ */
50
+ export declare function scanRoutes(appDir: string): Promise<ScannedRoutes>;
@@ -0,0 +1,50 @@
1
+ /** A page route discovered by the scanner. */
2
+ export interface PageRoute {
3
+ /** URL path, e.g. "/blog/:slug". */
4
+ path: string;
5
+ /** File system path to the page.ts module. */
6
+ pagePath: string;
7
+ /** File system path to the page.data.ts module, if any. */
8
+ dataPath?: string;
9
+ /** File system path to the page.action.ts module, if any. */
10
+ actionPath?: string;
11
+ /** Ordered list of layout.ts modules from root to leaf. */
12
+ layouts: string[];
13
+ /** File system path to the loading.ts module, if any. */
14
+ loadingPath?: string;
15
+ /** Dynamic parameter names extracted from the path. */
16
+ params: string[];
17
+ /** Whether the route has an optional catch-all segment. */
18
+ optionalCatchAll?: boolean;
19
+ /**
20
+ * Named slot modules discovered in the same directory as the page.
21
+ * Keyed by slot name (filename without `.slot.ts` suffix).
22
+ * (v2.1 — Fix #2: Layout Slots)
23
+ */
24
+ slots?: Record<string, string>;
25
+ }
26
+ /** An API route discovered by the scanner. */
27
+ export interface ApiRoute {
28
+ /** URL path, e.g. "/api/posts". */
29
+ path: string;
30
+ /** File system path to the route.ts module. */
31
+ routePath: string;
32
+ /** Dynamic parameter names extracted from the path. */
33
+ params: string[];
34
+ }
35
+ /** Result of scanning the app directory. */
36
+ export interface ScannedRoutes {
37
+ pages: PageRoute[];
38
+ api: ApiRoute[];
39
+ /** Optional 404 error page. */
40
+ error404?: PageRoute;
41
+ /** Optional 500 error page. */
42
+ error500?: PageRoute;
43
+ }
44
+ /**
45
+ * Scans an app directory for Elur Kit file-based routes.
46
+ *
47
+ * @param appDir Absolute path to the app directory (e.g. "src/app").
48
+ * @returns Discovered page and API routes.
49
+ */
50
+ export declare function scanRoutes(appDir: string): Promise<ScannedRoutes>;
@@ -0,0 +1,47 @@
1
+ export type FilesystemCapability = "none" | "readonly" | "persistent" | "ephemeral";
2
+ export interface AdapterCapabilities {
3
+ /** Whether the host supports streaming responses (ReadableStream bodies). */
4
+ streaming: boolean;
5
+ /** Filesystem access model of the host. */
6
+ filesystem: FilesystemCapability;
7
+ /** Whether the host can run image transforms at request time. */
8
+ imageRuntime: boolean;
9
+ /** Whether the host allows background work after the response completes. */
10
+ backgroundWork: boolean;
11
+ /** Maximum request body size in bytes accepted by the host (if any). */
12
+ maxBodySize?: number;
13
+ }
14
+ export interface CapabilityOptions {
15
+ streaming?: boolean;
16
+ filesystem?: FilesystemCapability;
17
+ imageRuntime?: boolean;
18
+ backgroundWork?: boolean;
19
+ maxBodySize?: number;
20
+ }
21
+ /** Default capabilities for a full-featured long-lived Node/Bun process. */
22
+ export declare const DEFAULT_CAPABILITIES: AdapterCapabilities;
23
+ /** Default capabilities for a stateless serverless function (Vercel/Netlify). */
24
+ export declare const SERVERLESS_CAPABILITIES: AdapterCapabilities;
25
+ /** Default capabilities for an edge runtime (read-only filesystem). */
26
+ export declare const EDGE_CAPABILITIES: AdapterCapabilities;
27
+ export declare function createCapabilities(options?: CapabilityOptions): AdapterCapabilities;
28
+ /** True when the host supports streaming responses (streaming !== false). */
29
+ export declare function supportsStreaming(capabilities?: Pick<AdapterCapabilities, "streaming">): boolean;
30
+ /** True when the host can write to persistent storage (for ISR/cache/image writes). */
31
+ export declare function supportsPersistentStorage(capabilities: Pick<AdapterCapabilities, "filesystem">): boolean;
32
+ /** True when the host exposes a writable filesystem at build/runtime. */
33
+ export declare function supportsWritableFilesystem(capabilities: Pick<AdapterCapabilities, "filesystem">): boolean;
34
+ export interface CapabilityDiagnostics {
35
+ ok: boolean;
36
+ problems: string[];
37
+ }
38
+ /**
39
+ * Validates a capability declaration and reports incompatible combinations.
40
+ * Used by the build pipeline so invalid hosts fail at build time instead of
41
+ * producing a broken runtime.
42
+ */
43
+ export declare function validateCapabilities(capabilities: AdapterCapabilities, features?: {
44
+ isr?: boolean;
45
+ images?: boolean;
46
+ streaming?: boolean;
47
+ }): CapabilityDiagnostics;
@@ -0,0 +1,47 @@
1
+ export type FilesystemCapability = "none" | "readonly" | "persistent" | "ephemeral";
2
+ export interface AdapterCapabilities {
3
+ /** Whether the host supports streaming responses (ReadableStream bodies). */
4
+ streaming: boolean;
5
+ /** Filesystem access model of the host. */
6
+ filesystem: FilesystemCapability;
7
+ /** Whether the host can run image transforms at request time. */
8
+ imageRuntime: boolean;
9
+ /** Whether the host allows background work after the response completes. */
10
+ backgroundWork: boolean;
11
+ /** Maximum request body size in bytes accepted by the host (if any). */
12
+ maxBodySize?: number;
13
+ }
14
+ export interface CapabilityOptions {
15
+ streaming?: boolean;
16
+ filesystem?: FilesystemCapability;
17
+ imageRuntime?: boolean;
18
+ backgroundWork?: boolean;
19
+ maxBodySize?: number;
20
+ }
21
+ /** Default capabilities for a full-featured long-lived Node/Bun process. */
22
+ export declare const DEFAULT_CAPABILITIES: AdapterCapabilities;
23
+ /** Default capabilities for a stateless serverless function (Vercel/Netlify). */
24
+ export declare const SERVERLESS_CAPABILITIES: AdapterCapabilities;
25
+ /** Default capabilities for an edge runtime (read-only filesystem). */
26
+ export declare const EDGE_CAPABILITIES: AdapterCapabilities;
27
+ export declare function createCapabilities(options?: CapabilityOptions): AdapterCapabilities;
28
+ /** True when the host supports streaming responses (streaming !== false). */
29
+ export declare function supportsStreaming(capabilities?: Pick<AdapterCapabilities, "streaming">): boolean;
30
+ /** True when the host can write to persistent storage (for ISR/cache/image writes). */
31
+ export declare function supportsPersistentStorage(capabilities: Pick<AdapterCapabilities, "filesystem">): boolean;
32
+ /** True when the host exposes a writable filesystem at build/runtime. */
33
+ export declare function supportsWritableFilesystem(capabilities: Pick<AdapterCapabilities, "filesystem">): boolean;
34
+ export interface CapabilityDiagnostics {
35
+ ok: boolean;
36
+ problems: string[];
37
+ }
38
+ /**
39
+ * Validates a capability declaration and reports incompatible combinations.
40
+ * Used by the build pipeline so invalid hosts fail at build time instead of
41
+ * producing a broken runtime.
42
+ */
43
+ export declare function validateCapabilities(capabilities: AdapterCapabilities, features?: {
44
+ isr?: boolean;
45
+ images?: boolean;
46
+ streaming?: boolean;
47
+ }): CapabilityDiagnostics;
@@ -0,0 +1,140 @@
1
+ import type { ResolvedElurConfig } from "../config/index.js";
2
+ export interface RouteTable {
3
+ pages: import("../router/route-scanner.js").PageRoute[];
4
+ api: import("../router/route-scanner.js").ApiRoute[];
5
+ error404?: import("../router/route-scanner.js").PageRoute;
6
+ error500?: import("../router/route-scanner.js").PageRoute;
7
+ }
8
+ /** Read-only access to request cookies. */
9
+ export interface CookieJar {
10
+ /** Gets a cookie value by name, or undefined if not present. */
11
+ get(name: string): string | undefined;
12
+ /** Returns all cookie name-value pairs. */
13
+ getAll(): Record<string, string>;
14
+ /** Checks if a cookie exists. */
15
+ has(name: string): boolean;
16
+ }
17
+ /** Write access to response cookies (Set-Cookie headers). */
18
+ export interface ResponseCookieJar {
19
+ /** Sets a Set-Cookie header. */
20
+ set(name: string, value: string, options?: CookieOptions): void;
21
+ /** Removes a cookie by setting it expired. */
22
+ clear(name: string, options?: CookieOptions): void;
23
+ /** Returns all Set-Cookie header values accumulated so far. */
24
+ getAll(): string[];
25
+ }
26
+ export interface CookieOptions {
27
+ httpOnly?: boolean;
28
+ secure?: boolean;
29
+ sameSite?: "strict" | "lax" | "none";
30
+ maxAge?: number;
31
+ expires?: Date;
32
+ path?: string;
33
+ domain?: string;
34
+ }
35
+ /** Mutable response state accumulated during the request lifecycle. */
36
+ export interface ResponseState {
37
+ status?: number;
38
+ headers: Headers;
39
+ cookies: ResponseCookieJar;
40
+ }
41
+ export interface RequestContextOptions {
42
+ request: Request;
43
+ config: ResolvedElurConfig;
44
+ routes: RouteTable;
45
+ actions: import("../action/scan.js").ActionRegistry;
46
+ /** Public action names serialized into the HTML shell. */
47
+ publicActions: Record<string, string[]>;
48
+ /** Optional module loader for adapter-bundled entries. */
49
+ importer?: (path: string) => unknown | Promise<unknown>;
50
+ /** Whether the render endpoint (/__elur-js/render) is available. */
51
+ renderEndpoint?: boolean;
52
+ /** Whether to bypass the ISR cache (dev mode). */
53
+ noCache?: boolean;
54
+ /** ISR cache directory (absolute). */
55
+ cacheDir?: string;
56
+ /** Default ISR revalidate interval in seconds. */
57
+ defaultRevalidate?: number;
58
+ /** Route params (populated after route matching). */
59
+ params?: Record<string, string | string[] | undefined>;
60
+ /** Per-request locals (populated by middleware). */
61
+ locals?: Record<string, unknown>;
62
+ /** Abort signal for the request (from host disconnect). */
63
+ signal?: AbortSignal;
64
+ /** Request ID (auto-generated if not provided). */
65
+ requestId?: string;
66
+ /** Platform-specific context (e.g. Vercel, Netlify). */
67
+ platform?: unknown;
68
+ /** Matched route (populated after route matching). */
69
+ route?: import("../router/route-scanner.js").PageRoute | import("../router/route-scanner.js").ApiRoute;
70
+ }
71
+ export declare class RequestContext {
72
+ readonly request: Request;
73
+ readonly url: URL;
74
+ readonly config: ResolvedElurConfig;
75
+ readonly routes: RouteTable;
76
+ readonly actions: import("../action/scan.js").ActionRegistry;
77
+ readonly publicActions: Record<string, string[]>;
78
+ readonly importer?: (path: string) => unknown | Promise<unknown>;
79
+ readonly renderEndpoint: boolean;
80
+ readonly noCache: boolean;
81
+ readonly cacheDir?: string;
82
+ readonly defaultRevalidate?: number;
83
+ /** Route params derived from the matched route. */
84
+ params: Readonly<Record<string, string | string[] | undefined>>;
85
+ /** Per-request locals, populated by middleware. Not global. */
86
+ locals: Record<string, unknown>;
87
+ /** Read-only access to request cookies. */
88
+ readonly cookies: CookieJar;
89
+ /** Abort signal (from host disconnect when platform allows). */
90
+ readonly signal: AbortSignal;
91
+ /** Unique request ID for logging/correlation. */
92
+ readonly requestId: string;
93
+ /** Platform-specific context (Vercel, Netlify, etc.). */
94
+ readonly platform: unknown;
95
+ /** Matched route after route matching. */
96
+ route?: import("../router/route-scanner.js").PageRoute | import("../router/route-scanner.js").ApiRoute;
97
+ /** Mutable response state accumulated during the request. */
98
+ readonly response: ResponseState;
99
+ constructor(options: RequestContextOptions);
100
+ /** The pathname without a query string. */
101
+ get pathname(): string;
102
+ /** The HTTP method, uppercased. */
103
+ get method(): string;
104
+ /** Whether the request accepts JSON. */
105
+ get wantsJson(): boolean;
106
+ /** Search params from the request URL. */
107
+ get searchParams(): URLSearchParams;
108
+ /** Render config passed to renderPage/renderErrorPage. */
109
+ get renderConfig(): {
110
+ lang?: string;
111
+ clientEntry?: string;
112
+ renderEndpoint?: boolean;
113
+ };
114
+ /** Applies accumulated response state (headers, cookies, status) to a Response. */
115
+ applyToResponse(response: Response): Response;
116
+ }
117
+ export declare function htmlResponse(body: string, status?: number, headers?: HeadersInit): Response;
118
+ export declare function jsonResponse(data: unknown, status?: number, headers?: HeadersInit): Response;
119
+ export declare function textResponse(body: string, status?: number, headers?: HeadersInit): Response;
120
+ export declare function notFound(body?: string): Response;
121
+ export declare function methodNotAllowed(method: string): Response;
122
+ export declare function serverError(body: string): Response;
123
+ export declare function guessContentType(filePath: string): string;
124
+ /**
125
+ * Serves a static file from the root directory with full conditional and
126
+ * range support:
127
+ *
128
+ * - ETag / Last-Modified with If-None-Match / If-Modified-Since → 304.
129
+ * - `Range` with `If-Range` (ETag or date) → 206 with `Content-Range`.
130
+ * - HEAD → same headers as GET without a body.
131
+ * - Invalid/unsatisfiable ranges → 416 with a `Content-Range: bytes (asterisk)/size` header.
132
+ *
133
+ * Files with content hashes in their names (e.g. `app-abc123.js`) get
134
+ * `Cache-Control: public, max-age=31536000, immutable`.
135
+ *
136
+ * @param root Static file root (absolute path).
137
+ * @param pathname Request pathname.
138
+ * @param request Optional request for conditional/range/HEAD handling.
139
+ */
140
+ export declare function serveStaticFile(root: string, pathname: string, request?: Request): Promise<Response | null>;
@@ -0,0 +1,140 @@
1
+ import type { ResolvedElurConfig } from "../config/index.js";
2
+ export interface RouteTable {
3
+ pages: import("../router/route-scanner.js").PageRoute[];
4
+ api: import("../router/route-scanner.js").ApiRoute[];
5
+ error404?: import("../router/route-scanner.js").PageRoute;
6
+ error500?: import("../router/route-scanner.js").PageRoute;
7
+ }
8
+ /** Read-only access to request cookies. */
9
+ export interface CookieJar {
10
+ /** Gets a cookie value by name, or undefined if not present. */
11
+ get(name: string): string | undefined;
12
+ /** Returns all cookie name-value pairs. */
13
+ getAll(): Record<string, string>;
14
+ /** Checks if a cookie exists. */
15
+ has(name: string): boolean;
16
+ }
17
+ /** Write access to response cookies (Set-Cookie headers). */
18
+ export interface ResponseCookieJar {
19
+ /** Sets a Set-Cookie header. */
20
+ set(name: string, value: string, options?: CookieOptions): void;
21
+ /** Removes a cookie by setting it expired. */
22
+ clear(name: string, options?: CookieOptions): void;
23
+ /** Returns all Set-Cookie header values accumulated so far. */
24
+ getAll(): string[];
25
+ }
26
+ export interface CookieOptions {
27
+ httpOnly?: boolean;
28
+ secure?: boolean;
29
+ sameSite?: "strict" | "lax" | "none";
30
+ maxAge?: number;
31
+ expires?: Date;
32
+ path?: string;
33
+ domain?: string;
34
+ }
35
+ /** Mutable response state accumulated during the request lifecycle. */
36
+ export interface ResponseState {
37
+ status?: number;
38
+ headers: Headers;
39
+ cookies: ResponseCookieJar;
40
+ }
41
+ export interface RequestContextOptions {
42
+ request: Request;
43
+ config: ResolvedElurConfig;
44
+ routes: RouteTable;
45
+ actions: import("../action/scan.js").ActionRegistry;
46
+ /** Public action names serialized into the HTML shell. */
47
+ publicActions: Record<string, string[]>;
48
+ /** Optional module loader for adapter-bundled entries. */
49
+ importer?: (path: string) => unknown | Promise<unknown>;
50
+ /** Whether the render endpoint (/__elur-js/render) is available. */
51
+ renderEndpoint?: boolean;
52
+ /** Whether to bypass the ISR cache (dev mode). */
53
+ noCache?: boolean;
54
+ /** ISR cache directory (absolute). */
55
+ cacheDir?: string;
56
+ /** Default ISR revalidate interval in seconds. */
57
+ defaultRevalidate?: number;
58
+ /** Route params (populated after route matching). */
59
+ params?: Record<string, string | string[] | undefined>;
60
+ /** Per-request locals (populated by middleware). */
61
+ locals?: Record<string, unknown>;
62
+ /** Abort signal for the request (from host disconnect). */
63
+ signal?: AbortSignal;
64
+ /** Request ID (auto-generated if not provided). */
65
+ requestId?: string;
66
+ /** Platform-specific context (e.g. Vercel, Netlify). */
67
+ platform?: unknown;
68
+ /** Matched route (populated after route matching). */
69
+ route?: import("../router/route-scanner.js").PageRoute | import("../router/route-scanner.js").ApiRoute;
70
+ }
71
+ export declare class RequestContext {
72
+ readonly request: Request;
73
+ readonly url: URL;
74
+ readonly config: ResolvedElurConfig;
75
+ readonly routes: RouteTable;
76
+ readonly actions: import("../action/scan.js").ActionRegistry;
77
+ readonly publicActions: Record<string, string[]>;
78
+ readonly importer?: (path: string) => unknown | Promise<unknown>;
79
+ readonly renderEndpoint: boolean;
80
+ readonly noCache: boolean;
81
+ readonly cacheDir?: string;
82
+ readonly defaultRevalidate?: number;
83
+ /** Route params derived from the matched route. */
84
+ params: Readonly<Record<string, string | string[] | undefined>>;
85
+ /** Per-request locals, populated by middleware. Not global. */
86
+ locals: Record<string, unknown>;
87
+ /** Read-only access to request cookies. */
88
+ readonly cookies: CookieJar;
89
+ /** Abort signal (from host disconnect when platform allows). */
90
+ readonly signal: AbortSignal;
91
+ /** Unique request ID for logging/correlation. */
92
+ readonly requestId: string;
93
+ /** Platform-specific context (Vercel, Netlify, etc.). */
94
+ readonly platform: unknown;
95
+ /** Matched route after route matching. */
96
+ route?: import("../router/route-scanner.js").PageRoute | import("../router/route-scanner.js").ApiRoute;
97
+ /** Mutable response state accumulated during the request. */
98
+ readonly response: ResponseState;
99
+ constructor(options: RequestContextOptions);
100
+ /** The pathname without a query string. */
101
+ get pathname(): string;
102
+ /** The HTTP method, uppercased. */
103
+ get method(): string;
104
+ /** Whether the request accepts JSON. */
105
+ get wantsJson(): boolean;
106
+ /** Search params from the request URL. */
107
+ get searchParams(): URLSearchParams;
108
+ /** Render config passed to renderPage/renderErrorPage. */
109
+ get renderConfig(): {
110
+ lang?: string;
111
+ clientEntry?: string;
112
+ renderEndpoint?: boolean;
113
+ };
114
+ /** Applies accumulated response state (headers, cookies, status) to a Response. */
115
+ applyToResponse(response: Response): Response;
116
+ }
117
+ export declare function htmlResponse(body: string, status?: number, headers?: HeadersInit): Response;
118
+ export declare function jsonResponse(data: unknown, status?: number, headers?: HeadersInit): Response;
119
+ export declare function textResponse(body: string, status?: number, headers?: HeadersInit): Response;
120
+ export declare function notFound(body?: string): Response;
121
+ export declare function methodNotAllowed(method: string): Response;
122
+ export declare function serverError(body: string): Response;
123
+ export declare function guessContentType(filePath: string): string;
124
+ /**
125
+ * Serves a static file from the root directory with full conditional and
126
+ * range support:
127
+ *
128
+ * - ETag / Last-Modified with If-None-Match / If-Modified-Since → 304.
129
+ * - `Range` with `If-Range` (ETag or date) → 206 with `Content-Range`.
130
+ * - HEAD → same headers as GET without a body.
131
+ * - Invalid/unsatisfiable ranges → 416 with a `Content-Range: bytes (asterisk)/size` header.
132
+ *
133
+ * Files with content hashes in their names (e.g. `app-abc123.js`) get
134
+ * `Cache-Control: public, max-age=31536000, immutable`.
135
+ *
136
+ * @param root Static file root (absolute path).
137
+ * @param pathname Request pathname.
138
+ * @param request Optional request for conditional/range/HEAD handling.
139
+ */
140
+ export declare function serveStaticFile(root: string, pathname: string, request?: Request): Promise<Response | null>;
@@ -0,0 +1,39 @@
1
+ import type { SecurityHeadersConfig } from "../config/index.js";
2
+ export interface WebHandlerOptions {
3
+ /** Static file root (absolute path). Usually the build output directory. */
4
+ staticRoot: string;
5
+ /** Whether to bypass the ISR cache (dev mode). */
6
+ noCache?: boolean;
7
+ /** ISR cache directory (absolute). */
8
+ cacheDir?: string;
9
+ /** Default ISR revalidate interval in seconds. */
10
+ defaultRevalidate?: number;
11
+ /** Optional module loader for adapter-bundled entries. */
12
+ importer?: (path: string) => Promise<unknown>;
13
+ /** HTML lang attribute. */
14
+ lang?: string;
15
+ /** Client entry path. */
16
+ clientEntry?: string;
17
+ /** Whether the render endpoint exists. */
18
+ renderEndpoint?: boolean;
19
+ /** Security headers config (runtime-security §14). `false` disables. */
20
+ securityHeaders?: SecurityHeadersConfig | false;
21
+ }
22
+ export interface WebHandlerRouteTable {
23
+ pages: import("../router/route-scanner.js").PageRoute[];
24
+ api: import("../router/route-scanner.js").ApiRoute[];
25
+ error404?: import("../router/route-scanner.js").PageRoute;
26
+ error500?: import("../router/route-scanner.js").PageRoute;
27
+ }
28
+ export interface WebHandlerActionRegistry {
29
+ [pagePath: string]: Record<string, string>;
30
+ }
31
+ export interface CreateWebHandlerResult {
32
+ (request: Request): Promise<Response>;
33
+ }
34
+ /**
35
+ * Create a unified Web handler from scanned routes, actions and options.
36
+ *
37
+ * The returned function is the single entry point for all runtimes.
38
+ */
39
+ export declare function createWebHandler(routes: WebHandlerRouteTable, actions: WebHandlerActionRegistry, options: WebHandlerOptions): CreateWebHandlerResult;
@@ -0,0 +1,39 @@
1
+ import type { SecurityHeadersConfig } from "../config/index.js";
2
+ export interface WebHandlerOptions {
3
+ /** Static file root (absolute path). Usually the build output directory. */
4
+ staticRoot: string;
5
+ /** Whether to bypass the ISR cache (dev mode). */
6
+ noCache?: boolean;
7
+ /** ISR cache directory (absolute). */
8
+ cacheDir?: string;
9
+ /** Default ISR revalidate interval in seconds. */
10
+ defaultRevalidate?: number;
11
+ /** Optional module loader for adapter-bundled entries. */
12
+ importer?: (path: string) => Promise<unknown>;
13
+ /** HTML lang attribute. */
14
+ lang?: string;
15
+ /** Client entry path. */
16
+ clientEntry?: string;
17
+ /** Whether the render endpoint exists. */
18
+ renderEndpoint?: boolean;
19
+ /** Security headers config (runtime-security §14). `false` disables. */
20
+ securityHeaders?: SecurityHeadersConfig | false;
21
+ }
22
+ export interface WebHandlerRouteTable {
23
+ pages: import("../router/route-scanner.js").PageRoute[];
24
+ api: import("../router/route-scanner.js").ApiRoute[];
25
+ error404?: import("../router/route-scanner.js").PageRoute;
26
+ error500?: import("../router/route-scanner.js").PageRoute;
27
+ }
28
+ export interface WebHandlerActionRegistry {
29
+ [pagePath: string]: Record<string, string>;
30
+ }
31
+ export interface CreateWebHandlerResult {
32
+ (request: Request): Promise<Response>;
33
+ }
34
+ /**
35
+ * Create a unified Web handler from scanned routes, actions and options.
36
+ *
37
+ * The returned function is the single entry point for all runtimes.
38
+ */
39
+ export declare function createWebHandler(routes: WebHandlerRouteTable, actions: WebHandlerActionRegistry, options: WebHandlerOptions): CreateWebHandlerResult;
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../node-http-DhxguYyz.cjs"),t=require("../runtime-CrH5X-Es.cjs"),n=require("../capabilities-C0TDQoMY.cjs");exports.DEFAULT_CAPABILITIES=n.t,exports.DEFAULT_SECURITY_HEADERS=t.n,exports.EDGE_CAPABILITIES=n.n,exports.RequestContext=t.a,exports.SERVERLESS_CAPABILITIES=n.r,exports.applySecurityHeaders=t.r,exports.buildSecurityHeaders=t.i,exports.createCapabilities=n.i,exports.createWebHandler=t.t,exports.guessContentType=t.o,exports.htmlResponse=t.s,exports.incomingMessageToRequest=e.t,exports.jsonResponse=t.c,exports.methodNotAllowed=t.l,exports.notFound=t.u,exports.resolveStaticFile=t.m,exports.serveStaticFile=t.d,exports.serverError=t.f,exports.supportsPersistentStorage=n.a,exports.supportsStreaming=n.o,exports.supportsWritableFilesystem=n.s,exports.textResponse=t.p,exports.validateCapabilities=n.c;
@@ -0,0 +1,6 @@
1
+ export { RequestContext, type RequestContextOptions, type RouteTable, type CookieJar, type ResponseCookieJar, type ResponseState, type CookieOptions, htmlResponse, jsonResponse, textResponse, notFound, methodNotAllowed, serverError, guessContentType, serveStaticFile, } from "./context.js";
2
+ export { createWebHandler, type WebHandlerOptions, type WebHandlerRouteTable, type WebHandlerActionRegistry, type CreateWebHandlerResult, } from "./handler.js";
3
+ export { resolveStaticFile } from "./static.js";
4
+ export { incomingMessageToRequest } from "./node-http.js";
5
+ export { buildSecurityHeaders, applySecurityHeaders, DEFAULT_SECURITY_HEADERS, } from "./security-headers.js";
6
+ export { DEFAULT_CAPABILITIES, SERVERLESS_CAPABILITIES, EDGE_CAPABILITIES, createCapabilities, supportsStreaming, supportsPersistentStorage, supportsWritableFilesystem, validateCapabilities, type AdapterCapabilities, type FilesystemCapability, type CapabilityOptions, type CapabilityDiagnostics, } from "./capabilities.js";
@@ -0,0 +1,6 @@
1
+ export { RequestContext, type RequestContextOptions, type RouteTable, type CookieJar, type ResponseCookieJar, type ResponseState, type CookieOptions, htmlResponse, jsonResponse, textResponse, notFound, methodNotAllowed, serverError, guessContentType, serveStaticFile, } from "./context.js";
2
+ export { createWebHandler, type WebHandlerOptions, type WebHandlerRouteTable, type WebHandlerActionRegistry, type CreateWebHandlerResult, } from "./handler.js";
3
+ export { resolveStaticFile } from "./static.js";
4
+ export { incomingMessageToRequest } from "./node-http.js";
5
+ export { buildSecurityHeaders, applySecurityHeaders, DEFAULT_SECURITY_HEADERS, } from "./security-headers.js";
6
+ export { DEFAULT_CAPABILITIES, SERVERLESS_CAPABILITIES, EDGE_CAPABILITIES, createCapabilities, supportsStreaming, supportsPersistentStorage, supportsWritableFilesystem, validateCapabilities, type AdapterCapabilities, type FilesystemCapability, type CapabilityOptions, type CapabilityDiagnostics, } from "./capabilities.js";
@@ -0,0 +1,4 @@
1
+ import { t as e } from "../node-http-DRAUhO0c.js";
2
+ import { a as t, c as n, d as r, f as i, i as a, l as o, m as s, n as c, o as l, p as u, r as d, s as f, t as p, u as m } from "../runtime-Ds2-wH6P.js";
3
+ import { a as h, c as g, i as _, n as v, o as y, r as b, s as x, t as S } from "../capabilities-C7txofmY.js";
4
+ export { S as DEFAULT_CAPABILITIES, c as DEFAULT_SECURITY_HEADERS, v as EDGE_CAPABILITIES, t as RequestContext, b as SERVERLESS_CAPABILITIES, d as applySecurityHeaders, a as buildSecurityHeaders, _ as createCapabilities, p as createWebHandler, l as guessContentType, f as htmlResponse, e as incomingMessageToRequest, n as jsonResponse, o as methodNotAllowed, m as notFound, s as resolveStaticFile, r as serveStaticFile, i as serverError, h as supportsPersistentStorage, y as supportsStreaming, x as supportsWritableFilesystem, u as textResponse, g as validateCapabilities };
@@ -0,0 +1,2 @@
1
+ import type { IncomingMessage } from "node:http";
2
+ export declare function incomingMessageToRequest(req: IncomingMessage, body?: BodyInit | null): Request;
@@ -0,0 +1,2 @@
1
+ import type { IncomingMessage } from "node:http";
2
+ export declare function incomingMessageToRequest(req: IncomingMessage, body?: BodyInit | null): Request;
@@ -0,0 +1,13 @@
1
+ import type { SecurityHeadersConfig } from "../config/index.js";
2
+ /** Default security headers applied when `security.headers` is not `false`. */
3
+ export declare const DEFAULT_SECURITY_HEADERS: Required<Omit<SecurityHeadersConfig, "contentSecurityPolicy" | "hsts" | "permissionsPolicy">>;
4
+ /**
5
+ * Builds the security headers map from the resolved config.
6
+ * Returns an empty map if headers are disabled.
7
+ */
8
+ export declare function buildSecurityHeaders(config: SecurityHeadersConfig | false, isHttps: boolean, nonce?: string): Record<string, string>;
9
+ /**
10
+ * Applies security headers to an existing Response, preserving any
11
+ * user-set headers unless overridden by security config.
12
+ */
13
+ export declare function applySecurityHeaders(response: Response, headers: Record<string, string>): Response;
@@ -0,0 +1,13 @@
1
+ import type { SecurityHeadersConfig } from "../config/index.js";
2
+ /** Default security headers applied when `security.headers` is not `false`. */
3
+ export declare const DEFAULT_SECURITY_HEADERS: Required<Omit<SecurityHeadersConfig, "contentSecurityPolicy" | "hsts" | "permissionsPolicy">>;
4
+ /**
5
+ * Builds the security headers map from the resolved config.
6
+ * Returns an empty map if headers are disabled.
7
+ */
8
+ export declare function buildSecurityHeaders(config: SecurityHeadersConfig | false, isHttps: boolean, nonce?: string): Record<string, string>;
9
+ /**
10
+ * Applies security headers to an existing Response, preserving any
11
+ * user-set headers unless overridden by security config.
12
+ */
13
+ export declare function applySecurityHeaders(response: Response, headers: Record<string, string>): Response;
@@ -0,0 +1 @@
1
+ export declare function resolveStaticFile(root: string, pathname: string): Promise<string | null>;
@@ -0,0 +1 @@
1
+ export declare function resolveStaticFile(root: string, pathname: string): Promise<string | null>;