Skip to content

Commit 86e0815

Browse files
author
Vladimir Enchev
committed
comments added
1 parent 212c77d commit 86e0815

File tree

1 file changed

+45
-1
lines changed

1 file changed

+45
-1
lines changed

http/http.d.ts

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,24 +45,68 @@
4545
function request(options: HttpRequestOptions): promises.Promise<HttpResponse>;
4646

4747
interface HttpRequestOptions {
48+
/**
49+
* Gets or sets the request url.
50+
*/
4851
url: string;
52+
53+
/**
54+
* Gets or sets the request method.
55+
*/
4956
method: string;
57+
58+
/**
59+
* Gets or sets the request headers in JSON format.
60+
*/
5061
headers?: any;
62+
63+
/**
64+
* Gets or sets the request body.
65+
*/
5166
content?: any;
67+
68+
/**
69+
* Gets or sets the request timeout.
70+
*/
5271
timeout?: number;
5372
}
5473

5574
interface HttpResponse {
75+
/**
76+
* Gets the response status code.
77+
*/
5678
statusCode: number;
79+
80+
/**
81+
* Gets the response headers.
82+
*/
5783
headers: any;
84+
85+
/**
86+
* Gets the response content.
87+
*/
5888
content?: HttpContent;
5989
}
6090

6191
interface HttpContent {
92+
/**
93+
* Gets the response body as raw data.
94+
*/
6295
raw: any;
96+
97+
/**
98+
* Gets the response body as string.
99+
*/
63100
toString: () => string;
64-
// TODO: Isn't parseJSON better naming? toJSON sounds to me like we will return a string object
101+
102+
/**
103+
* Gets the response body as JSON object.
104+
*/
65105
toJSON: () => any;
106+
107+
/**
108+
* Gets the response body as ImageSource.
109+
*/
66110
toImage: () => image.ImageSource;
67111
}
68112
}

0 commit comments

Comments
 (0)