mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
@types/koa-bodyparser: use any for Request.body
Also, fix Request.rawBody and library version.
This commit is contained in:
parent
1733f6bed0
commit
e4b6fecfdc
10
types/koa-bodyparser/index.d.ts
vendored
10
types/koa-bodyparser/index.d.ts
vendored
@ -1,6 +1,8 @@
|
||||
// Type definitions for koa-bodyparser 5.0
|
||||
// Type definitions for koa-bodyparser 4.2
|
||||
// Project: https://github.com/koajs/bodyparser
|
||||
// Definitions by: Jerry Chin <https://github.com/hellopao>, Anup Kishore <https://github.com/anup-2s>
|
||||
// Definitions by: Jerry Chin <https://github.com/hellopao>
|
||||
// Anup Kishore <https://github.com/anup-2s>
|
||||
// Hiroshi Ioka <https://github.com/hirochachacha>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
@ -18,8 +20,8 @@ import * as Koa from "koa";
|
||||
|
||||
declare module "koa" {
|
||||
interface Request {
|
||||
body: {} | null | undefined;
|
||||
rawBody: {} | null | undefined;
|
||||
body: any;
|
||||
rawBody: string;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -7,6 +7,7 @@ app.use(bodyParser({ strict: false }));
|
||||
|
||||
app.use((ctx) => {
|
||||
console.log(ctx.request.body);
|
||||
console.log(ctx.request.body.ok);
|
||||
console.log(ctx.request.rawBody);
|
||||
});
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user