forked from honojs/hono
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.ts
32 lines (28 loc) · 829 Bytes
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// @denoify-ignore
// eslint-disable-next-line @typescript-eslint/triple-slash-reference
/// <reference path="./request.ts" /> Import "declare global" for the Request interface.
import { Hono } from './hono'
export type {
Next,
ContextVariableMap,
MiddlewareHandler,
ErrorHandler,
NotFoundHandler,
} from './types'
export type { Context } from './context'
export type { Validator } from './validator/validator'
import type { CustomHandler } from './types'
export type { CustomHandler as Handler }
declare module './hono' {
interface Hono {
fire(): void
}
}
Hono.prototype.fire = function () {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
addEventListener('fetch', (event: FetchEvent): void => {
void event.respondWith(this.handleEvent(event))
})
}
export { Hono }