import Redis from 'ioredis';
import { IProxyCache, RedisProxyCacheConfig, RedisClusterProxyCacheConfig, AlsRequestDetails, IsLastFailure, ProcessExpiryKeyCallback, ProcessNodeStreamSingleKeyCallback, RedisConnectionStatus } from '../../types/lib.js';
import '../../constants.js';
import '../../types/utils.js';

type RedisConfig = RedisProxyCacheConfig | RedisClusterProxyCacheConfig;
declare class RedisProxyCache implements IProxyCache {
    private readonly proxyConfig;
    private readonly redisClient;
    private readonly log;
    private readonly defaultTtlSec;
    private readonly isCluster;
    constructor(proxyConfig: RedisConfig, isCluster?: boolean);
    protected get redisNodes(): Redis[];
    addDfspIdToProxyMapping(dfspId: string, proxyId: string): Promise<boolean>;
    lookupProxyByDfspId(dfspId: string): Promise<string | null>;
    removeDfspIdFromProxyMapping(dfspId: string): Promise<boolean>;
    removeProxyGetPartiesTimeout(alsReq: AlsRequestDetails, proxyId: string): Promise<boolean>;
    setProxyGetPartiesTimeout(alsReq: AlsRequestDetails, proxyId: string, ttlSec?: number): Promise<boolean>;
    setSendToProxiesList(alsReq: AlsRequestDetails, proxyIds: string[], ttlSec: number): Promise<boolean>;
    receivedSuccessResponse(alsReq: AlsRequestDetails, proxyId: string): Promise<boolean>;
    receivedErrorResponse(alsReq: AlsRequestDetails, proxyId: string): Promise<IsLastFailure>;
    isPendingCallback(alsReq: AlsRequestDetails, proxyId?: string): Promise<boolean>;
    processExpiredAlsKeys(callbackFn: ProcessExpiryKeyCallback, batchSize: number): Promise<unknown>;
    processExpiredProxyGetPartiesKeys(customFn: ProcessNodeStreamSingleKeyCallback, batchSize: number): Promise<unknown>;
    connect(): Promise<RedisConnectionStatus>;
    disconnect(): Promise<boolean>;
    healthCheck(): Promise<boolean>;
    get isConnected(): boolean;
    private createRedisClient;
    private addEventListeners;
    private executePipeline;
    /** @deprecated Use processAllNodesStream */
    private processNode;
    private processAllNodesStream;
    private processSingleNodeStream;
    private processExpiryKey;
    private storeSuccessAlsResponse;
    private isLastCallback;
    private calculateExpiryTimestampInMs;
    static formatAlsCacheKey(alsReq: AlsRequestDetails): string;
    static formatAlsCacheExpiryKey(alsReq: AlsRequestDetails): string;
    static formatAlsCacheSuccessKey(alsReq: AlsRequestDetails): string;
    static formatProxyGetPartiesExpiryKey(alsReq: AlsRequestDetails, proxyId: string): string;
    static formatDfspCacheKey(dfspId: string): string;
    static extractAlsRequestDetails(key: string): AlsRequestDetails;
}

export { RedisProxyCache };
