/** * CacheManager - Cache Management * * Manages caching for messages, contacts, rooms, and room members. * Uses FlashStore for persistent disk storage and LRU Cache for messages (due to potentially large volume). */ import type { Contact as ContactPayload, Room as RoomPayload, RoomMember as RoomMemberPayload } from '@juzi/wechaty-puppet/payloads'; export type RoomMemberMap = { [contactId: string]: RoomMemberPayload; }; export declare class CacheManager { private readonly _userName; private _baseDir?; private _messageCache?; private _contactCache?; private _contactListCache?; private _roomCache?; private _roomListCache?; private _roomMemberCache?; private _roomMemberListCache?; constructor(userName?: string); init(): Promise; close(): Promise; /** * Message Section */ getMessage(messageId: string): Record | undefined; setMessage(messageId: string, payload: Record): void; hasMessage(messageId: string): boolean; /** * Contact Section */ getContact(contactId: string): Promise; setContact(contactId: string, payload: ContactPayload): Promise; hasContact(contactId: string): Promise; getContactList(): Promise; setContactList(contactIds: string[]): Promise; clearContactListCache(): Promise; /** * Room Section */ getRoom(roomId: string): Promise; setRoom(roomId: string, payload: RoomPayload): Promise; hasRoom(roomId: string): Promise; getRoomList(): Promise; setRoomList(roomIds: string[]): Promise; clearRoomListCache(): Promise; /** Idempotent: add roomId to the room list if not already present. */ addRoomToList(roomId: string): Promise; /** * Room Member Section */ getRoomMember(roomId: string, contactId: string): Promise; getRoomMemberMap(roomId: string): Promise; setRoomMember(roomId: string, contactId: string, payload: RoomMemberPayload): Promise; setRoomMemberMap(roomId: string, memberMap: RoomMemberMap): Promise; deleteRoomMember(roomId: string, contactId: string): Promise; getRoomMemberList(roomId: string): Promise; setRoomMemberList(roomId: string, memberIds: string[]): Promise; clearRoomMemberListCache(roomId: string): Promise; getContactIds(): Promise; getRoomIds(): Promise; deleteRoomMemberMap(roomId: string): Promise; clear(): Promise; } //# sourceMappingURL=cache-manager.d.ts.map