Optionaloptions: { attempts?: number; backoff?: number | ((attempt: number) => number) }Optionalattempts?: numberTotal number of attempts (≥ 1). Default 3.
Optionalbackoff?: number | ((attempt: number) => number)Delay between attempts in ms, or a function of attempt number (1-indexed).
Retries an async function up to
attemptstimes.backoffcontrols the delay between attempts in milliseconds — either a fixed number or a function(attemptNumber) => delayMs(1-indexed). Defaults to no delay.The error from the last failed attempt is rethrown.