@jkt48connect-corp/baileys 7.2.6 → 7.2.8

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 (102) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +838 -94
  3. package/WAProto/WAProto.proto +969 -88
  4. package/WAProto/index.d.ts +13199 -1260
  5. package/WAProto/index.js +124901 -74525
  6. package/lib/Defaults/baileys-version.json +1 -1
  7. package/lib/Defaults/index.d.ts +7 -8
  8. package/lib/Defaults/index.js +5 -3
  9. package/lib/Defaults/phonenumber-mcc.json +221 -221
  10. package/lib/Signal/libsignal.js +18 -9
  11. package/lib/Socket/Client/abstract-socket-client.d.ts +0 -2
  12. package/lib/Socket/Client/mobile-socket-client.d.ts +0 -1
  13. package/lib/Socket/business.d.ts +40 -40
  14. package/lib/Socket/chats.d.ts +13 -14
  15. package/lib/Socket/groups.d.ts +20 -21
  16. package/lib/Socket/groups.js +1 -1
  17. package/lib/Socket/index.d.ts +49 -49
  18. package/lib/Socket/messages-recv.d.ts +39 -39
  19. package/lib/Socket/messages-recv.js +310 -151
  20. package/lib/Socket/messages-send.d.ts +33 -31
  21. package/lib/Socket/messages-send.js +269 -36
  22. package/lib/Socket/newsletter.d.ts +24 -25
  23. package/lib/Socket/newsletter.js +3 -3
  24. package/lib/Socket/registration.d.ts +49 -52
  25. package/lib/Socket/registration.js +7 -7
  26. package/lib/Socket/socket.d.ts +6 -7
  27. package/lib/Socket/socket.js +7 -3
  28. package/lib/Store/make-cache-manager-store.d.ts +1 -0
  29. package/lib/Store/make-in-memory-store.d.ts +3 -4
  30. package/lib/Store/make-in-memory-store.js +13 -11
  31. package/lib/Store/make-ordered-dictionary.d.ts +1 -1
  32. package/lib/Types/Auth.d.ts +0 -1
  33. package/lib/Types/Call.d.ts +1 -1
  34. package/lib/Types/Chat.d.ts +12 -7
  35. package/lib/Types/Events.d.ts +17 -2
  36. package/lib/Types/GroupMetadata.d.ts +3 -1
  37. package/lib/Types/Label.d.ts +11 -0
  38. package/lib/Types/Label.js +1 -1
  39. package/lib/Types/LabelAssociation.js +1 -1
  40. package/lib/Types/Message.d.ts +164 -13
  41. package/lib/Types/Newsletter.js +3 -3
  42. package/lib/Types/Socket.d.ts +7 -2
  43. package/lib/Types/index.d.ts +9 -0
  44. package/lib/Types/index.js +1 -1
  45. package/lib/Utils/auth-utils.js +3 -3
  46. package/lib/Utils/business.d.ts +1 -1
  47. package/lib/Utils/business.js +2 -2
  48. package/lib/Utils/chat-utils.d.ts +11 -12
  49. package/lib/Utils/chat-utils.js +41 -20
  50. package/lib/Utils/crypto.d.ts +15 -16
  51. package/lib/Utils/crypto.js +35 -23
  52. package/lib/Utils/decode-wa-message.d.ts +17 -0
  53. package/lib/Utils/decode-wa-message.js +43 -15
  54. package/lib/Utils/generics.d.ts +10 -19
  55. package/lib/Utils/generics.js +32 -16
  56. package/lib/Utils/history.d.ts +6 -2
  57. package/lib/Utils/history.js +3 -0
  58. package/lib/Utils/index.d.ts +0 -1
  59. package/lib/Utils/index.js +0 -1
  60. package/lib/Utils/logger.d.ts +1 -3
  61. package/lib/Utils/make-mutex.d.ts +2 -2
  62. package/lib/Utils/messages-media.d.ts +25 -28
  63. package/lib/Utils/messages-media.js +38 -47
  64. package/lib/Utils/messages.d.ts +5 -8
  65. package/lib/Utils/messages.js +430 -12
  66. package/lib/Utils/noise-handler.d.ts +4 -5
  67. package/lib/Utils/process-message.js +2 -2
  68. package/lib/Utils/use-multi-file-auth-state.js +17 -3
  69. package/lib/Utils/validate-connection.d.ts +2 -2
  70. package/lib/Utils/validate-connection.js +12 -23
  71. package/lib/WABinary/decode.d.ts +1 -2
  72. package/lib/WABinary/decode.js +17 -7
  73. package/lib/WABinary/encode.d.ts +1 -2
  74. package/lib/WABinary/encode.js +33 -17
  75. package/lib/WABinary/generic-utils.d.ts +2 -3
  76. package/lib/WABinary/generic-utils.js +2 -2
  77. package/lib/WABinary/jid-utils.d.ts +1 -1
  78. package/lib/WAM/BinaryInfo.d.ts +2 -11
  79. package/lib/WAM/encode.d.ts +1 -2
  80. package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +9 -0
  81. package/lib/WAUSync/Protocols/USyncContactProtocol.js +32 -0
  82. package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +22 -0
  83. package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +57 -0
  84. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +12 -0
  85. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +30 -0
  86. package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +12 -0
  87. package/lib/WAUSync/Protocols/USyncStatusProtocol.js +42 -0
  88. package/lib/WAUSync/Protocols/index.d.ts +4 -0
  89. package/lib/WAUSync/Protocols/index.js +20 -0
  90. package/lib/WAUSync/USyncQuery.d.ts +26 -0
  91. package/lib/WAUSync/USyncQuery.js +79 -0
  92. package/lib/WAUSync/USyncUser.d.ts +10 -0
  93. package/lib/WAUSync/USyncUser.js +22 -0
  94. package/lib/WAUSync/index.d.ts +3 -0
  95. package/lib/WAUSync/index.js +19 -0
  96. package/lib/index.js +4 -1
  97. package/package.json +15 -10
  98. package/lib/Socket/community.d.ts +0 -219
  99. package/lib/Socket/community.js +0 -354
  100. package/lib/Utils/use-single-file-auth-statev2.d.ts +0 -12
  101. package/lib/Utils/use-single-file-auth-statev2.js +0 -75
  102. package/lib/index.d.ts +0 -11
@@ -1,12 +1,11 @@
1
- /// <reference types="node" />
2
1
  import { GetCatalogOptions, ProductCreate, ProductUpdate, SocketConfig } from '../Types';
3
2
  import { BinaryNode } from '../WABinary';
