1
0
This commit is contained in:
2022-11-25 01:05:26 +01:00
parent 61ad67766f
commit c41e3e95f9

View File

@@ -13,13 +13,13 @@ export interface Route<TEnv> {
} }
/** /**
* Router Context * Router Context
* *
* @typedef RouterContext * @typedef RouterContext
* @property {RouterEnv} env Environment * @property {RouterEnv} env Environment
* @property {RouterRequest} req Request Object * @property {RouterRequest} req Request Object
* @property {ExecutionContext} ctx Context Object * @property {ExecutionContext} ctx Context Object
*/ */
export interface RouterContext<TEnv = any> { export interface RouterContext<TEnv = any> {
env: TEnv env: TEnv
req: RouterRequest req: RouterRequest
@@ -68,12 +68,12 @@ export interface RouterRequestQuery {
} }
/** /**
* Handler Function * Handler Function
* *
* @callback RouterHandler * @callback RouterHandler
* @param {RouterContext} ctx * @param {RouterContext} ctx
* @returns {Promise<Response | void> Response | void} * @returns {Promise<Response | void> Response | void}
*/ */
export interface RouterHandler<TEnv = any> { export interface RouterHandler<TEnv = any> {
(ctx: RouterContext<TEnv>): Promise<Response | void> | Response | void (ctx: RouterContext<TEnv>): Promise<Response | void> | Response | void
} }