Add definitions for superagent-no-cache 0.1.

This commit is contained in:
Michael Ledin 2017-06-02 22:13:28 +03:00
parent 2ea788c866
commit f72abdaf74
5 changed files with 44 additions and 2 deletions

11
types/superagent-no-cache/index.d.ts vendored Normal file
View File

@ -0,0 +1,11 @@
// Type definitions for superagent-no-cache 0.1
// Project: https://github.com/johntron/superagent-no-cache
// Definitions by: Michael Ledin <https://github.com/mxl/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
import * as request from 'superagent';
declare const plugin: request.Plugin;
export default plugin;

View File

@ -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
});

View File

@ -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"
]
}

View File

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

View File

@ -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
});