h3 0.7.7 → 0.7.8
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/dist/index.d.ts +5 -5
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -10,12 +10,12 @@ interface H3Event {
|
|
|
10
10
|
context: Record<string, any>;
|
|
11
11
|
}
|
|
12
12
|
declare type CompatibilityEvent = H3Event | IncomingMessage;
|
|
13
|
-
declare type H3Response = any
|
|
14
|
-
interface EventHandler<T
|
|
13
|
+
declare type H3Response<T = any> = T | Promise<T>;
|
|
14
|
+
interface EventHandler<T = any> {
|
|
15
15
|
'__is_handler__'?: true;
|
|
16
|
-
(event: CompatibilityEvent): T
|
|
16
|
+
(event: CompatibilityEvent): H3Response<T>;
|
|
17
17
|
}
|
|
18
|
-
declare function defineEventHandler<T
|
|
18
|
+
declare function defineEventHandler<T = any>(handler: EventHandler<T>): EventHandler<T>;
|
|
19
19
|
declare const eventHandler: typeof defineEventHandler;
|
|
20
20
|
declare type LazyEventHandler = () => EventHandler | Promise<EventHandler>;
|
|
21
21
|
declare function defineLazyEventHandler(factory: LazyEventHandler): EventHandler;
|
|
@@ -88,7 +88,7 @@ interface AppOptions {
|
|
|
88
88
|
}
|
|
89
89
|
declare function createApp(options?: AppOptions): App;
|
|
90
90
|
declare function use(app: App, arg1: string | Handler | InputLayer | InputLayer[], arg2?: Handler | Partial<InputLayer> | Handler[] | Middleware | Middleware[], arg3?: Partial<InputLayer>): App;
|
|
91
|
-
declare function createAppEventHandler(stack: Stack, options: AppOptions): EventHandler<
|
|
91
|
+
declare function createAppEventHandler(stack: Stack, options: AppOptions): EventHandler<void>;
|
|
92
92
|
|
|
93
93
|
/**
|
|
94
94
|
* H3 Runtime Error
|