Skip to content

Commit 5042e92

Browse files
authoredJun 1, 2022
feat: add H3EventContext for type augmentation (#124)
1 parent 417af22 commit 5042e92

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed
 

‎src/event.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@ import type http from 'http'
22
import type { IncomingMessage, ServerResponse, Handler, Middleware } from './types'
33
import { callHandler } from './handler'
44

5+
export interface H3EventContext extends Record<string, any> {}
6+
57
export interface H3Event {
68
'__is_event__': true
79
event: H3Event
810
req: IncomingMessage
911
res: ServerResponse
10-
context: Record<string, any>
12+
context: H3EventContext
1113
}
1214

1315
export type CompatibilityEvent = H3Event | IncomingMessage

0 commit comments

Comments
 (0)
Please sign in to comment.