@@ -47,19 +47,18 @@ interface RequiredOptions<P extends Payload> extends RequestInit {
47
47
*/
48
48
json ?: P [ 'json' ]
49
49
/**
50
- * Search params to append to the request URL.
51
- * Provide an `object`, `string`, or `URLSearchParams` instance.
50
+ * Search params to append to a request URL.
52
51
*/
53
52
params ?: P [ 'params' ]
54
53
/**
55
- * Custom search params serializer when `object` is used .
54
+ * Custom search params serializer when `object` passed to `params` .
56
55
* Defaults to internal implementation based on `URLSearchParams`
57
56
* with better handling of array values.
58
57
*/
59
58
serialize ?: Serialize
60
59
/**
61
- * If specified `TimeoutError` will be thrown and
62
- * the request will be cancelled after the specified duration.
60
+ * If specified `TimeoutError` will be thrown and the request will be
61
+ * cancelled after a specified duration.
63
62
*/
64
63
timeout ?: number
65
64
/**
@@ -68,8 +67,7 @@ interface RequiredOptions<P extends Payload> extends RequestInit {
68
67
*/
69
68
highWaterMark ?: number
70
69
/**
71
- * Request handler.
72
- * Use the callback to modify options before the request
70
+ * Use the callback to modify options before a request
73
71
*/
74
72
onRequest ( url : URL , options : RequestOptions < P > ) : Promise < void > | void
75
73
/**
@@ -78,13 +76,11 @@ interface RequiredOptions<P extends Payload> extends RequestInit {
78
76
onResponse ( response : Response < P > ) : Promise < Response < P > > | Response < P >
79
77
/**
80
78
* Success response handler (usually codes 200-299).
81
- * @see onResponse
82
79
*/
83
80
onSuccess ?( response : Response < P > ) : Promise < Response < P > > | Response < P >
84
81
/**
85
- * Error handler.
86
- * Throw custom error, or return a new `Promise` with `Response` using `request`.
87
- * @see onResponse
82
+ * Instance error handler. Use it to throw custom errors
83
+ * or to send information to error tracking service.
88
84
*/
89
85
onFailure ?(
90
86
error : ResponseError < P > | TimeoutError | Error
0 commit comments