From f72abdaf74df9837f986efd925c78fff3bf80a97 Mon Sep 17 00:00:00 2001 From: Michael Ledin Date: Fri, 2 Jun 2017 22:13:28 +0300 Subject: [PATCH] Add definitions for superagent-no-cache 0.1. --- types/superagent-no-cache/index.d.ts | 11 +++++++++ .../superagent-no-cache-tests.ts | 9 ++++++++ types/superagent-no-cache/tsconfig.json | 23 +++++++++++++++++++ types/superagent-no-cache/tslint.json | 1 + types/superagent/superagent-tests.ts | 2 -- 5 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 types/superagent-no-cache/index.d.ts create mode 100644 types/superagent-no-cache/superagent-no-cache-tests.ts create mode 100644 types/superagent-no-cache/tsconfig.json create mode 100644 types/superagent-no-cache/tslint.json diff --git a/types/superagent-no-cache/index.d.ts b/types/superagent-no-cache/index.d.ts new file mode 100644 index 0000000000..9dcfc02005 --- /dev/null +++ b/types/superagent-no-cache/index.d.ts @@ -0,0 +1,11 @@ +// Type definitions for superagent-no-cache 0.1 +// Project: https://github.com/johntron/superagent-no-cache +// Definitions by: Michael Ledin +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +import * as request from 'superagent'; + +declare const plugin: request.Plugin; + +export default plugin; diff --git a/types/superagent-no-cache/superagent-no-cache-tests.ts b/types/superagent-no-cache/superagent-no-cache-tests.ts new file mode 100644 index 0000000000..528eb4fd40 --- /dev/null +++ b/types/superagent-no-cache/superagent-no-cache-tests.ts @@ -0,0 +1,9 @@ +import * as request from 'superagent'; +import plugin from 'superagent-no-cache'; + +request + .get('/some-url') + .use(plugin) + .end((err, res) => { + // Do something + }); diff --git a/types/superagent-no-cache/tsconfig.json b/types/superagent-no-cache/tsconfig.json new file mode 100644 index 0000000000..668d406795 --- /dev/null +++ b/types/superagent-no-cache/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "superagent-no-cache-tests.ts" + ] +} diff --git a/types/superagent-no-cache/tslint.json b/types/superagent-no-cache/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/superagent-no-cache/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/superagent/superagent-tests.ts b/types/superagent/superagent-tests.ts index cfac121640..628b4fd1f6 100644 --- a/types/superagent/superagent-tests.ts +++ b/types/superagent/superagent-tests.ts @@ -40,13 +40,11 @@ agent }); // Plugins -var nocache = require('superagent-no-cache'); var prefix = require('superagent-prefix')('/static'); request .get('/some-url') .use(prefix) // Prefixes *only* this request - .use(nocache) // Prevents caching of *only* this request .end(function (err, res) { // Do something });