export interface OTPOptions { length?: number; expiresInMinutes?: number; purpose?: string; } export interface OTPRecord { code: string; identifier: string; type: "email" | "phone"; expiresAt: string; attempts: number; maxAttempts: number; createdAt: string; } export declare class OTPManager { /** * Generate 6-digit OTP code */ static generateOTP(options?: OTPOptions): string; /** * Get Redis key for OTP storage */ private static getOTPKey; /** * Get Redis key for rate limiting */ private static getRateLimitKey; /** * Check rate limit for OTP requests */ static checkRateLimit(identifier: string, type: "email" | "phone"): Promise<{ allowed: boolean; remainingRequests: number; resetAt: Date; message?: string; }>; /** * Increment rate limit counter */ private static incrementRateLimit; /** * Store OTP for email or phone verification */ static storeOTP(identifier: string, type: "email" | "phone", options?: OTPOptions): Promise<{ success: boolean; code?: string; expiresAt?: Date; error?: string; remainingRequests?: number; }>; /** * Verify OTP code */ static verifyOTP(identifier: string, type: "email" | "phone", code: string): Promise<{ success: boolean; message: string; attemptsLeft?: number; }>; /** * Check if OTP exists and is valid */ static hasValidOTP(identifier: string, type: "email" | "phone"): Promise; /** * Get OTP info (for debugging/testing) */ static getOTPInfo(identifier: string, type: "email" | "phone"): Promise<{ exists: boolean; expiresAt?: Date; attempts?: number; attemptsLeft?: number; }>; /** * Delete OTP (for manual cleanup or testing) */ static deleteOTP(identifier: string, type: "email" | "phone"): Promise; /** * Get rate limit info */ static getRateLimitInfo(identifier: string, type: "email" | "phone"): Promise<{ requestsUsed: number; remainingRequests: number; resetAt: Date; }>; /** * Check Redis connection status */ static isConnected(): boolean; } export default OTPManager; //# sourceMappingURL=otp.d.ts.map