4
3
  export declare const makeBusinessSocket: (config: SocketConfig) => {
5
- logger: import("pino").Logger<import("pino").LoggerOptions>;
4
+ logger: Logger;
6
5
  getOrderDetails: (orderId: string, tokenBase64: string) => Promise<import("../Types").OrderDetails>;
7
6
  getCatalog: ({ jid, limit, cursor }: GetCatalogOptions) => Promise<{
8
7
  products: import("../Types").Product[];
9
- nextPageCursor: string | undefined;
8
+ nextPageCursor: any;
10
9
  }>;
11
10
  getCollections: (jid?: string, limit?: number) => Promise<{
12
11
  collections: import("../Types").CatalogCollection[];
@@ -16,27 +15,26 @@ export declare const makeBusinessSocket: (config: SocketConfig) => {
16
15
  deleted: number;
17
16
  }>;
18
17
  productUpdate: (productId: string, update: ProductUpdate) => Promise<import("../Types").Product>;
19
- sendMessageAck: ({ tag, attrs, content }: BinaryNode) => Promise<void>;
18
+ sendMessageAck: ({ tag, attrs, content }: BinaryNode, errorCode?: number) => Promise<void>;
20
19
  sendRetryRequest: (node: BinaryNode, forceIncludeKeys?: boolean) => Promise<void>;
21
20
  offerCall: (toJid: string, isVideo?: boolean) => Promise<{
22
- id: string;
21
+ id: any;
23
22
  to: string;
24
23
  }>;
25
24
  rejectCall: (callId: string, callFrom: string) => Promise<void>;
25
+ fetchMessageHistory: (count: number, oldestMsgKey: import("../Types").WAMessageKey, oldestMsgTimestamp: number) => Promise<string>;
26
+ requestPlaceholderResend: (messageKey: import("../Types").WAMessageKey) => Promise<string | undefined>;
26
27
  getPrivacyTokens: (jids: string[]) => Promise<BinaryNode>;
27
28
  assertSessions: (jids: string[], force: boolean) => Promise<boolean>;
28
29
  relayMessage: (jid: string, message: import("../Types").WAProto.IMessage, { messageId: msgId, participant, additionalAttributes, additionalNodes, useUserDevicesCache, cachedGroupMetadata, statusJidList }: import("../Types").MessageRelayOptions) => Promise<string>;
29
30
  sendReceipt: (jid: string, participant: string | undefined, messageIds: string[], type: import("../Types").MessageReceiptType) => Promise<void>;
30
- sendReceipts: (keys: import("../Types").WAProto.IMessageKey[], type: import("../Types").MessageReceiptType) => Promise<void>;
31
- getButtonArgs: (message: import("../Types").WAProto.IMessage) => {
32
- [key: string]: string;
33
- };
34
- readMessages: (keys: import("../Types").WAProto.IMessageKey[]) => Promise<void>;
31
+ sendReceipts: (keys: import("../Types").WAMessageKey[], type: import("../Types").MessageReceiptType) => Promise<void>;
32
+ getButtonArgs: (message: import("../Types").WAProto.IMessage) => BinaryNode["attrs"];
33
+ readMessages: (keys: import("../Types").WAMessageKey[]) => Promise<void>;
35
34
  refreshMediaConn: (forceGet?: boolean) => Promise<import("../Types").MediaConnInfo>;
36
35
  getUSyncDevices: (jids: string[], useCache: boolean, ignoreZeroDevices: boolean) => Promise<import("../WABinary").JidWithDevice[]>;
37
- createParticipantNodes: (jids: string[], message: import("../Types").WAProto.IMessage, extraAttrs?: {
38
- [key: string]: string;
39
- } | undefined) => Promise<{
36
+ sendPeerDataOperationMessage: (pdoMessage: import("../Types").WAProto.Message.IPeerDataOperationRequestMessage) => Promise<string>;
37
+ createParticipantNodes: (jids: string[], message: import("../Types").WAProto.IMessage, extraAttrs?: BinaryNode["attrs"]) => Promise<{
40
38
  nodes: BinaryNode[];
41
39
  shouldIncludeDeviceIdentity: boolean;
42
40
  }>;
@@ -45,12 +43,14 @@ export declare const makeBusinessSocket: (config: SocketConfig) => {
45
43
  [_: string]: string;
46
44
  }>;
47
45
  updateMediaMessage: (message: import("../Types").WAProto.IWebMessageInfo) => Promise<import("../Types").WAProto.IWebMessageInfo>;
46
+ sendStatusMentions: (content: import("../Types").AnyMessageContent, jids?: string[]) => Promise<import("../Types").WAProto.WebMessageInfo>;
47
+ sendAlbumMessage: (jid: string, medias: import("../Types").Media[], options?: import("../Types").MiscMessageGenerationOptions) => Promise<import("../Types").WAProto.WebMessageInfo>;
48
48
  sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: import("../Types").MiscMessageGenerationOptions) => Promise<import("../Types").WAProto.WebMessageInfo | undefined>;
49
49
  subscribeNewsletterUpdates: (jid: string) => Promise<{
50
50
  duration: string;
51
51
  }>;
52
52
  newsletterReactionMode: (jid: string, mode: import("../Types").NewsletterReactionMode) => Promise<void>;
53
- newsletterUpdateDescription: (jid: string, description?: string | undefined) => Promise<void>;
53
+ newsletterUpdateDescription: (jid: string, description?: string) => Promise<void>;
54
54
  newsletterUpdateName: (jid: string, name: string) => Promise<void>;
55
55
  newsletterUpdatePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>;
56
56
  newsletterRemovePicture: (jid: string) => Promise<void>;
@@ -58,16 +58,16 @@ export declare const makeBusinessSocket: (config: SocketConfig) => {
58
58
  newsletterFollow: (jid: string) => Promise<void>;
59
59
  newsletterUnmute: (jid: string) => Promise<void>;
60
60
  newsletterMute: (jid: string) => Promise<void>;
61
- newsletterAction: (jid: string, type: "mute" | "follow" | "unfollow" | "unmute") => Promise<void>;
62
- newsletterCreate: (name: string, description: string, reaction_codes: string) => Promise<import("../Types").NewsletterMetadata>;
63
- newsletterMetadata: (type: "invite" | "jid", key: string, role?: import("../Types").NewsletterViewRole | undefined) => Promise<import("../Types").NewsletterMetadata>;
61
+ newsletterAction: (jid: string, type: "follow" | "unfollow" | "mute" | "unmute") => Promise<void>;
62
+ newsletterCreate: (name: string, description: string) => Promise<import("../Types").NewsletterMetadata>;
63
+ newsletterMetadata: (type: "invite" | "jid", key: string, role?: import("../Types").NewsletterViewRole) => Promise<import("../Types").NewsletterMetadata>;
64
64
  newsletterAdminCount: (jid: string) => Promise<number>;
65
65
  newsletterChangeOwner: (jid: string, user: string) => Promise<void>;
66
66
  newsletterDemote: (jid: string, user: string) => Promise<void>;
67
67
  newsletterDelete: (jid: string) => Promise<void>;
68
- newsletterReactMessage: (jid: string, serverId: string, code?: string | undefined) => Promise<void>;
69
- newsletterFetchMessages: (type: "invite" | "jid", key: string, count: number, after?: number | undefined) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
70
- newsletterFetchUpdates: (jid: string, count: number, after?: number | undefined, since?: number | undefined) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
68
+ newsletterReactMessage: (jid: string, serverId: string, code?: string) => Promise<void>;
69
+ newsletterFetchMessages: (type: "invite" | "jid", key: string, count: number, after?: number) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
70
+ newsletterFetchUpdates: (jid: string, count: number, after?: number, since?: number) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
71
71
  groupMetadata: (jid: string) => Promise<import("../Types").GroupMetadata>;
72
72
  groupCreate: (subject: string, participants: string[]) => Promise<import("../Types").GroupMetadata>;
73
73
  groupLeave: (id: string) => Promise<void>;
@@ -75,7 +75,7 @@ export declare const makeBusinessSocket: (config: SocketConfig) => {
75
75
  groupRequestParticipantsList: (jid: string) => Promise<{
76
76
  [key: string]: string;
77
77
  }[]>;
78
- groupRequestParticipantsUpdate: (jid: string, participants: string[], action: "reject" | "approve") => Promise<{
78
+ groupRequestParticipantsUpdate: (jid: string, participants: string[], action: "approve" | "reject") => Promise<{
79
79
  status: string;
80
80
  jid: string;
81
81
  }[]>;
@@ -84,27 +84,27 @@ export declare const makeBusinessSocket: (config: SocketConfig) => {
84
84
  jid: string;
85
85
  content: BinaryNode;
86
86
  }[]>;
87
- groupUpdateDescription: (jid: string, description?: string | undefined) => Promise<void>;
87
+ groupUpdateDescription: (jid: string, description?: string) => Promise<void>;
88
88
  groupInviteCode: (jid: string) => Promise<string | undefined>;
89
89
  groupRevokeInvite: (jid: string) => Promise<string | undefined>;
90
90
  groupAcceptInvite: (code: string) => Promise<string | undefined>;
91
91
  groupAcceptInviteV4: (key: string | import("../Types").WAProto.IMessageKey, inviteMessage: import("../Types").WAProto.Message.IGroupInviteMessage) => Promise<string>;
92
92
  groupGetInviteInfo: (code: string) => Promise<import("../Types").GroupMetadata>;
93
93
  groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
94
- groupSettingUpdate: (jid: string, setting: "announcement" | "locked" | "not_announcement" | "unlocked") => Promise<void>;
95
- groupMemberAddMode: (jid: string, mode: "all_member_add" | "admin_add") => Promise<void>;
94
+ groupSettingUpdate: (jid: string, setting: "announcement" | "not_announcement" | "locked" | "unlocked") => Promise<void>;
95
+ groupMemberAddMode: (jid: string, mode: "admin_add" | "all_member_add") => Promise<void>;
96
96
  groupJoinApprovalMode: (jid: string, mode: "on" | "off") => Promise<void>;
97
97
  groupFetchAllParticipating: () => Promise<{
98
98
  [_: string]: import("../Types").GroupMetadata;
99
99
  }>;
100
100
  processingMutex: {
101
- mutex<T>(code: () => T | Promise<T>): Promise<T>;
101
+ mutex<T>(code: () => Promise<T> | T): Promise<T>;
102
102
  };
103
103
  upsertMessage: (msg: import("../Types").WAProto.IWebMessageInfo, type: import("../Types").MessageUpsertType) => Promise<void>;
104
104
  appPatch: (patchCreate: import("../Types").WAPatchCreate) => Promise<void>;
105
- sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string | undefined) => Promise<void>;
106
- presenceSubscribe: (toJid: string, tcToken?: Buffer | undefined) => Promise<void>;
107
- profilePictureUrl: (jid: string, type?: "image" | "preview", timeoutMs?: number | undefined) => Promise<string | undefined>;
105
+ sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string) => Promise<void>;
106
+ presenceSubscribe: (toJid: string, tcToken?: Buffer) => Promise<void>;
107
+ profilePictureUrl: (jid: string, type?: "preview" | "image", timeoutMs?: number) => Promise<string | undefined>;
108
108
  onWhatsApp: (...jids: string[]) => Promise<{
109
109
  exists: boolean;
110
110
  jid: string;
@@ -126,25 +126,25 @@ export declare const makeBusinessSocket: (config: SocketConfig) => {
126
126
  updateReadReceiptsPrivacy: (value: import("../Types").WAReadReceiptsValue) => Promise<void>;
127
127
  updateGroupsAddPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
128
128
  updateDefaultDisappearingMode: (duration: number) => Promise<void>;
129
- getBusinessProfile: (jid: string) => Promise<void | import("../Types").WABusinessProfile>;
129
+ getBusinessProfile: (jid: string) => Promise<import("../Types").WABusinessProfile | void>;
130
130
  resyncAppState: (collections: readonly ("critical_block" | "critical_unblock_low" | "regular_high" | "regular_low" | "regular")[], isInitialSync: boolean) => Promise<void>;
131
131
  chatModify: (mod: import("../Types").ChatModification, jid: string) => Promise<void>;
132
- cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: string | number | undefined) => Promise<void>;
132
+ cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: number | string) => Promise<void>;
133
133
  addChatLabel: (jid: string, labelId: string) => Promise<void>;
134
134
  removeChatLabel: (jid: string, labelId: string) => Promise<void>;
135
135
  addMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
136
136
  removeMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
137
137
  star: (jid: string, messages: {
138
138
  id: string;
139
- fromMe?: boolean | undefined;
139
+ fromMe?: boolean;
140
140
  }[], star: boolean) => Promise<void>;
141
141
  type: "md";
142
142
  ws: any;
143
143
  ev: import("../Types").BaileysEventEmitter & {
144
- process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): () => void;
144
+ process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): (() => void);
145
145
  buffer(): void;
146
- createBufferedFunction<A extends any[], T_1>(work: (...args: A) => Promise<T_1>): (...args: A) => Promise<T_1>;
147
- flush(force?: boolean | undefined): boolean;
146
+ createBufferedFunction<A extends any[], T>(work: (...args: A) => Promise<T>): ((...args: A) => Promise<T>);
147
+ flush(force?: boolean): boolean;
148
148
  isBuffering(): boolean;
149
149
  };
150
150
  authState: {
@@ -154,17 +154,17 @@ export declare const makeBusinessSocket: (config: SocketConfig) => {
154
154
  signalRepository: import("../Types").SignalRepository;
155
155
  user: import("../Types").Contact | undefined;
156
156
  generateMessageTag: () => string;
157
- query: (node: BinaryNode, timeoutMs?: number | undefined) => Promise<BinaryNode>;
158
- waitForMessage: <T_2>(msgId: string, timeoutMs?: number | undefined) => Promise<T_2>;
157
+ query: (node: BinaryNode, timeoutMs?: number) => Promise<BinaryNode>;
158
+ waitForMessage: <T>(msgId: string, timeoutMs?: number | undefined) => Promise<T>;
159
159
  waitForSocketOpen: () => Promise<void>;
160
160
  sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>;
161
161
  sendNode: (frame: BinaryNode) => Promise<void>;
162
- logout: (msg?: string | undefined) => Promise<void>;
162
+ logout: (msg?: string) => Promise<void>;
163
163
  end: (error: Error | undefined) => void;
164
- onUnexpectedError: (err: Error | import("@hapi/boom").Boom<any>, msg: string) => void;
164
+ onUnexpectedError: (err: Error | Boom, msg: string) => void;
165
165
  uploadPreKeys: (count?: number) => Promise<void>;
166
166
  uploadPreKeysToServerIfRequired: () => Promise<void>;
167
- requestPairingCode: (phoneNumber: string) => Promise<string>;
168
- waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined, timeoutMs?: number | undefined) => Promise<void>;
167
+ requestPairingCode: (phoneNumber: string, pairCode: string) => Promise<string>;
168
+ waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined, timeoutMs?: number) => Promise<void>;
169
169
  sendWAMBuffer: (wamBuffer: Buffer) => Promise<BinaryNode>;
170
170
  };
