diff --git a/types/koa-qs/index.d.ts b/types/koa-qs/index.d.ts new file mode 100644 index 0000000000..e69c131408 --- /dev/null +++ b/types/koa-qs/index.d.ts @@ -0,0 +1,15 @@ +// Type definitions for koa-qs 2.0 +// Project: https://github.com/koajs/qs#readme +// Definitions by: Rémy Jeancolas +// 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; diff --git a/types/koa-qs/koa-qs-tests.ts b/types/koa-qs/koa-qs-tests.ts new file mode 100644 index 0000000000..c0063b757b --- /dev/null +++ b/types/koa-qs/koa-qs-tests.ts @@ -0,0 +1,6 @@ +import koaQs = require('koa-qs'); +import Koa = require('koa'); + +const app = koaQs(new Koa()); + +app.listen(80); diff --git a/types/koa-qs/tsconfig.json b/types/koa-qs/tsconfig.json new file mode 100644 index 0000000000..b5a52f4ccd --- /dev/null +++ b/types/koa-qs/tsconfig.json @@ -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" + ] +} diff --git a/types/koa-qs/tslint.json b/types/koa-qs/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/koa-qs/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }