lordceaser-baileys 1.0.20 → 1.0.21

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 (123) hide show
  1. package/lib/Defaults/baileys-version.json +1 -1
  2. package/lib/Defaults/index.d.ts +235 -3
  3. package/lib/Defaults/index.js +22 -6
  4. package/lib/Defaults/phonenumber-mcc.json +223 -0
  5. package/lib/Signal/libsignal.js +9 -18
  6. package/lib/Socket/Client/{types.d.ts → abstract-socket-client.d.ts} +2 -0
  7. package/lib/Socket/Client/index.d.ts +3 -2
  8. package/lib/Socket/Client/index.js +3 -2
  9. package/lib/Socket/Client/mobile-socket-client.d.ts +13 -0
  10. package/lib/Socket/Client/mobile-socket-client.js +65 -0
  11. package/lib/Socket/Client/{websocket.d.ts → web-socket-client.d.ts} +1 -1
  12. package/lib/Socket/Client/{websocket.js → web-socket-client.js} +2 -2
  13. package/lib/Socket/business.d.ts +40 -38
  14. package/lib/Socket/chats.d.ts +23 -25
  15. package/lib/Socket/chats.js +78 -79
  16. package/lib/Socket/groups.d.ts +29 -30
  17. package/lib/Socket/groups.js +3 -4
  18. package/lib/Socket/index.d.ts +48 -44
  19. package/lib/Socket/index.js +2 -2
  20. package/lib/Socket/messages-recv.d.ts +37 -37
  21. package/lib/Socket/messages-recv.js +44 -98
  22. package/lib/Socket/messages-send.d.ts +31 -33
  23. package/lib/Socket/messages-send.js +70 -82
  24. package/lib/Socket/registration.d.ts +242 -0
  25. package/lib/Socket/registration.js +166 -0
  26. package/lib/Socket/socket.d.ts +10 -9
  27. package/lib/Socket/socket.js +23 -28
  28. package/lib/Store/index.d.ts +3 -0
  29. package/lib/Store/index.js +10 -0
  30. package/lib/Store/make-cache-manager-store.d.ts +14 -0
  31. package/lib/Store/make-cache-manager-store.js +83 -0
  32. package/lib/Store/make-in-memory-store.d.ts +118 -0
  33. package/lib/Store/make-in-memory-store.js +422 -0
  34. package/lib/Store/make-ordered-dictionary.d.ts +13 -0
  35. package/lib/Store/make-ordered-dictionary.js +81 -0
  36. package/lib/Store/object-repository.d.ts +10 -0
  37. package/lib/Store/object-repository.js +27 -0
  38. package/lib/Types/Auth.d.ts +7 -0
  39. package/lib/Types/Chat.d.ts +7 -12
  40. package/lib/Types/Contact.d.ts +1 -1
  41. package/lib/Types/GroupMetadata.d.ts +0 -2
  42. package/lib/Types/Label.js +1 -1
  43. package/lib/Types/LabelAssociation.js +1 -1
  44. package/lib/Types/Message.d.ts +10 -9
  45. package/lib/Types/Message.js +3 -1
  46. package/lib/Types/Socket.d.ts +11 -16
  47. package/lib/Types/index.js +1 -1
  48. package/lib/Utils/auth-utils.d.ts +3 -3
  49. package/lib/Utils/auth-utils.js +13 -7
  50. package/lib/Utils/business.js +5 -13
  51. package/lib/Utils/chat-utils.d.ts +14 -13
  52. package/lib/Utils/chat-utils.js +31 -36
  53. package/lib/Utils/crypto.d.ts +15 -14
  54. package/lib/Utils/crypto.js +30 -70
  55. package/lib/Utils/decode-wa-message.d.ts +2 -18
  56. package/lib/Utils/decode-wa-message.js +19 -23
  57. package/lib/Utils/event-buffer.d.ts +2 -2
  58. package/lib/Utils/event-buffer.js +7 -7
  59. package/lib/Utils/generics.d.ts +14 -15
  60. package/lib/Utils/generics.js +29 -33
  61. package/lib/Utils/history.d.ts +2 -2
  62. package/lib/Utils/history.js +1 -1
  63. package/lib/Utils/link-preview.d.ts +2 -2
  64. package/lib/Utils/link-preview.js +1 -34
  65. package/lib/Utils/logger.d.ts +3 -10
  66. package/lib/Utils/lt-hash.d.ts +2 -2
  67. package/lib/Utils/lt-hash.js +6 -6
  68. package/lib/Utils/make-mutex.d.ts +2 -2
  69. package/lib/Utils/make-mutex.js +0 -1
  70. package/lib/Utils/messages-media.d.ts +24 -20
  71. package/lib/Utils/messages-media.js +76 -79
  72. package/lib/Utils/messages.d.ts +9 -7
  73. package/lib/Utils/messages.js +30 -29
  74. package/lib/Utils/noise-handler.d.ts +11 -9
  75. package/lib/Utils/noise-handler.js +22 -17
  76. package/lib/Utils/process-message.d.ts +5 -4
  77. package/lib/Utils/process-message.js +40 -68
  78. package/lib/Utils/signal.d.ts +1 -2
  79. package/lib/Utils/signal.js +19 -11
  80. package/lib/Utils/use-multi-file-auth-state.js +14 -46
  81. package/lib/Utils/validate-connection.d.ts +3 -2
  82. package/lib/Utils/validate-connection.js +46 -16
  83. package/lib/WABinary/constants.js +5 -5
  84. package/lib/WABinary/decode.d.ts +3 -2
  85. package/lib/WABinary/decode.js +9 -20
  86. package/lib/WABinary/encode.d.ts +2 -1
  87. package/lib/WABinary/encode.js +18 -38
  88. package/lib/WABinary/generic-utils.d.ts +2 -1
  89. package/lib/WABinary/generic-utils.js +3 -3
  90. package/lib/WABinary/jid-utils.d.ts +3 -7
  91. package/lib/WABinary/jid-utils.js +2 -9
  92. package/lib/WAM/BinaryInfo.d.ts +11 -2
  93. package/lib/WAM/constants.d.ts +2 -3
  94. package/lib/WAM/encode.d.ts +2 -1
  95. package/lib/WAM/encode.js +2 -2
  96. package/lib/index.d.ts +1 -1
  97. package/lib/index.js +1 -1
  98. package/package.json +2 -2
  99. package/lib/Socket/usync.d.ts +0 -36
  100. package/lib/Socket/usync.js +0 -70
  101. package/lib/Types/USync.d.ts +0 -25
  102. package/lib/Types/USync.js +0 -2
  103. package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +0 -9
  104. package/lib/WAUSync/Protocols/USyncContactProtocol.js +0 -32
  105. package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +0 -22
  106. package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +0 -57
  107. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +0 -12
  108. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +0 -30
  109. package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +0 -12
  110. package/lib/WAUSync/Protocols/USyncStatusProtocol.js +0 -42
  111. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +0 -25
  112. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +0 -53
  113. package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +0 -8
  114. package/lib/WAUSync/Protocols/UsyncLIDProtocol.js +0 -24
  115. package/lib/WAUSync/Protocols/index.d.ts +0 -4
  116. package/lib/WAUSync/Protocols/index.js +0 -20
  117. package/lib/WAUSync/USyncQuery.d.ts +0 -28
  118. package/lib/WAUSync/USyncQuery.js +0 -89
  119. package/lib/WAUSync/USyncUser.d.ts +0 -12
  120. package/lib/WAUSync/USyncUser.js +0 -26
  121. package/lib/WAUSync/index.d.ts +0 -3
  122. package/lib/WAUSync/index.js +0 -19
  123. /package/lib/Socket/Client/{types.js → abstract-socket-client.js} +0 -0
@@ -1,3 +1,4 @@
1
+ /// <reference types="node" />
1
2
  import { proto } from '../../WAProto';
2
3
  import { GroupMetadata, ParticipantAction, SocketConfig } from '../Types';
3
4
  import { BinaryNode } from '../WABinary';
@@ -9,7 +10,7 @@ export declare const makeGroupsSocket: (config: SocketConfig) => {
9
10
  groupRequestParticipantsList: (jid: string) => Promise<{
10
11
  [key: string]: string;
11
12
  }[]>;
12
- groupRequestParticipantsUpdate: (jid: string, participants: string[], action: "approve" | "reject") => Promise<{
13
+ groupRequestParticipantsUpdate: (jid: string, participants: string[], action: 'approve' | 'reject') => Promise<{
13
14
  status: string;
14
15
  jid: string;
15
16
  }[]>;
@@ -34,42 +35,41 @@ export declare const makeGroupsSocket: (config: SocketConfig) => {
34
35
  * @param key the key of the invite message, or optionally only provide the jid of the person who sent the invite
35
36
  * @param inviteMessage the message to accept
36
37
  */
37
- groupAcceptInviteV4: (key: string | proto.IMessageKey, inviteMessage: proto.Message.IGroupInviteMessage) => Promise<any>;
38
+ groupAcceptInviteV4: (key: string | proto.IMessageKey, inviteMessage: proto.Message.IGroupInviteMessage) => Promise<string>;
38
39
  groupGetInviteInfo: (code: string) => Promise<GroupMetadata>;
39
40
  groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
40
- groupSettingUpdate: (jid: string, setting: "announcement" | "not_announcement" | "locked" | "unlocked") => Promise<void>;
41
- groupMemberAddMode: (jid: string, mode: "admin_add" | "all_member_add") => Promise<void>;
42
- groupJoinApprovalMode: (jid: string, mode: "on" | "off") => Promise<void>;
41
+ groupSettingUpdate: (jid: string, setting: 'announcement' | 'not_announcement' | 'locked' | 'unlocked') => Promise<void>;
42
+ groupMemberAddMode: (jid: string, mode: 'admin_add' | 'all_member_add') => Promise<void>;
43
+ groupJoinApprovalMode: (jid: string, mode: 'on' | 'off') => Promise<void>;
43
44
  groupFetchAllParticipating: () => Promise<{
44
45
  [_: string]: GroupMetadata;
45
46
  }>;
46
- getBotListV2: () => Promise<import("../Types").BotListInfo[]>;
47
47
  processingMutex: {
48
- mutex<T>(code: () => Promise<T> | T): Promise<T>;
48
+ mutex<T>(code: () => T | Promise<T>): Promise<T>;
49
49
  };
50
50
  fetchPrivacySettings: (force?: boolean) => Promise<{
51
51
  [_: string]: string;
52
52
  }>;
53
53
  upsertMessage: (msg: proto.IWebMessageInfo, type: import("../Types").MessageUpsertType) => Promise<void>;
54
54
  appPatch: (patchCreate: import("../Types").WAPatchCreate) => Promise<void>;
55
- sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string) => Promise<void>;
56
- presenceSubscribe: (toJid: string, tcToken?: Buffer) => Promise<void>;
57
- profilePictureUrl: (jid: string, type?: "preview" | "image", timeoutMs?: number) => Promise<string | undefined>;
55
+ sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string | undefined) => Promise<void>;
56
+ presenceSubscribe: (toJid: string, tcToken?: Buffer | undefined) => Promise<void>;
57
+ profilePictureUrl: (jid: string, type?: "image" | "preview", timeoutMs?: number | undefined) => Promise<string | undefined>;
58
58
  onWhatsApp: (...jids: string[]) => Promise<{
59
+ exists: boolean;
59
60
  jid: string;
60
- exists: unknown;
61
- lid: unknown;
62
- }[] | undefined>;
61
+ }[]>;
63
62
  fetchBlocklist: () => Promise<string[]>;
