@@ -11,12 +11,12 @@ export declare class Wretcher {
11
11
* Sets the default fetch options used for every subsequent fetch call.
12
12
* @param opts New default options
13
13
*/
14
- defaults ( opts : Object ) : this;
14
+ defaults ( opts : object ) : this;
15
15
/**
16
16
* Mixins the default fetch options used for every subsequent fetch calls.
17
17
* @param opts Options to mixin with the current default options
18
18
*/
19
- mixdefaults ( opts : Object ) : this;
19
+ mixdefaults ( opts : object ) : this;
20
20
/**
21
21
* Sets the method (text, json ...) used to parse the data contained in the response body in case of an HTTP error.
22
22
*
@@ -39,7 +39,7 @@ export declare class Wretcher {
39
39
* Returns a new Wretcher object with the same url and new options.
40
40
* @param options New options
41
41
*/
42
- options ( options : Object ) : Wretcher ;
42
+ options ( options : object ) : Wretcher ;
43
43
/**
44
44
* Converts a javascript object to query parameters,
45
45
* then appends this query string to the current url.
@@ -51,18 +51,22 @@ export declare class Wretcher {
51
51
*
52
52
* @param qp An object which will be converted.
53
53
*/
54
- query ( qp : Object ) : Wretcher ;
54
+ query ( qp : object ) : Wretcher ;
55
55
/**
56
56
* Shortcut to set the "Accept" header.
57
57
* @param what Header value
58
58
*/
59
59
accept ( what : string ) : Wretcher ;
60
60
/**
61
- * Performs a get request.
62
- */
61
+ * Performs a get request.
62
+ */
63
63
get ( opts ?: { } ) : {
64
64
res : < Result = Response > ( cb ?: ( type : void ) => Result ) => Promise < Result > ;
65
- json : < Result = Object > ( cb ?: ( type : Object ) => Result ) => Promise < Result > ;
65
+ json : < Result = {
66
+ [ key : string ] : any ;
67
+ } > ( cb ?: ( type : {
68
+ [ key : string ] : any ;
69
+ } ) => Result ) => Promise < Result > ;
66
70
blob : < Result = Blob > ( cb ?: ( type : Blob ) => Result ) => Promise < Result > ;
67
71
formData : < Result = FormData > ( cb ?: ( type : FormData ) => Result ) => Promise < Result > ;
68
72
arrayBuffer : < Result = ArrayBuffer > ( cb ?: ( type : ArrayBuffer ) => Result ) => Promise < Result > ;
@@ -106,11 +110,15 @@ export declare class Wretcher {
106
110
} ) => void ) => any ;
107
111
} ;
108
112
/**
109
- * Performs a delete request.
110
- */
113
+ * Performs a delete request.
114
+ */
111
115
delete ( opts ?: { } ) : {
112
116
res : < Result = Response > ( cb ?: ( type : void ) => Result ) => Promise < Result > ;
113
- json : < Result = Object > ( cb ?: ( type : Object ) => Result ) => Promise < Result > ;
117
+ json : < Result = {
118
+ [ key : string ] : any ;
119
+ } > ( cb ?: ( type : {
120
+ [ key : string ] : any ;
121
+ } ) => Result ) => Promise < Result > ;
114
122
blob : < Result = Blob > ( cb ?: ( type : Blob ) => Result ) => Promise < Result > ;
115
123
formData : < Result = FormData > ( cb ?: ( type : FormData ) => Result ) => Promise < Result > ;
116
124
arrayBuffer : < Result = ArrayBuffer > ( cb ?: ( type : ArrayBuffer ) => Result ) => Promise < Result > ;
@@ -154,11 +162,15 @@ export declare class Wretcher {
154
162
} ) => void ) => any ;
155
163
} ;
156
164
/**
157
- * Performs a put request.
158
- */
165
+ * Performs a put request.
166
+ */
159
167
put ( opts ?: { } ) : {
160
168
res : < Result = Response > ( cb ?: ( type : void ) => Result ) => Promise < Result > ;
161
- json : < Result = Object > ( cb ?: ( type : Object ) => Result ) => Promise < Result > ;
169
+ json : < Result = {
170
+ [ key : string ] : any ;
171
+ } > ( cb ?: ( type : {
172
+ [ key : string ] : any ;
173
+ } ) => Result ) => Promise < Result > ;
162
174
blob : < Result = Blob > ( cb ?: ( type : Blob ) => Result ) => Promise < Result > ;
163
175
formData : < Result = FormData > ( cb ?: ( type : FormData ) => Result ) => Promise < Result > ;
164
176
arrayBuffer : < Result = ArrayBuffer > ( cb ?: ( type : ArrayBuffer ) => Result ) => Promise < Result > ;
@@ -202,11 +214,15 @@ export declare class Wretcher {
202
214
} ) => void ) => any ;
203
215
} ;
204
216
/**
205
- * Performs a post request.
206
- */
217
+ * Performs a post request.
218
+ */
207
219
post ( opts ?: { } ) : {
208
220
res : < Result = Response > ( cb ?: ( type : void ) => Result ) => Promise < Result > ;
209
- json : < Result = Object > ( cb ?: ( type : Object ) => Result ) => Promise < Result > ;
221
+ json : < Result = {
222
+ [ key : string ] : any ;
223
+ } > ( cb ?: ( type : {
224
+ [ key : string ] : any ;
225
+ } ) => Result ) => Promise < Result > ;
210
226
blob : < Result = Blob > ( cb ?: ( type : Blob ) => Result ) => Promise < Result > ;
211
227
formData : < Result = FormData > ( cb ?: ( type : FormData ) => Result ) => Promise < Result > ;
212
228
arrayBuffer : < Result = ArrayBuffer > ( cb ?: ( type : ArrayBuffer ) => Result ) => Promise < Result > ;
@@ -250,11 +266,15 @@ export declare class Wretcher {
250
266
} ) => void ) => any ;
251
267
} ;
252
268
/**
253
- * Performs a patch request.
254
- */
269
+ * Performs a patch request.
270
+ */
255
271
patch ( opts ?: { } ) : {
256
272
res : < Result = Response > ( cb ?: ( type : void ) => Result ) => Promise < Result > ;
257
- json : < Result = Object > ( cb ?: ( type : Object ) => Result ) => Promise < Result > ;
273
+ json : < Result = {
274
+ [ key : string ] : any ;
275
+ } > ( cb ?: ( type : {
276
+ [ key : string ] : any ;
277
+ } ) => Result ) => Promise < Result > ;
258
278
blob : < Result = Blob > ( cb ?: ( type : Blob ) => Result ) => Promise < Result > ;
259
279
formData : < Result = FormData > ( cb ?: ( type : FormData ) => Result ) => Promise < Result > ;
260
280
arrayBuffer : < Result = ArrayBuffer > ( cb ?: ( type : ArrayBuffer ) => Result ) => Promise < Result > ;
@@ -301,10 +321,10 @@ export declare class Wretcher {
301
321
* Sets the content type header, stringifies an object and sets the request body.
302
322
* @param jsObject An object
303
323
*/
304
- json ( jsObject : Object ) : Wretcher ;
324
+ json ( jsObject : object ) : Wretcher ;
305
325
/**
306
326
* Converts the javascript object to a FormData and sets the request body.
307
327
* @param formObject An object
308
328
*/
309
- formData ( formObject : Object ) : Wretcher ;
329
+ formData ( formObject : object ) : Wretcher ;
310
330
}
0 commit comments