mirror of
https://github.com/honojs/hono.git
synced 2024-12-01 11:51:01 +01:00
85e3c6a275
* feat: introduce HonoRequest with "wrapper pattern" (#733) * feat: HonoRequest * avoid `awaits` * use `raw` instead of `original` * feat: types for "RPC" support & build-in validator obsolete * feat: introduce HonoRequest with "wrapper pattern" (#733) * feat: HonoRequest * avoid `awaits` * use `raw` instead of `original` * create generic middleare for 3rd-party validator * indent * support multiple validators and refactor * remove unsed lines * denoify
30 lines
1004 B
TypeScript
30 lines
1004 B
TypeScript
import { Hono } from './hono.ts'
|
|
|
|
declare global {
|
|
class ExtendableEvent extends Event {
|
|
constructor(type: string, init?: EventInit)
|
|
waitUntil(promise: Promise<void>): void
|
|
}
|
|
abstract class FetchEvent extends ExtendableEvent {
|
|
readonly request: Request
|
|
respondWith(promise: Response | Promise<Response>): void
|
|
passThroughOnException(): void
|
|
}
|
|
interface ExecutionContext {
|
|
waitUntil(promise: Promise<void>): void
|
|
passThroughOnException(): void
|
|
}
|
|
}
|
|
|
|
export type { Next, MiddlewareHandler, ErrorHandler, NotFoundHandler } from './types.ts'
|
|
import type { CustomHandler } from './types.ts'
|
|
export type { CustomHandler as Handler }
|
|
export type { Context, ContextVariableMap } from './context.ts'
|
|
export { Hono }
|
|
|
|
// Router
|
|
export { RegExpRouter } from './router/reg-exp-router/index.ts'
|
|
export { TrieRouter } from './router/trie-router/index.ts'
|
|
export { StaticRouter } from './router/static-router/index.ts'
|
|
export { SmartRouter } from './router/smart-router/index.ts'
|