64
- fetchStatus: (...jids: string[]) => Promise<import("..").USyncQueryResultList[] | undefined>;
65
- fetchDisappearingDuration: (...jids: string[]) => Promise<import("..").USyncQueryResultList[] | undefined>;
63
+ fetchStatus: (jid: string) => Promise<{
64
+ status: string | undefined;
65
+ setAt: Date;
66
+ } | undefined>;
66
67
  updateProfilePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>;
67
68
  removeProfilePicture: (jid: string) => Promise<void>;
68
69
  updateProfileStatus: (status: string) => Promise<void>;
69
70
  updateProfileName: (name: string) => Promise<void>;
70
71
  updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise<void>;
71
72
  updateCallPrivacy: (value: import("../Types").WAPrivacyCallValue) => Promise<void>;
72
- updateMessagesPrivacy: (value: import("../Types").WAPrivacyMessagesValue) => Promise<void>;
73
73
  updateLastSeenPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
74
74
  updateOnlinePrivacy: (value: import("../Types").WAPrivacyOnlineValue) => Promise<void>;
75
75
  updateProfilePicturePrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
@@ -77,10 +77,10 @@ export declare const makeGroupsSocket: (config: SocketConfig) => {
77
77
  updateReadReceiptsPrivacy: (value: import("../Types").WAReadReceiptsValue) => Promise<void>;
78
78
  updateGroupsAddPrivacy: (value: import("../Types").WAPrivacyGroupAddValue) => Promise<void>;
79
79
  updateDefaultDisappearingMode: (duration: number) => Promise<void>;
80
- getBusinessProfile: (jid: string) => Promise<import("../Types").WABusinessProfile | void>;
80
+ getBusinessProfile: (jid: string) => Promise<void | import("../Types").WABusinessProfile>;
81
81
  resyncAppState: (collections: readonly ("critical_block" | "critical_unblock_low" | "regular_high" | "regular_low" | "regular")[], isInitialSync: boolean) => Promise<void>;
82
82
  chatModify: (mod: import("../Types").ChatModification, jid: string) => Promise<void>;
83
- cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: number | string) => Promise<void>;
83
+ cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: string | number | undefined) => Promise<void>;
84
84
  addLabel: (jid: string, labels: import("../Types/Label").LabelActionBody) => Promise<void>;
85
85
  addChatLabel: (jid: string, labelId: string) => Promise<void>;
86
86
  removeChatLabel: (jid: string, labelId: string) => Promise<void>;
@@ -88,16 +88,15 @@ export declare const makeGroupsSocket: (config: SocketConfig) => {
88
88
  removeMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
89
89
  star: (jid: string, messages: {
90
90
  id: string;
91
- fromMe?: boolean;
91
+ fromMe?: boolean | undefined;
92
92
  }[], star: boolean) => Promise<void>;
93
- executeUSyncQuery: (usyncQuery: import("..").USyncQuery) => Promise<import("..").USyncQueryResult | undefined>;
94
93
  type: "md";
95
- ws: import("./Client").WebSocketClient;
94
+ ws: any;
96
95
  ev: import("../Types").BaileysEventEmitter & {
97
- process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): (() => void);
96
+ process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): () => void;
98
97
  buffer(): void;
99
- createBufferedFunction<A extends any[], T>(work: (...args: A) => Promise<T>): ((...args: A) => Promise<T>);
100
- flush(force?: boolean): boolean;
98
+ createBufferedFunction<A extends any[], T_1>(work: (...args: A) => Promise<T_1>): (...args: A) => Promise<T_1>;
99
+ flush(force?: boolean | undefined): boolean;
101
100
  isBuffering(): boolean;
102
101
  };
103
102
  authState: {
@@ -107,18 +106,18 @@ export declare const makeGroupsSocket: (config: SocketConfig) => {
107
106
  signalRepository: import("../Types").SignalRepository;
108
107
  user: import("../Types").Contact | undefined;
109
108
  generateMessageTag: () => string;
110
- query: (node: BinaryNode, timeoutMs?: number) => Promise<any>;
111
- waitForMessage: <T>(msgId: string, timeoutMs?: number | undefined) => Promise<any>;
109
+ query: (node: BinaryNode, timeoutMs?: number | undefined) => Promise<BinaryNode>;
110
+ waitForMessage: <T_2>(msgId: string, timeoutMs?: number | undefined) => Promise<T_2>;
112
111
  waitForSocketOpen: () => Promise<void>;
113
112
  sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>;
114
113
  sendNode: (frame: BinaryNode) => Promise<void>;
115
- logout: (msg?: string) => Promise<void>;
114
+ logout: (msg?: string | undefined) => Promise<void>;
116
115
  end: (error: Error | undefined) => void;
117
- onUnexpectedError: (err: Error | import("@hapi/boom").Boom, msg: string) => void;
116
+ onUnexpectedError: (err: Error | import("@hapi/boom").Boom<any>, msg: string) => void;
118
117
  uploadPreKeys: (count?: number) => Promise<void>;
119
118
  uploadPreKeysToServerIfRequired: () => Promise<void>;
120
119
  requestPairingCode: (phoneNumber: string) => Promise<string>;
121
- waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => Promise<boolean | undefined>, timeoutMs?: number) => Promise<void>;
122
- sendWAMBuffer: (wamBuffer: Buffer) => Promise<any>;
120
+ waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined, timeoutMs?: number | undefined) => Promise<void>;
121
+ sendWAMBuffer: (wamBuffer: Buffer) => Promise<BinaryNode>;
123
122
  };
124
123
  export declare const extractGroupMetadata: (result: BinaryNode) => GroupMetadata;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.extractGroupMetadata = exports.makeGroupsSocket = void 0;
4
- const WAProto_1 = require("../WAProto");
4
+ const WAProto_1 = require("../../WAProto");
5
5
  const Types_1 = require("../Types");
6
6
  const Utils_1 = require("../Utils");
7
7
  const WABinary_1 = require("../WABinary");
