elysia 2.0.0-exp.5 → 2.0.0-exp.50

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 (348) hide show
  1. package/dist/_virtual/_rolldown/runtime.js +0 -14
  2. package/dist/_virtual/_rolldown/runtime.mjs +2 -0
  3. package/dist/adapter/bun/index.d.ts +3 -26
  4. package/dist/adapter/bun/index.js +175 -58
  5. package/dist/adapter/bun/index.mjs +176 -59
  6. package/dist/adapter/constants.d.ts +3 -26
  7. package/dist/adapter/default-headers.d.ts +4 -0
  8. package/dist/adapter/default-headers.js +7 -0
  9. package/dist/adapter/default-headers.mjs +5 -0
  10. package/dist/adapter/index.d.ts +1 -26
  11. package/dist/adapter/index.js +1 -19
  12. package/dist/adapter/index.mjs +1 -19
  13. package/dist/adapter/response-ownership.d.ts +5 -0
  14. package/dist/adapter/response-ownership.js +13 -0
  15. package/dist/adapter/response-ownership.mjs +10 -0
  16. package/dist/adapter/skip-clone.d.ts +4 -0
  17. package/dist/adapter/skip-clone.js +7 -0
  18. package/dist/adapter/skip-clone.mjs +5 -0
  19. package/dist/adapter/types.d.ts +8 -34
  20. package/dist/adapter/utils.d.ts +22 -17
  21. package/dist/adapter/utils.js +352 -160
  22. package/dist/adapter/utils.mjs +352 -160
  23. package/dist/adapter/web-standard/handler.d.ts +3 -3
  24. package/dist/adapter/web-standard/handler.js +85 -84
  25. package/dist/adapter/web-standard/handler.mjs +86 -85
  26. package/dist/adapter/web-standard/index.d.ts +2 -26
  27. package/dist/adapter/web-standard/index.js +47 -2
  28. package/dist/adapter/web-standard/index.mjs +47 -2
  29. package/dist/adapter/web-standard/utils.js +9 -2
  30. package/dist/adapter/web-standard/utils.mjs +9 -2
  31. package/dist/base.d.ts +187 -338
  32. package/dist/base.js +831 -352
  33. package/dist/base.mjs +833 -354
  34. package/dist/compile/analysis-cache.d.ts +6 -0
  35. package/dist/compile/analysis-cache.js +14 -0
  36. package/dist/compile/analysis-cache.mjs +13 -0
  37. package/dist/compile/aot-capture.d.ts +24 -0
  38. package/dist/compile/aot-capture.js +373 -0
  39. package/dist/compile/aot-capture.mjs +361 -0
  40. package/dist/compile/aot-emit.d.ts +29 -0
  41. package/dist/compile/aot-emit.js +107 -0
  42. package/dist/compile/aot-emit.mjs +101 -0
  43. package/dist/compile/aot-reconstruct.d.ts +30 -0
  44. package/dist/compile/aot-reconstruct.js +156 -0
  45. package/dist/compile/aot-reconstruct.mjs +147 -0
  46. package/dist/compile/aot.d.ts +141 -60
  47. package/dist/compile/aot.js +169 -244
  48. package/dist/compile/aot.mjs +153 -234
  49. package/dist/compile/handler/descriptor.d.ts +80 -0
  50. package/dist/compile/handler/descriptor.js +200 -0
  51. package/dist/compile/handler/descriptor.mjs +195 -0
  52. package/dist/compile/handler/frozen-validator.d.ts +39 -0
  53. package/dist/compile/handler/frozen-validator.js +322 -0
  54. package/dist/compile/handler/frozen-validator.mjs +316 -0
  55. package/dist/compile/handler/index.d.ts +12 -4
  56. package/dist/compile/handler/index.js +192 -62
  57. package/dist/compile/handler/index.mjs +191 -65
  58. package/dist/compile/handler/jit.d.ts +13 -7
  59. package/dist/compile/handler/jit.js +223 -147
  60. package/dist/compile/handler/jit.mjs +227 -152
  61. package/dist/compile/handler/params.d.ts +5 -1
  62. package/dist/compile/handler/params.js +20 -3
  63. package/dist/compile/handler/params.mjs +22 -5
  64. package/dist/compile/handler/reconstruct.d.ts +3 -4
  65. package/dist/compile/handler/reconstruct.js +36 -15
  66. package/dist/compile/handler/reconstruct.mjs +36 -15
  67. package/dist/compile/handler/utils.d.ts +18 -12
  68. package/dist/compile/handler/utils.js +174 -128
  69. package/dist/compile/handler/utils.mjs +156 -113
  70. package/dist/compile/jit-probe.d.ts +0 -4
  71. package/dist/compile/jit-probe.js +1 -11
  72. package/dist/compile/jit-probe.mjs +1 -11
  73. package/dist/compile/lexer.d.ts +7 -0
  74. package/dist/compile/lexer.js +53 -0
  75. package/dist/compile/lexer.mjs +48 -0
  76. package/dist/compile/utils.js +8 -4
  77. package/dist/compile/utils.mjs +8 -4
  78. package/dist/constants.d.ts +4 -25
  79. package/dist/constants.js +17 -17
  80. package/dist/constants.mjs +15 -15
  81. package/dist/context.d.ts +14 -48
  82. package/dist/context.js +43 -20
  83. package/dist/context.mjs +44 -21
  84. package/dist/cookie/config.d.ts +5 -1
  85. package/dist/cookie/config.js +19 -22
  86. package/dist/cookie/config.mjs +18 -22
  87. package/dist/cookie/cookie.d.ts +3 -5
  88. package/dist/cookie/cookie.js +42 -23
  89. package/dist/cookie/cookie.mjs +43 -23
  90. package/dist/cookie/crypto.d.ts +20 -0
  91. package/dist/cookie/crypto.js +164 -0
  92. package/dist/cookie/crypto.mjs +147 -0
  93. package/dist/cookie/error.d.ts +17 -0
  94. package/dist/cookie/error.js +25 -0
  95. package/dist/cookie/error.mjs +24 -0
  96. package/dist/cookie/index.d.ts +5 -3
  97. package/dist/cookie/index.js +5 -3
  98. package/dist/cookie/index.mjs +4 -2
  99. package/dist/cookie/lib.d.ts +1 -1
  100. package/dist/cookie/lib.js +15 -13
  101. package/dist/cookie/lib.mjs +15 -13
  102. package/dist/cookie/serialize.js +5 -1
  103. package/dist/cookie/serialize.mjs +5 -1
  104. package/dist/cookie/types.d.ts +1 -3
  105. package/dist/cookie/utils.d.ts +14 -7
  106. package/dist/cookie/utils.js +107 -95
  107. package/dist/cookie/utils.mjs +102 -91
  108. package/dist/error.d.ts +100 -19
  109. package/dist/error.js +355 -120
  110. package/dist/error.mjs +347 -119
  111. package/dist/generation.d.ts +30 -0
  112. package/dist/generation.js +23 -0
  113. package/dist/generation.mjs +17 -0
  114. package/dist/handler/error.js +37 -6
  115. package/dist/handler/error.mjs +38 -7
  116. package/dist/handler/fetch.js +175 -130
  117. package/dist/handler/fetch.mjs +175 -130
  118. package/dist/handler/index.d.ts +1 -3
  119. package/dist/handler/index.js +1 -5
  120. package/dist/handler/index.mjs +1 -3
  121. package/dist/handler/utils.d.ts +11 -2
  122. package/dist/handler/utils.js +27 -5
  123. package/dist/handler/utils.mjs +24 -5
  124. package/dist/index.d.ts +17 -10
  125. package/dist/index.js +19 -7
  126. package/dist/index.mjs +11 -8
  127. package/dist/memory.js +2 -2
  128. package/dist/memory.mjs +2 -2
  129. package/dist/package.js +11 -0
  130. package/dist/package.mjs +5 -0
  131. package/dist/parse-query.js +38 -22
  132. package/dist/parse-query.mjs +38 -22
  133. package/dist/plugin/{bun.d.ts → aot/bun.d.ts} +4 -2
  134. package/dist/plugin/aot/bun.js +35 -0
  135. package/dist/plugin/aot/bun.mjs +34 -0
  136. package/dist/plugin/aot/core.d.ts +291 -0
  137. package/dist/plugin/aot/core.js +505 -0
  138. package/dist/plugin/aot/core.mjs +481 -0
  139. package/dist/plugin/{esbuild.d.ts → aot/esbuild.d.ts} +5 -3
  140. package/dist/plugin/aot/esbuild.js +48 -0
  141. package/dist/plugin/aot/esbuild.mjs +46 -0
  142. package/dist/plugin/aot/hooks.d.ts +28 -0
  143. package/dist/plugin/aot/hooks.js +114 -0
  144. package/dist/plugin/aot/hooks.mjs +112 -0
  145. package/dist/plugin/aot/rspack-loader.d.ts +23 -0
  146. package/dist/plugin/aot/rspack-loader.js +44 -0
  147. package/dist/plugin/aot/rspack-loader.mjs +40 -0
  148. package/dist/plugin/aot/rspack.d.ts +23 -0
  149. package/dist/plugin/aot/rspack.js +85 -0
  150. package/dist/plugin/aot/rspack.mjs +82 -0
  151. package/dist/plugin/aot/source.d.ts +60 -0
  152. package/dist/plugin/aot/source.js +422 -0
  153. package/dist/plugin/aot/source.mjs +418 -0
  154. package/dist/plugin/aot/treeshake.d.ts +4 -0
  155. package/dist/plugin/aot/treeshake.js +95 -0
  156. package/dist/plugin/aot/treeshake.mjs +94 -0
  157. package/dist/plugin/aot/unplugin.d.ts +54 -0
  158. package/dist/plugin/aot/unplugin.js +68 -0
  159. package/dist/plugin/aot/unplugin.mjs +66 -0
  160. package/dist/plugin/{vite.d.ts → aot/vite.d.ts} +4 -3
  161. package/dist/plugin/aot/vite.js +34 -0
  162. package/dist/plugin/aot/vite.mjs +33 -0
  163. package/dist/plugin/aot/worker.js +28 -0
  164. package/dist/plugin/aot/worker.mjs +27 -0
  165. package/dist/plugin/auto-head.d.ts +6 -0
  166. package/dist/plugin/auto-head.js +38 -0
  167. package/dist/plugin/auto-head.mjs +36 -0
  168. package/dist/plugin/trace.d.ts +10 -0
  169. package/dist/plugin/trace.js +39 -0
  170. package/dist/plugin/trace.mjs +36 -0
  171. package/dist/plugin/websocket.d.ts +6 -0
  172. package/dist/plugin/websocket.js +61 -0
  173. package/dist/plugin/websocket.mjs +60 -0
  174. package/dist/route-table.d.ts +25 -0
  175. package/dist/route-table.js +59 -0
  176. package/dist/route-table.mjs +56 -0
  177. package/dist/schema-snapshot.d.ts +5 -0
  178. package/dist/schema-snapshot.js +111 -0
  179. package/dist/schema-snapshot.mjs +108 -0
  180. package/dist/sucrose.d.ts +1 -23
  181. package/dist/sucrose.js +527 -210
  182. package/dist/sucrose.mjs +528 -208
  183. package/dist/trace.d.ts +27 -57
  184. package/dist/trace.js +256 -141
  185. package/dist/trace.mjs +256 -141
  186. package/dist/type/bridge-live.d.ts +15 -0
  187. package/dist/type/bridge-live.js +38 -0
  188. package/dist/type/bridge-live.mjs +17 -0
  189. package/dist/type/bridge.d.ts +12 -5
  190. package/dist/type/bridge.js +26 -0
  191. package/dist/type/bridge.mjs +8 -1
  192. package/dist/type/coerce-plan.d.ts +38 -0
  193. package/dist/type/coerce-plan.js +110 -0
  194. package/dist/type/coerce-plan.mjs +101 -0
  195. package/dist/type/coerce.d.ts +6 -24
  196. package/dist/type/coerce.js +49 -172
  197. package/dist/type/coerce.mjs +35 -158
  198. package/dist/type/compat.js +6 -3
  199. package/dist/type/compat.mjs +7 -4
  200. package/dist/type/constants.d.ts +1 -1
  201. package/dist/type/elysia/accelerate.js +2 -1
  202. package/dist/type/elysia/accelerate.mjs +2 -1
  203. package/dist/type/elysia/array-buffer.d.ts +1 -2
  204. package/dist/type/elysia/array-buffer.js +9 -3
  205. package/dist/type/elysia/array-buffer.mjs +10 -4
  206. package/dist/type/elysia/array-string.js +3 -3
  207. package/dist/type/elysia/array-string.mjs +1 -1
  208. package/dist/type/elysia/array.js +7 -4
  209. package/dist/type/elysia/array.mjs +7 -4
  210. package/dist/type/elysia/boolean.js +6 -3
  211. package/dist/type/elysia/boolean.mjs +6 -3
  212. package/dist/type/elysia/cookie.d.ts +2 -5
  213. package/dist/type/elysia/date.js +38 -7
  214. package/dist/type/elysia/date.mjs +39 -8
  215. package/dist/type/elysia/file-type.d.ts +2 -1
  216. package/dist/type/elysia/file-type.js +11 -13
  217. package/dist/type/elysia/file-type.mjs +12 -14
  218. package/dist/type/elysia/file.js +10 -4
  219. package/dist/type/elysia/file.mjs +10 -4
  220. package/dist/type/elysia/files.js +16 -6
  221. package/dist/type/elysia/files.mjs +18 -8
  222. package/dist/type/elysia/integer-string.js +3 -3
  223. package/dist/type/elysia/integer-string.mjs +3 -3
  224. package/dist/type/elysia/integer.js +6 -3
  225. package/dist/type/elysia/integer.mjs +6 -3
  226. package/dist/type/elysia/intersect.js +8 -5
  227. package/dist/type/elysia/intersect.mjs +7 -4
  228. package/dist/type/elysia/maybe-empty.js +4 -2
  229. package/dist/type/elysia/maybe-empty.mjs +5 -3
  230. package/dist/type/elysia/nullable.js +4 -1
  231. package/dist/type/elysia/nullable.mjs +5 -2
  232. package/dist/type/elysia/number.js +6 -3
  233. package/dist/type/elysia/number.mjs +6 -3
  234. package/dist/type/elysia/numeric.js +1 -1
  235. package/dist/type/elysia/numeric.mjs +1 -1
  236. package/dist/type/elysia/object-string.js +3 -3
  237. package/dist/type/elysia/object-string.mjs +1 -1
  238. package/dist/type/elysia/object.js +8 -5
  239. package/dist/type/elysia/object.mjs +8 -5
  240. package/dist/type/elysia/optional.js +11 -13
  241. package/dist/type/elysia/optional.mjs +12 -13
  242. package/dist/type/elysia/string.js +22 -6
  243. package/dist/type/elysia/string.mjs +22 -6
  244. package/dist/type/elysia/uint8-array.d.ts +1 -2
  245. package/dist/type/elysia/uint8-array.js +10 -4
  246. package/dist/type/elysia/uint8-array.mjs +11 -5
  247. package/dist/type/elysia/union-enum.js +3 -2
  248. package/dist/type/elysia/union-enum.mjs +4 -3
  249. package/dist/type/elysia/union.js +6 -3
  250. package/dist/type/elysia/union.mjs +6 -3
  251. package/dist/type/elysia/utils.d.ts +3 -2
  252. package/dist/type/elysia/utils.js +34 -34
  253. package/dist/type/elysia/utils.mjs +33 -34
  254. package/dist/type/exports.js +6 -2073
  255. package/dist/type/exports.mjs +3 -323
  256. package/dist/type/index.d.ts +6 -2
  257. package/dist/type/index.js +64 -2
  258. package/dist/type/index.mjs +62 -3
  259. package/dist/type/shared.d.ts +18 -0
  260. package/dist/type/shared.js +153 -0
  261. package/dist/type/shared.mjs +145 -0
  262. package/dist/type/types.d.ts +20 -8
  263. package/dist/type/utils.js +20 -63
  264. package/dist/type/utils.mjs +20 -63
  265. package/dist/type/validator/clean-safe.d.ts +8 -0
  266. package/dist/type/validator/clean-safe.js +82 -0
  267. package/dist/type/validator/clean-safe.mjs +77 -0
  268. package/dist/type/validator/custom-error.js +124 -46
  269. package/dist/type/validator/custom-error.mjs +125 -47
  270. package/dist/type/validator/default-precompute.d.ts +7 -3
  271. package/dist/type/validator/default-precompute.js +61 -105
  272. package/dist/type/validator/default-precompute.mjs +60 -104
  273. package/dist/type/validator/frozen-check.js +4 -3
  274. package/dist/type/validator/frozen-check.mjs +2 -1
  275. package/dist/type/validator/index.d.ts +3 -2
  276. package/dist/type/validator/index.js +323 -235
  277. package/dist/type/validator/index.mjs +327 -240
  278. package/dist/type/validator/string-codec-aot.d.ts +2 -3
  279. package/dist/type/validator/string-codec-aot.js +8 -47
  280. package/dist/type/validator/string-codec-aot.mjs +7 -45
  281. package/dist/type/validator/validator-cache.d.ts +4 -5
  282. package/dist/type/validator/validator-cache.js +32 -47
  283. package/dist/type/validator/validator-cache.mjs +32 -47
  284. package/dist/types.d.ts +184 -105
  285. package/dist/universal/constants.d.ts +1 -3
  286. package/dist/universal/constants.js +1 -5
  287. package/dist/universal/constants.mjs +1 -3
  288. package/dist/universal/env.d.ts +3 -2
  289. package/dist/universal/env.js +6 -2
  290. package/dist/universal/env.mjs +5 -2
  291. package/dist/universal/file.d.ts +12 -5
  292. package/dist/universal/file.js +76 -47
  293. package/dist/universal/file.mjs +76 -47
  294. package/dist/universal/index.d.ts +2 -1
  295. package/dist/universal/index.js +3 -1
  296. package/dist/universal/index.mjs +2 -1
  297. package/dist/universal/is-production.d.ts +5 -0
  298. package/dist/universal/is-production.js +10 -0
  299. package/dist/universal/is-production.mjs +8 -0
  300. package/dist/universal/server.d.ts +1 -0
  301. package/dist/utils.d.ts +44 -18
  302. package/dist/utils.js +262 -27
  303. package/dist/utils.mjs +247 -26
  304. package/dist/validator/index.d.ts +13 -12
  305. package/dist/validator/index.js +157 -68
  306. package/dist/validator/index.mjs +158 -69
  307. package/dist/validator/route.d.ts +0 -1
  308. package/dist/validator/route.js +3 -2
  309. package/dist/validator/route.mjs +3 -2
  310. package/dist/ws/context.d.ts +13 -12
  311. package/dist/ws/context.js +33 -67
  312. package/dist/ws/context.mjs +33 -67
  313. package/dist/ws/parser.d.ts +1 -4
  314. package/dist/ws/route.d.ts +8 -3
  315. package/dist/ws/route.js +343 -133
  316. package/dist/ws/route.mjs +341 -135
  317. package/dist/ws/types.d.ts +47 -5
  318. package/package.json +78 -32
  319. package/dist/adapter/bun/router.d.ts +0 -10
  320. package/dist/adapter/bun/router.js +0 -86
  321. package/dist/adapter/bun/router.mjs +0 -83
  322. package/dist/compile/handler/constants.js +0 -1
  323. package/dist/compile/handler/constants.mjs +0 -1
  324. package/dist/compile/index.d.ts +0 -3
  325. package/dist/compile/index.js +0 -8
  326. package/dist/compile/index.mjs +0 -4
  327. package/dist/compile/types.d.ts +0 -4
  328. package/dist/compile/types.js +0 -1
  329. package/dist/compile/types.mjs +0 -1
  330. package/dist/plugin/bun.js +0 -82
  331. package/dist/plugin/bun.mjs +0 -80
  332. package/dist/plugin/core.d.ts +0 -87
  333. package/dist/plugin/core.js +0 -109
  334. package/dist/plugin/core.mjs +0 -102
  335. package/dist/plugin/esbuild.js +0 -83
  336. package/dist/plugin/esbuild.mjs +0 -81
  337. package/dist/plugin/source.d.ts +0 -75
  338. package/dist/plugin/source.js +0 -354
  339. package/dist/plugin/source.mjs +0 -349
  340. package/dist/plugin/treeshake.d.ts +0 -10
  341. package/dist/plugin/treeshake.js +0 -63
  342. package/dist/plugin/treeshake.mjs +0 -61
  343. package/dist/plugin/vite.js +0 -61
  344. package/dist/plugin/vite.mjs +0 -60
  345. package/dist/universal/types.d.ts +0 -127
  346. package/dist/universal/types.js +0 -20
  347. package/dist/universal/types.mjs +0 -17
  348. /package/dist/{compile/handler/constants.d.ts → plugin/aot/worker.d.ts} +0 -0
