1
0

2 Commits

Author SHA1 Message Date
95ccb2263a 3.1.3 2023-11-14 14:54:46 +01:00
dc88d900cb fix default extension types 2023-11-14 14:54:04 +01:00
3 changed files with 6 additions and 6 deletions

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{ {
"name": "@tsndr/cloudflare-worker-router", "name": "@tsndr/cloudflare-worker-router",
"version": "3.1.2", "version": "3.1.3",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@tsndr/cloudflare-worker-router", "name": "@tsndr/cloudflare-worker-router",
"version": "3.1.2", "version": "3.1.3",
"license": "MIT", "license": "MIT",
"devDependencies": { "devDependencies": {
"@cloudflare/workers-types": "^4.20231025.0", "@cloudflare/workers-types": "^4.20231025.0",

View File

@@ -1,6 +1,6 @@
{ {
"name": "@tsndr/cloudflare-worker-router", "name": "@tsndr/cloudflare-worker-router",
"version": "3.1.2", "version": "3.1.3",
"description": "", "description": "",
"main": "index.js", "main": "index.js",
"types": "index.d.ts", "types": "index.d.ts",

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