@@ -69,7 +69,7 @@ const makeGroupsSocket = (config) => {
69
69
  ...sock,
70
70
  groupMetadata,
71
71
  groupCreate: async (subject, participants) => {
72
- const key = (0, Utils_1.generateMessageIDV2)();
72
+ const key = (0, Utils_1.generateMessageID)();
73
73
  const result = await groupQuery('@g.us', 'set', [
74
74
  {
75
75
  tag: 'create',
@@ -163,7 +163,7 @@ const makeGroupsSocket = (config) => {
163
163
  {
164
164
  tag: 'description',
165
165
  attrs: {
166
- ...(description ? { id: (0, Utils_1.generateMessageIDV2)() } : { delete: 'true' }),
166
+ ...(description ? { id: (0, Utils_1.generateMessageID)() } : { delete: 'true' }),
167
167
  ...(prev ? { prev } : {})
168
168
  },
169
169
  content: description ? [
@@ -286,7 +286,6 @@ const extractGroupMetadata = (result) => {
286
286
  const memberAddMode = (0, WABinary_1.getBinaryNodeChildString)(group, 'member_add_mode') === 'all_member_add';
287
287
  const metadata = {
288
288
  id: groupId,
289
- addressingMode: group.attrs.addressing_mode,
290
289
  subject: group.attrs.subject,
291
290
  subjectOwner: group.attrs.s_o,
292
291
  subjectTime: +group.attrs.s_t,
@@ -1,12 +1,16 @@
1
+ /// <reference types="long" />
2
+ /// <reference types="node" />
1
3
  import { UserFacingSocketConfig } from '../Types';
2
4
  declare const makeWASocket: (config: UserFacingSocketConfig) => {
3
- logger: import("../Utils/logger").ILogger;
5
+ register: (code: string) => Promise<import("./registration").ExistsResponse>;
6
+ requestRegistrationCode: (registrationOptions?: import("./registration").RegistrationOptions | undefined) => Promise<import("./registration").ExistsResponse>;
7
+ logger: import("pino").Logger<import("pino").LoggerOptions>;
4
8
  getOrderDetails: (orderId: string, tokenBase64: string) => Promise<import("../Types").OrderDetails>;
5
9
  getCatalog: ({ jid, limit, cursor }: import("../Types").GetCatalogOptions) => Promise<{
6
10
  products: import("../Types").Product[];
7
11
  nextPageCursor: string | undefined;
8
12
  }>;
9
- getCollections: (jid?: string, limit?: number) => Promise<{
13
+ getCollections: (jid?: string | undefined, limit?: number) => Promise<{
10
14
  collections: import("../Types").CatalogCollection[];
11
15
  }>;
12
16
  productCreate: (create: import("../Types").ProductCreate) => Promise<import("../Types").Product>;
@@ -14,28 +18,30 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
14
18
  deleted: number;
15
19
  }>;
16
20
  productUpdate: (productId: string, update: import("../Types").ProductUpdate) => Promise<import("../Types").Product>;
17
- sendMessageAck: ({ tag, attrs, content }: import("..").BinaryNode, errorCode?: number) => Promise<void>;
18
- sendRetryRequest: (node: import("..").BinaryNode, forceIncludeKeys?: boolean) => Promise<void>;
21
+ sendMessageAck: ({ tag, attrs, content }: import("../index").BinaryNode) => Promise<void>;
22
+ sendRetryRequest: (node: import("../index").BinaryNode, forceIncludeKeys?: boolean) => Promise<void>;
19
23
  rejectCall: (callId: string, callFrom: string) => Promise<void>;
20
- fetchMessageHistory: (count: number, oldestMsgKey: import("../Types").WAMessageKey, oldestMsgTimestamp: number | import("long").default) => Promise<string>;
21
- requestPlaceholderResend: (messageKey: import("../Types").WAMessageKey) => Promise<string | undefined>;
22
- getPrivacyTokens: (jids: string[]) => Promise<any>;
24
+ fetchMessageHistory: (count: number, oldestMsgKey: import("../Types").WAProto.IMessageKey, oldestMsgTimestamp: number | import("long").Long) => Promise<string>;
25
+ requestPlaceholderResend: (messageKey: import("../Types").WAProto.IMessageKey) => Promise<string | undefined>;
26
+ getPrivacyTokens: (jids: string[]) => Promise<import("../index").BinaryNode>;
23
27
  assertSessions: (jids: string[], force: boolean) => Promise<boolean>;
24
28
  relayMessage: (jid: string, message: import("../Types").WAProto.IMessage, { messageId: msgId, participant, additionalAttributes, additionalNodes, useUserDevicesCache, useCachedGroupMetadata, statusJidList }: import("../Types").MessageRelayOptions) => Promise<string>;
25
29
  sendReceipt: (jid: string, participant: string | undefined, messageIds: string[], type: import("../Types").MessageReceiptType) => Promise<void>;
26
- sendReceipts: (keys: import("../Types").WAMessageKey[], type: import("../Types").MessageReceiptType) => Promise<void>;
27
- readMessages: (keys: import("../Types").WAMessageKey[]) => Promise<void>;
30
+ sendReceipts: (keys: import("../Types").WAProto.IMessageKey[], type: import("../Types").MessageReceiptType) => Promise<void>;
31
+ readMessages: (keys: import("../Types").WAProto.IMessageKey[]) => Promise<void>;
28
32
  refreshMediaConn: (forceGet?: boolean) => Promise<import("../Types").MediaConnInfo>;
29
33
  waUploadToServer: import("../Types").WAMediaUploadFunction;
30
34
  fetchPrivacySettings: (force?: boolean) => Promise<{
31
35
  [_: string]: string;
32
36
  }>;
33
37
  sendPeerDataOperationMessage: (pdoMessage: import("../Types").WAProto.Message.IPeerDataOperationRequestMessage) => Promise<string>;
34
- createParticipantNodes: (jids: string[], message: import("../Types").WAProto.IMessage, extraAttrs?: import("..").BinaryNode["attrs"]) => Promise<{
35
- nodes: import("..").BinaryNode[];
38
+ createParticipantNodes: (jids: string[], message: import("../Types").WAProto.IMessage, extraAttrs?: {
39
+ [key: string]: string;
40
+ } | undefined) => Promise<{
41
+ nodes: import("../index").BinaryNode[];
36
42
  shouldIncludeDeviceIdentity: boolean;
37
43
  }>;
38
- getUSyncDevices: (jids: string[], useCache: boolean, ignoreZeroDevices: boolean) => Promise<import("..").JidWithDevice[]>;
44
+ getUSyncDevices: (jids: string[], useCache: boolean, ignoreZeroDevices: boolean) => Promise<import("../index").JidWithDevice[]>;
39
45
  updateMediaMessage: (message: import("../Types").WAProto.IWebMessageInfo) => Promise<import("../Types").WAProto.IWebMessageInfo>;
40
46
  sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: import("../Types").MiscMessageGenerationOptions) => Promise<import("../Types").WAProto.WebMessageInfo | undefined>;
41
47
  groupMetadata: (jid: string) => Promise<import("../Types").GroupMetadata>;
@@ -45,53 +51,52 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
45
51
  groupRequestParticipantsList: (jid: string) => Promise<{
46
52
  [key: string]: string;
47
53
  }[]>;
48
- groupRequestParticipantsUpdate: (jid: string, participants: string[], action: "approve" | "reject") => Promise<{
54
+ groupRequestParticipantsUpdate: (jid: string, participants: string[], action: "reject" | "approve") => Promise<{
49
55
  status: string;
50
56
  jid: string;
51
57
  }[]>;
52
58
  groupParticipantsUpdate: (jid: string, participants: string[], action: import("../Types").ParticipantAction) => Promise<{
53
59
  status: string;
54
60
  jid: string;
55
- content: import("..").BinaryNode;
61
+ content: import("../index").BinaryNode;
56
62
  }[]>;
57
- groupUpdateDescription: (jid: string, description?: string) => Promise<void>;
63
+ groupUpdateDescription: (jid: string, description?: string | undefined) => Promise<void>;
58
64
  groupInviteCode: (jid: string) => Promise<string | undefined>;
59
65
  groupRevokeInvite: (jid: string) => Promise<string | undefined>;
60
66
  groupAcceptInvite: (code: string) => Promise<string | undefined>;
61
67
  groupRevokeInviteV4: (groupJid: string, invitedJid: string) => Promise<boolean>;
62
- groupAcceptInviteV4: (key: string | import("../Types").WAProto.IMessageKey, inviteMessage: import("../Types").WAProto.Message.IGroupInviteMessage) => Promise<any>;
68
+ groupAcceptInviteV4: (key: string | import("../Types").WAProto.IMessageKey, inviteMessage: import("../Types").WAProto.Message.IGroupInviteMessage) => Promise<string>;
63
69
  groupGetInviteInfo: (code: string) => Promise<import("../Types").GroupMetadata>;
64
70
  groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
65
- groupSettingUpdate: (jid: string, setting: "announcement" | "not_announcement" | "locked" | "unlocked") => Promise<void>;
66
- groupMemberAddMode: (jid: string, mode: "admin_add" | "all_member_add") => Promise<void>;
71
+ groupSettingUpdate: (jid: string, setting: "announcement" | "locked" | "not_announcement" | "unlocked") => Promise<void>;
72
+ groupMemberAddMode: (jid: string, mode: "all_member_add" | "admin_add") => Promise<void>;
67
73
  groupJoinApprovalMode: (jid: string, mode: "on" | "off") => Promise<void>;
68
74
  groupFetchAllParticipating: () => Promise<{
69
75
  [_: string]: import("../Types").GroupMetadata;
70
76
  }>;
71
- getBotListV2: () => Promise<import("../Types").BotListInfo[]>;
72
77
  processingMutex: {
73
- mutex<T>(code: () => Promise<T> | T): Promise<T>;
78
+ mutex<T>(code: () => T | Promise<T>): Promise<T>;
74
79
  };
75
80
  upsertMessage: (msg: import("../Types").WAProto.IWebMessageInfo, type: import("../Types").MessageUpsertType) => Promise<void>;
76
81
  appPatch: (patchCreate: import("../Types").WAPatchCreate) => Promise<void>;
77
- sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string) => Promise<void>;
78
- presenceSubscribe: (toJid: string, tcToken?: Buffer) => Promise<void>;
79
- profilePictureUrl: (jid: string, type?: "preview" | "image", timeoutMs?: number) => Promise<string | undefined>;
82
+ sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string | undefined) => Promise<void>;
83
+ presenceSubscribe: (toJid: string, tcToken?: Buffer | undefined) => Promise<void>;
84
+ profilePictureUrl: (jid: string, type?: "image" | "preview", timeoutMs?: number | undefined) => Promise<string | undefined>;
80
85
  onWhatsApp: (...jids: string[]) => Promise<{
86
+ exists: boolean;
81
87
  jid: string;
82
- exists: unknown;
83
- lid: unknown;
84
- }[] | undefined>;
88
+ }[]>;
85
89
  fetchBlocklist: () => Promise<string[]>;
86
- fetchStatus: (...jids: string[]) => Promise<import("..").USyncQueryResultList[] | undefined>;
87
- fetchDisappearingDuration: (...jids: string[]) => Promise<import("..").USyncQueryResultList[] | undefined>;
90
+ fetchStatus: (jid: string) => Promise<{
91
+ status: string | undefined;
92
+ setAt: Date;
93
+ } | undefined>;
88
94
  updateProfilePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>;
89
95
  removeProfilePicture: (jid: string) => Promise<void>;
90
96
  updateProfileStatus: (status: string) => Promise<void>;
91
97
  updateProfileName: (name: string) => Promise<void>;
92
98
  updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise<void>;
93
99
  updateCallPrivacy: (value: import("../Types").WAPrivacyCallValue) => Promise<void>;
94
- updateMessagesPrivacy: (value: import("../Types").WAPrivacyMessagesValue) => Promise<void>;
95
100
  updateLastSeenPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
96
101
  updateOnlinePrivacy: (value: import("../Types").WAPrivacyOnlineValue) => Promise<void>;
97
102
  updateProfilePicturePrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
@@ -99,10 +104,10 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
99
104
  updateReadReceiptsPrivacy: (value: import("../Types").WAReadReceiptsValue) => Promise<void>;
100
105
  updateGroupsAddPrivacy: (value: import("../Types").WAPrivacyGroupAddValue) => Promise<void>;
101
106
  updateDefaultDisappearingMode: (duration: number) => Promise<void>;
102
- getBusinessProfile: (jid: string) => Promise<import("../Types").WABusinessProfile | void>;
107
+ getBusinessProfile: (jid: string) => Promise<void | import("../Types").WABusinessProfile>;
103
108
  resyncAppState: (collections: readonly ("critical_block" | "critical_unblock_low" | "regular_high" | "regular_low" | "regular")[], isInitialSync: boolean) => Promise<void>;
104
109
  chatModify: (mod: import("../Types").ChatModification, jid: string) => Promise<void>;
105
- cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: number | string) => Promise<void>;
110
+ cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: string | number | undefined) => Promise<void>;
106
111
  addLabel: (jid: string, labels: import("../Types/Label").LabelActionBody) => Promise<void>;
107
112
  addChatLabel: (jid: string, labelId: string) => Promise<void>;
108
113
  removeChatLabel: (jid: string, labelId: string) => Promise<void>;
@@ -110,16 +115,15 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
110
115
  removeMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
111
116
  star: (jid: string, messages: {
112
117
  id: string;
113
- fromMe?: boolean;
118
+ fromMe?: boolean | undefined;
114
119
  }[], star: boolean) => Promise<void>;
115
- executeUSyncQuery: (usyncQuery: import("..").USyncQuery) => Promise<import("..").USyncQueryResult | undefined>;
116
120
  type: "md";
117
- ws: import("./Client").WebSocketClient;
121
+ ws: any;
118
122
  ev: import("../Types").BaileysEventEmitter & {
119
- process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): (() => void);
123
+ process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): () => void;
120
124
  buffer(): void;
121
- createBufferedFunction<A extends any[], T>(work: (...args: A) => Promise<T>): ((...args: A) => Promise<T>);
122
- flush(force?: boolean): boolean;
125
+ createBufferedFunction<A extends any[], T_1>(work: (...args: A) => Promise<T_1>): (...args: A) => Promise<T_1>;
126
+ flush(force?: boolean | undefined): boolean;
123
127
  isBuffering(): boolean;
124
128
  };
125
129
  authState: {
@@ -129,18 +133,18 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
129
133
  signalRepository: import("../Types").SignalRepository;
130
134
  user: import("../Types").Contact | undefined;
131
135
  generateMessageTag: () => string;
132
- query: (node: import("..").BinaryNode, timeoutMs?: number) => Promise<any>;
133
- waitForMessage: <T>(msgId: string, timeoutMs?: number | undefined) => Promise<any>;
136
+ query: (node: import("../index").BinaryNode, timeoutMs?: number | undefined) => Promise<import("../index").BinaryNode>;
137
+ waitForMessage: <T_2>(msgId: string, timeoutMs?: number | undefined) => Promise<T_2>;
134
138
  waitForSocketOpen: () => Promise<void>;
135
139
  sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>;
136
- sendNode: (frame: import("..").BinaryNode) => Promise<void>;
137
- logout: (msg?: string) => Promise<void>;
140
+ sendNode: (frame: import("../index").BinaryNode) => Promise<void>;
141
+ logout: (msg?: string | undefined) => Promise<void>;
138
142
  end: (error: Error | undefined) => void;
139
- onUnexpectedError: (err: Error | import("@hapi/boom").Boom, msg: string) => void;
143
+ onUnexpectedError: (err: Error | import("@hapi/boom").Boom<any>, msg: string) => void;
140
144
  uploadPreKeys: (count?: number) => Promise<void>;
141
145
  uploadPreKeysToServerIfRequired: () => Promise<void>;
142
146
  requestPairingCode: (phoneNumber: string) => Promise<string>;
143
- waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => Promise<boolean | undefined>, timeoutMs?: number) => Promise<void>;
144
- sendWAMBuffer: (wamBuffer: Buffer) => Promise<any>;
147
+ waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined, timeoutMs?: number | undefined) => Promise<void>;
148
+ sendWAMBuffer: (wamBuffer: Buffer) => Promise<import("../index").BinaryNode>;
145
149
  };
146
150
  export default makeWASocket;
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const Defaults_1 = require("../Defaults");
4
- const business_1 = require("./business");
4
+ const registration_1 = require("./registration");
5
5
  // export the last socket layer
6
- const makeWASocket = (config) => ((0, business_1.makeBusinessSocket)({
6
+ const makeWASocket = (config) => ((0, registration_1.makeRegistrationSocket)({
7
7
  ...Defaults_1.DEFAULT_CONNECTION_CONFIG,
8
8
  ...config
9
9
  }));
@@ -1,27 +1,29 @@
1
+ /// <reference types="node" />
1
2
  import { Boom } from '@hapi/boom';
2
- import Long = require('long');
3
3
  import { proto } from '../../WAProto';
4
4
  import { MessageReceiptType, MessageRelayOptions, SocketConfig, WAMessageKey } from '../Types';
5
5
  import { BinaryNode } from '../WABinary';
6
6
  export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
7
- sendMessageAck: ({ tag, attrs, content }: BinaryNode, errorCode?: number) => Promise<void>;
7
+ sendMessageAck: ({ tag, attrs, content }: BinaryNode) => Promise<void>;
8
8
  sendRetryRequest: (node: BinaryNode, forceIncludeKeys?: boolean) => Promise<void>;
9
9
  rejectCall: (callId: string, callFrom: string) => Promise<void>;
10
10
  fetchMessageHistory: (count: number, oldestMsgKey: WAMessageKey, oldestMsgTimestamp: number | Long) => Promise<string>;
11
- requestPlaceholderResend: (messageKey: WAMessageKey) => Promise<string | undefined>;
12
- getPrivacyTokens: (jids: string[]) => Promise<any>;
11
+ requestPlaceholderResend: (messageKey: WAMessageKey) => Promise<'RESOLVED' | string | undefined>;
12
+ getPrivacyTokens: (jids: string[]) => Promise<BinaryNode>;
13
13
  assertSessions: (jids: string[], force: boolean) => Promise<boolean>;
14
14
  relayMessage: (jid: string, message: proto.IMessage, { messageId: msgId, participant, additionalAttributes, additionalNodes, useUserDevicesCache, useCachedGroupMetadata, statusJidList }: MessageRelayOptions) => Promise<string>;
15
15
  sendReceipt: (jid: string, participant: string | undefined, messageIds: string[], type: MessageReceiptType) => Promise<void>;
16
- sendReceipts: (keys: WAMessageKey[], type: MessageReceiptType) => Promise<void>;
17
- readMessages: (keys: WAMessageKey[]) => Promise<void>;
16
+ sendReceipts: (keys: proto.IMessageKey[], type: MessageReceiptType) => Promise<void>;
17
+ readMessages: (keys: proto.IMessageKey[]) => Promise<void>;
18
18
  refreshMediaConn: (forceGet?: boolean) => Promise<import("../Types").MediaConnInfo>;
19
19
  waUploadToServer: import("../Types").WAMediaUploadFunction;
20
20
  fetchPrivacySettings: (force?: boolean) => Promise<{
21
21
  [_: string]: string;
22
22
  }>;
23
23
  sendPeerDataOperationMessage: (pdoMessage: proto.Message.IPeerDataOperationRequestMessage) => Promise<string>;
24
- createParticipantNodes: (jids: string[], message: proto.IMessage, extraAttrs?: BinaryNode["attrs"]) => Promise<{
24
+ createParticipantNodes: (jids: string[], message: proto.IMessage, extraAttrs?: {
25
+ [key: string]: string;
26
+ } | undefined) => Promise<{
25
27
  nodes: BinaryNode[];
26
28
  shouldIncludeDeviceIdentity: boolean;
27
29
  }>;
@@ -35,7 +37,7 @@ export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
35
37
  groupRequestParticipantsList: (jid: string) => Promise<{
36
38
  [key: string]: string;
37
39
  }[]>;
38
- groupRequestParticipantsUpdate: (jid: string, participants: string[], action: "approve" | "reject") => Promise<{
40
+ groupRequestParticipantsUpdate: (jid: string, participants: string[], action: "reject" | "approve") => Promise<{
39
41
  status: string;
40
42
  jid: string;
41
43
  }[]>;
@@ -44,44 +46,43 @@ export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
44
46
  jid: string;
45
47
  content: BinaryNode;
46
48
  }[]>;
47
- groupUpdateDescription: (jid: string, description?: string) => Promise<void>;
49
+ groupUpdateDescription: (jid: string, description?: string | undefined) => Promise<void>;
48
50
  groupInviteCode: (jid: string) => Promise<string | undefined>;
49
51
  groupRevokeInvite: (jid: string) => Promise<string | undefined>;
50
52
  groupAcceptInvite: (code: string) => Promise<string | undefined>;
51
53
  groupRevokeInviteV4: (groupJid: string, invitedJid: string) => Promise<boolean>;
52
- groupAcceptInviteV4: (key: string | proto.IMessageKey, inviteMessage: proto.Message.IGroupInviteMessage) => Promise<any>;
54
+ groupAcceptInviteV4: (key: string | proto.IMessageKey, inviteMessage: proto.Message.IGroupInviteMessage) => Promise<string>;
53
55
  groupGetInviteInfo: (code: string) => Promise<import("../Types").GroupMetadata>;
54
56
  groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
55
- groupSettingUpdate: (jid: string, setting: "announcement" | "not_announcement" | "locked" | "unlocked") => Promise<void>;
56
- groupMemberAddMode: (jid: string, mode: "admin_add" | "all_member_add") => Promise<void>;
57
+ groupSettingUpdate: (jid: string, setting: "announcement" | "locked" | "not_announcement" | "unlocked") => Promise<void>;
58
+ groupMemberAddMode: (jid: string, mode: "all_member_add" | "admin_add") => Promise<void>;
57
59
  groupJoinApprovalMode: (jid: string, mode: "on" | "off") => Promise<void>;
58
60
  groupFetchAllParticipating: () => Promise<{
59
61
  [_: string]: import("../Types").GroupMetadata;
60
62
  }>;
61
- getBotListV2: () => Promise<import("../Types").BotListInfo[]>;
62
63
  processingMutex: {
63
- mutex<T>(code: () => Promise<T> | T): Promise<T>;
64
+ mutex<T>(code: () => T | Promise<T>): Promise<T>;
64
65
  };
65
66
  upsertMessage: (msg: proto.IWebMessageInfo, type: import("../Types").MessageUpsertType) => Promise<void>;
66
67
  appPatch: (patchCreate: import("../Types").WAPatchCreate) => Promise<void>;
67
- sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string) => Promise<void>;
68
- presenceSubscribe: (toJid: string, tcToken?: Buffer) => Promise<void>;
69
- profilePictureUrl: (jid: string, type?: "preview" | "image", timeoutMs?: number) => Promise<string | undefined>;
68
+ sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string | undefined) => Promise<void>;
69
+ presenceSubscribe: (toJid: string, tcToken?: Buffer | undefined) => Promise<void>;
70
+ profilePictureUrl: (jid: string, type?: "image" | "preview", timeoutMs?: number | undefined) => Promise<string | undefined>;
70
71
  onWhatsApp: (...jids: string[]) => Promise<{
72
+ exists: boolean;
71
73
  jid: string;
72
- exists: unknown;
73
- lid: unknown;
74
- }[] | undefined>;
74
+ }[]>;
75
75
  fetchBlocklist: () => Promise<string[]>;
76
- fetchStatus: (...jids: string[]) => Promise<import("..").USyncQueryResultList[] | undefined>;
77
- fetchDisappearingDuration: (...jids: string[]) => Promise<import("..").USyncQueryResultList[] | undefined>;
76
+ fetchStatus: (jid: string) => Promise<{
77
+ status: string | undefined;
78
+ setAt: Date;
79
+ } | undefined>;
78
80
  updateProfilePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>;
79
81
  removeProfilePicture: (jid: string) => Promise<void>;
80
82
  updateProfileStatus: (status: string) => Promise<void>;
81
83
  updateProfileName: (name: string) => Promise<void>;
82
84
  updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise<void>;
83
85
  updateCallPrivacy: (value: import("../Types").WAPrivacyCallValue) => Promise<void>;
84
- updateMessagesPrivacy: (value: import("../Types").WAPrivacyMessagesValue) => Promise<void>;
85
86
  updateLastSeenPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
86
87
  updateOnlinePrivacy: (value: import("../Types").WAPrivacyOnlineValue) => Promise<void>;
87
88
  updateProfilePicturePrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
@@ -89,10 +90,10 @@ export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
89
90
  updateReadReceiptsPrivacy: (value: import("../Types").WAReadReceiptsValue) => Promise<void>;
90
91
  updateGroupsAddPrivacy: (value: import("../Types").WAPrivacyGroupAddValue) => Promise<void>;
91
92
  updateDefaultDisappearingMode: (duration: number) => Promise<void>;
92
- getBusinessProfile: (jid: string) => Promise<import("../Types").WABusinessProfile | void>;
93
+ getBusinessProfile: (jid: string) => Promise<void | import("../Types").WABusinessProfile>;
93
94
  resyncAppState: (collections: readonly ("critical_block" | "critical_unblock_low" | "regular_high" | "regular_low" | "regular")[], isInitialSync: boolean) => Promise<void>;
94
95
  chatModify: (mod: import("../Types").ChatModification, jid: string) => Promise<void>;
95
- cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: number | string) => Promise<void>;
96
+ cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: string | number | undefined) => Promise<void>;
96
97
  addLabel: (jid: string, labels: import("../Types/Label").LabelActionBody) => Promise<void>;
97
98
  addChatLabel: (jid: string, labelId: string) => Promise<void>;
98
99
  removeChatLabel: (jid: string, labelId: string) => Promise<void>;
@@ -100,16 +101,15 @@ export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
100
101
  removeMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
101
102
  star: (jid: string, messages: {
102
103
  id: string;
103
- fromMe?: boolean;
104
+ fromMe?: boolean | undefined;
104
105
  }[], star: boolean) => Promise<void>;
105
- executeUSyncQuery: (usyncQuery: import("..").USyncQuery) => Promise<import("..").USyncQueryResult | undefined>;
106
106
  type: "md";
107
- ws: import("./Client").WebSocketClient;
107
+ ws: any;
108
108
  ev: import("../Types").BaileysEventEmitter & {
109
- process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): (() => void);
109
+ process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): () => void;
110
110
  buffer(): void;
111
- createBufferedFunction<A extends any[], T>(work: (...args: A) => Promise<T>): ((...args: A) => Promise<T>);
112
- flush(force?: boolean): boolean;
111
+ createBufferedFunction<A extends any[], T_1>(work: (...args: A) => Promise<T_1>): (...args: A) => Promise<T_1>;
112
+ flush(force?: boolean | undefined): boolean;
113
113
  isBuffering(): boolean;
114
114
  };
115
115
  authState: {
@@ -119,17 +119,17 @@ export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
119
119
  signalRepository: import("../Types").SignalRepository;
120
120
  user: import("../Types").Contact | undefined;
121
121
  generateMessageTag: () => string;
122
- query: (node: BinaryNode, timeoutMs?: number) => Promise<any>;
123
- waitForMessage: <T>(msgId: string, timeoutMs?: number | undefined) => Promise<any>;
122
+ query: (node: BinaryNode, timeoutMs?: number | undefined) => Promise<BinaryNode>;
123
+ waitForMessage: <T_2>(msgId: string, timeoutMs?: number | undefined) => Promise<T_2>;
124
124
  waitForSocketOpen: () => Promise<void>;
125
125
  sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>;
126
126
  sendNode: (frame: BinaryNode) => Promise<void>;
127
- logout: (msg?: string) => Promise<void>;
127
+ logout: (msg?: string | undefined) => Promise<void>;
128
128
  end: (error: Error | undefined) => void;
129
- onUnexpectedError: (err: Error | Boom, msg: string) => void;
129
+ onUnexpectedError: (err: Error | Boom<any>, msg: string) => void;
130
130
  uploadPreKeys: (count?: number) => Promise<void>;
131
131
  uploadPreKeysToServerIfRequired: () => Promise<void>;
132
132
  requestPairingCode: (phoneNumber: string) => Promise<string>;
133
- waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => Promise<boolean | undefined>, timeoutMs?: number) => Promise<void>;
134
- sendWAMBuffer: (wamBuffer: Buffer) => Promise<any>;
133
+ waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined, timeoutMs?: number | undefined) => Promise<void>;
134
+ sendWAMBuffer: (wamBuffer: Buffer) => Promise<BinaryNode>;
135
135
  };