import type { OTPRateLimitAlgorithm, StoreAdapter } from "../core/otp.types.js"; export interface RedisLikeClient { get(key: string): Promise; set(key: string, value: string, options?: { EX?: number; }): Promise; del(key: string): Promise; incr(key: string): Promise; expire(key: string, seconds: number): Promise; eval?(script: string, options: { keys: string[]; arguments: string[]; }): Promise; } export interface AtomicGenerateParams { otpKey: string; attemptsKey: string; rateLimitKey: string; cooldownKey: string; lockKey: string; hashedOtp: string; ttl: number; rateWindow?: number; rateMax?: number; rateAlgorithm?: OTPRateLimitAlgorithm; rateNonce?: string; resendCooldown?: number; checkLock?: boolean; } export interface AtomicVerifyParams { otpKey: string; attemptsKey: string; lockKey: string; usedKey?: string; candidateHashes: string[]; ttl: number; maxAttempts: number; checkLock?: boolean; lockoutSeconds?: number; lockoutAfter?: number; replayProtectionTtl?: number; } export type AtomicGenerateResult = "ok" | "rate_limit" | "cooldown" | "locked"; export type AtomicVerifyResult = "verified" | "expired" | "invalid" | "max_attempts" | "locked" | "already_used"; export declare class RedisAdapter implements StoreAdapter { private readonly client; constructor(client: RedisLikeClient); get(key: string): Promise; set(key: string, value: string, ttlSeconds: number): Promise; del(key: string): Promise; increment(key: string, ttlSeconds: number): Promise; generateOtpAtomically(params: AtomicGenerateParams): Promise; verifyOtpAtomically(params: AtomicVerifyParams): Promise; }