This repository has been archived on 2022-08-14. You can view files and clone it, but cannot push or open issues or pull requests.
2020-08-08 23:26:20 +00:00
|
|
|
// flow-typed signature: a58f72097622ee04c396fbb8bb02db81
|
|
|
|
// flow-typed version: c6154227d1/koa-bodyparser_v4.x.x/flow_>=v0.104.x
|
2018-05-05 23:16:08 +00:00
|
|
|
|
|
|
|
declare module "koa-bodyparser" {
|
|
|
|
declare type Context = Object;
|
|
|
|
|
|
|
|
declare type Middleware = (
|
|
|
|
ctx: Context,
|
|
|
|
next: () => Promise<void>
|
|
|
|
) => Promise<void> | void;
|
|
|
|
|
|
|
|
declare type Options = {|
|
|
|
|
enableTypes?: Array<string>,
|
|
|
|
encode?: string,
|
|
|
|
formLimit?: string,
|
|
|
|
jsonLimit?: string,
|
|
|
|
strict?: boolean,
|
|
|
|
detectJSON?: (ctx: Context) => boolean,
|
|
|
|
extendTypes?: {
|
|
|
|
json?: Array<string>,
|
|
|
|
form?: Array<string>,
|
2020-08-08 23:26:20 +00:00
|
|
|
text?: Array<string>,
|
|
|
|
...
|
2018-05-05 23:16:08 +00:00
|
|
|
},
|
|
|
|
onerror?: (err: Error, ctx: Context) => void
|
|
|
|
|};
|
|
|
|
|
2018-11-07 05:58:32 +00:00
|
|
|
declare module.exports: (opts?: Options) => Middleware;
|
2018-05-05 23:16:08 +00:00
|
|
|
}
|