elysia 2.0.0-beta.5 → 2.0.0-beta.7

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 (50) hide show
  1. package/dist/base.d.ts +26 -9
  2. package/dist/base.js +207 -202
  3. package/dist/base.mjs +207 -202
  4. package/dist/compile/aot-capture.js +1 -1
  5. package/dist/compile/aot-capture.mjs +1 -1
  6. package/dist/compile/aot.d.ts +5 -5
  7. package/dist/compile/handler/index.js +6 -1
  8. package/dist/compile/handler/index.mjs +6 -1
  9. package/dist/compile/handler/jit.js +3 -1
  10. package/dist/compile/handler/jit.mjs +4 -2
  11. package/dist/compile/handler/params.js +1 -0
  12. package/dist/compile/handler/params.mjs +2 -1
  13. package/dist/compile/handler/utils.d.ts +2 -1
  14. package/dist/compile/handler/utils.js +8 -0
  15. package/dist/compile/handler/utils.mjs +8 -1
  16. package/dist/error.d.ts +2 -1
  17. package/dist/error.js +62 -3
  18. package/dist/error.mjs +62 -4
  19. package/dist/package.js +1 -1
  20. package/dist/package.mjs +1 -1
  21. package/dist/plugin/aot/core.d.ts +15 -36
  22. package/dist/plugin/aot/core.js +21 -39
  23. package/dist/plugin/aot/core.mjs +22 -41
  24. package/dist/type/bridge-live.d.ts +1 -1
  25. package/dist/type/bridge-live.js +1 -1
  26. package/dist/type/bridge-live.mjs +1 -1
  27. package/dist/type/bridge.d.ts +3 -3
  28. package/dist/type/coerce-plan.d.ts +1 -1
  29. package/dist/type/coerce-plan.js +1 -0
  30. package/dist/type/coerce-plan.mjs +1 -0
  31. package/dist/type/coerce.d.ts +2 -2
  32. package/dist/type/coerce.js +1 -1
  33. package/dist/type/coerce.mjs +2 -2
  34. package/dist/type/constants.d.ts +1 -1
  35. package/dist/type/typebox-value-live.d.ts +2 -2
  36. package/dist/type/typebox-value-live.js +2 -2
  37. package/dist/type/typebox-value-live.mjs +2 -2
  38. package/dist/type/typebox-value.d.ts +6 -6
  39. package/dist/type/validator/default-precompute.d.ts +9 -1
  40. package/dist/type/validator/default-precompute.js +14 -2
  41. package/dist/type/validator/default-precompute.mjs +14 -3
  42. package/dist/type/validator/exact-mirror-live.d.ts +8 -0
  43. package/dist/type/validator/exact-mirror-live.js +22 -0
  44. package/dist/type/validator/exact-mirror-live.mjs +17 -0
  45. package/dist/type/validator/index.d.ts +1 -1
  46. package/dist/type/validator/index.js +12 -1
  47. package/dist/type/validator/index.mjs +13 -2
  48. package/dist/type/validator/validator-cache.d.ts +1 -1
  49. package/dist/types.d.ts +11 -7
  50. package/package.json +1 -1
package/dist/base.d.ts CHANGED
@@ -28,6 +28,17 @@ declare class Elysia<const in out BasePath extends string = '', const in out Sco
28
28
  '~Ephemeral': Ephemeral;
29
29
  '~Volatile': Volatile;
30
30
  '~Routes': Routes;
31
+ private hasPlugin?;
32
+ private hasGlobal?;
33
+ private ready?;
34
+ private _pending;
35
+ private _error?;
36
+ private hash?;
37
+ private childrenHash?;
38
+ private scopeParent?;
39
+ private pluginMacros?;
40
+ private macroBaseline?;
41
+ private macroSnapshots?;
31
42
  '~ext'?: {
32
43
  decorator?: Singleton['decorator'];
33
44
  store?: Singleton['store'];
@@ -55,10 +66,18 @@ declare class Elysia<const in out BasePath extends string = '', const in out Sco
55
66
  };
