@daiso-tech/core
Version:
The library offers flexible, framework-agnostic solutions for modern web applications, built on adaptable components that integrate seamlessly with popular frameworks like Next Js.
28 lines (27 loc) • 1.13 kB
TypeScript
/**
* @module Resilience
*/
import { type MiddlewareFn } from "../../../middleware/contracts/_module.js";
import { type RetryCallbacks } from "../../../resilience/implementations/retry/_module.js";
import { type ITimeSpan } from "../../../time-span/contracts/_module.js";
import { type ErrorPolicySettings } from "../../../utilities/_module.js";
/**
* IMPORT_PATH: `"@daiso-tech/core/resilience"`
* @group Middlewares
*/
export type RetryIntervalSettings<TParameters extends Array<unknown> = Array<unknown>> = RetryCallbacks<TParameters> & ErrorPolicySettings & {
time: ITimeSpan;
interval: ITimeSpan;
/**
* If true last error will be thrown otherwise an {@link RetryIntervalResilienceError | `RetryIntervalResilienceError`} will be thrown.
*
* @default false
*/
throwLastError?: boolean;
};
/**
* IMPORT_PATH: `"@daiso-tech/core/resilience"`
* @group Middlewares
* @throws {RetryIntervalResilienceError}
*/
export declare function retryInterval<TParameters extends Array<unknown>, TReturn>(settings: RetryIntervalSettings<TParameters>): MiddlewareFn<TParameters, Promise<TReturn>>;