Path: blob/master/node_modules/@adiwajshing/baileys/lib/Socket/chats.d.ts
1129 views
/// <reference types="ws" />1/// <reference types="node" />2import { proto } from '../../WAProto';3import { ChatModification, InitialReceivedChatsState, MessageUpsertType, SocketConfig, WABusinessProfile, WAMediaUpload, WAPatchCreate, WAPresence } from '../Types';4import { BinaryNode } from '../WABinary';5export declare const makeChatsSocket: (config: SocketConfig) => {6processingMutex: {7mutex<T>(code: () => T | Promise<T>): Promise<T>;8};9fetchPrivacySettings: (force?: boolean) => Promise<{10[_: string]: string;11}>;12upsertMessage: (msg: proto.IWebMessageInfo, type: MessageUpsertType) => Promise<void>;13appPatch: (patchCreate: WAPatchCreate) => Promise<void>;14sendPresenceUpdate: (type: WAPresence, toJid?: string) => Promise<void>;15presenceSubscribe: (toJid: string) => Promise<void>;16profilePictureUrl: (jid: string, type?: 'preview' | 'image', timeoutMs?: number) => Promise<string | undefined>;17onWhatsApp: (...jids: string[]) => Promise<{18exists: boolean;19jid: string;20}[]>;21fetchBlocklist: () => Promise<string[]>;22fetchStatus: (jid: string) => Promise<{23status: string | undefined;24setAt: Date;25} | undefined>;26updateProfilePicture: (jid: string, content: WAMediaUpload) => Promise<void>;27updateProfileStatus: (status: string) => Promise<void>;28updateProfileName: (name: string) => Promise<void>;29updateBlockStatus: (jid: string, action: 'block' | 'unblock') => Promise<void>;30getBusinessProfile: (jid: string) => Promise<WABusinessProfile | void>;31resyncAppState: (collections: readonly ("critical_block" | "critical_unblock_low" | "regular_high" | "regular_low" | "regular")[], recvChats: InitialReceivedChatsState | undefined) => Promise<void>;32chatModify: (mod: ChatModification, jid: string) => Promise<void>;33resyncMainAppState: (ctx?: InitialReceivedChatsState) => Promise<void>;34type: "md";35ws: import("ws");36ev: import("../Types").BaileysEventEmitter & {37process(handler: (events: Partial<import("../Types").BaileysEventMap<import("../Types").AuthenticationCreds>>) => void | Promise<void>): () => void;38buffer(): boolean;39createBufferedFunction<A extends any[], T_1>(work: (...args: A) => Promise<T_1>): (...args: A) => Promise<T_1>;40flush(): Promise<void>;41processInBuffer(task: Promise<any>): any;42};43authState: {44creds: import("../Types").AuthenticationCreds;45keys: import("../Types").SignalKeyStoreWithTransaction;46};47user: import("../Types").Contact | undefined;48generateMessageTag: () => string;49query: (node: BinaryNode, timeoutMs?: number | undefined) => Promise<BinaryNode>;50waitForMessage: (msgId: string, timeoutMs?: number | undefined) => Promise<any>;51waitForSocketOpen: () => Promise<void>;52sendRawMessage: (data: Buffer | Uint8Array) => Promise<void>;53sendNode: (frame: BinaryNode) => Promise<void>;54logout: () => Promise<void>;55end: (error: Error | undefined) => void;56onUnexpectedError: (error: Error, msg: string) => void;57uploadPreKeys: (count?: number) => Promise<void>;58waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined, timeoutMs?: number | undefined) => Promise<void>;59};606162