Skip to content

Commit

Permalink
feat: add H3EventContext for type augmentation (#124)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Jun 1, 2022
1 parent 417af22 commit 5042e92
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/event.ts
Expand Up @@ -2,12 +2,14 @@ import type http from 'http'
import type { IncomingMessage, ServerResponse, Handler, Middleware } from './types'
import { callHandler } from './handler'

export interface H3EventContext extends Record<string, any> {}

export interface H3Event {
'__is_event__': true
event: H3Event
req: IncomingMessage
res: ServerResponse
context: Record<string, any>
context: H3EventContext
}

export type CompatibilityEvent = H3Event | IncomingMessage
Expand Down

0 comments on commit 5042e92

Please sign in to comment.