@japofc/baileys - v2.4.7
    Preparing search index...

    Function makePersistentStore

    • Persisted counterpart to makeInMemoryStore(). Same return shape (chats, contacts, messages, groupMetadata, labels, bind, loadMessages, ...) plus adapter and an async close(). Hydrates from adapter on creation, then write-throughs every mutating event alongside the normal in-memory update.

      Parameters

      Returns Promise<
          {
              bind: (ev: any) => void;
              chats: any;
              contacts: {};
              fetchGroupMetadata: (jid: any, sock: any) => Promise<any>;
              fetchImageUrl: (jid: any, sock: any) => Promise<any>;
              fetchMessageReceipts: (
                  __namedParameters: { id: any; remoteJid: any },
              ) => Promise<any>;
              fromJSON: (json: any) => void;
              getChatLabels: (chatId: any) => any;
              getLabels: () => ObjectRepository;
              getMessageLabels: (messageId: any) => any;
              groupMetadata: {};
              labelAssociations: any;
              labels: ObjectRepository;
              loadMessage: (jid: any, id: any) => Promise<any>;
              loadMessages: (jid: any, count: any, cursor: any) => Promise<any>;
              messages: {};
              mostRecentMessage: (jid: any) => Promise<any>;
              presences: {};
              readFromFile: (path: any) => void;
              state: { connection: string };
              toJSON: () => {
                  chats: any;
                  contacts: {};
                  labelAssociations: any;
                  labels: ObjectRepository;
                  messages: {};
              };
              writeToFile: (path: any) => void;
          } & {
              adapter: StoreAdapter;
              close(): Promise<void>;
              flush(): Promise<void>;
              loadMessage(jid: string, id: string): Promise<any>;
              loadMessages(
                  jid: string,
                  count: number,
                  cursor?: { after?: { id?: string }; before?: { id?: string } },
              ): Promise<any[]>;
              loadOlderMessages(
                  jid: string,
                  count: number,
                  before?: { id?: string },
              ): Promise<any[]>;
          },
      >