Path: blob/master/node_modules/@adiwajshing/baileys/lib/LegacySocket/messages.d_1.ts
2593 views
/// <reference types="node" />1/// <reference types="ws" />2import { proto } from '../../WAProto';3import { AnyMessageContent, Chat, LegacySocketConfig, MiscMessageGenerationOptions, WAMessage, WAMessageCursor, WAUrlInfo } from '../Types';4import { BinaryNode } from '../WABinary';5declare const makeMessagesSocket: (config: LegacySocketConfig) => {6relayMessage: (message: WAMessage, { waitForAck }?: {7waitForAck: boolean;8}) => Promise<void>;9generateUrlInfo: (text: string) => Promise<WAUrlInfo>;10messageInfo: (jid: string, messageID: string) => Promise<proto.IUserReceipt[]>;11downloadMediaMessage: (message: WAMessage, type?: 'buffer' | 'stream') => Promise<Buffer | import("stream").Readable>;12updateMediaMessage: (message: WAMessage) => Promise<BinaryNode>;13fetchMessagesFromWA: (jid: string, count: number, cursor?: WAMessageCursor) => Promise<proto.WebMessageInfo[]>;14/** Load a single message specified by the ID */15loadMessageFromWA: (jid: string, id: string) => Promise<proto.WebMessageInfo>;16searchMessages: (txt: string, inJid: string | null, count: number, page: number) => Promise<{17last: boolean;18messages: proto.WebMessageInfo[];19}>;20sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions & {21waitForAck?: boolean;22}) => Promise<proto.WebMessageInfo>;23sendChatsQuery: (epoch: number) => Promise<string>;24profilePictureUrl: (jid: string, timeoutMs?: number) => Promise<string>;25chatRead: (fromMessage: proto.IMessageKey, count: number) => Promise<void>;26chatModify: (modification: import("../Types").ChatModification, jid: string, chatInfo: Pick<Chat, "mute" | "pin">, timestampNow?: number) => Promise<void | {27status: number;28}>;29onWhatsApp: (str: string) => Promise<{30exists: boolean;31jid: string;32isBusiness: boolean;33}>;34sendPresenceUpdate: (type: import("../Types").WAPresence, jid: string) => Promise<string>;35presenceSubscribe: (jid: string) => Promise<string>;36getStatus: (jid: string) => Promise<{37status: string;38}>;39setStatus: (status: string) => Promise<{40status: number;41}>;42updateBusinessProfile: (profile: import("../Types").WABusinessProfile) => Promise<void>;43updateProfileName: (name: string) => Promise<{44status: number;45pushname: string;46}>;47updateProfilePicture(jid: string, img: Buffer): Promise<void>;48blockUser: (jid: string, type?: "add" | "remove") => Promise<void>;49getBusinessProfile: (jid: string) => Promise<import("../Types").WABusinessProfile>;50state: import("../Types").ConnectionState;51authInfo: import("../Types").LegacyAuthenticationCreds;52ev: import("../Types").LegacyBaileysEventEmitter;53canLogin: () => boolean;54logout: () => Promise<void>;55waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean, timeoutMs?: number) => Promise<void>;56type: "legacy";57ws: import("ws");58sendAdminTest: () => Promise<string>;59updateKeys: (info: {60encKey: Buffer;61macKey: Buffer;62}) => {63encKey: Buffer;64macKey: Buffer;65};66waitForSocketOpen: () => Promise<void>;67sendNode: ({ json, binaryTag, tag, longTag }: import("../Types").SocketSendMessageOptions) => Promise<string>;68generateMessageTag: (longTag?: boolean) => string;69waitForMessage: (tag: string, requiresPhoneConnection: boolean, timeoutMs?: number) => {70promise: Promise<any>;71cancelToken: () => void;72};73query: ({ json, timeoutMs, expect200, tag, longTag, binaryTag, requiresPhoneConnection }: import("../Types").SocketQueryOptions) => Promise<any>;74setQuery: (nodes: BinaryNode[], binaryTag?: import("../Types").WATag, tag?: string) => Promise<{75status: number;76}>;77currentEpoch: () => number;78end: (error: Error) => void;79};80export default makeMessagesSocket;818283