Skip to content

Commit a916179

Browse files
authored
🤖 Merge PR DefinitelyTyped#74176 feat(koa-qs): type the options argument by @ysai258
1 parent 7ff0953 commit a916179

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

types/koa-qs/index.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import koa = require("koa");
2+
import qs = require("qs");
23

34
declare namespace koaQs {
45
type ParseMode = "extended" | "strict" | "first";
56
}
67

7-
declare function koaQs(app: koa, mode?: koaQs.ParseMode): koa;
8+
declare function koaQs(app: koa, mode?: koaQs.ParseMode, options?: qs.IParseOptions): koa;
89

910
export = koaQs;

types/koa-qs/koa-qs-tests.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,7 @@ import Koa = require("koa");
44
const app = koaQs(new Koa());
55

66
app.listen(80);
7+
8+
const appWithOptions = koaQs(new Koa(), "extended", { arrayLimit: 50 });
9+
10+
appWithOptions.listen(80);

types/koa-qs/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"https://github.com/koajs/qs#readme"
77
],
88
"dependencies": {
9-
"@types/koa": "*"
9+
"@types/koa": "*",
10+
"@types/qs": "*"
1011
},
1112
"devDependencies": {
1213
"@types/koa-qs": "workspace:."

0 commit comments

Comments
 (0)