56
67
  '~hookChain'?: ChainNode;
57
68
  '~wsConfig'?: WSOptions;
69
+ private declaredRoutes?;
70
+ private routeSources?;
58
71
  server?: Server;
59
72
  get history(): readonly HistoryEntry[];
60
73
  get ['~routes'](): readonly InternalRoute[];
61
74
  ['~addRoute'](route: InternalRoute): this;
75
+ private compiled?;
76
+ private jitColdRemaining?;
77
+ private jitTable?;
78
+ private jitRoute?;
79
+ private jitStatic?;
80
+ private jitAliases?;
62
81
  '~router'?: Memoirist<CompiledHandler>;
63
82
  '~map'?: {
64
83
  [method: string]: {
@@ -528,6 +547,7 @@ declare class Elysia<const in out BasePath extends string = '', const in out Sco
528
547
  parser: Metadata['parser'];
529
548
  response: Metadata['response'] & MacroContext['response'] & ElysiaHandlerToResponseSchemaAmbiguous<BeforeHandle> & ElysiaHandlerToResponseSchemaAmbiguous<AfterHandle> & ElysiaHandlerToResponseSchemaAmbiguous<ErrorHandle>;
530
549
  }, {}, Ephemeral, Volatile>) => NewElysia): Elysia<BasePath, Scope, Singleton, Definitions, Metadata, Routes & NewElysia['~Routes'], Ephemeral, Volatile>;
550
+ private get ext();
531
551
  ['~resolvedCapability'](kind: 'trace'): TraceCapability | undefined;
532
552
  ['~resolvedCapability'](kind: 'ws'): {
533
553
  provider: WSCapability;
@@ -869,8 +889,11 @@ declare class Elysia<const in out BasePath extends string = '', const in out Sco
869
889
  */
870
890
  compile(): this;
871
891
  handler(index: number, immediate?: boolean, route?: InternalRoute, precomputedStatic?: Response, aliases?: StaticMapAliases, table?: RouteTable): CompiledHandler;
892
+ private routerBuilt;
872
893
  ['~newGeneration'](): this;
894
+ private fetchFn?;
873
895
  get fetch(): (request: Request, ...rest: any[]) => MaybePromise<Response>;
896
+ private _handle?;
874
897
  get handle(): (url: string | Request, options?: RequestInit) => Promise<Response>;
875
898
  listen(options: string | number | Partial<Serve>, callback?: ListenCallback): this;
876
899
  /**
@@ -904,21 +927,15 @@ declare class Elysia<const in out BasePath extends string = '', const in out Sco
904
927
  */
905
928
  cleanup(handler: MaybeArray<GracefulHandler<this>>): this;
906
929
  /**
907
- * Stop the underlying server (if any), then run every `cleanup` handler.
908
- * Omitted and `false` are the same graceful stop: new requests are gated,
909
- * tracked WebSockets are settled and active HTTP is drained, then cleanup
910
- * runs and the epoch is released. `true` force-closes the transport
911
- * instead of draining it, and escalates a graceful stop already in flight.
930
+ * Stop the underlying server (if any), then run every `cleanup` handler
912
931
  *
913
932
  * Awaiting `stop()` from inside a `setup`, `cleanup` or WebSocket lifecycle
914
- * callback is only supported while that callback is still synchronous; the
915
- * teardown is waiting on the callback, so after an `await` it can only be
916
- * issued as `void app.stop()`.
933
+ * callback is only supported while that callback is still synchronous
917
934
  *
918
935
  * @param closeActiveConnections Pass `true` to terminate active
919
936
  * transports. Omit (or pass `false`) to drain safely.
920
937
  */
921
- stop(closeActiveConnections?: boolean): Promise<void> | void;
938
+ stop(closeActiveConnections?: boolean): Promise<void> | undefined;
922
939
  }
923
940
  //#endregion
924
941
  export { AnyElysia, Elysia };