Path: blob/master/node_modules/@adiwajshing/baileys/lib/LegacySocket/chats.d.ts
1129 views
/// <reference types="node" />1/// <reference types="ws" />2import { Chat, ChatModification, LegacySocketConfig, WABusinessProfile, WAMessageKey, WAPresence } from '../Types';3import { BinaryNode } from '../WABinary';4declare const makeChatsSocket: (config: LegacySocketConfig) => {5sendChatsQuery: (epoch: number) => Promise<string>;6profilePictureUrl: (jid: string, timeoutMs?: number) => Promise<string | undefined>;7chatRead: (fromMessage: WAMessageKey, count: number) => Promise<void>;8/**9* Modify a given chat (archive, pin etc.)10* @param jid the ID of the person/group you are modifiying11*/12chatModify: (modification: ChatModification, jid: string, chatInfo: Pick<Chat, 'mute' | 'pin'>, timestampNow?: number) => Promise<void | {13status: number;14}>;15/**16* Query whether a given number is registered on WhatsApp17* @param str phone number/jid you want to check for18* @returns undefined if the number doesn't exists, otherwise the correctly formatted jid19*/20onWhatsApp: (str: string) => Promise<{21exists: boolean;22jid: string;23isBusiness: boolean;24} | undefined>;25/**26* Tell someone about your presence -- online, typing, offline etc.27* @param jid the ID of the person/group who you are updating28* @param type your presence29*/30sendPresenceUpdate: (type: WAPresence, toJid?: string) => Promise<string>;31/**32* Request updates on the presence of a user33* this returns nothing, you'll receive updates in chats.update event34* */35presenceSubscribe: (jid: string) => Promise<string>;36/** Query the status of the person (see groupMetadata() for groups) */37getStatus: (jid: string) => Promise<{38status: string;39}>;40setStatus: (status: string) => Promise<{41status: number;42}>;43/** Updates business profile. */44updateBusinessProfile: (profile: WABusinessProfile) => Promise<void>;45updateProfileName: (name: string) => Promise<{46status: number;47pushname: string;48}>;49/**50* Update the profile picture51* @param jid52* @param img53*/54updateProfilePicture(jid: string, imgBuffer: Buffer): Promise<void>;55/**56* Add or remove user from blocklist57* @param jid the ID of the person who you are blocking/unblocking58* @param type type of operation59*/60blockUser: (jid: string, type?: 'add' | 'remove') => Promise<void>;61/**62* Query Business Profile (Useful for VCards)63* @param jid Business Jid64* @returns profile object or undefined if not business account65*/66getBusinessProfile: (jid: string) => Promise<WABusinessProfile>;67state: import("../Types").ConnectionState;68authInfo: import("../Types").LegacyAuthenticationCreds;69ev: import("../Types").LegacyBaileysEventEmitter;70canLogin: () => boolean;71logout: () => Promise<void>;72waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined, timeoutMs?: number | undefined) => Promise<void>;73type: "legacy";74ws: import("ws");75sendAdminTest: () => Promise<string>;76updateKeys: (info: {77encKey: Buffer;78macKey: Buffer;79}) => {80encKey: Buffer;81macKey: Buffer;82};83waitForSocketOpen: () => Promise<void>;84sendNode: ({ json, binaryTag, tag, longTag }: import("../Types").SocketSendMessageOptions) => Promise<string>;85generateMessageTag: (longTag?: boolean) => string;86waitForMessage: (tag: string, requiresPhoneConnection: boolean, timeoutMs?: number | undefined) => {87promise: Promise<any>;88cancelToken: () => void;89};90query: ({ json, timeoutMs, expect200, tag, longTag, binaryTag, requiresPhoneConnection }: import("../Types").SocketQueryOptions) => Promise<any>;91setQuery: (nodes: BinaryNode[], binaryTag?: import("../Types").WATag, tag?: string | undefined) => Promise<{92status: number;93}>;94currentEpoch: () => number;95end: (error: Error | undefined) => void;96};97export default makeChatsSocket;9899100