/// import type { WhatsAppContactPayload, InviteV4Data, WhatsAppMessagePayload } from '../schema/whatsapp-type.js'; import { Friendship } from '@juzi/wechaty-puppet/payloads'; export declare class CacheManager { /** * ************************************************************************ * Static Methods * ************************************************************************ */ private static _instance?; static get Instance(): CacheManager; static init(userId: string): Promise; static release(): Promise; /** * ************************************************************************ * Instance Methods * ************************************************************************ */ private cacheMessageRawPayload?; private cacheContactOrRoomRawPayload?; private cacheRoomMemberIdList?; private cacheRoomInvitationRawPayload?; private cacheLatestMessageTimestampForChat?; private cacheFriendshipRawPayload?; /** * ------------------------------- * Message Cache Section * -------------------------------- */ getMessageRawPayload(id: string): Promise<{ mentionedIds: string[]; location?: import("@juzi/whatsapp-web.js").Location | undefined; orderId?: string | undefined; id: import("../schema/whatsapp-type.js").MessageId; _data?: any; description?: string | undefined; type: import("@juzi/whatsapp-web.js").MessageTypes; ack: import("@juzi/whatsapp-web.js").MessageAck; author?: string | undefined; deviceType: string; body: string; broadcast: boolean; isStatus: boolean; isGif: boolean; isEphemeral: boolean; from: string; fromMe: boolean; hasMedia: boolean; hasQuotedMsg: boolean; isForwarded: boolean; forwardingScore: number; isStarred: boolean; vCards: string[]; inviteV4?: InviteV4Data | undefined; mediaKey?: string | undefined; groupMentions: { groupSubject: string; groupJid: string; }[]; timestamp: number; to: string; links: { link: string; isSuspicious: boolean; }[]; title?: string | undefined; businessOwnerJid?: string | undefined; productId?: string | undefined; latestEditSenderTimestampMs?: number | undefined; latestEditMsgKey?: import("@juzi/whatsapp-web.js").MessageId | undefined; protocolMessageKey?: import("@juzi/whatsapp-web.js").MessageId | undefined; dynamicReplyButtons?: object | undefined; selectedButtonId?: string | undefined; selectedRowId?: string | undefined; pollName: string; pollOptions: string[]; allowMultipleAnswers: boolean; eventEndTime?: number | undefined; eventDescription?: string | undefined; eventLocation?: { degreesLatitude: number; degreesLongitude: number; name: string; } | undefined; eventJoinLink?: string | undefined; messageSecret?: number[] | undefined; urlLink?: import("@juzi/whatsapp-web.js").UrlLink | undefined; productMessage?: import("@juzi/whatsapp-web.js").ProductMessage | undefined; eventStartTime?: number | undefined; isEventCaneled?: boolean | undefined; getPollVotes?: (() => Promise) | undefined; editScheduledEvent?: ((editedEventObject: Event) => Promise) | undefined; vote?: ((selectedOptions: string[]) => Promise) | undefined; } | undefined>; setMessageRawPayload(id: string, payload: WhatsAppMessagePayload): Promise; deleteMessage(id: string): Promise; private getMessageCache; /** * ------------------------------- * Contact And Room Cache Section * -------------------------------- */ getContactOrRoomRawPayload(id: string): Promise; setContactOrRoomRawPayload(id: string, payload: WhatsAppContactPayload): Promise; deleteContactOrRoom(id: string): Promise; private getContactOrRoomCache; getContactIdList(): Promise; getRoomIdList(): Promise; /** * ------------------------------- * Room Member Cache Section * -------------------------------- */ getRoomMemberIdList(roomId: string): Promise; setRoomMemberIdList(roomId: string, list: string[]): Promise; addRoomMemberToList(roomId: string, memberIds: string | string[]): Promise; removeRoomMemberFromList(roomId: string, memberIds: string | string[]): Promise; deleteRoomMemberIdList(roomId: string): Promise; private getRoomMemberCache; /** * ------------------------------- * Room Invitation Cache Section * -------------------------------- */ getRoomInvitationRawPayload(id: string): Promise | undefined>; setRoomInvitationRawPayload(id: string, payload: Partial): Promise; deleteRoomInvitation(id: string): Promise; private getRoomInvitationCache; /** * ------------------------------- * Message Cache Section * -------------------------------- */ /** * get timestamp of the latest message for contact or room, if timestamp is not in cache, return Number.MAX_SAFE_INTEGER * @param {string} id message id * @returns {number} timestamp or Number.MAX_SAFE_INTEGER */ getLatestMessageTimestampForChat(id: string): Promise; setLatestMessageTimestampForChat(id: string, num: number): Promise; private getLatestMessageTimestampForChatCache; /** * ------------------------------- * Friendship Cache Section * -------------------------------- */ getFriendshipRawPayload(id: string): Promise; setFriendshipRawPayload(id: string, payload: Friendship): Promise; deleteFriendship(id: string): Promise; private getFriendshipCache; /** * ------------------------------- * Private Method Section * -------------------------------- */ private initCache; private releaseCache; } //# sourceMappingURL=cache-manager.d.ts.map