1
0

Add env and ctx to router.handle()

This commit is contained in:
2022-03-18 17:57:35 +01:00
parent 2437f82e94
commit 6e6a771c1a
3 changed files with 33 additions and 8 deletions

24
index.d.ts vendored
View File

@@ -265,16 +265,32 @@ type RouterRequest = {
* HTTP request method
*/
method: string
/**
* Object containing request headers
*/
headers: Headers
/**
* URL String
*/
url: string
/**
* Environment object
*/
env: any
/**
* Context object
*/
ctx: any
/**
* Cloudflare object
*/
cf: any
/**
* Object containing all parameters defined in the url string
*/
params: {
[key: string]: string
}
/**
* Object containing request headers
*/
headers: Headers
/**
* Only available if method is `POST`, `PUT` or `PATCH`. Contains either the received body string or a parsed object if valid JSON was sent.
*/