forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
wreck.d.ts
41 lines (29 loc) · 1.66 KB
/
wreck.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Type definitions for wreck 7.0.0
// Project: https://github.com/hapijs/wreck
// Definitions by: Marcin Porębski <http://github.com/marcinporebski>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
declare module "wreck"
{
import http = require('http');
import stream = require('stream');
interface WreckObject
{
defaults: (options: any) => WreckObject;
request: (method: string, uri: string, options: any, callback?: (err: any, response: http.IncomingMessage) => void) => http.ClientRequest;
read: (response: http.IncomingMessage, options: any, callback: (err: any, payload: any) => void) => void;
get: (uri: string, options: any, callback: (err: any, response: http.IncomingMessage, payload: any) => void) => http.ClientRequest;
post: (uri: string, options: any, callback: (err: any, response: http.IncomingMessage, payload: any) => void) => http.ClientRequest;
patch: (uri: string, options: any, callback: (err: any, response: http.IncomingMessage, payload: any) => void) => http.ClientRequest;
put: (uri: string, options: any, callback: (err: any, response: http.IncomingMessage, payload: any) => void) => http.ClientRequest;
delete: (uri: string, options: any, callback: (err: any, response: http.IncomingMessage, payload: any) => void) => http.ClientRequest;
toReadableStream: (payload: any, encoding?: string) => stream.Readable;
parseCacheControl: (field: string) => any;
agents: {
http: http.Agent,
https: http.Agent
};
}
var wreck: WreckObject;
export = wreck;
}