elysia 1.1.9 → 1.1.12

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.
package/bunfig.toml ADDED
@@ -0,0 +1,2 @@
1
+ [install]
2
+ registry = "https://registry.npmjs.org/"
@@ -88,10 +88,12 @@ export default class Elysia<const in out BasePath extends string = '', const in
88
88
  dynamic: Memoirist<DynamicHandler>;
89
89
  static: {
90
90
  http: {
91
+ static: Record<string, Response>;
91
92
  handlers: ComposedHandler[];
92
93
  map: Record<string, {
93
94
  code: string;
94
95
  all?: string;
96
+ static?: Function;
95
97
  }>;
96
98
  all: string;
97
99
  };
@@ -131,8 +133,8 @@ export default class Elysia<const in out BasePath extends string = '', const in
131
133
  * @example
132
134
  * ```typescript
133
135
  * new Elysia()
134
- * .onStart(({ url, port }) => {
135
- * console.log("Running at ${url}:${port}")
136
+ * .onStart(({ server }) => {
137
+ * console.log("Running at ${server?.url}:${server?.port}")
136
138
  * })
137
139
  * .listen(3000)
138
140
  * ```
@@ -803,8 +805,8 @@ export default class Elysia<const in out BasePath extends string = '', const in
803
805
  schema: {};
804
806
  }>;
805
807
  as(type: 'plugin'): Elysia<BasePath, Scoped, Singleton, Definitions, Metadata, Routes, {
806
- derive: Prettify2<Ephemeral['derive'] & Volatile['derive']>;
807
- resolve: Prettify2<Ephemeral['resolve'] & Volatile['resolve']>;
808
+ derive: Prettify<Ephemeral['derive'] & Volatile['derive']>;
809
+ resolve: Prettify<Ephemeral['resolve'] & Volatile['resolve']>;
808
810
  schema: MergeSchema<Volatile['schema'], Ephemeral['schema']>;
809
811
  }, {
810
812
  derive: {};
@@ -1590,8 +1592,17 @@ export default class Elysia<const in out BasePath extends string = '', const in
1590
1592
  * // Sometime later
1591
1593
  * app.stop()
1592
1594
  * ```
1595
+ *
1596
+ * @example
1597
+ * ```typescript
1598
+ * const app = new Elysia()
1599
+ * .get("/", () => 'hi')
1600
+ * .listen(3000)
1601
+ *
1602
+ * app.stop(true) // Abruptly any requests inflight
1603
+ * ```
1593
1604
  */
1594
- stop: () => Promise<void>;
1605
+ stop: (closeActiveConnections?: boolean) => Promise<void>;
1595
1606
  /**
1596
1607
  * Wait until all lazy loaded modules all load is fully
1597
1608
  */
@@ -1606,4 +1617,5 @@ export { ELYSIA_TRACE, type TraceEvent, type TraceListener, type TraceHandler, t
1606
1617
  export { getSchemaValidator, mergeHook, mergeObjectArray, getResponseSchemaValidator, redirect, StatusMap, InvertedStatusMap, form, replaceSchemaType, replaceUrlPath, checksum, cloneInference, deduplicateChecksum, ELYSIA_FORM_DATA, ELYSIA_REQUEST_ID } from './utils';
1607
1618
  export { error, mapValueError, ParseError, NotFoundError, ValidationError, InternalServerError, InvalidCookieSignature, ERROR_CODE, ELYSIA_RESPONSE } from './error';
1608
1619
  export type { EphemeralType, CreateEden, ComposeElysiaResponse, ElysiaConfig, SingletonBase, DefinitionBase, RouteBase, Handler, ComposedHandler, InputSchema, LocalHook, MergeSchema, RouteSchema, UnwrapRoute, InternalRoute, HTTPMethod, SchemaValidator, VoidHandler, PreHandler, BodyHandler, OptionalHandler, AfterResponseHandler, ErrorHandler, AfterHandler, LifeCycleEvent, LifeCycleStore, LifeCycleType, MaybePromise, ListenCallback, UnwrapSchema, Checksum, DocumentDecoration, InferContext, InferHandler, ResolvePath, MapResponse, MacroQueue, BaseMacro, MacroManager, BaseMacroFn, MacroToProperty, ResolveMacroContext, MergeElysiaInstances, MaybeArray, ModelValidator, MetadataBase, UnwrapBodySchema, UnwrapGroupGuardRoute, ModelValidatorError, ExcludeElysiaResponse, CoExist } from './types';
1620
+ export { TypeSystemPolicy } from '@sinclair/typebox/system';
1609
1621
  export type { Static, TSchema } from '@sinclair/typebox';