import { OnModuleDestroy } from "@nestjs/common"; import { ConfigService } from "@nestjs/config"; import { Redis } from "ioredis"; import { BaseConfigInterface } from "../../../config/interfaces"; interface ClientInfo { userId: string; companyId: string; socketId: string; connectedAt: Date; } export declare class RedisClientStorageService implements OnModuleDestroy { private readonly configService; private redis; private readonly CLIENT_KEY_PREFIX; private readonly USER_CLIENTS_KEY_PREFIX; private readonly COMPANY_USERS_KEY_PREFIX; constructor(configService: ConfigService); getRedisClient(): Redis; isConnected(): boolean; /** * Acquire a distributed lock using Redis SET NX PX. * @param key The lock key * @param ttlMs Time-to-live in milliseconds (auto-release) * @returns Lock value if acquired, null if already locked */ acquireLock(key: string, ttlMs: number): Promise; /** * Release a distributed lock. Only releases if the lock value matches * (prevents releasing another holder's lock). Atomic via Lua. * @param key The lock key * @param lockValue The value returned by acquireLock */ releaseLock(key: string, lockValue: string): Promise; addClient(userId: string, companyId: string, socketId: string): Promise; removeClient(socketId: string): Promise; getClientInfo(socketId: string): Promise; getUserClients(userId: string): Promise; getCompanyUsers(companyId: string): Promise; getUserCompany(userId: string): Promise; getAllConnectedUsers(): Promise; cleanupExpiredClients(): Promise; onModuleDestroy(): Promise; } export {}; //# sourceMappingURL=redis.client.storage.service.d.ts.map