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