@@ -5,19 +5,6 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __getProtoOf = Object.getPrototypeOf;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __exportAll = (all, no_symbols) => {
9
- let target = {};
10
- for (var name in all) {
11
- __defProp(target, name, {
12
- get: all[name],
13
- enumerable: true
14
- });
15
- }
16
- if (!no_symbols) {
17
- __defProp(target, Symbol.toStringTag, { value: "Module" });
18
- }
19
- return target;
20
- };
21
8
  var __copyProps = (to, from, except, desc) => {
22
9
  if (from && typeof from === "object" || typeof from === "function") {
23
10
  for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
@@ -39,5 +26,4 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
39
26
 
40
27
  //#endregion
41
28
 
42
- exports.__exportAll = __exportAll;
43
29
  exports.__toESM = __toESM;
@@ -1,3 +1,5 @@
1
+ import { createRequire } from "node:module";
2
+
1
3
  //#region \0rolldown/runtime.js
2
4
  var __defProp = Object.defineProperty;
3
5
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -1,30 +1,7 @@
1
- import { ListenCallback, Serve } from "../../universal/server.js";
2
- import { AnyLocalHook, MaybePromise } from "../../types.js";
3
- import { Context } from "../../context.js";
4
1
  import { AnyElysia } from "../../base.js";
2
+ import { ElysiaAdapterOptions } from "../types.js";
5
3
  //#region src/adapter/bun/index.d.ts
6
- declare function collectStaticRoutes(app: AnyElysia): readonly [Record<string, Record<string, Response>>, Promise<void>[]] | undefined;
7
- declare const BunAdapter: {
8
- parse: {
9
- default: (context: Context, contentType: string) => string | ArrayBuffer | unknown[] | Record<string, unknown> | Promise<unknown[] | Record<string | number | symbol, undefined>> | Promise<ArrayBuffer> | Promise<Record<string, unknown>> | Promise<string> | undefined;
10
- json: (context: Context) => MaybePromise<Record<keyof any, undefined> | unknown[]>;
11
- text: (context: Context) => MaybePromise<string>;
12
- urlencoded: (context: Context) => MaybePromise<Record<string, string | string[]>>;
13
- arrayBuffer: (context: Context) => MaybePromise<ArrayBuffer>;
14
- formData: (context: Context) => MaybePromise<Record<string, unknown>>;
15
- };
16
- name: string;
17
- runtime: "node" | "deno" | "bun" | "cloudflare-worker" | "browser" | "vercel" | "netlify" | "lambda" | "fastly" | "edge" | "unknown" | (string & {});
18
- isWebStandard: boolean;
19
- listen?(app: AnyElysia, options: string | number | Partial<Serve>, callback?: ListenCallback): void;
20
- stop?(app: AnyElysia, closeActiveConnections?: boolean): Promise<void>;
21
- response: {
22
- map(response: unknown, set: Context["set"], ...params: unknown[]): unknown;
23
- compact?(response: unknown, ...params: unknown[]): unknown;
24
- static?(handle: unknown, hooks: AnyLocalHook, setHeaders?: Context["set"]["headers"], ...params: unknown[]): (() => unknown) | undefined;
25
- nativeStatic?(handle: unknown, hooks: AnyLocalHook, set?: Context["set"]): (() => MaybePromise<Response>) | undefined;
26
- };
27
- fetch?(app: AnyElysia): (request: Request) => MaybePromise<Response>;
28
- };
4
+ declare function collectStaticRoutes(app: AnyElysia): readonly [Record<string, Record<string, Response>>, readonly []] | undefined;
5
+ declare const BunAdapter: ElysiaAdapterOptions;
29
6
  //#endregion
30
7
  export { BunAdapter, collectStaticRoutes };
@@ -1,84 +1,201 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  const require_adapter_index = require('../index.js');
3
+ const require_constants = require('../../constants.js');
3
4
  const require_utils = require('../../utils.js');
4
5
  const require_adapter_web_standard_index = require('../web-standard/index.js');
5
- const require_memory = require('../../memory.js');
6
- const require_ws_route = require('../../ws/route.js');
6
+ const require_generation = require('../../generation.js');
7
+ const require_compile_handler_index = require('../../compile/handler/index.js');
8
+ const require_route_table = require('../../route-table.js');
7
9
 
8
10
  //#region src/adapter/bun/index.ts
11
+ const nativeStaticMethods = new Set([
12
+ "GET",
13
+ "POST",
14
+ "PUT",
15
+ "DELETE",
16
+ "PATCH",
17
+ "HEAD",
18
+ "OPTIONS"
19
+ ]);
9
20
  function collectStaticRoutes(app) {
10
- if (app["~ext"]?.hoc?.length) return;
11
- const hook = require_utils.flattenChain(app["~hookChain"]);
12
- if (hook && (hook?.request?.length || hook?.mapResponse?.length || hook?.afterResponse?.length || hook?.trace?.length)) return;
21
+ if (app["~config"]?.nativeStaticResponse === false) return;
13
22
  app.fetch;
14
- const source = app["~staticResponse"];
15
- if (!source) return;
23
+ const frozenRoot = require_generation.frozenRootOf(app);
24
+ const fetchLevelHook = require_utils.flattenChain(frozenRoot["~hookChain"]);
25
+ if (fetchLevelHook?.request?.length || fetchLevelHook?.trace?.length || frozenRoot["~ext"]?.hoc?.length) return;
26
+ const table = app["~generation"]?.routeTable ?? app["~routeTable"];
27
+ const length = table?.length ?? 0;
28
+ if (!table || !length) return;
29
+ const methods = table.method;
30
+ const paths = table.path;
31
+ const handlers = table.handler;
32
+ let hasCandidate = false;
33
+ for (let i = 0; i < length; i++) {
34
+ const h = handlers[i];
35
+ if (typeof h === "function" || h instanceof Error || h instanceof Promise) continue;
36
+ if (!nativeStaticMethods.has(methods[i])) continue;
37
+ hasCandidate = true;
38
+ break;
39
+ }
40
+ if (!hasCandidate) return;
16
41
  const ready = require_utils.nullObject();
17
- const pending = [];
18
- for (const rawPath in source) {
19
- const path = encodeURI(rawPath);
20
- const methods = source[rawPath];
21
- for (const method in methods) {
22
- const value = methods[method];
23
- if (value instanceof Promise) pending.push(value.then((resolved) => {
24
- if (resolved instanceof Response) (ready[path] ??= require_utils.nullObject())[method] = resolved;
25
- }, (err) => {
26
- console.error(`[Elysia] Static route ${method} ${path} failed to resolve:`, err);
27
- }));
28
- else (ready[path] ??= require_utils.nullObject())[method] = value;
42
+ const strictPath = frozenRoot["~config"]?.strictPath === true;
43
+ const seen = /* @__PURE__ */ new Map();
44
+ for (let i = 0; i < length; i++) seen.set(methods[i] + " " + paths[i], i);
45
+ let explicitPaths;
46
+ if (!strictPath) {
47
+ explicitPaths = /* @__PURE__ */ new Map();
48
+ for (let i = 0; i < length; i++) {
49
+ const method = methods[i];
50
+ const path = paths[i];
51
+ let set = explicitPaths.get(method);
52
+ if (!set) explicitPaths.set(method, set = /* @__PURE__ */ new Set());
53
+ set.add(path);
54
+ if (require_constants.needEncodeRegex.test(path)) {
55
+ const encoded = encodeURI(path);
56
+ if (encoded !== path) set.add(encoded);
57
+ }
58
+ }
59
+ }
60
+ const add = (method, path, value) => {
61
+ if (require_constants.needEncodeRegex.test(path)) path = encodeURI(path);
62
+ (ready[path] ??= require_utils.nullObject())[method] = value;
63
+ };
64
+ for (let i = 0; i < length; i++) {
65
+ const method = methods[i];
66
+ if (method === "WS") continue;
67
+ const path = paths[i];
68
+ if (seen.get(method + " " + path) !== i) continue;
69
+ if (!nativeStaticMethods.has(method)) continue;
70
+ const h = handlers[i];
71
+ if (typeof h === "function" || h instanceof Error || h instanceof Promise) continue;
72
+ const value = require_compile_handler_index.buildNativeStaticResponse(require_route_table.routeRow(table, i), app);
73
+ if (!value) continue;
74
+ add(method, path, value);
75
+ if (!strictPath && !require_constants.isDynamicRegex.test(path)) {
76
+ const loose = require_utils.getLoosePath(path);
77
+ if (loose !== path && !explicitPaths?.get(method)?.has(loose)) add(method, loose, value);
29
78
  }
30
79
  }
31
- return [ready, pending];
80
+ if (!Object.keys(ready).length) return;
81
+ return [ready, []];
32
82
  }
33
83
  const BunAdapter = require_adapter_index.createAdapter({
34
- ...require_adapter_web_standard_index.WebStandardAdapter,
35
84
  name: "bun",
36
85
  runtime: "bun",
86
+ isWebStandard: true,
87
+ parse: require_adapter_web_standard_index.WebStandardAdapter.parse,
88
+ response: require_adapter_web_standard_index.WebStandardAdapter.response,
37
89
  listen(app, options, callback) {
38
90
  const _config = app["~config"]?.serve;
39
- const _options = typeof options === "object" ? options : { port: +options };
91
+ const optionsIsObject = typeof options === "object";
92
+ const _options = optionsIsObject ? { ...options } : {
93
+ port: +options,
94
+ fetch: (request, server) => app.fetch(request, server)
95
+ };
96
+ if (optionsIsObject) _options.fetch = (request, server) => app.fetch(request, server);
40
97
  const serve = _config ? {
41
98
  ..._config,
42
99
  ..._options
43
100
  } : _options;
44
- const hasWs = app["~hasWS"];
45
- serve.fetch = (request, server) => app.fetch(request, server);
46
- app.server = Bun.serve(serve);
47
- if (!hasWs) callback?.(app.server);
48
- queueMicrotask(() => {
49
- if (!app.pending) serve.fetch = app.fetch;
50
- const buildWebSocket = () => {
51
- const defaultConfig = app["~config"]?.websocket;
52
- serve.websocket = defaultConfig ? Object.assign(require_ws_route.buildGlobalWSHandler(), defaultConfig) : require_ws_route.buildGlobalWSHandler();
53
- };
54
- if (hasWs) buildWebSocket();
55
- const collectRoutes = () => {
56
- const staticRoutes = collectStaticRoutes(app);
57
- if (!staticRoutes) return;
58
- if (staticRoutes[1].length) return Promise.all(staticRoutes[1]).then(() => {
59
- serve.routes = staticRoutes[0];
60
- app.server.reload(serve);
61
- });
62
- if (Object.keys(staticRoutes[0]).length) serve.routes = staticRoutes[0];
101
+ const onSetup = app["~ext"]?.setup;
102
+ const needsGate = app.pending || !!onSetup?.length;
103
+ let ready;
104
+ const build = () => {
105
+ const fetch = app.fetch;
106
+ let routes;
107
+ try {
108
+ routes = collectStaticRoutes(app);
109
+ } catch (error) {
110
+ console.warn("[Elysia] Native static promotion was skipped:", error);
111
+ }
112
+ let websocket;
113
+ if (app["~hasWS"]) {
114
+ const resolved = require_generation.resolvedWsOf(app);
115
+ if (!resolved) throw new Error("[Elysia] internal: WebSocket routes are present but no capability provider was resolved.");
116
+ websocket = resolved.config ? Object.assign(resolved.provider.buildGlobalWSHandler(), resolved.config) : resolved.provider.buildGlobalWSHandler();
117
+ }
118
+ return {
119
+ fetch,
120
+ routes,
121
+ websocket
63
122
  };
64
- if (app.pending) {
65
- if (app.server) app.server.reload(serve);
66
- else app.server = Bun.serve(serve);
67
- const reloadAfterModules = () => {
68
- serve.fetch = app.fetch;
69
- if (hasWs || app["~hasWS"]) buildWebSocket();
70
- collectRoutes();
71
- app.server.reload(serve);
72
- };
73
- app.modules.then(reloadAfterModules, reloadAfterModules);
74
- } else {
75
- collectRoutes();
76
- if (app.server) app.server.reload(serve);
77
- else app.server = Bun.serve(serve);
123
+ };
124
+ let built;
125
+ if (!needsGate) built = build();
126
+ if (needsGate) serve.fetch = (request, server) => ready.then(() => app.fetch(request, server));
127
+ else serve.fetch = built.fetch;
128
+ const server = app.server = Bun.serve(serve);
129
+ const reload = () => {
130
+ try {
131
+ server.reload(serve);
132
+ } catch (error) {
133
+ if (!serve.routes) throw error;
134
+ delete serve.routes;
135
+ console.warn("[Elysia] Native static promotion was skipped:", error);
136
+ try {
137
+ server.reload(serve);
138
+ } catch (fallbackError) {
139
+ console.error("[Elysia] Failed to reload Bun server:", fallbackError);
140
+ throw fallbackError;
141
+ }
142
+ }
143
+ };
144
+ const setup = () => {
145
+ const onSetup = app["~ext"]?.setup;
146
+ if (!onSetup) return;
147
+ let pendingSetups;
148
+ for (let i = 0; i < onSetup.length; i++) {
149
+ const result = onSetup[i](app);
150
+ if (result && typeof result.then === "function") (pendingSetups ??= []).push(result);
151
+ }
152
+ if (pendingSetups) return Promise.all(pendingSetups);
153
+ };
154
+ const rollback = (error) => {
155
+ if (app.server !== server) return;
156
+ try {
157
+ server.stop(true);
158
+ } catch (stopError) {
159
+ console.error(stopError);
160
+ } finally {
161
+ app.server = void 0;
78
162
  }
79
- require_memory.flushMemory();
80
- if (hasWs) callback?.(app.server);
81
- });
163
+ const cleanup = app["~ext"]?.cleanup;
164
+ if (cleanup) for (let i = cleanup.length - 1; i >= 0; i--) try {
165
+ const result = cleanup[i](app);
166
+ if (result && typeof result.then === "function") Promise.resolve(result).catch(console.error);
167
+ } catch (cleanupError) {
168
+ console.error(cleanupError);
169
+ }
170
+ return error;
171
+ };
172
+ const publish = () => {
173
+ if (app.server !== server) return;
174
+ built ??= build();
175
+ serve.fetch = built.fetch;
176
+ if (built.websocket) serve.websocket = built.websocket;
177
+ if (built.routes) serve.routes = built.routes[0];
178
+ if (needsGate || built.websocket || built.routes) reload();
179
+ if (callback) callback(server);
180
+ };
181
+ const start = () => {
182
+ if (app.server !== server) return;
183
+ const setupReady = setup();
184
+ if (setupReady && typeof setupReady.then === "function") return Promise.resolve(setupReady).then(publish);
185
+ publish();
186
+ };
187
+ try {
188
+ if (app.pending) ready = app.modules.then(start);
189
+ else {
190
+ const result = start();
191
+ if (result && typeof result.then === "function") ready = result;
192
+ else if (needsGate) ready = Promise.resolve();
193
+ }
194
+ ready?.catch(rollback);
195
+ } catch (error) {
196
+ rollback(error);
197
+ throw error;
198
+ }
82
199
  }
83
200
  });
84
201
 
@@ -1,83 +1,200 @@
1
1
  import { createAdapter } from "../index.mjs";
2
- import { flattenChain, nullObject } from "../../utils.mjs";
2
+ import { isDynamicRegex, needEncodeRegex } from "../../constants.mjs";
3
+ import { flattenChain, getLoosePath, nullObject } from "../../utils.mjs";
3
4
  import { WebStandardAdapter } from "../web-standard/index.mjs";
4
- import { flushMemory } from "../../memory.mjs";
5
- import { buildGlobalWSHandler } from "../../ws/route.mjs";
5
+ import { frozenRootOf, resolvedWsOf } from "../../generation.mjs";
6
+ import { buildNativeStaticResponse } from "../../compile/handler/index.mjs";
7
+ import { routeRow } from "../../route-table.mjs";
6
8
 
7
9
  //#region src/adapter/bun/index.ts
10
+ const nativeStaticMethods = new Set([
11
+ "GET",
12
+ "POST",
13
+ "PUT",
14
+ "DELETE",
15
+ "PATCH",
16
+ "HEAD",
17
+ "OPTIONS"
18
+ ]);
8
19
  function collectStaticRoutes(app) {
9
- if (app["~ext"]?.hoc?.length) return;
10
- const hook = flattenChain(app["~hookChain"]);
11
- if (hook && (hook?.request?.length || hook?.mapResponse?.length || hook?.afterResponse?.length || hook?.trace?.length)) return;
20
+ if (app["~config"]?.nativeStaticResponse === false) return;
12
21
  app.fetch;
13
- const source = app["~staticResponse"];
14
- if (!source) return;
22
+ const frozenRoot = frozenRootOf(app);
23
+ const fetchLevelHook = flattenChain(frozenRoot["~hookChain"]);
24
+ if (fetchLevelHook?.request?.length || fetchLevelHook?.trace?.length || frozenRoot["~ext"]?.hoc?.length) return;
25
+ const table = app["~generation"]?.routeTable ?? app["~routeTable"];
26
+ const length = table?.length ?? 0;
27
+ if (!table || !length) return;
28
+ const methods = table.method;
29
+ const paths = table.path;
30
+ const handlers = table.handler;
31
+ let hasCandidate = false;
32
+ for (let i = 0; i < length; i++) {
33
+ const h = handlers[i];
34
+ if (typeof h === "function" || h instanceof Error || h instanceof Promise) continue;
35
+ if (!nativeStaticMethods.has(methods[i])) continue;
36
+ hasCandidate = true;
37
+ break;
38
+ }
39
+ if (!hasCandidate) return;
15
40
  const ready = nullObject();
16
- const pending = [];
17
- for (const rawPath in source) {
18
- const path = encodeURI(rawPath);
19
- const methods = source[rawPath];
20
- for (const method in methods) {
21
- const value = methods[method];
22
- if (value instanceof Promise) pending.push(value.then((resolved) => {
23
- if (resolved instanceof Response) (ready[path] ??= nullObject())[method] = resolved;
24
- }, (err) => {
25
- console.error(`[Elysia] Static route ${method} ${path} failed to resolve:`, err);
26
- }));
27
- else (ready[path] ??= nullObject())[method] = value;
41
+ const strictPath = frozenRoot["~config"]?.strictPath === true;
42
+ const seen = /* @__PURE__ */ new Map();
43
+ for (let i = 0; i < length; i++) seen.set(methods[i] + " " + paths[i], i);
44
+ let explicitPaths;
45
+ if (!strictPath) {
46
+ explicitPaths = /* @__PURE__ */ new Map();
47
+ for (let i = 0; i < length; i++) {
48
+ const method = methods[i];
49
+ const path = paths[i];
50
+ let set = explicitPaths.get(method);
51
+ if (!set) explicitPaths.set(method, set = /* @__PURE__ */ new Set());
52
+ set.add(path);
53
+ if (needEncodeRegex.test(path)) {
54
+ const encoded = encodeURI(path);
55
+ if (encoded !== path) set.add(encoded);
56
+ }
57
+ }
58
+ }
59
+ const add = (method, path, value) => {
60
+ if (needEncodeRegex.test(path)) path = encodeURI(path);
61
+ (ready[path] ??= nullObject())[method] = value;
62
+ };
63
+ for (let i = 0; i < length; i++) {
64
+ const method = methods[i];
65
+ if (method === "WS") continue;
66
+ const path = paths[i];
67
+ if (seen.get(method + " " + path) !== i) continue;
68
+ if (!nativeStaticMethods.has(method)) continue;
69
+ const h = handlers[i];
70
+ if (typeof h === "function" || h instanceof Error || h instanceof Promise) continue;
71
+ const value = buildNativeStaticResponse(routeRow(table, i), app);
72
+ if (!value) continue;
73
+ add(method, path, value);
74
+ if (!strictPath && !isDynamicRegex.test(path)) {
75
+ const loose = getLoosePath(path);
76
+ if (loose !== path && !explicitPaths?.get(method)?.has(loose)) add(method, loose, value);
28
77
  }
29
78
  }
30
- return [ready, pending];
79
+ if (!Object.keys(ready).length) return;
80
+ return [ready, []];
31
81
  }
32
82
  const BunAdapter = createAdapter({
33
- ...WebStandardAdapter,
34
83
  name: "bun",
35
84
  runtime: "bun",
85
+ isWebStandard: true,
86
+ parse: WebStandardAdapter.parse,
87
+ response: WebStandardAdapter.response,
36
88
  listen(app, options, callback) {
37
89
  const _config = app["~config"]?.serve;
38
- const _options = typeof options === "object" ? options : { port: +options };
90
+ const optionsIsObject = typeof options === "object";
91
+ const _options = optionsIsObject ? { ...options } : {
92
+ port: +options,
93
+ fetch: (request, server) => app.fetch(request, server)
94
+ };
95
+ if (optionsIsObject) _options.fetch = (request, server) => app.fetch(request, server);
39
96
  const serve = _config ? {
40
97
  ..._config,
41
98
  ..._options
42
99
  } : _options;
43
- const hasWs = app["~hasWS"];
44
- serve.fetch = (request, server) => app.fetch(request, server);
45
- app.server = Bun.serve(serve);
46
- if (!hasWs) callback?.(app.server);
47
- queueMicrotask(() => {
48
- if (!app.pending) serve.fetch = app.fetch;
49
- const buildWebSocket = () => {
50
- const defaultConfig = app["~config"]?.websocket;
51
- serve.websocket = defaultConfig ? Object.assign(buildGlobalWSHandler(), defaultConfig) : buildGlobalWSHandler();
52
- };
53
- if (hasWs) buildWebSocket();
54
- const collectRoutes = () => {
55
- const staticRoutes = collectStaticRoutes(app);
56
- if (!staticRoutes) return;
57
- if (staticRoutes[1].length) return Promise.all(staticRoutes[1]).then(() => {
58
- serve.routes = staticRoutes[0];
59
- app.server.reload(serve);
60
- });
61
- if (Object.keys(staticRoutes[0]).length) serve.routes = staticRoutes[0];
100
+ const onSetup = app["~ext"]?.setup;
101
+ const needsGate = app.pending || !!onSetup?.length;
102
+ let ready;
103
+ const build = () => {
104
+ const fetch = app.fetch;
105
+ let routes;
106
+ try {
107
+ routes = collectStaticRoutes(app);
108
+ } catch (error) {
109
+ console.warn("[Elysia] Native static promotion was skipped:", error);
110
+ }
111
+ let websocket;
112
+ if (app["~hasWS"]) {
113
+ const resolved = resolvedWsOf(app);
114
+ if (!resolved) throw new Error("[Elysia] internal: WebSocket routes are present but no capability provider was resolved.");
115
+ websocket = resolved.config ? Object.assign(resolved.provider.buildGlobalWSHandler(), resolved.config) : resolved.provider.buildGlobalWSHandler();
116
+ }
117
+ return {
118
+ fetch,
119
+ routes,
120
+ websocket
62
121
  };
63
- if (app.pending) {
64
- if (app.server) app.server.reload(serve);
65
- else app.server = Bun.serve(serve);
66
- const reloadAfterModules = () => {
67
- serve.fetch = app.fetch;
68
- if (hasWs || app["~hasWS"]) buildWebSocket();
69
- collectRoutes();
70
- app.server.reload(serve);
71
- };
72
- app.modules.then(reloadAfterModules, reloadAfterModules);
73
- } else {
74
- collectRoutes();
75
- if (app.server) app.server.reload(serve);
76
- else app.server = Bun.serve(serve);
122
+ };
123
+ let built;
124
+ if (!needsGate) built = build();
125
+ if (needsGate) serve.fetch = (request, server) => ready.then(() => app.fetch(request, server));
126
+ else serve.fetch = built.fetch;
127
+ const server = app.server = Bun.serve(serve);
128
+ const reload = () => {
129
+ try {
130
+ server.reload(serve);
131
+ } catch (error) {
132
+ if (!serve.routes) throw error;
133
+ delete serve.routes;
134
+ console.warn("[Elysia] Native static promotion was skipped:", error);
135
+ try {
136
+ server.reload(serve);
137
+ } catch (fallbackError) {
138
+ console.error("[Elysia] Failed to reload Bun server:", fallbackError);
139
+ throw fallbackError;
140
+ }
141
+ }
142
+ };
143
+ const setup = () => {
144
+ const onSetup = app["~ext"]?.setup;
145
+ if (!onSetup) return;
146
+ let pendingSetups;
147
+ for (let i = 0; i < onSetup.length; i++) {
148
+ const result = onSetup[i](app);
149
+ if (result && typeof result.then === "function") (pendingSetups ??= []).push(result);
150
+ }
151
+ if (pendingSetups) return Promise.all(pendingSetups);
152
+ };
153
+ const rollback = (error) => {
154
+ if (app.server !== server) return;
155
+ try {
156
+ server.stop(true);
157
+ } catch (stopError) {
158
+ console.error(stopError);
159
+ } finally {
160
+ app.server = void 0;
77
161
  }
78
- flushMemory();
79
- if (hasWs) callback?.(app.server);
80
- });
162
+ const cleanup = app["~ext"]?.cleanup;
163
+ if (cleanup) for (let i = cleanup.length - 1; i >= 0; i--) try {
164
+ const result = cleanup[i](app);
165
+ if (result && typeof result.then === "function") Promise.resolve(result).catch(console.error);
166
+ } catch (cleanupError) {
167
+ console.error(cleanupError);
168
+ }
169
+ return error;
170
+ };
171
+ const publish = () => {
172
+ if (app.server !== server) return;
173
+ built ??= build();
174
+ serve.fetch = built.fetch;
175
+ if (built.websocket) serve.websocket = built.websocket;
176
+ if (built.routes) serve.routes = built.routes[0];
177
+ if (needsGate || built.websocket || built.routes) reload();
178
+ if (callback) callback(server);
179
+ };
180
+ const start = () => {
181
+ if (app.server !== server) return;
182
+ const setupReady = setup();
183
+ if (setupReady && typeof setupReady.then === "function") return Promise.resolve(setupReady).then(publish);
184
+ publish();
185
+ };
186
+ try {
187
+ if (app.pending) ready = app.modules.then(start);
188
+ else {
189
+ const result = start();
190
+ if (result && typeof result.then === "function") ready = result;
191
+ else if (needsGate) ready = Promise.resolve();
192
+ }
193
+ ready?.catch(rollback);
194
+ } catch (error) {
195
+ rollback(error);
196
+ throw error;
197
+ }
81
198
  }
82
199
  });
83
200
 
@@ -1,29 +1,6 @@
1
- import { ListenCallback, Serve } from "../universal/server.js";
2
- import { AnyLocalHook, MaybePromise } from "../types.js";
3
- import { Context } from "../context.js";
4
- import { AnyElysia } from "../base.js";
1
+ import { ElysiaAdapterOptions } from "./types.js";
2
+
5
3
  //#region src/adapter/constants.d.ts
6
- declare const defaultAdapter: {
7
- parse: {
8
- default: (context: Context, contentType: string) => string | ArrayBuffer | unknown[] | Record<string, unknown> | Promise<unknown[] | Record<string | number | symbol, undefined>> | Promise<ArrayBuffer> | Promise<Record<string, unknown>> | Promise<string> | undefined;
9
- json: (context: Context) => MaybePromise<Record<keyof any, undefined> | unknown[]>;
10
- text: (context: Context) => MaybePromise<string>;
11
- urlencoded: (context: Context) => MaybePromise<Record<string, string | string[]>>;
12
- arrayBuffer: (context: Context) => MaybePromise<ArrayBuffer>;
13
- formData: (context: Context) => MaybePromise<Record<string, unknown>>;
14
- };
15
- name: string;
16
- runtime: "node" | "deno" | "bun" | "cloudflare-worker" | "browser" | "vercel" | "netlify" | "lambda" | "fastly" | "edge" | "unknown" | (string & {});
17
- isWebStandard: boolean;
18
- listen?(app: AnyElysia, options: string | number | Partial<Serve>, callback?: ListenCallback): void;
19
- stop?(app: AnyElysia, closeActiveConnections?: boolean): Promise<void>;
20
- response: {
21
- map(response: unknown, set: Context["set"], ...params: unknown[]): unknown;
22
- compact?(response: unknown, ...params: unknown[]): unknown;
23
- static?(handle: unknown, hooks: AnyLocalHook, setHeaders?: Context["set"]["headers"], ...params: unknown[]): (() => unknown) | undefined;
24
- nativeStatic?(handle: unknown, hooks: AnyLocalHook, set?: Context["set"]): (() => MaybePromise<Response>) | undefined;
25
- };
26
- fetch?(app: AnyElysia): (request: Request) => MaybePromise<Response>;
27
- };
4
+ declare const defaultAdapter: ElysiaAdapterOptions;
28
5
  //#endregion
29
6
  export { defaultAdapter };
@@ -0,0 +1,4 @@
1
+ //#region src/adapter/default-headers.d.ts
2
+ declare const defaultHeaders = "\0";
3
+ //#endregion
4
+ export { defaultHeaders };
@@ -0,0 +1,7 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ //#region src/adapter/default-headers.ts
4
+ const defaultHeaders = "\0";
5
+
6
+ //#endregion
7
+ exports.defaultHeaders = defaultHeaders;
@@ -0,0 +1,5 @@
1
+ //#region src/adapter/default-headers.ts
2
+ const defaultHeaders = "\0";
3
+
4
+ //#endregion
5
+ export { defaultHeaders };