0
0
mirror of https://github.com/honojs/hono.git synced 2024-11-29 17:46:30 +01:00
hono/deno_dist/mod.ts
Yusuke Wada 677b572fd5 feat: introduce PatternRouter and hono/tiny (#1036)
* wip

* Use RegExp instead of URLPattern. (#1039)

* Use RegExp instead of URLPattern.

* refactor(url-pattern-router): tidy up.

* refactor(url-pattern-router): Tweaks type for mangling.

* refactor: Rename URLPatternRouter to PatternRouter.

* chore: denoify.

---------

Co-authored-by: Taku Amano <taku@taaas.jp>
2023-04-28 12:10:20 +09:00

49 lines
1.3 KiB
TypeScript

import { Hono } from './hono.ts'
declare global {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
class ExtendableEvent extends Event {
constructor(type: string, init?: EventInit)
waitUntil(promise: Promise<void>): void
}
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
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 {
Env,
ErrorHandler,
Handler,
MiddlewareHandler,
Next,
NotFoundHandler,
ValidationTargets,
Input,
} from './types.ts'
export type { Context, ContextVariableMap } from './context.ts'
export type { HonoRequest } from './request.ts'
export { Hono }
// Router
export { RegExpRouter } from './router/reg-exp-router/index.ts'
export { TrieRouter } from './router/trie-router/index.ts'
export { SmartRouter } from './router/smart-router/index.ts'
export { PatternRouter } from './router/pattern-router/index.ts'
// Validator
export { validator } from './validator/index.ts'
// Client
export { hc } from './client/index.ts'
export type { InferResponseType } from './client/index.ts'