forked from soywiz-archive/typescript-node-definitions
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsuperagent.d.ts
More file actions
39 lines (35 loc) · 1.03 KB
/
superagent.d.ts
File metadata and controls
39 lines (35 loc) · 1.03 KB
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
///<reference path='node.d.ts' />
declare module "superagent" {
import superagent = module('superagent');
export interface Response {
text: string;
header: any;
headers: any;
type: string;
status: number;
statusCode: number;
statusType: number;
info: any;
ok: bool;
redirect: bool;
req: any;
res: any;
}
export class Request {
auth(user: string, name: string): Request;
redirects(count: number): Request;
type(type: string): Request;
get(url: string): Request;
del(url: string): Request;
head(url: string): Request;
post(url: string): Request;
query(object: any): Request;
send(object: any): Request;
set(key: string, value: any): Request;
field(key: string, value: any): Request;
attach(key: string, file: any): Request;
end(callback: (err: Error, res: Response) => void): Request;
}
export function agent(url?: string, cb?: (err: Error, res: Response) => void): Request;
export function(url?: string, cb?: (err: Error, res: Response) => void): Request;
}