@types/koa-better-body
Advanced tools
Comparing version 3.3.2 to 3.3.3
@@ -6,3 +6,3 @@ // Type definitions for koa-better-body 3.3 | ||
import { Context } from 'koa'; | ||
import { Next, ParameterizedContext, DefaultState, DefaultContext } from 'koa'; | ||
@@ -16,5 +16,24 @@ declare function KoaBetterBody( | ||
/** | ||
* { | ||
* <br /> multipart: ['multipart/form-data'], | ||
* <br /> text: ['text/*'], | ||
* <br /> form: ['application/x-www-form-urlencoded'], | ||
* <br /> json: [ | ||
* <br /> 'application/json', | ||
* <br /> 'application/json-patch+json', | ||
* <br /> 'application/vnd.api+json', | ||
* <br /> 'application/csp-report' | ||
* <br /> ], | ||
* <br /> buffer: ['text/*'] | ||
* } | ||
*/ | ||
extendTypes?: Record<string, string | string[]> & { | ||
custom?: string | string[]; | ||
}; | ||
/** | ||
* @default false | ||
*/ | ||
fields?: boolean | string; | ||
/** | ||
@@ -24,2 +43,3 @@ * @default false | ||
files?: boolean | string; | ||
/** | ||
@@ -29,2 +49,3 @@ * @default true | ||
multipart?: boolean; | ||
/** | ||
@@ -34,2 +55,3 @@ * @default false | ||
textLimit?: string; | ||
/** | ||
@@ -39,2 +61,3 @@ * @default false | ||
formLimit?: string; | ||
/** | ||
@@ -44,2 +67,3 @@ * @default false | ||
jsonLimit?: string; | ||
/** | ||
@@ -49,6 +73,10 @@ * @default true | ||
jsonStrict?: boolean; | ||
/** | ||
* @default () => false | ||
*/ | ||
detectJSON?: (ctx: Context) => boolean; | ||
detectJSON?: <StateT = DefaultState, ContextT = DefaultContext>( | ||
ctx: ParameterizedContext<StateT, ContextT>, | ||
) => boolean; | ||
/** | ||
@@ -58,2 +86,3 @@ * @default false | ||
bufferLimit?: string; | ||
/** | ||
@@ -63,2 +92,3 @@ * @default false | ||
buffer?: boolean; | ||
/** | ||
@@ -72,7 +102,9 @@ * @default true | ||
*/ | ||
delimiter?: string; // default: '&' | ||
delimiter?: string; | ||
/** | ||
* @default require('querystring').unescape | ||
*/ | ||
decodeURIComponent?: (query: string) => string; // default: require('querystring').unescape | ||
decodeURIComponent?: (query: string) => string; | ||
/** | ||
@@ -98,12 +130,20 @@ * @default 1000 | ||
*/ | ||
onError?: (err: any, ctx: Context) => void; | ||
onError?: <StateT = DefaultState, ContextT = DefaultContext>( | ||
err: any, | ||
ctx: ParameterizedContext<StateT, ContextT>, | ||
) => void; | ||
/** | ||
* @default undefined | ||
*/ | ||
handler?: (ctx: Context, options: Options, next: () => any) => void; | ||
handler?: <StateT = DefaultState, ContextT = DefaultContext>( | ||
ctx: ParameterizedContext<StateT, ContextT>, | ||
options: Options, | ||
next: Next, | ||
) => void; | ||
} | ||
type Body = (next: any) => Generator; | ||
type Body = (next: Next) => Generator; | ||
} | ||
export = KoaBetterBody; |
{ | ||
"name": "@types/koa-better-body", | ||
"version": "3.3.2", | ||
"version": "3.3.3", | ||
"description": "TypeScript definitions for koa-better-body", | ||
@@ -25,4 +25,4 @@ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/koa-better-body", | ||
}, | ||
"typesPublisherContentHash": "3630071738441b68f089461ed11c2f269a6486ba51a2107daca5c24c7fb58a95", | ||
"typeScriptVersion": "3.7" | ||
"typesPublisherContentHash": "3ae8d813eea85750baf98c54143deae236f76e214372dff1c51865a56443f220", | ||
"typeScriptVersion": "3.8" | ||
} |
@@ -9,106 +9,5 @@ # Installation | ||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/koa-better-body. | ||
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/koa-better-body/index.d.ts) | ||
````ts | ||
// Type definitions for koa-better-body 3.3 | ||
// Project: https://github.com/tunnckoCore/opensource/tree/master/%40packages/koa-better-body | ||
// Definitions by: David Tanner <https://github.com/DavidTanner> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
import { Context } from 'koa'; | ||
declare function KoaBetterBody( | ||
options?: KoaBetterBody.Options, | ||
): KoaBetterBody.Body; | ||
declare namespace KoaBetterBody { | ||
interface Options { | ||
/** | ||
* @default false | ||
*/ | ||
fields?: boolean | string; | ||
/** | ||
* @default false | ||
*/ | ||
files?: boolean | string; | ||
/** | ||
* @default true | ||
*/ | ||
multipart?: boolean; | ||
/** | ||
* @default false | ||
*/ | ||
textLimit?: string; | ||
/** | ||
* @default false | ||
*/ | ||
formLimit?: string; | ||
/** | ||
* @default false | ||
*/ | ||
jsonLimit?: string; | ||
/** | ||
* @default true | ||
*/ | ||
jsonStrict?: boolean; | ||
/** | ||
* @default () => false | ||
*/ | ||
detectJSON?: (ctx: Context) => boolean; | ||
/** | ||
* @default false | ||
*/ | ||
bufferLimit?: string; | ||
/** | ||
* @default false | ||
*/ | ||
buffer?: boolean; | ||
/** | ||
* @default true | ||
*/ | ||
strict?: boolean; | ||
/** | ||
* @default '&' | ||
*/ | ||
delimiter?: string; // default: '&' | ||
/** | ||
* @default require('querystring').unescape | ||
*/ | ||
decodeURIComponent?: (query: string) => string; // default: require('querystring').unescape | ||
/** | ||
* @default 1000 | ||
*/ | ||
maxKeys?: number; // default: 1000 | ||
/** | ||
* @deprecated use formLimit instead | ||
* @default config.formLimit | ||
*/ | ||
urlencodedLimit?: string; | ||
/** | ||
* @deprecated use delimiter instead | ||
* @default config.delimiter | ||
*/ | ||
sep?: string; | ||
/** | ||
* @default undefined | ||
*/ | ||
onError?: (err: any, ctx: Context) => void; | ||
/** | ||
* @default undefined | ||
*/ | ||
handler?: (ctx: Context, options: Options, next: () => any) => void; | ||
} | ||
type Body = (next: any) => Generator; | ||
} | ||
export = KoaBetterBody; | ||
```` | ||
### Additional Details | ||
* Last updated: Mon, 25 Oct 2021 23:31:44 GMT | ||
* Last updated: Fri, 17 Dec 2021 22:31:12 GMT | ||
* Dependencies: [@types/koa](https://npmjs.com/package/@types/koa) | ||
@@ -115,0 +14,0 @@ * Global values: none |
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
114
5556
17