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