koa-qs: Add types definitions

This commit is contained in:
Rémy Jeancolas 2018-11-06 14:23:19 -05:00
parent ffdaa7c3bf
commit a3766f8dbe
4 changed files with 45 additions and 0 deletions

15
types/koa-qs/index.d.ts vendored Normal file
View File

@ -0,0 +1,15 @@
// Type definitions for koa-qs 2.0
// Project: https://github.com/koajs/qs#readme
// Definitions by: Rémy Jeancolas <https://github.com/RemyJeancolas>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
import * as koa from 'koa';
declare namespace koaQs {
type ParseMode = 'extended'|'strict'|'first';
}
declare function koaQs(app: koa, mode?: koaQs.ParseMode): koa;
export = koaQs;

View File

@ -0,0 +1,6 @@
import koaQs = require('koa-qs');
import Koa = require('koa');
const app = koaQs(new Koa());
app.listen(80);

View File

@ -0,0 +1,23 @@
{
"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-qs-tests.ts"
]
}

1
types/koa-qs/tslint.json Normal file
View File

@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }