Comparing version 0.7.7 to 0.7.8
@@ -13,8 +13,8 @@ import http from 'http'; | ||
declare type CompatibilityEvent = H3Event | IncomingMessage; | ||
declare type H3Response = any; | ||
interface EventHandler<T extends H3Response = H3Response> { | ||
declare type H3Response<T = any> = T | Promise<T>; | ||
interface EventHandler<T = any> { | ||
'__is_handler__'?: true; | ||
(event: CompatibilityEvent): T; | ||
(event: CompatibilityEvent): H3Response<T>; | ||
} | ||
declare function defineEventHandler<T extends H3Response = H3Response>(handler: EventHandler<T>): EventHandler<T>; | ||
declare function defineEventHandler<T = any>(handler: EventHandler<T>): EventHandler<T>; | ||
declare const eventHandler: typeof defineEventHandler; | ||
@@ -92,3 +92,3 @@ declare type LazyEventHandler = () => EventHandler | Promise<EventHandler>; | ||
declare function use(app: App, arg1: string | Handler | InputLayer | InputLayer[], arg2?: Handler | Partial<InputLayer> | Handler[] | Middleware | Middleware[], arg3?: Partial<InputLayer>): App; | ||
declare function createAppEventHandler(stack: Stack, options: AppOptions): EventHandler<Promise<void>>; | ||
declare function createAppEventHandler(stack: Stack, options: AppOptions): EventHandler<void>; | ||
@@ -95,0 +95,0 @@ /** |
{ | ||
"name": "h3", | ||
"version": "0.7.7", | ||
"version": "0.7.8", | ||
"description": "Tiny JavaScript Server", | ||
@@ -5,0 +5,0 @@ "repository": "unjs/h3", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
51174