fix default extension types
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user