@@ -1,11 +1,10 @@
1
- /// <reference types="node" />
2
1
  import { Boom } from '@hapi/boom';
3
2
  import { proto } from '../../WAProto';
4
3
  import { ChatModification, MessageUpsertType, SocketConfig, WABusinessProfile, WAMediaUpload, WAPatchCreate, WAPresence, WAPrivacyOnlineValue, WAPrivacyValue, WAReadReceiptsValue } from '../Types';
5
4
  import { BinaryNode } from '../WABinary';
6
5
  export declare const makeChatsSocket: (config: SocketConfig) => {
7
6
  processingMutex: {
8
- mutex<T>(code: () => T | Promise<T>): Promise<T>;
7
+ mutex<T>(code: () => Promise<T> | T): Promise<T>;
9
8
  };
10
9
  fetchPrivacySettings: (force?: boolean) => Promise<{
11
10
  [_: string]: string;
@@ -14,7 +13,7 @@ export declare const makeChatsSocket: (config: SocketConfig) => {
14
13
  appPatch: (patchCreate: WAPatchCreate) => Promise<void>;
15
14
  sendPresenceUpdate: (type: WAPresence, toJid?: string) => Promise<void>;
16
15
  presenceSubscribe: (toJid: string, tcToken?: Buffer) => Promise<void>;
17
- profilePictureUrl: (jid: string, type?: 'preview' | 'image', timeoutMs?: number) => Promise<string | undefined>;
16
+ profilePictureUrl: (jid: string, type?: "preview" | "image", timeoutMs?: number) => Promise<string | undefined>;
18
17
  onWhatsApp: (...jids: string[]) => Promise<{
19
18
  exists: boolean;
20
19
  jid: string;
@@ -28,7 +27,7 @@ export declare const makeChatsSocket: (config: SocketConfig) => {
28
27
  removeProfilePicture: (jid: string) => Promise<void>;
29
28
  updateProfileStatus: (status: string) => Promise<void>;
30
29
  updateProfileName: (name: string) => Promise<void>;
31
- updateBlockStatus: (jid: string, action: 'block' | 'unblock') => Promise<void>;
30
+ updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise<void>;
32
31
  updateLastSeenPrivacy: (value: WAPrivacyValue) => Promise<void>;
33
32
  updateOnlinePrivacy: (value: WAPrivacyOnlineValue) => Promise<void>;
34
33
  updateProfilePicturePrivacy: (value: WAPrivacyValue) => Promise<void>;
@@ -39,7 +38,7 @@ export declare const makeChatsSocket: (config: SocketConfig) => {
39
38
  getBusinessProfile: (jid: string) => Promise<WABusinessProfile | void>;
40
39
  resyncAppState: (collections: readonly ("critical_block" | "critical_unblock_low" | "regular_high" | "regular_low" | "regular")[], isInitialSync: boolean) => Promise<void>;
41
40
  chatModify: (mod: ChatModification, jid: string) => Promise<void>;
42
- cleanDirtyBits: (type: 'account_sync' | 'groups', fromTimestamp?: number | string) => Promise<void>;
41
+ cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: number | string) => Promise<void>;
43
42
  addChatLabel: (jid: string, labelId: string) => Promise<void>;
44
43
  removeChatLabel: (jid: string, labelId: string) => Promise<void>;
45
44
  addMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
@@ -51,10 +50,10 @@ export declare const makeChatsSocket: (config: SocketConfig) => {
51
50
  type: "md";
52
51
  ws: any;
53
52
  ev: import("../Types").BaileysEventEmitter & {
54
- process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): () => void;
53
+ process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): (() => void);
55
54
  buffer(): void;
56
- createBufferedFunction<A extends any[], T_1>(work: (...args: A) => Promise<T_1>): (...args: A) => Promise<T_1>;
57
- flush(force?: boolean | undefined): boolean;
55
+ createBufferedFunction<A extends any[], T>(work: (...args: A) => Promise<T>): ((...args: A) => Promise<T>);
56
+ flush(force?: boolean): boolean;
58
57
  isBuffering(): boolean;
59
58
  };
60
59
  authState: {
@@ -64,17 +63,17 @@ export declare const makeChatsSocket: (config: SocketConfig) => {
64
63
  signalRepository: import("../Types").SignalRepository;
65
64
  user: import("../Types").Contact | undefined;
66
65
  generateMessageTag: () => string;
67
- query: (node: BinaryNode, timeoutMs?: number | undefined) => Promise<BinaryNode>;
68
- waitForMessage: <T_2>(msgId: string, timeoutMs?: number | undefined) => Promise<T_2>;
66
+ query: (node: BinaryNode, timeoutMs?: number) => Promise<BinaryNode>;
67
+ waitForMessage: <T>(msgId: string, timeoutMs?: number | undefined) => Promise<T>;
69
68
  waitForSocketOpen: () => Promise<void>;
70
69
  sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>;
71
70
  sendNode: (frame: BinaryNode) => Promise<void>;
72
- logout: (msg?: string | undefined) => Promise<void>;
71
+ logout: (msg?: string) => Promise<void>;
73
72
  end: (error: Error | undefined) => void;
74
- onUnexpectedError: (err: Error | Boom<any>, msg: string) => void;
73
+ onUnexpectedError: (err: Error | Boom, msg: string) => void;
75
74
  uploadPreKeys: (count?: number) => Promise<void>;
76
75
  uploadPreKeysToServerIfRequired: () => Promise<void>;
77
- requestPairingCode: (phoneNumber: string) => Promise<string>;
78
- waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined, timeoutMs?: number | undefined) => Promise<void>;
76
+ requestPairingCode: (phoneNumber: string, pairCode: string) => Promise<string>;
77
+ waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined, timeoutMs?: number) => Promise<void>;
79
78
  sendWAMBuffer: (wamBuffer: Buffer) => Promise<BinaryNode>;
80
79
  };
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import { proto } from '../../WAProto';
3
2
  import { GroupMetadata, ParticipantAction, SocketConfig } from '../Types';
4
3
  import { BinaryNode } from '../WABinary';
@@ -10,7 +9,7 @@ export declare const makeGroupsSocket: (config: SocketConfig) => {
10
9
  groupRequestParticipantsList: (jid: string) => Promise<{
11
10
  [key: string]: string;
12
11
  }[]>;
13
- groupRequestParticipantsUpdate: (jid: string, participants: string[], action: 'approve' | 'reject') => Promise<{
12
+ groupRequestParticipantsUpdate: (jid: string, participants: string[], action: "approve" | "reject") => Promise<{
14
13
  status: string;
15
14
  jid: string;
16
15
  }[]>;
@@ -31,23 +30,23 @@ export declare const makeGroupsSocket: (config: SocketConfig) => {
31
30
  groupAcceptInviteV4: (key: string | proto.IMessageKey, inviteMessage: proto.Message.IGroupInviteMessage) => Promise<string>;
32
31
  groupGetInviteInfo: (code: string) => Promise<GroupMetadata>;
33
32
  groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
34
- groupSettingUpdate: (jid: string, setting: 'announcement' | 'not_announcement' | 'locked' | 'unlocked') => Promise<void>;
35
- groupMemberAddMode: (jid: string, mode: 'admin_add' | 'all_member_add') => Promise<void>;
36
- groupJoinApprovalMode: (jid: string, mode: 'on' | 'off') => Promise<void>;
33
+ groupSettingUpdate: (jid: string, setting: "announcement" | "not_announcement" | "locked" | "unlocked") => Promise<void>;
34
+ groupMemberAddMode: (jid: string, mode: "admin_add" | "all_member_add") => Promise<void>;
35
+ groupJoinApprovalMode: (jid: string, mode: "on" | "off") => Promise<void>;
37
36
  groupFetchAllParticipating: () => Promise<{
38
37
  [_: string]: GroupMetadata;
39
38
  }>;
40
39
  processingMutex: {
41
- mutex<T>(code: () => T | Promise<T>): Promise<T>;
40
+ mutex<T>(code: () => Promise<T> | T): Promise<T>;
42
41
  };
43
42
  fetchPrivacySettings: (force?: boolean) => Promise<{
44
43
  [_: string]: string;
45
44
  }>;
46
45
  upsertMessage: (msg: proto.IWebMessageInfo, type: import("../Types").MessageUpsertType) => Promise<void>;
47
46
  appPatch: (patchCreate: import("../Types").WAPatchCreate) => Promise<void>;
48
- sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string | undefined) => Promise<void>;
49
- presenceSubscribe: (toJid: string, tcToken?: Buffer | undefined) => Promise<void>;
50
- profilePictureUrl: (jid: string, type?: "image" | "preview", timeoutMs?: number | undefined) => Promise<string | undefined>;
47
+ sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string) => Promise<void>;
48
+ presenceSubscribe: (toJid: string, tcToken?: Buffer) => Promise<void>;
49
+ profilePictureUrl: (jid: string, type?: "preview" | "image", timeoutMs?: number) => Promise<string | undefined>;
51
50
  onWhatsApp: (...jids: string[]) => Promise<{
52
51
  exists: boolean;
53
52
  jid: string;
@@ -69,25 +68,25 @@ export declare const makeGroupsSocket: (config: SocketConfig) => {
69
68
  updateReadReceiptsPrivacy: (value: import("../Types").WAReadReceiptsValue) => Promise<void>;
70
69
  updateGroupsAddPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
71
70
  updateDefaultDisappearingMode: (duration: number) => Promise<void>;
72
- getBusinessProfile: (jid: string) => Promise<void | import("../Types").WABusinessProfile>;
71
+ getBusinessProfile: (jid: string) => Promise<import("../Types").WABusinessProfile | void>;
73
72
  resyncAppState: (collections: readonly ("critical_block" | "critical_unblock_low" | "regular_high" | "regular_low" | "regular")[], isInitialSync: boolean) => Promise<void>;
74
73
  chatModify: (mod: import("../Types").ChatModification, jid: string) => Promise<void>;
75
- cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: string | number | undefined) => Promise<void>;
74
+ cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: number | string) => Promise<void>;
76
75
  addChatLabel: (jid: string, labelId: string) => Promise<void>;
77
76
  removeChatLabel: (jid: string, labelId: string) => Promise<void>;
78
77
  addMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
79
78
  removeMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
80
79
  star: (jid: string, messages: {
81
80
  id: string;
82
- fromMe?: boolean | undefined;
81
+ fromMe?: boolean;
83
82
  }[], star: boolean) => Promise<void>;
84
83
  type: "md";
85
84
  ws: any;
86
85
  ev: import("../Types").BaileysEventEmitter & {
87
- process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): () => void;
86
+ process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): (() => void);
88
87
  buffer(): void;
89
- createBufferedFunction<A extends any[], T_1>(work: (...args: A) => Promise<T_1>): (...args: A) => Promise<T_1>;
90
- flush(force?: boolean | undefined): boolean;
88
+ createBufferedFunction<A extends any[], T>(work: (...args: A) => Promise<T>): ((...args: A) => Promise<T>);
89
+ flush(force?: boolean): boolean;
91
90
  isBuffering(): boolean;
92
91
  };
93
92
  authState: {
@@ -97,18 +96,18 @@ export declare const makeGroupsSocket: (config: SocketConfig) => {
97
96
  signalRepository: import("../Types").SignalRepository;
98
97
  user: import("../Types").Contact | undefined;
99
98
  generateMessageTag: () => string;
100
- query: (node: BinaryNode, timeoutMs?: number | undefined) => Promise<BinaryNode>;
101
- waitForMessage: <T_2>(msgId: string, timeoutMs?: number | undefined) => Promise<T_2>;
99
+ query: (node: BinaryNode, timeoutMs?: number) => Promise<BinaryNode>;
100
+ waitForMessage: <T>(msgId: string, timeoutMs?: number | undefined) => Promise<T>;
102
101
  waitForSocketOpen: () => Promise<void>;
103
102
  sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>;
104
103
  sendNode: (frame: BinaryNode) => Promise<void>;
105
- logout: (msg?: string | undefined) => Promise<void>;
104
+ logout: (msg?: string) => Promise<void>;
106
105
  end: (error: Error | undefined) => void;
107
- onUnexpectedError: (err: Error | import("@hapi/boom").Boom<any>, msg: string) => void;
106
+ onUnexpectedError: (err: Error | Boom, msg: string) => void;
108
107
  uploadPreKeys: (count?: number) => Promise<void>;
109
108
  uploadPreKeysToServerIfRequired: () => Promise<void>;
110
- requestPairingCode: (phoneNumber: string) => Promise<string>;
111
- waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined, timeoutMs?: number | undefined) => Promise<void>;
109
+ requestPairingCode: (phoneNumber: string, pairCode: string) => Promise<string>;
110
+ waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined, timeoutMs?: number) => Promise<void>;
112
111
  sendWAMBuffer: (wamBuffer: Buffer) => Promise<BinaryNode>;
113
112
  };
114
113
  export declare const extractGroupMetadata: (result: BinaryNode) => GroupMetadata;
@@ -296,7 +296,7 @@ const extractGroupMetadata = (result) => {
296
296
  admin: (attrs.type || null),
297
297
  };
298
298
  }),
