import type { Metrics } from '@libp2p/interface';
import type { ClearableSignal } from 'any-signal';
export declare const DEFAULT_TIMEOUT_MULTIPLIER = 1.2;
export declare const DEFAULT_FAILURE_MULTIPLIER = 2;
export declare const DEFAULT_MIN_TIMEOUT = 5000;
export declare const DEFAULT_MAX_TIMEOUT = 60000;
export declare const DEFAULT_INTERVAL = 5000;
export interface AdaptiveTimeoutSignal extends ClearableSignal {
    start: number;
    timeout: number;
}
export interface AdaptiveTimeoutInit {
    metricName?: string;
    metrics?: Metrics;
    interval?: number;
    timeoutMultiplier?: number;
    failureMultiplier?: number;
    minTimeout?: number;
    maxTimeout?: number;
}
export interface GetTimeoutSignalOptions {
    timeoutFactor?: number;
    signal?: AbortSignal;
}
export declare class AdaptiveTimeout {
    private readonly success;
    private readonly failure;
    private readonly next;
    private readonly metric?;
    private readonly timeoutMultiplier;
    private readonly failureMultiplier;
    private readonly minTimeout;
    private readonly maxTimeout;
    constructor(init?: AdaptiveTimeoutInit);
    getTimeoutSignal(options?: GetTimeoutSignalOptions): AdaptiveTimeoutSignal;
    cleanUp(signal: AdaptiveTimeoutSignal): void;
}
//# sourceMappingURL=adaptive-timeout.d.ts.map