@denzy-official/baileys 1.1.1 → 1.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/WAProto/index.d.ts +55058 -0
  2. package/WAProto/index.js +169662 -0
  3. package/WAProto/index.ts.ts +53474 -0
  4. package/lib/Defaults/index.d.ts +52 -0
  5. package/lib/Signal/Group/ciphertext-message.d.ts +10 -0
  6. package/lib/Signal/Group/group-session-builder.d.ts +15 -0
  7. package/lib/Signal/Group/group_cipher.d.ts +18 -0
  8. package/lib/Signal/Group/index.d.ts +12 -0
  9. package/lib/Signal/Group/keyhelper.d.ts +11 -0
  10. package/lib/Signal/Group/queue-job.d.ts +2 -0
  11. package/lib/Signal/Group/sender-chain-key.d.ts +14 -0
  12. package/lib/Signal/Group/sender-key-distribution-message.d.ts +17 -0
  13. package/lib/Signal/Group/sender-key-message.d.ts +19 -0
  14. package/lib/Signal/Group/sender-key-name.d.ts +18 -0
  15. package/lib/Signal/Group/sender-key-record.d.ts +31 -0
  16. package/lib/Signal/Group/sender-key-state.d.ts +39 -0
  17. package/lib/Signal/Group/sender-message-key.d.ts +12 -0
  18. package/lib/Signal/libsignal.d.ts +4 -0
  19. package/lib/Socket/Client/abstract-socket-client.d.ts +17 -0
  20. package/lib/Socket/Client/abstract-socket-client.js +13 -0
  21. package/lib/Socket/Client/index.d.ts +3 -0
  22. package/lib/Socket/Client/index.js +3 -3
  23. package/lib/Socket/Client/mobile-socket-client.d.ts +13 -0
  24. package/lib/Socket/Client/mobile-socket-client.js +65 -0
  25. package/lib/Socket/Client/types.d.ts +17 -0
  26. package/lib/Socket/Client/web-socket-client.d.ts +12 -0
  27. package/lib/Socket/Client/web-socket-client.js +62 -0
  28. package/lib/Socket/Client/websocket.d.ts +14 -0
  29. package/lib/Socket/business.d.ts +171 -0
  30. package/lib/Socket/business.js +0 -1
  31. package/lib/Socket/chats.d.ts +267 -0
  32. package/lib/Socket/chats.js +238 -140
  33. package/lib/Socket/dugong.d.ts +254 -0
  34. package/lib/Socket/dugong.js +343 -335
  35. package/lib/Socket/groups.d.ts +115 -0
  36. package/lib/Socket/groups.js +23 -39
  37. package/lib/Socket/index.d.ts +173 -0
  38. package/lib/Socket/index.js +3 -3
  39. package/lib/Socket/messages-recv.d.ts +161 -0
  40. package/lib/Socket/messages-recv.js +65 -10
  41. package/lib/Socket/messages-send.d.ts +149 -0
  42. package/lib/Socket/messages-send.js +392 -412
  43. package/lib/Socket/newsletter.d.ts +134 -0
  44. package/lib/Socket/newsletter.js +124 -72
  45. package/lib/Socket/registration.d.ts +267 -0
  46. package/lib/Socket/registration.js +166 -0
  47. package/lib/Socket/socket.d.ts +43 -0
  48. package/lib/Socket/socket.js +38 -63
  49. package/lib/Socket/usync.d.ts +36 -0
  50. package/lib/Socket/usync.js +0 -1
  51. package/lib/Store/index.d.ts +3 -0
  52. package/lib/Store/make-in-memory-store.d.ts +119 -0
  53. package/lib/Store/make-ordered-dictionary.d.ts +14 -0
  54. package/lib/Store/object-repository.d.ts +11 -0
  55. package/lib/Types/Auth.d.ts +104 -0
  56. package/lib/Types/Call.d.ts +14 -0
  57. package/lib/Types/Chat.d.ts +110 -0
  58. package/lib/Types/Contact.d.ts +24 -0
  59. package/lib/Types/Events.d.ts +200 -0
  60. package/lib/Types/GroupMetadata.d.ts +65 -0
  61. package/lib/Types/Label.d.ts +36 -0
  62. package/lib/Types/LabelAssociation.d.ts +30 -0
  63. package/lib/Types/Message.d.ts +401 -0
  64. package/lib/Types/Newsletter.d.ts +80 -0
  65. package/lib/Types/Product.d.ts +78 -0
  66. package/lib/Types/Signal.d.ts +57 -0
  67. package/lib/Types/Socket.d.ts +119 -0
  68. package/lib/Types/State.d.ts +27 -0
  69. package/lib/Types/USync.d.ts +25 -0
  70. package/lib/Types/index.d.ts +65 -0
  71. package/lib/Utils/auth-utils.d.ts +18 -0
  72. package/lib/Utils/auth-utils.js +13 -8
  73. package/lib/Utils/baileys-event-stream.d.ts +16 -0
  74. package/lib/Utils/baileys-event-stream.js +0 -1
  75. package/lib/Utils/business.d.ts +22 -0
  76. package/lib/Utils/business.js +2 -3
  77. package/lib/Utils/chat-utils.d.ts +71 -0
  78. package/lib/Utils/chat-utils.js +35 -37
  79. package/lib/Utils/crypto.d.ts +41 -0
  80. package/lib/Utils/crypto.js +29 -72
  81. package/lib/Utils/decode-wa-message.d.ts +19 -0
  82. package/lib/Utils/decode-wa-message.js +56 -66
  83. package/lib/Utils/event-buffer.d.ts +35 -0
  84. package/lib/Utils/event-buffer.js +7 -12
  85. package/lib/Utils/generics.d.ts +92 -0
  86. package/lib/Utils/generics.js +75 -96
  87. package/lib/Utils/history.d.ts +15 -0
  88. package/lib/Utils/history.js +6 -5
  89. package/lib/Utils/index.d.ts +17 -0
  90. package/lib/Utils/index.js +0 -1
  91. package/lib/Utils/link-preview.d.ts +21 -0
  92. package/lib/Utils/link-preview.js +1 -34
  93. package/lib/Utils/logger.d.ts +4 -0
  94. package/lib/Utils/lt-hash.d.ts +12 -0
  95. package/lib/Utils/lt-hash.js +6 -6
  96. package/lib/Utils/make-mutex.d.ts +7 -0
  97. package/lib/Utils/messages-media.d.ts +116 -0
  98. package/lib/Utils/messages-media.js +235 -296
  99. package/lib/Utils/messages.d.ts +77 -0
  100. package/lib/Utils/messages.js +60 -304
  101. package/lib/Utils/noise-handler.d.ts +21 -0
  102. package/lib/Utils/noise-handler.js +23 -18
  103. package/lib/Utils/process-message.d.ts +41 -0
  104. package/lib/Utils/process-message.js +25 -89
  105. package/lib/Utils/signal.d.ts +32 -0
  106. package/lib/Utils/signal.js +26 -26
  107. package/lib/Utils/use-multi-file-auth-state.d.ts +13 -0
  108. package/lib/Utils/use-multi-file-auth-state.js +6 -51
  109. package/lib/Utils/validate-connection.d.ts +11 -0
  110. package/lib/Utils/validate-connection.js +52 -20
  111. package/lib/WABinary/constants.d.ts +28 -0
  112. package/lib/WABinary/decode.d.ts +7 -0
  113. package/lib/WABinary/encode.d.ts +3 -0
  114. package/lib/WABinary/generic-utils.d.ts +15 -0
  115. package/lib/WABinary/index.d.ts +6 -0
  116. package/lib/WABinary/jid-utils.d.ts +37 -0
  117. package/lib/WABinary/types.d.ts +19 -0
  118. package/lib/WAM/BinaryInfo.d.ts +9 -0
  119. package/lib/WAM/constants.d.ts +39 -0
  120. package/lib/WAM/encode.d.ts +3 -0
  121. package/lib/WAM/index.d.ts +4 -0
  122. package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +9 -0
  123. package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +22 -0
  124. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +12 -0
  125. package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +12 -0
  126. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +25 -0
  127. package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +8 -0
  128. package/lib/WAUSync/Protocols/index.d.ts +4 -0
  129. package/lib/WAUSync/USyncQuery.d.ts +28 -0
  130. package/lib/WAUSync/USyncUser.d.ts +12 -0
  131. package/lib/WAUSync/index.d.ts +3 -0
  132. package/package.json +2 -1
