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