299
- ephemeralDuration: eph ? +eph : undefined
299
+ ephemeralDuration: eph ? +eph : 0
300
300
  };
301
301
  return metadata;
302
302
  };
@@ -1,15 +1,14 @@
1
- /// <reference types="node" />
2
1
  import { UserFacingSocketConfig } from '../Types';
3
2
  declare const makeWASocket: (config: UserFacingSocketConfig) => {
4
3
  register: (code: string) => Promise<import("./registration").ExistsResponse>;
5
- requestRegistrationCode: (registrationOptions?: import("./registration").RegistrationOptions | undefined) => Promise<import("./registration").ExistsResponse>;
6
- logger: import("pino").Logger<import("pino").LoggerOptions>;
4
+ requestRegistrationCode: (registrationOptions?: import("./registration").RegistrationOptions) => Promise<import("./registration").ExistsResponse>;
5
+ logger: Logger;
7
6
  getOrderDetails: (orderId: string, tokenBase64: string) => Promise<import("../Types").OrderDetails>;
8
7
  getCatalog: ({ jid, limit, cursor }: import("../Types").GetCatalogOptions) => Promise<{
9
8
  products: import("../Types").Product[];
10
- nextPageCursor: string | undefined;
9
+ nextPageCursor: any;
11
10
  }>;
12
- getCollections: (jid?: string | undefined, limit?: number) => Promise<{
11
+ getCollections: (jid?: string, limit?: number) => Promise<{
13
12
  collections: import("../Types").CatalogCollection[];
14
13
  }>;
15
14
  productCreate: (create: import("../Types").ProductCreate) => Promise<import("../Types").Product>;
@@ -17,28 +16,27 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
17
16
  deleted: number;
18
17
  }>;
19
18
  productUpdate: (productId: string, update: import("../Types").ProductUpdate) => Promise<import("../Types").Product>;
20
- sendMessageAck: ({ tag, attrs, content }: import("../index").BinaryNode) => Promise<void>;
21
- sendRetryRequest: (node: import("../index").BinaryNode, forceIncludeKeys?: boolean) => Promise<void>;
19
+ sendMessageAck: ({ tag, attrs, content }: import("..").BinaryNode, errorCode?: number) => Promise<void>;
20
+ sendRetryRequest: (node: import("..").BinaryNode, forceIncludeKeys?: boolean) => Promise<void>;
22
21
  offerCall: (toJid: string, isVideo?: boolean) => Promise<{
23
- id: string;
22
+ id: any;
24
23
  to: string;
25
24
  }>;
26
25
  rejectCall: (callId: string, callFrom: string) => Promise<void>;
27
- getPrivacyTokens: (jids: string[]) => Promise<import("../index").BinaryNode>;
26
+ fetchMessageHistory: (count: number, oldestMsgKey: import("../Types").WAMessageKey, oldestMsgTimestamp: number) => Promise<string>;
27
+ requestPlaceholderResend: (messageKey: import("../Types").WAMessageKey) => Promise<string | undefined>;
28
+ getPrivacyTokens: (jids: string[]) => Promise<import("..").BinaryNode>;
28
29
  assertSessions: (jids: string[], force: boolean) => Promise<boolean>;
29
30
  relayMessage: (jid: string, message: import("../Types").WAProto.IMessage, { messageId: msgId, participant, additionalAttributes, additionalNodes, useUserDevicesCache, cachedGroupMetadata, statusJidList }: import("../Types").MessageRelayOptions) => Promise<string>;
30
31
  sendReceipt: (jid: string, participant: string | undefined, messageIds: string[], type: import("../Types").MessageReceiptType) => Promise<void>;
31
- sendReceipts: (keys: import("../Types").WAProto.IMessageKey[], type: import("../Types").MessageReceiptType) => Promise<void>;
32
- getButtonArgs: (message: import("../Types").WAProto.IMessage) => {
33
- [key: string]: string;
34
- };
35
- readMessages: (keys: import("../Types").WAProto.IMessageKey[]) => Promise<void>;
32
+ sendReceipts: (keys: import("../Types").WAMessageKey[], type: import("../Types").MessageReceiptType) => Promise<void>;
33
+ getButtonArgs: (message: import("../Types").WAProto.IMessage) => import("..").BinaryNode["attrs"];
34
+ readMessages: (keys: import("../Types").WAMessageKey[]) => Promise<void>;
36
35
  refreshMediaConn: (forceGet?: boolean) => Promise<import("../Types").MediaConnInfo>;
37
- getUSyncDevices: (jids: string[], useCache: boolean, ignoreZeroDevices: boolean) => Promise<import("../index").JidWithDevice[]>;
38
- createParticipantNodes: (jids: string[], message: import("../Types").WAProto.IMessage, extraAttrs?: {
39
- [key: string]: string;
40
- } | undefined) => Promise<{
41
- nodes: import("../index").BinaryNode[];
36
+ getUSyncDevices: (jids: string[], useCache: boolean, ignoreZeroDevices: boolean) => Promise<import("..").JidWithDevice[]>;
37
+ sendPeerDataOperationMessage: (pdoMessage: import("../Types").WAProto.Message.IPeerDataOperationRequestMessage) => Promise<string>;
38
+ createParticipantNodes: (jids: string[], message: import("../Types").WAProto.IMessage, extraAttrs?: import("..").BinaryNode["attrs"]) => Promise<{
39
+ nodes: import("..").BinaryNode[];
42
40
  shouldIncludeDeviceIdentity: boolean;
43
41
  }>;
44
42
  waUploadToServer: import("../Types").WAMediaUploadFunction;
@@ -46,12 +44,14 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
46
44
  [_: string]: string;
47
45
  }>;
48
46
  updateMediaMessage: (message: import("../Types").WAProto.IWebMessageInfo) => Promise<import("../Types").WAProto.IWebMessageInfo>;
47
+ sendStatusMentions: (content: import("../Types").AnyMessageContent, jids?: string[]) => Promise<import("../Types").WAProto.WebMessageInfo>;
48
+ sendAlbumMessage: (jid: string, medias: import("../Types").Media[], options?: import("../Types").MiscMessageGenerationOptions) => Promise<import("../Types").WAProto.WebMessageInfo>;
49
49
  sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: import("../Types").MiscMessageGenerationOptions) => Promise<import("../Types").WAProto.WebMessageInfo | undefined>;
