mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-01-30 05:27:30 +00:00
Add definitions for superagent-no-cache 0.1.
This commit is contained in:
parent
2ea788c866
commit
f72abdaf74
11
types/superagent-no-cache/index.d.ts
vendored
Normal file
11
types/superagent-no-cache/index.d.ts
vendored
Normal 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;
|
||||
9
types/superagent-no-cache/superagent-no-cache-tests.ts
Normal file
9
types/superagent-no-cache/superagent-no-cache-tests.ts
Normal 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
|
||||
});
|
||||
23
types/superagent-no-cache/tsconfig.json
Normal file
23
types/superagent-no-cache/tsconfig.json
Normal 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"
|
||||
]
|
||||
}
|
||||
1
types/superagent-no-cache/tslint.json
Normal file
1
types/superagent-no-cache/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
@ -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
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user