import { RpcCallMiddleware, RpcCallMiddlewareContext } from '../network-manager.js'; export interface FloodWaiterOptions { /** * Maximum number of ms to wait when a FLOOD_WAIT_X * error is encountered. If the wait time is greater * than this value, the request will throw an error instead * * This can be overwritten on a per-request basis by setting * `floodSleepThreshold` in the request parameters * * @default 10_000 */ maxWait?: number; /** * Maximum number of retries to perform when a FLOOD_WAIT_X * error is encountered. After this number of retries, the * last error will be thrown * * @default 5 */ maxRetries?: number; /** * Whether to store the last flood wait time and delay * the consecutive requests accordingly * * @default true */ store?: boolean; /** * If the stored wait time is less than this value, * the request will not be delayed * * @default 2_000 */ minStoredWait?: number; /** * Function that will be called before we are about to wait for `seconds` * seconds before retrying the request. * * @default print a warning to the console, except some methods that often result in flood waits */ onBeforeWait?: (ctx: RpcCallMiddlewareContext, seconds: number) => void; } export declare function floodWaiter(options: FloodWaiterOptions): RpcCallMiddleware;