import type { RestFetch, RestFetchMiddlewareContext } from '@vunk/shared/fetch'; import type { AnyFunc } from '@vunk/shared/types'; import type { MaybePromise } from '@vunk/shared'; export declare function RetryRestFetchPlugin(restFetch: RestFetch, pluginOptions?: RetryRestFetchPluginOptions): void; export interface RetryRestFetchPluginOptions { retryTimes?: number; retryDelay?: number; retryState?: AnyFunc; /** * @description 自定义重试条件 */ retryWhen?: (ctx: RestFetchMiddlewareContext) => MaybePromise; } export interface RetryRestFetchContext extends RetryRestFetchPluginOptions { retryEnable?: boolean; }