40 lines
1.5 KiB
TypeScript
40 lines
1.5 KiB
TypeScript
export interface ActiveChatData {
|
|
chatId: string;
|
|
participants: string[];
|
|
lastActivity: Date;
|
|
messageCount: number;
|
|
chatType: 'direct' | 'group' | 'game';
|
|
gameId?: string;
|
|
name?: string;
|
|
}
|
|
export interface ActiveUserData {
|
|
userId: string;
|
|
activeChatIds: string[];
|
|
lastActivity: Date;
|
|
isOnline: boolean;
|
|
}
|
|
export declare class RedisService {
|
|
private static instance;
|
|
private client;
|
|
private isConnected;
|
|
private constructor();
|
|
static getInstance(): RedisService;
|
|
connect(): Promise<void>;
|
|
disconnect(): Promise<void>;
|
|
setActiveChat(chatId: string, chatData: ActiveChatData): Promise<void>;
|
|
getActiveChat(chatId: string): Promise<ActiveChatData | null>;
|
|
removeActiveChat(chatId: string): Promise<void>;
|
|
getAllActiveChats(): Promise<ActiveChatData[]>;
|
|
setActiveUser(userId: string, userData: ActiveUserData): Promise<void>;
|
|
getActiveUser(userId: string): Promise<ActiveUserData | null>;
|
|
removeActiveUser(userId: string): Promise<void>;
|
|
addUserToChat(userId: string, chatId: string): Promise<void>;
|
|
removeUserFromChat(userId: string, chatId: string): Promise<void>;
|
|
getUserActiveChats(userId: string): Promise<string[]>;
|
|
updateChatActivity(chatId: string, messageCount?: number): Promise<void>;
|
|
getInactiveChats(inactivityMinutes: number): Promise<string[]>;
|
|
cleanupInactiveChats(inactivityMinutes: number): Promise<string[]>;
|
|
ping(): Promise<boolean>;
|
|
isRedisConnected(): boolean;
|
|
}
|
|
//# sourceMappingURL=RedisService.d.ts.map
|