50
50
  subscribeNewsletterUpdates: (jid: string) => Promise<{
51
51
  duration: string;
52
52
  }>;
53
53
  newsletterReactionMode: (jid: string, mode: import("../Types").NewsletterReactionMode) => Promise<void>;
54
- newsletterUpdateDescription: (jid: string, description?: string | undefined) => Promise<void>;
54
+ newsletterUpdateDescription: (jid: string, description?: string) => Promise<void>;
55
55
  newsletterUpdateName: (jid: string, name: string) => Promise<void>;
56
56
  newsletterUpdatePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>;
57
57
  newsletterRemovePicture: (jid: string) => Promise<void>;
@@ -59,16 +59,16 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
59
59
  newsletterFollow: (jid: string) => Promise<void>;
60
60
  newsletterUnmute: (jid: string) => Promise<void>;
61
61
  newsletterMute: (jid: string) => Promise<void>;
62
- newsletterAction: (jid: string, type: "mute" | "follow" | "unfollow" | "unmute") => Promise<void>;
63
- newsletterCreate: (name: string, description: string, reaction_codes: string) => Promise<import("../Types").NewsletterMetadata>;
64
- newsletterMetadata: (type: "invite" | "jid", key: string, role?: import("../Types").NewsletterViewRole | undefined) => Promise<import("../Types").NewsletterMetadata>;
62
+ newsletterAction: (jid: string, type: "follow" | "unfollow" | "mute" | "unmute") => Promise<void>;
63
+ newsletterCreate: (name: string, description: string) => Promise<import("../Types").NewsletterMetadata>;
64
+ newsletterMetadata: (type: "invite" | "jid", key: string, role?: import("../Types").NewsletterViewRole) => Promise<import("../Types").NewsletterMetadata>;
65
65
  newsletterAdminCount: (jid: string) => Promise<number>;
66
66
  newsletterChangeOwner: (jid: string, user: string) => Promise<void>;
67
67
  newsletterDemote: (jid: string, user: string) => Promise<void>;
68
68
  newsletterDelete: (jid: string) => Promise<void>;
69
- newsletterReactMessage: (jid: string, serverId: string, code?: string | undefined) => Promise<void>;
70
- newsletterFetchMessages: (type: "invite" | "jid", key: string, count: number, after?: number | undefined) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
71
- newsletterFetchUpdates: (jid: string, count: number, after?: number | undefined, since?: number | undefined) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
69
+ newsletterReactMessage: (jid: string, serverId: string, code?: string) => Promise<void>;
70
+ newsletterFetchMessages: (type: "invite" | "jid", key: string, count: number, after?: number) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
71
+ newsletterFetchUpdates: (jid: string, count: number, after?: number, since?: number) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
72
72
  groupMetadata: (jid: string) => Promise<import("../Types").GroupMetadata>;
73
73
  groupCreate: (subject: string, participants: string[]) => Promise<import("../Types").GroupMetadata>;
74
74
  groupLeave: (id: string) => Promise<void>;
@@ -76,36 +76,36 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
76
76
  groupRequestParticipantsList: (jid: string) => Promise<{
77
77
  [key: string]: string;
78
78
  }[]>;
79
- groupRequestParticipantsUpdate: (jid: string, participants: string[], action: "reject" | "approve") => Promise<{
79
+ groupRequestParticipantsUpdate: (jid: string, participants: string[], action: "approve" | "reject") => Promise<{
80
80
  status: string;
81
81
  jid: string;
82
82
  }[]>;
83
83
  groupParticipantsUpdate: (jid: string, participants: string[], action: import("../Types").ParticipantAction) => Promise<{
84
84
  status: string;
85
85
  jid: string;
86
- content: import("../index").BinaryNode;
86
+ content: import("..").BinaryNode;
87
87
  }[]>;
88
- groupUpdateDescription: (jid: string, description?: string | undefined) => Promise<void>;
88
+ groupUpdateDescription: (jid: string, description?: string) => Promise<void>;
89
89
  groupInviteCode: (jid: string) => Promise<string | undefined>;
90
90
  groupRevokeInvite: (jid: string) => Promise<string | undefined>;
91
91
  groupAcceptInvite: (code: string) => Promise<string | undefined>;
92
92
  groupAcceptInviteV4: (key: string | import("../Types").WAProto.IMessageKey, inviteMessage: import("../Types").WAProto.Message.IGroupInviteMessage) => Promise<string>;
93
93
  groupGetInviteInfo: (code: string) => Promise<import("../Types").GroupMetadata>;
94
94
  groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
95
- groupSettingUpdate: (jid: string, setting: "announcement" | "locked" | "not_announcement" | "unlocked") => Promise<void>;
96
- groupMemberAddMode: (jid: string, mode: "all_member_add" | "admin_add") => Promise<void>;
95
+ groupSettingUpdate: (jid: string, setting: "announcement" | "not_announcement" | "locked" | "unlocked") => Promise<void>;
96
+ groupMemberAddMode: (jid: string, mode: "admin_add" | "all_member_add") => Promise<void>;
97
97
  groupJoinApprovalMode: (jid: string, mode: "on" | "off") => Promise<void>;
98
98
  groupFetchAllParticipating: () => Promise<{
99
99
  [_: string]: import("../Types").GroupMetadata;
100
100
  }>;
101
101
  processingMutex: {
102
- mutex<T>(code: () => T | Promise<T>): Promise<T>;
102
+ mutex<T>(code: () => Promise<T> | T): Promise<T>;
103
103
  };
104
104
  upsertMessage: (msg: import("../Types").WAProto.IWebMessageInfo, type: import("../Types").MessageUpsertType) => Promise<void>;
105
105
  appPatch: (patchCreate: import("../Types").WAPatchCreate) => Promise<void>;
106
- sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string | undefined) => Promise<void>;
107
- presenceSubscribe: (toJid: string, tcToken?: Buffer | undefined) => Promise<void>;
108
- profilePictureUrl: (jid: string, type?: "image" | "preview", timeoutMs?: number | undefined) => Promise<string | undefined>;
106
+ sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string) => Promise<void>;
107
+ presenceSubscribe: (toJid: string, tcToken?: Buffer) => Promise<void>;
108
+ profilePictureUrl: (jid: string, type?: "preview" | "image", timeoutMs?: number) => Promise<string | undefined>;
109
109
  onWhatsApp: (...jids: string[]) => Promise<{
110
110
  exists: boolean;
111
111
  jid: string;
@@ -127,25 +127,25 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
127
127
  updateReadReceiptsPrivacy: (value: import("../Types").WAReadReceiptsValue) => Promise<void>;
128
128
  updateGroupsAddPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
129
129
  updateDefaultDisappearingMode: (duration: number) => Promise<void>;
130
- getBusinessProfile: (jid: string) => Promise<void | import("../Types").WABusinessProfile>;
130
+ getBusinessProfile: (jid: string) => Promise<import("../Types").WABusinessProfile | void>;
131
131
  resyncAppState: (collections: readonly ("critical_block" | "critical_unblock_low" | "regular_high" | "regular_low" | "regular")[], isInitialSync: boolean) => Promise<void>;
132
132
  chatModify: (mod: import("../Types").ChatModification, jid: string) => Promise<void>;
133
- cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: string | number | undefined) => Promise<void>;
133
+ cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: number | string) => Promise<void>;
134
134
  addChatLabel: (jid: string, labelId: string) => Promise<void>;
