diff --git a/types/koa-etag/index.d.ts b/types/koa-etag/index.d.ts new file mode 100644 index 0000000000..807fd7803b --- /dev/null +++ b/types/koa-etag/index.d.ts @@ -0,0 +1,12 @@ +// Type definitions for koa-etag 3.0 +// Project: https://github.com/koajs/etag#readme +// Definitions by: Matthew Bull +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import * as koa from 'koa'; +import * as etag from 'etag'; + +declare function koaEtag(options?: etag.Options): koa.Middleware; + +export = koaEtag; diff --git a/types/koa-etag/koa-etag-tests.ts b/types/koa-etag/koa-etag-tests.ts new file mode 100644 index 0000000000..fa2d5515d6 --- /dev/null +++ b/types/koa-etag/koa-etag-tests.ts @@ -0,0 +1,8 @@ +import koaEtag = require('koa-etag'); +import * as Koa from 'koa'; + +new Koa().use(koaEtag()); + +new Koa().use(koaEtag({})); + +new Koa().use(koaEtag({ weak: true })); diff --git a/types/koa-etag/tsconfig.json b/types/koa-etag/tsconfig.json new file mode 100644 index 0000000000..d6b1feb52c --- /dev/null +++ b/types/koa-etag/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-etag-tests.ts" + ] +} diff --git a/types/koa-etag/tslint.json b/types/koa-etag/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/koa-etag/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }