koa-better-body: Provides its own types (#39451)

This commit is contained in:
Alexander T
2019-11-01 10:39:15 -07:00
committed by Jesse Trinity
parent 35c84fe5a5
commit ada4aee144
5 changed files with 6 additions and 66 deletions
+6
View File
@@ -2118,6 +2118,12 @@
"sourceRepoURL": "https://github.com/sindresorhus/known",
"asOfVersion": "3.0.0"
},
{
"libraryName": "koa-better-body",
"typingsPackageName": "koa-better-body",
"sourceRepoURL": "https://github.com/tunnckoCore/koa-better-body",
"asOfVersion": "3.1.0"
},
{
"libraryName": "koa-jwt",
"typingsPackageName": "koa-jwt",
-33
View File
@@ -1,33 +0,0 @@
// Type definitions for koa-better-body 3.0
// Project: https://github.com/tunnckoCore/koa-better-body
// Definitions by: Daniel Byrne <https://github.com/danwbyrne>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
import { Context } from 'koa';
declare function KoaBetterBody(options?: KoaBetterBody.Options): KoaBetterBody.Body;
declare namespace KoaBetterBody {
interface Options {
fields?: boolean | string;
files?: boolean | string;
multipart?: boolean;
textLimit?: string;
formLimit?: string;
urlencodedLimit?: string;
jsonLimit?: string;
bufferLimit?: string;
jsonStrict?: boolean;
detectJSON?: () => any;
strict?: boolean;
delimiter?: symbol;
decodeURIComponent?: any;
maxKeys?: number;
buffer?: boolean;
}
type Body = (context: Context, next: () => void) => Generator;
}
export = KoaBetterBody;
@@ -1,11 +0,0 @@
import body = require('koa-better-body');
// $ExpectType Body
body();
const testOptions: body.Options = {
jsonLimit: '100mb',
};
// $ExpectType Body
body(testOptions);
-19
View File
@@ -1,19 +0,0 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": ["es6"],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": ["../"],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"koa-better-body-tests.ts"
]
}
-3
View File
@@ -1,3 +0,0 @@
{
"extends": "dtslint/dt.json"
}