1
0

fix default extension types

This commit is contained in:
2023-11-14 14:54:04 +01:00
parent 0dca90f4f9
commit dc88d900cb

View File

@@ -20,7 +20,7 @@ export type Route<TEnv, TCtx, TReq> = {
* @property {RouterRequest} req Request Object * @property {RouterRequest} req Request Object
* @property {ExecutionContext} ctx Context Object * @property {ExecutionContext} ctx Context Object
*/ */
export type RouterContext<TEnv = any, TCtx = any, TReq = any> = TCtx & { export type RouterContext<TEnv = any, TCtx = {}, TReq = {}> = TCtx & {
env: TEnv env: TEnv
req: RouterRequest<TReq> req: RouterRequest<TReq>
dbg: boolean dbg: boolean
@@ -80,7 +80,7 @@ export type RouterRequestQuery = {
* @param {RouterContext} ctx * @param {RouterContext} ctx
* @returns {Promise<Response | void> Response | void} * @returns {Promise<Response | void> Response | void}
*/ */
export type RouterHandler<TEnv = any, TCtx = any, TReq = any> = { export type RouterHandler<TEnv = any, TCtx = {}, TReq = {}> = {
(ctx: RouterContext<TEnv, TCtx, TReq>): Promise<Response | void> | Response | void (ctx: RouterContext<TEnv, TCtx, TReq>): Promise<Response | void> | Response | void
} }
@@ -120,7 +120,7 @@ export type RouterBuffer = {
* @public * @public
* @class * @class
*/ */
export class Router<TEnv = any, TCtx = any, TReq = any> { export class Router<TEnv = any, TCtx = {}, TReq = {}> {
/** /**
* Router Array * Router Array