import type KeyedDB from "@adiwajshing/keyed-db"; import type { Comparable } from "@adiwajshing/keyed-db/lib/Types"; import type { Logger } from "pino"; import { proto } from "../../WAProto"; import type makeMDSocket from "../Socket"; import type { BaileysEventEmitter, Chat, ConnectionState, Contact, GroupMetadata, PresenceData, WAMessage, WAMessageCursor, WAMessageKey } from "../Types"; declare type WASocket = ReturnType; export declare const waChatKey: (pin: boolean) => { key: (c: Chat) => string; compare: (k1: string, k2: string) => number; }; export declare const waMessageID: (m: WAMessage) => string; export declare type BaileysInMemoryStoreConfig = { chatKey?: Comparable; logger?: Logger; }; declare const _default: ({ logger: _logger, chatKey }: BaileysInMemoryStoreConfig) => { chats: KeyedDB; contacts: { [_: string]: Contact; }; messages: { [_: string]: { array: WAMessage[]; get: (id: string) => WAMessage | undefined; upsert: (item: WAMessage, mode: "append" | "prepend") => void; update: (item: WAMessage) => boolean; remove: (item: WAMessage) => boolean; updateAssign: (id: string, update: Partial) => boolean; clear: () => void; filter: (contain: (item: WAMessage) => boolean) => void; toJSON: () => WAMessage[]; fromJSON: (newItems: WAMessage[]) => void; }; }; groupMetadata: { [_: string]: GroupMetadata; }; state: ConnectionState; presences: { [id: string]: { [participant: string]: PresenceData; }; }; bind: (ev: BaileysEventEmitter) => void; /** loads messages from the store, if not found -- uses the legacy connection */ loadMessages: (jid: string, count: number, cursor: WAMessageCursor) => Promise; loadMessage: (jid: string, id: string) => Promise; mostRecentMessage: (jid: string) => Promise; fetchImageUrl: (jid: string, sock: WASocket | undefined) => Promise; fetchGroupMetadata: (jid: string, sock: WASocket | undefined) => Promise; fetchMessageReceipts: ({ remoteJid, id }: WAMessageKey) => Promise; toJSON: () => { chats: KeyedDB; contacts: { [_: string]: Contact; }; messages: { [_: string]: { array: WAMessage[]; get: (id: string) => WAMessage | undefined; upsert: (item: WAMessage, mode: "append" | "prepend") => void; update: (item: WAMessage) => boolean; remove: (item: WAMessage) => boolean; updateAssign: (id: string, update: Partial) => boolean; clear: () => void; filter: (contain: (item: WAMessage) => boolean) => void; toJSON: () => WAMessage[]; fromJSON: (newItems: WAMessage[]) => void; }; }; }; fromJSON: (json: { chats: Chat[]; contacts: { [id: string]: Contact; }; messages: { [id: string]: WAMessage[]; }; }) => void; writeToFile: (path: string) => void; readFromFile: (path: string) => void; }; export default _default;