Commit Graph

3 Commits

Author SHA1 Message Date
Chen Zhutian
27986da0aa add request.body (#11395)
* add request.body

* Update koa-bodyparser.d.ts

According to the documentation of `koa-bodyparser`:
```javascript
 // the parsed body will store in this.request.body
 // if nothing was parsed, body will be an empty object {}
 ctx.body = ctx.request.body;
```

Therefore the `body` property will exit in the `request` object.
Changing the `body` property from optional to required can also fix the conflict problem in Koa's declaration file:
```ts
 class Koa extend Request, Response {}
```
2016-09-28 21:24:41 +09:00
liushigit
7437a9ab3a added an empty namespace in koa-bodyparser.d.ts (#8979)
Without this, there will be `Module '"koa-bodyparser"' resolves to a non-module entity and cannot be imported using this construct. (2497)` error
This solution is found (here)[https://github.com/Microsoft/TypeScript/issues/5073].
koa-json's `.d.ts` file has such namespace.
2016-04-14 21:44:40 +09:00
hellopao
667df4b7a7 add definitions for koa-bodyparser 2016-03-22 10:34:06 +08:00