import { AppLoggingService } from "../../logging/services/logging.service"; import { RedisClientStorageService } from "../../redis/services/redis.client.storage.service"; export interface PresenceStatus { status: "online" | "away" | "offline"; lastActivity: Date; socketIds: string[]; userName: string; } /** * Presence Service * * Tracks user online/offline/away status using Redis * * Features: * - Real-time presence tracking * - Multi-device support (tracks multiple socket connections) * - Automatic status calculation (online/away/offline) * - TTL-based expiration * - Batch status queries */ export declare class PresenceService { private readonly logger; private readonly redisClientStorage?; private readonly PRESENCE_KEY_PREFIX; private readonly PRESENCE_TTL; private readonly ONLINE_THRESHOLD; private readonly AWAY_THRESHOLD; constructor(logger: AppLoggingService, redisClientStorage?: RedisClientStorageService); /** * Set user as online when they connect */ setUserOnline(userId: string, userName: string, socketId: string): Promise; /** * Set user as offline when they disconnect * Only sets to offline if no other sockets are connected */ setUserOffline(userId: string, socketId: string): Promise; /** * Update user activity timestamp (called on heartbeat) */ updateActivity(userId: string): Promise; /** * Get user's current status */ getUserStatus(userId: string): Promise; /** * Get statuses for multiple users */ getUsersStatuses(userIds: string[]): Promise>; /** * Mark idle users as "away" * Called by cron job every 5 minutes * Returns array of user IDs whose status changed */ markIdleUsersAsAway(): Promise; /** * Helper to construct Redis key */ private getPresenceKey; } //# sourceMappingURL=presence.service.d.ts.map