import type { NonceStore } from './nonce-store.js';
/**
 * Minimal Redis client interface.
 *
 * Users implement this with their Redis library of choice (ioredis, node-redis, etc.).
 * This keeps @private.me/xbind free of concrete Redis dependencies.
 */
export interface RedisClient {
    /**
     * SET key value EX seconds NX -- atomic set-if-not-exists with TTL.
     * @param key - The key to set.
     * @param value - The value to store.
     * @param ttlSeconds - Time-to-live in seconds.
     * @returns 'OK' if the key was set (new), null if the key already exists (duplicate).
     */
    setNX(key: string, value: string, ttlSeconds: number): Promise<string | null>;
    /**
     * DEL key -- delete a key from Redis.
     * @param key - The key to delete.
     * @returns The number of keys removed.
     */
    del(key: string): Promise<number>;
    /**
     * QUIT -- disconnect from Redis gracefully.
     */
    quit(): Promise<void>;
}
/**
 * Configuration options for RedisNonceStore.
 */
export interface RedisNonceStoreOptions {
    /** The Redis client instance to use for nonce storage. */
    readonly client: RedisClient;
    /** TTL in seconds for nonce entries. Default: 600 (10 minutes). */
    readonly ttlSeconds?: number;
    /** Key prefix for all nonce entries in Redis. Default: 'nonce:'. */
    readonly keyPrefix?: string;
}
/**
 * Redis-backed nonce store for multi-node deployments.
 *
 * Uses Redis SET NX with TTL for atomic, distributed nonce deduplication.
 * Nonce expiry is handled by Redis TTL -- no manual cleanup needed.
 * Zero npm dependencies: users provide their own RedisClient implementation.
 *
 * @example
 * ```typescript
 * import { RedisNonceStore } from '@private.me/xbind';
 * import Redis from 'ioredis';
 *
 * const redis = new Redis();
 * const store = new RedisNonceStore({
 *   client: {
 *     setNX: (key, value, ttl) =>
 *       redis.set(key, value, 'EX', ttl, 'NX'),
 *     del: (key) => redis.del(key),
 *     quit: () => redis.quit(),
 *   },
 * });
 * ```
 */
export declare class RedisNonceStore implements NonceStore {
    private readonly client;
    private readonly ttlSeconds;
    private readonly keyPrefix;
    constructor(opts: RedisNonceStoreOptions);
    /**
     * Check if a nonce is fresh and record it atomically via Redis SET NX.
     *
     * Uses Redis SET with NX (set-if-not-exists) and EX (TTL in seconds)
     * for atomic, distributed deduplication. If the key already exists in
     * any Redis-connected node, the nonce is rejected as a duplicate.
     *
     * @param nonce - The nonce string to check.
     * @param senderDid - The DID of the sender.
     * @returns true if the nonce is new (accepted), false if duplicate (rejected).
     */
    check(nonce: string, senderDid: string): Promise<boolean>;
    /**
     * No-op for Redis store -- TTL-based expiry is handled automatically.
     *
     * This method exists to satisfy the NonceStore interface. Redis keys
     * expire based on the TTL set during setNX, so no manual cleanup is needed.
     */
    cleanup(): void;
    /**
     * Disconnect from Redis gracefully.
     *
     * Calls the underlying RedisClient quit() method to close the connection.
     * After calling dispose(), the store should not be used.
     */
    dispose(): void;
}
