needle definitions added

This commit is contained in:
San Chen
2014-08-04 16:16:54 +08:00
parent 496e3ba3df
commit 86ac984bb0
3 changed files with 31 additions and 0 deletions
+1
View File
@@ -249,6 +249,7 @@ All definitions files include a header with the author and editors, so at some p
* [msgpack.js](https://github.com/uupaa/msgpack.js) (by [Shinya Mochizuki](https://github.com/enrapt-mochizuki))
* [Mustache.js](https://github.com/janl/mustache.js) (by [Boris Yankov](https://github.com/borisyankov))
* [nconf](https://github.com/flatiron/nconf) (by [Jeff Goddard](https://github.com/jedigo))
* [needle](https://github.com/tomas/needle) (by [San Chen](https://github.com/bigsan))
* [noble](https://github.com/sandeepmistry/noble) (by [Seon-Wook Park](https://github.com/swook))
* [nock](https://github.com/pgte/nock) (by [bonnici](https://github.com/bonnici))
* [Node.js](http://nodejs.org/) (from TypeScript samples)
+14
View File
@@ -0,0 +1,14 @@
/// <reference path="needle.d.ts" />
import needle = require("needle");
var url = "";
var options = {};
var callback = (err, resp) => {};
needle.head(url, options, callback);
needle.get(url, options, callback);
needle.post(url, data, options, callback);
needle.put(url, data, options, callback);
needle.delete(url, data, options, callback);
needle.request(method, url, data, options, callback);
+16
View File
@@ -0,0 +1,16 @@
// Type definitions for needle 0.7.8
// Project: https://github.com/tomas/needle
// Definitions by: San Chen <https://github.com/bigsan>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
interface INeedle {
head(url: string): IReadableStream;
head(url: string, callback?: Function): IReadableStream;
head(url: string, options?: any, callback?: Function): IReadableStream;
}
declare module "needle" {
var needle: INeedle;
export = needle;
}