@types/koa-bodyparser
Advanced tools
Comparing version 4.3.10 to 4.3.11
@@ -1,10 +0,1 @@ | ||
// Type definitions for koa-bodyparser 4.3 | ||
// Project: https://github.com/koajs/body-parser | ||
// Definitions by: Jerry Chin <https://github.com/hellopao> | ||
// Hiroshi Ioka <https://github.com/hirochachacha> | ||
// Alexi Maschas <https://github.com/amaschas> | ||
// Pirasis Leelatanon <https://github.com/1pete> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
// TypeScript Version: 2.3 | ||
/* =================== USAGE =================== | ||
@@ -11,0 +2,0 @@ |
{ | ||
"name": "@types/koa-bodyparser", | ||
"version": "4.3.10", | ||
"version": "4.3.11", | ||
"description": "TypeScript definitions for koa-bodyparser", | ||
@@ -10,19 +10,19 @@ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/koa-bodyparser", | ||
"name": "Jerry Chin", | ||
"url": "https://github.com/hellopao", | ||
"githubUsername": "hellopao" | ||
"githubUsername": "hellopao", | ||
"url": "https://github.com/hellopao" | ||
}, | ||
{ | ||
"name": "Hiroshi Ioka", | ||
"url": "https://github.com/hirochachacha", | ||
"githubUsername": "hirochachacha" | ||
"githubUsername": "hirochachacha", | ||
"url": "https://github.com/hirochachacha" | ||
}, | ||
{ | ||
"name": "Alexi Maschas", | ||
"url": "https://github.com/amaschas", | ||
"githubUsername": "amaschas" | ||
"githubUsername": "amaschas", | ||
"url": "https://github.com/amaschas" | ||
}, | ||
{ | ||
"name": "Pirasis Leelatanon", | ||
"url": "https://github.com/1pete", | ||
"githubUsername": "1pete" | ||
"githubUsername": "1pete", | ||
"url": "https://github.com/1pete" | ||
} | ||
@@ -41,4 +41,4 @@ ], | ||
}, | ||
"typesPublisherContentHash": "5c3e437194a7de261d59a0bd7ea99d4d0f60b2a2e15d0a8db5aaea139f3dd788", | ||
"typeScriptVersion": "4.1" | ||
"typesPublisherContentHash": "886ac31c5975b23bf26170e702c7afaabe84c93edc2f7b256b78834815ba30fe", | ||
"typeScriptVersion": "4.5" | ||
} |
@@ -9,9 +9,93 @@ # Installation | ||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/koa-bodyparser. | ||
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/koa-bodyparser/index.d.ts) | ||
````ts | ||
/* =================== USAGE =================== | ||
import bodyParser = require("koa-bodyparser"); | ||
var Koa = require('koa'); | ||
var app = new Koa(); | ||
app.use(bodyParser()); | ||
=============================================== */ | ||
import * as Koa from "koa"; | ||
declare module "koa" { | ||
interface Request { | ||
body?: unknown; | ||
rawBody: string; | ||
} | ||
} | ||
declare function bodyParser(opts?: bodyParser.Options): Koa.Middleware; | ||
declare namespace bodyParser { | ||
interface Options { | ||
/** | ||
* parser will only parse when request type hits enableTypes, default is ['json', 'form']. | ||
*/ | ||
enableTypes?: string[] | undefined; | ||
/** | ||
* requested encoding. Default is utf-8 by co-body | ||
*/ | ||
encoding?: string | undefined; | ||
/** | ||
* limit of the urlencoded body. If the body ends up being larger than this limit | ||
* a 413 error code is returned. Default is 56kb | ||
*/ | ||
formLimit?: string | undefined; | ||
/** | ||
* limit of the json body. Default is 1mb | ||
*/ | ||
jsonLimit?: string | undefined; | ||
/** | ||
* limit of the text body. Default is 1mb. | ||
*/ | ||
textLimit?: string | undefined; | ||
/** | ||
* limit of the xml body. Default is 1mb. | ||
*/ | ||
xmlLimit?: string | undefined; | ||
/** | ||
* when set to true, JSON parser will only accept arrays and objects. Default is true | ||
*/ | ||
strict?: boolean | undefined; | ||
/** | ||
* custom json request detect function. Default is null | ||
*/ | ||
detectJSON?: ((ctx: Koa.Context) => boolean) | undefined; | ||
/** | ||
* support extend types | ||
*/ | ||
extendTypes?: { | ||
json?: string[] | string | undefined; | ||
form?: string[] | string | undefined; | ||
text?: string[] | string | undefined; | ||
} | undefined; | ||
/** | ||
* support custom error handle | ||
*/ | ||
onerror?: ((err: Error, ctx: Koa.Context) => void) | undefined; | ||
} | ||
} | ||
export = bodyParser; | ||
```` | ||
### Additional Details | ||
* Last updated: Fri, 04 Nov 2022 23:32:53 GMT | ||
* Last updated: Wed, 18 Oct 2023 05:47:07 GMT | ||
* Dependencies: [@types/koa](https://npmjs.com/package/@types/koa) | ||
* Global values: none | ||
# Credits | ||
These definitions were written by [Jerry Chin](https://github.com/hellopao), [Hiroshi Ioka](https://github.com/hirochachacha), [Alexi Maschas](https://github.com/amaschas), and [Pirasis Leelatanon](https://github.com/1pete). |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7409
101
64