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
+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;
}