1 | declare module "fetch" {
|
2 |
|
3 | interface FetchCookieJar {
|
4 | setCookie(line: string)
|
5 | }
|
6 |
|
7 | interface FetchResponseMeta {
|
8 | status: number
|
9 | responseHeaders: {[name: string] : string }
|
10 | finalUrl: string
|
11 | redirectCount: number
|
12 | cookieJar: FetchCookieJar
|
13 | }
|
14 |
|
15 | interface FetchOptions {
|
16 | maxRedirects: number
|
17 | disableRedirects
|
18 | headers: {[name: string] : string }
|
19 | maxResponseLength
|
20 | method
|
21 | payload
|
22 | cookies: string[]
|
23 | cookieJar: FetchCookieJar
|
24 | outputEncoding
|
25 | disableDecoding
|
26 | overrideCharset
|
27 | asyncDnsLoookup
|
28 | timeout
|
29 | }
|
30 |
|
31 | var fetch: {
|
32 | fetchUrl (url: string, opts: FetchOptions, cb: (error: Error, meta: FetchResponseMeta, body) => void);
|
33 | CookieJar: new () => FetchCookieJar
|
34 | }
|
35 |
|
36 | export = fetch;
|
37 | } |
\ | No newline at end of file |