From a3766f8dbe722d49f57180a7e027e64faf3ef3a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Jeancolas?= Date: Tue, 6 Nov 2018 14:23:19 -0500 Subject: [PATCH] koa-qs: Add types definitions --- types/koa-qs/index.d.ts | 15 +++++++++++++++ types/koa-qs/koa-qs-tests.ts | 6 ++++++ types/koa-qs/tsconfig.json | 23 +++++++++++++++++++++++ types/koa-qs/tslint.json | 1 + 4 files changed, 45 insertions(+) create mode 100644 types/koa-qs/index.d.ts create mode 100644 types/koa-qs/koa-qs-tests.ts create mode 100644 types/koa-qs/tsconfig.json create mode 100644 types/koa-qs/tslint.json 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" }