@@ -1,4 +1,3 @@
1
- // baileys by denzy
2
1
  "use strict";
3
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
4
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
@@ -17,9 +16,34 @@ const WABinary_1 = require("../WABinary");
17
16
  const groups_1 = require("./groups");
18
17
  const messages_send_1 = require("./messages-send");
19
18
  const makeMessagesRecvSocket = (config) => {
20
- const { logger, retryRequestDelayMs, maxMsgRetryCount, getMessage, shouldIgnoreJid } = config;
19
+ const {
20
+ logger,
21
+ retryRequestDelayMs,
22
+ maxMsgRetryCount,
23
+ getMessage,
24
+ shouldIgnoreJid
25
+ } = config;
21
26
  const sock = (0, messages_send_1.makeMessagesSocket)(config);
22
- const { ev, authState, ws, processingMutex, signalRepository, query, upsertMessage, resyncAppState, groupMetadata, onUnexpectedError, assertSessions, sendNode, relayMessage, sendReceipt, uploadPreKeys, createParticipantNodes, getUSyncDevices, sendPeerDataOperationMessage, } = sock;
27
+ const {
28
+ ev,
29
+ authState,
30
+ ws,
31
+ processingMutex,
32
+ signalRepository,
33
+ query,
34
+ upsertMessage,
35
+ resyncAppState,
36
+ groupMetadata,
37
+ onUnexpectedError,
38
+ assertSessions,
39
+ sendNode,
40
+ relayMessage,
41
+ sendReceipt,
42
+ uploadPreKeys,
43
+ createParticipantNodes,
44
+ getUSyncDevices,
45
+ sendPeerDataOperationMessage
46
+ } = sock;
23
47
  /** this mutex ensures that each retryRequest will wait for the previous one to finish */
24
48
  const retryMutex = (0, make_mutex_1.makeMutex)();
25
49
  const msgRetryCache = config.msgRetryCounterCache || new node_cache_1.default({
@@ -43,7 +67,7 @@ const makeMessagesRecvSocket = (config) => {
43
67
  to: attrs.from,
44
68
  class: tag
45
69
  }
46
- };
70
+ }
47
71
  if (!!errorCode) {
48
72
  stanza.attrs.error = errorCode.toString();
49
73
  }
@@ -59,14 +83,31 @@ const makeMessagesRecvSocket = (config) => {
59
83
  if (tag === 'message' && (0, WABinary_1.getBinaryNodeChild)({ tag, attrs, content }, 'unavailable')) {
60
84
  stanza.attrs.from = authState.creds.me.id;
61
85
  }
62
- logger.debug({ recv: { tag, attrs }, sent: stanza.attrs }, 'sent ack');
86
+ logger.debug({
87
+ recv: {
88
+ tag,
89
+ attrs
90
+ },
91
+ sent: stanza.attrs }, 'sent ack');
63
92
  await sendNode(stanza);
64
93
  };
65
94
  const offerCall = async (toJid, isVideo = false) => {
66
95
  const callId = (0, crypto_1.randomBytes)(16).toString('hex').toUpperCase().substring(0, 64);
67
96
  const offerContent = [];
68
- offerContent.push({ tag: 'audio', attrs: { enc: 'opus', rate: '16000' }, content: undefined });
69
- offerContent.push({ tag: 'audio', attrs: { enc: 'opus', rate: '8000' }, content: undefined });
97
+ offerContent.push({
98
+ tag: 'audio',
99
+ attrs: {
100
+ enc: 'opus',
101
+ rate: '16000'
102
+ }, content: undefined
103
+ });
104
+ offerContent.push({
105
+ tag: 'audio',
106
+ attrs: {
107
+ enc: 'opus',
108
+ rate: '8000'
109
+ }, content: undefined
110
+ });
70
111
  if (isVideo) {
71
112
  offerContent.push({
72
113
  tag: 'video',
@@ -80,9 +121,23 @@ const makeMessagesRecvSocket = (config) => {
80
121
  }
81
122
  });
82
123
  }
83
- offerContent.push({ tag: 'net', attrs: { medium: '3' }, content: undefined });
84
- offerContent.push({ tag: 'capability', attrs: { ver: '1' }, content: new Uint8Array([1, 4, 255, 131, 207, 4]) });
85
- offerContent.push({ tag: 'encopt', attrs: { keygen: '2' }, content: undefined });
124
+ offerContent.push({
125
+ tag: 'net',
126
+ attrs: {
127
+ medium: '3'
128
+ }, content: undefined
129
+ });
130
+ offerContent.push({
131
+ tag: 'capability',
132
+ attrs: {
133
+ ver: '1'
134
+ }, content: new Uint8Array([1, 4, 255, 131, 207, 4]) });
135
+ offerContent.push({
136
+ tag: 'encopt',
137
+ attrs: {
138
+ keygen: '2'
139
+ }, content: undefined
140
+ })
86
141
  const encKey = (0, crypto_1.randomBytes)(32);
87
142
  const devices = (await getUSyncDevices([toJid], true, false)).map(({ user, device }) => (0, WABinary_1.jidEncode)(user, 's.whatsapp.net', device));
88
143
  await assertSessions(devices, true);
@@ -0,0 +1,149 @@
1
+ /// <reference types="node" />
2
+ import { Boom } from '@hapi/boom';
3
+ import { proto } from '../../WAProto';
4
+ import { AnyMessageContent, MediaConnInfo, MessageReceiptType, MessageRelayOptions, MiscMessageGenerationOptions, SocketConfig, WAMessageKey } from '../Types';
5
+ import { BinaryNode, JidWithDevice } from '../WABinary';
6
+ export declare const makeMessagesSocket: (config: SocketConfig) => {
7
+ getPrivacyTokens: (jids: string[]) => Promise<BinaryNode>;
8
+ assertSessions: (jids: string[], force: boolean) => Promise<boolean>;
9
+ relayMessage: (jid: string, message: proto.IMessage, { messageId, participant, additionalAttributes, additionalNodes, useUserDevicesCache, cachedGroupMetadata, useCachedGroupMetadata, statusJidList }: MessageRelayOptions) => Promise<proto.WebMessageInfo>;
10
+ sendReceipt: (jid: string, participant: string | undefined, messageIds: string[], type: MessageReceiptType) => Promise<void>;
11
+ sendReceipts: (keys: WAMessageKey[], type: MessageReceiptType) => Promise<void>;
12
+ readMessages: (keys: WAMessageKey[]) => Promise<void>;
13
+ refreshMediaConn: (forceGet?: boolean) => Promise<MediaConnInfo>;
14
+ getUSyncDevices: (jids: string[], useCache: boolean, ignoreZeroDevices: boolean) => Promise<JidWithDevice[]>;
15
+ createParticipantNodes: (jids: string[], message: proto.IMessage, extraAttrs?: BinaryNode['attrs']) => Promise<{
16
+ nodes: BinaryNode[];
17
+ shouldIncludeDeviceIdentity: boolean;
18
+ }>;
19
+ waUploadToServer: import("../Types").WAMediaUploadFunction;
20
+ fetchPrivacySettings: (force?: boolean) => Promise<{
21
+ [_: string]: string;
22
+ }>;
23
+ sendPeerDataOperationMessage: (pdoMessage: proto.Message.IPeerDataOperationRequestMessage) => Promise<string>;
24
+ rahmi: any;
25
+ updateMediaMessage: (message: proto.IWebMessageInfo) => Promise<proto.IWebMessageInfo>;
26
+ sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions) => Promise<proto.WebMessageInfo | undefined>;
27
+ subscribeNewsletterUpdates: (jid: string) => Promise<{
28
+ duration: string;
29
+ }>;
30
+ newsletterReactionMode: (jid: string, mode: import("../Types").NewsletterReactionMode) => Promise<void>;
31
+ newsletterUpdateDescription: (jid: string, description?: string | undefined) => Promise<void>;
32
+ newsletterUpdateName: (jid: string, name: string) => Promise<void>;
33
+ newsletterUpdatePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>;
34
+ newsletterRemovePicture: (jid: string) => Promise<void>;
35
+ newsletterUnfollow: (jid: string) => Promise<void>;
36
+ newsletterFollow: (jid: string) => Promise<void>;
37
+ newsletterUnmute: (jid: string) => Promise<void>;
38
+ newsletterMute: (jid: string) => Promise<void>;
39
+ newsletterAction: (jid: string, type: "mute" | "follow" | "unfollow" | "unmute") => Promise<void>;
40
+ newsletterCreate: (name: string, description: string, reaction_codes: string) => Promise<import("../Types").NewsletterMetadata>;
41
+ newsletterMetadata: (type: "invite" | "jid", key: string, role?: import("../Types").NewsletterViewRole | undefined) => Promise<import("../Types").NewsletterMetadata>;
42
+ newsletterAdminCount: (jid: string) => Promise<number>;
43
+ newsletterChangeOwner: (jid: string, user: string) => Promise<void>;
44
+ newsletterDemote: (jid: string, user: string) => Promise<void>;
45
+ newsletterDelete: (jid: string) => Promise<void>;
46
+ newsletterReactMessage: (jid: string, serverId: string, code?: string | undefined) => Promise<void>;
47
+ newsletterFetchMessages: (type: "invite" | "jid", key: string, count: number, after?: number | undefined) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
48
+ newsletterFetchUpdates: (jid: string, count: number, after?: number | undefined, since?: number | undefined) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
49
+ groupMetadata: (jid: string) => Promise<import("../Types").GroupMetadata>;
50
+ groupCreate: (subject: string, participants: string[]) => Promise<import("../Types").GroupMetadata>;
51
+ groupLeave: (id: string) => Promise<void>;
52
+ groupUpdateSubject: (jid: string, subject: string) => Promise<void>;
53
+ groupRequestParticipantsList: (jid: string) => Promise<{
54
+ [key: string]: string;
55
+ }[]>;
56
+ groupRequestParticipantsUpdate: (jid: string, participants: string[], action: "reject" | "approve") => Promise<{
57
+ status: string;
58
+ jid: string;
59
+ }[]>;
60
+ groupParticipantsUpdate: (jid: string, participants: string[], action: import("../Types").ParticipantAction) => Promise<{
61
+ status: string;
62
+ jid: string;
63
+ content: BinaryNode;
64
+ }[]>;
65
+ groupUpdateDescription: (jid: string, description?: string | undefined) => Promise<void>;
66
+ groupInviteCode: (jid: string) => Promise<string | undefined>;
67
+ groupRevokeInvite: (jid: string) => Promise<string | undefined>;
68
+ groupAcceptInvite: (code: string) => Promise<string | undefined>;
69
+ groupAcceptInviteV4: (key: string | proto.IMessageKey, inviteMessage: proto.Message.IGroupInviteMessage) => Promise<string>;
70
+ groupGetInviteInfo: (code: string) => Promise<import("../Types").GroupMetadata>;
71
+ groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
72
+ groupSettingUpdate: (jid: string, setting: "announcement" | "locked" | "not_announcement" | "unlocked") => Promise<void>;
73
+ groupMemberAddMode: (jid: string, mode: "all_member_add" | "admin_add") => Promise<void>;
74
+ groupJoinApprovalMode: (jid: string, mode: "on" | "off") => Promise<void>;
75
+ groupFetchAllParticipating: () => Promise<{
76
+ [_: string]: import("../Types").GroupMetadata;
77
+ }>;
78
+ processingMutex: {
79
+ mutex<T>(code: () => T | Promise<T>): Promise<T>;
80
+ };
81
+ upsertMessage: (msg: proto.IWebMessageInfo, type: import("../Types").MessageUpsertType) => Promise<void>;
82
+ appPatch: (patchCreate: import("../Types").WAPatchCreate) => Promise<void>;
83
+ sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string | undefined) => Promise<void>;
84
+ presenceSubscribe: (toJid: string, tcToken?: Buffer | undefined) => Promise<void>;
85
+ profilePictureUrl: (jid: string, type?: "image" | "preview", timeoutMs?: number | undefined) => Promise<string | undefined>;
86
+ onWhatsApp: (...jids: string[]) => Promise<{
87
+ jid: string;
88
+ exists: unknown;
89
+ lid: unknown;
90
+ }[] | undefined>;
91
+ fetchBlocklist: () => Promise<string[]>;
92
+ fetchStatus: (jid: string) => Promise<{
93
+ status: string | undefined;
94
+ setAt: Date;
95
+ } | undefined>;
96
+ updateProfilePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>;
97
+ removeProfilePicture: (jid: string) => Promise<void>;
98
+ updateProfileStatus: (status: string) => Promise<void>;
99
+ updateProfileName: (name: string) => Promise<void>;
100
+ updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise<void>;
101
+ updateLastSeenPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
102
+ updateOnlinePrivacy: (value: import("../Types").WAPrivacyOnlineValue) => Promise<void>;
103
+ updateProfilePicturePrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
104
+ updateStatusPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
105
+ updateReadReceiptsPrivacy: (value: import("../Types").WAReadReceiptsValue) => Promise<void>;
106
+ updateGroupsAddPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
107
+ updateDefaultDisappearingMode: (duration: number) => Promise<void>;
108
+ getBusinessProfile: (jid: string) => Promise<void | import("../Types").WABusinessProfile>;
109
+ resyncAppState: (collections: readonly ("critical_block" | "critical_unblock_low" | "regular_high" | "regular_low" | "regular")[], isInitialSync: boolean) => Promise<void>;
110
+ chatModify: (mod: import("../Types").ChatModification, jid: string) => Promise<void>;
111
+ cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: string | number | undefined) => Promise<void>;
112
+ addChatLabel: (jid: string, labelId: string) => Promise<void>;
113
+ removeChatLabel: (jid: string, labelId: string) => Promise<void>;
114
+ addMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
115
+ removeMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
116
+ star: (jid: string, messages: {
117
+ id: string;
118
+ fromMe?: boolean | undefined;
119
+ }[], star: boolean) => Promise<void>;
120
+ type: "md";
121
+ ws: any;
122
+ ev: import("../Types").BaileysEventEmitter & {
123
+ process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): () => void;
124
+ buffer(): void;
125
+ createBufferedFunction<A extends any[], T_1>(work: (...args: A) => Promise<T_1>): (...args: A) => Promise<T_1>;
126
+ flush(force?: boolean | undefined): boolean;
127
+ isBuffering(): boolean;
128
+ };
129
+ authState: {
130
+ creds: import("../Types").AuthenticationCreds;
131
+ keys: import("../Types").SignalKeyStoreWithTransaction;
132
+ };
133
+ signalRepository: import("../Types").SignalRepository;
134
+ user: import("../Types").Contact | undefined;
135
+ generateMessageTag: () => string;
136
+ query: (node: BinaryNode, timeoutMs?: number | undefined) => Promise<BinaryNode>;
137
+ waitForMessage: <T_2>(msgId: string, timeoutMs?: number | undefined) => Promise<T_2>;
138
+ waitForSocketOpen: () => Promise<void>;
139
+ sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>;
140
+ sendNode: (frame: BinaryNode) => Promise<void>;
141
+ logout: (msg?: string | undefined) => Promise<void>;
142
+ end: (error: Error | undefined) => void;
143
+ onUnexpectedError: (err: Error | Boom<any>, msg: string) => void;
144
+ uploadPreKeys: (count?: number) => Promise<void>;
145
+ uploadPreKeysToServerIfRequired: () => Promise<void>;
146
+ requestPairingCode: (phoneNumber: string) => Promise<string>;
147
+ waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined, timeoutMs?: number | undefined) => Promise<void>;
148
+ sendWAMBuffer: (wamBuffer: Buffer) => Promise<BinaryNode>;
149
+ };