import { FileCache, MacproContactPayload, MacproRoomPayload, GrpcRoomMemberPayload, MacproRoomInvitationPayload } from './schemas'; import { FriendshipPayload } from 'unique-wechaty-puppet'; export declare class CacheManager { /** * ************************************************************************ * Static Methods * ************************************************************************ */ private static _instance?; static readonly Instance: CacheManager; static init(userId: string): Promise; static release(): Promise; /** * ************************************************************************ * Instance Methods * ************************************************************************ */ private cacheWXID?; private cacheContactRawPayload?; private cacheRoomMemberRawPayload?; private cacheRoomRawPayload?; private cacheRoomInvitationRawPayload?; private cacheFriendshipRawPayload?; private cacheFile?; /** * ------------------------------- * Account-WXID Section * -------------------------------- */ getAccountWXID(account: string): Promise; setAccountWXID(account: string, wxid: string): Promise; /** * ------------------------------- * Contact Section * -------------------------------- */ getContact(contactId: string): Promise; setContact(contactId: string, payload: MacproContactPayload): Promise; deleteContact(contactId: string): Promise; getContactIds(): Promise; getAllContacts(): Promise; hasContact(contactId: string): Promise; getContactCount(): Promise; /** * ------------------------------- * Room Section * -------------------------------- */ getRoom(roomId: string): Promise; setRoom(roomId: string, payload: MacproRoomPayload): Promise; deleteRoom(roomId: string): Promise; getRoomIds(): Promise; getRoomCount(): Promise; hasRoom(roomId: string): Promise; /** * ------------------------------- * Room Member Section * -------------------------------- */ getRoomMember(roomId: string): Promise<{ [contactId: string]: GrpcRoomMemberPayload; } | undefined>; setRoomMember(roomId: string, payload: { [contactId: string]: GrpcRoomMemberPayload; }): Promise; deleteRoomMember(roomId: string): Promise; /** * ------------------------------- * Room Invitation Section * -------------------------------- */ getRoomInvitation(messageId: string): Promise; setRoomInvitation(messageId: string, payload: MacproRoomInvitationPayload): Promise; deleteRoomInvitation(messageId: string): Promise; /** * ------------------------------- * CDN File Cache Section * -------------------------------- */ getFileCache(fileId: string): Promise; setFileCache(fileId: string, cache: FileCache): Promise; /** * ------------------------------- * Friendship Cache Section * -------------------------------- */ getFriendshipRawPayload(id: string): Promise; setFriendshipRawPayload(id: string, payload: FriendshipPayload): Promise; /** * ------------------------------- * Private Method Section * -------------------------------- */ private parseJSON; private initCache; private releaseCache; } //# sourceMappingURL=cache-manager.d.ts.map