import type FluidDB from '../DB/FluidDB'; import type { Comparable } from '../DB/Types'; import type { Logger } from 'pino'; import { proto } from '../Proto'; import type makeLegacySocket from '../FireSKT'; import type makeMDSocket from '../Connection'; import type { SuperChatsEventEmitter, Chat, ConnectionState, GroupMetadata, PresenceData, WAMessage, WAMessageCursor, WAMessageKey } from '../Models'; declare type LegacyWASocket = ReturnType; declare type AnyWASocket = 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, chatKey }: BaileysInMemoryStoreConfig) => { chats: FluidDB; messages: { [_: string]: { array: proto.IWebMessageInfo[]; get: (id: string) => proto.IWebMessageInfo; upsert: (item: proto.IWebMessageInfo, mode: "append" | "prepend") => void; update: (item: proto.IWebMessageInfo) => boolean; remove: (item: proto.IWebMessageInfo) => boolean; updateAssign: (id: string, update: Partial) => boolean; clear: () => void; filter: (contain: (item: proto.IWebMessageInfo) => boolean) => void; toJSON: () => proto.IWebMessageInfo[]; fromJSON: (newItems: proto.IWebMessageInfo[]) => void; }; }; groupMetadata: { [_: string]: GroupMetadata; }; state: ConnectionState; presences: { [id: string]: { [participant: string]: PresenceData; }; }; bind: (ev: SuperChatsEventEmitter) => void; /** loads messages from the store, if not found -- uses the legacy connection */ loadMessages: (jid: string, count: number, cursor?: WAMessageCursor, sock?: LegacyWASocket | undefined) => Promise; loadAllMessages(jid: string, chunkSize?: number, mostRecentFirst?: boolean): Promise; loadMessage: (jid: string, id: string, sock?: LegacyWASocket | undefined) => Promise; mostRecentMessage: (jid: string, sock?: LegacyWASocket | undefined) => Promise; fetchGroupMetadata: (jid: string, sock?: AnyWASocket | undefined) => Promise; fetchBroadcastListInfo: (jid: string, sock?: LegacyWASocket | undefined) => Promise; fetchMessageReceipts: ({ remoteJid, id }: WAMessageKey, sock?: LegacyWASocket | undefined) => Promise; toJSON: () => { chats: FluidDB; messages: { [_: string]: { array: proto.IWebMessageInfo[]; get: (id: string) => proto.IWebMessageInfo; upsert: (item: proto.IWebMessageInfo, mode: "append" | "prepend") => void; update: (item: proto.IWebMessageInfo) => boolean; remove: (item: proto.IWebMessageInfo) => boolean; updateAssign: (id: string, update: Partial) => boolean; clear: () => void; filter: (contain: (item: proto.IWebMessageInfo) => boolean) => void; toJSON: () => proto.IWebMessageInfo[]; fromJSON: (newItems: proto.IWebMessageInfo[]) => void; }; }; }; fromJSON: (json: { chats: Chat[]; messages: { [id: string]: proto.IWebMessageInfo[]; }; }) => void; writeToFile: (path: string) => void; readFromFile: (path: string) => void; }; export default _default;