@@ -222,14 +222,16 @@ interface WaitUntilOptions {
222
222
/** A backoff multiplier for how long the next interval will be (default: None, i.e 1) */
223
223
readonly backoff ?: number
224
224
/**
225
- * Call back, true when the function should be retried on failure.
225
+ * Callback, returns `true` when the function should be retried on failure.
226
+ *
226
227
* Example usage:
227
- * - () => boolean if the retry logic is "constant"
228
- * - (error) => { error ? retryOnError(error) : boolean }
229
- * where retryOnError determines what errors to retry, and the boolean is for base case when there's no error (undefined)
230
- * 'truthy' arg is ignored
231
- * If the timeout is reached it throws the last error
232
- * Default to false
228
+ * - `() => boolean` if the retry logic is "constant".
229
+ * - `(error) => { error ? retryOnError(error) : boolean }`
230
+ * where `retryOnError` determines what errors to retry, and the boolean is for the base case when there's no error (undefined).
231
+ *
232
+ * The `truthy` argument is ignored.
233
+ * If the timeout is reached, it throws the last error.
234
+ * Defaults to `false`.
233
235
*/
234
236
readonly retryOnFail ?: ( error : Error | undefined ) => boolean
235
237
}
@@ -248,7 +250,7 @@ export const waitUntilDefaultInterval = 500
248
250
*/
249
251
export async function waitUntil < T > (
250
252
fn : ( ) => Promise < T > ,
251
- options : WaitUntilOptions & { retryOnFail : ( error : Error | undefined ) => boolean }
253
+ options : WaitUntilOptions & { retryOnFail : ( error ? : Error ) => boolean }
252
254
) : Promise < T >
253
255
254
256
export async function waitUntil < T > (
0 commit comments