135
135
  removeChatLabel: (jid: string, labelId: string) => Promise<void>;
136
136
  addMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
137
137
  removeMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
138
138
  star: (jid: string, messages: {
139
139
  id: string;
140
- fromMe?: boolean | undefined;
140
+ fromMe?: boolean;
141
141
  }[], star: boolean) => Promise<void>;
142
142
  type: "md";
143
143
  ws: any;
144
144
  ev: import("../Types").BaileysEventEmitter & {
145
- process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): () => void;
145
+ process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): (() => void);
146
146
  buffer(): void;
147
- createBufferedFunction<A extends any[], T_1>(work: (...args: A) => Promise<T_1>): (...args: A) => Promise<T_1>;
148
- flush(force?: boolean | undefined): boolean;
147
+ createBufferedFunction<A extends any[], T>(work: (...args: A) => Promise<T>): ((...args: A) => Promise<T>);
148
+ flush(force?: boolean): boolean;
149
149
  isBuffering(): boolean;
150
150
  };
151
151
  authState: {
@@ -155,18 +155,18 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
155
155
  signalRepository: import("../Types").SignalRepository;
156
156
  user: import("../Types").Contact | undefined;
157
157
  generateMessageTag: () => string;
158
- query: (node: import("../index").BinaryNode, timeoutMs?: number | undefined) => Promise<import("../index").BinaryNode>;
159
- waitForMessage: <T_2>(msgId: string, timeoutMs?: number | undefined) => Promise<T_2>;
158
+ query: (node: import("..").BinaryNode, timeoutMs?: number) => Promise<import("..").BinaryNode>;
159
+ waitForMessage: <T>(msgId: string, timeoutMs?: number | undefined) => Promise<T>;
160
160
  waitForSocketOpen: () => Promise<void>;
161
161
  sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>;
162
- sendNode: (frame: import("../index").BinaryNode) => Promise<void>;
163
- logout: (msg?: string | undefined) => Promise<void>;
162
+ sendNode: (frame: import("..").BinaryNode) => Promise<void>;
163
+ logout: (msg?: string) => Promise<void>;
164
164
  end: (error: Error | undefined) => void;
165
- onUnexpectedError: (err: Error | import("@hapi/boom").Boom<any>, msg: string) => void;
165
+ onUnexpectedError: (err: Error | Boom, msg: string) => void;
166
166
  uploadPreKeys: (count?: number) => Promise<void>;
167
167
  uploadPreKeysToServerIfRequired: () => Promise<void>;
168
- requestPairingCode: (phoneNumber: string) => Promise<string>;
169
- waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined, timeoutMs?: number | undefined) => Promise<void>;
170
- sendWAMBuffer: (wamBuffer: Buffer) => Promise<import("../index").BinaryNode>;
168
+ requestPairingCode: (phoneNumber: string, pairCode: string) => Promise<string>;
169
+ waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined, timeoutMs?: number) => Promise<void>;
170
+ sendWAMBuffer: (wamBuffer: Buffer) => Promise<import("..").BinaryNode>;
171
171
  };
172
172
  export default makeWASocket;