@yui-bails/yui-bails 1.1.0 → 1.3.0

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 (63) hide show
  1. package/README.md +200 -0
  2. package/lib/Socket/connect-bot.d.ts +800 -0
  3. package/lib/Socket/connect-bot.d.ts.map +1 -0
  4. package/lib/Socket/connect-bot.js +94 -0
  5. package/lib/Socket/connect-bot.js.map +1 -0
  6. package/lib/Socket/index.d.ts +52 -0
  7. package/lib/Socket/index.d.ts.map +1 -1
  8. package/lib/Socket/index.js +34 -0
  9. package/lib/Socket/index.js.map +1 -1
  10. package/lib/Socket/session-manager.d.ts +56 -0
  11. package/lib/Socket/session-manager.d.ts.map +1 -1
  12. package/lib/Socket/session-manager.js +9 -3
  13. package/lib/Socket/session-manager.js.map +1 -1
  14. package/lib/Types/Message.d.ts +5 -0
  15. package/lib/Types/Message.d.ts.map +1 -1
  16. package/lib/Types/Socket.d.ts +5 -0
  17. package/lib/Types/Socket.d.ts.map +1 -1
  18. package/lib/Types/Socket.js.map +1 -1
  19. package/lib/Utils/banner.d.ts +1 -1
  20. package/lib/Utils/banner.js +1 -1
  21. package/lib/Utils/commands.d.ts +99 -0
  22. package/lib/Utils/commands.d.ts.map +1 -0
  23. package/lib/Utils/commands.js +176 -0
  24. package/lib/Utils/commands.js.map +1 -0
  25. package/lib/Utils/cooldown.d.ts +17 -0
  26. package/lib/Utils/cooldown.d.ts.map +1 -0
  27. package/lib/Utils/cooldown.js +42 -0
  28. package/lib/Utils/cooldown.js.map +1 -0
  29. package/lib/Utils/experimental-buttons.d.ts +24 -0
  30. package/lib/Utils/experimental-buttons.d.ts.map +1 -0
  31. package/lib/Utils/experimental-buttons.js +27 -0
  32. package/lib/Utils/experimental-buttons.js.map +1 -0
  33. package/lib/Utils/index.d.ts +6 -0
  34. package/lib/Utils/index.d.ts.map +1 -1
  35. package/lib/Utils/index.js +6 -0
  36. package/lib/Utils/index.js.map +1 -1
  37. package/lib/Utils/interactive.d.ts +126 -0
  38. package/lib/Utils/interactive.d.ts.map +1 -0
  39. package/lib/Utils/interactive.js +351 -0
  40. package/lib/Utils/interactive.js.map +1 -0
  41. package/lib/Utils/messages-media.d.ts +38 -0
  42. package/lib/Utils/messages-media.d.ts.map +1 -1
  43. package/lib/Utils/messages-media.js +51 -16
  44. package/lib/Utils/messages-media.js.map +1 -1
  45. package/lib/Utils/pairing.d.ts +28 -0
  46. package/lib/Utils/pairing.d.ts.map +1 -0
  47. package/lib/Utils/pairing.js +102 -0
  48. package/lib/Utils/pairing.js.map +1 -0
  49. package/lib/Utils/pretty-log.d.ts.map +1 -1
  50. package/lib/Utils/pretty-log.js +3 -1
  51. package/lib/Utils/pretty-log.js.map +1 -1
  52. package/lib/Utils/scheduler.d.ts +75 -0
  53. package/lib/Utils/scheduler.d.ts.map +1 -0
  54. package/lib/Utils/scheduler.js +265 -0
  55. package/lib/Utils/scheduler.js.map +1 -0
  56. package/lib/Utils/send-queue.d.ts.map +1 -1
  57. package/lib/Utils/send-queue.js +18 -2
  58. package/lib/Utils/send-queue.js.map +1 -1
  59. package/lib/index.d.ts +1 -0
  60. package/lib/index.d.ts.map +1 -1
  61. package/lib/index.js +1 -0
  62. package/lib/index.js.map +1 -1
  63. package/package.json +1 -1
@@ -0,0 +1,800 @@
1
+ import { Boom } from '@hapi/boom';
2
+ import type { UserFacingSocketConfig } from '../Types/index.js';
3
+ import { type YuiSocket } from './session-manager.js';
4
+ export type ConnectBotOptions = {
5
+ /** folder where the login is saved (created if missing). Never use `.`, `/` or your home folder */
6
+ authDir: string;
7
+ /** phone number to link with a pairing code (with country code). Without it, `onQR` gets a QR to scan */
8
+ number?: string;
9
+ /** socket config (logger, sendQueue, prettyLogs…) */
10
+ config?: Partial<UserFacingSocketConfig>;
11
+ /** called every time a socket is created, also after a reconnect: attach your event handlers here */
12
+ setup?: (sock: YuiSocket) => void | Promise<void>;
13
+ /** the pairing code, ready to type on the phone. By default it is printed in the console */
14
+ onCode?: (info: {
15
+ code: string;
16
+ formatted: string;
17
+ number: string;
18
+ }) => void;
19
+ /** a QR string to scan (draw it with a QR library). Used when no `number` is given */
20
+ onQR?: (qr: string) => void;
21
+ /** the account is connected */
22
+ onOpen?: (sock: YuiSocket) => void;
23
+ /** the connection closed. `message` says why and what to do, in Spanish */
24
+ onClose?: (info: {
25
+ reason: number | undefined;
26
+ willReconnect: boolean;
27
+ message: string;
28
+ }) => void;
29
+ onError?: (error: unknown, message: string) => void;
30
+ /** reconnect by itself (not after a logout). Default true */
31
+ reconnect?: boolean;
32
+ /** extra tries when WhatsApp times out or rate-limits the pairing code. Default 2 */
33
+ pairingRetries?: number;
34
+ /** where the default messages go. Default console.log */
35
+ log?: (line: string) => void;
36
+ /** replaceable for tests */
37
+ makeSocket?: (config: UserFacingSocketConfig) => YuiSocket;
38
+ sleep?: (ms: number) => Promise<void>;
39
+ };
40
+ /**
41
+ * Starts one WhatsApp account with everything needed already wired: login folder, pairing code
42
+ * (or QR), reconnection with waits, and error messages in plain Spanish.
43
+ *
44
+ * ```js
45
+ * const bot = await connectBot({ authDir: './sesion', number: '51912345678', setup: sock => { ... } })
46
+ * const sock = await bot.ready // resolves when it is connected
47
+ * ```
48
+ */
49
+ export declare const connectBot: (options: ConnectBotOptions) => Promise<{
50
+ /** resolves with the socket the first time the account is connected */
51
+ ready: Promise<{
52
+ communityMetadata: (jid: string) => Promise<import("../index.js").GroupMetadata>;
53
+ communityCreate: (subject: string, body: string) => Promise<import("../index.js").GroupMetadata | null>;
54
+ communityCreateGroup: (subject: string, participants: string[], parentCommunityJid: string) => Promise<import("../index.js").GroupMetadata | null>;
55
+ communityLeave: (id: string) => Promise<void>;
56
+ communityUpdateSubject: (jid: string, subject: string) => Promise<void>;
57
+ communityLinkGroup: (groupJid: string, parentCommunityJid: string) => Promise<void>;
58
+ communityUnlinkGroup: (groupJid: string, parentCommunityJid: string) => Promise<void>;
59
+ communityFetchLinkedGroups: (jid: string) => Promise<{
60
+ communityJid: string;
61
+ isCommunity: boolean;
62
+ linkedGroups: {
63
+ id: string | undefined;
64
+ subject: string;
65
+ creation: number | undefined;
66
+ owner: string | undefined;
67
+ size: number | undefined;
68
+ }[];
69
+ }>;
70
+ communityRequestParticipantsList: (jid: string) => Promise<{
71
+ [key: string]: string;
72
+ }[]>;
73
+ communityRequestParticipantsUpdate: (jid: string, participants: string[], action: "approve" | "reject") => Promise<{
74
+ status: string;
75
+ jid: string | undefined;
76
+ }[]>;
77
+ communityParticipantsUpdate: (jid: string, participants: string[], action: import("../index.js").ParticipantAction) => Promise<{
78
+ status: string;
79
+ jid: string | undefined;
80
+ content: import("../index.js").BinaryNode;
81
+ }[]>;
82
+ communityUpdateDescription: (jid: string, description?: string) => Promise<void>;
83
+ communityInviteCode: (jid: string) => Promise<string | undefined>;
84
+ communityRevokeInvite: (jid: string) => Promise<string | undefined>;
85
+ communityAcceptInvite: (code: string) => Promise<string | undefined>;
86
+ communityRevokeInviteV4: (communityJid: string, invitedJid: string) => Promise<boolean>;
87
+ communityAcceptInviteV4: (key: string | import("../index.js").WAMessageKey, inviteMessage: import("../index.js").proto.Message.IGroupInviteMessage) => Promise<any>;
88
+ communityGetInviteInfo: (code: string) => Promise<import("../index.js").GroupMetadata>;
89
+ communityToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
90
+ communitySettingUpdate: (jid: string, setting: "announcement" | "not_announcement" | "locked" | "unlocked") => Promise<void>;
91
+ communityMemberAddMode: (jid: string, mode: "admin_add" | "all_member_add") => Promise<void>;
92
+ communityJoinApprovalMode: (jid: string, mode: "on" | "off") => Promise<void>;
93
+ communityFetchAllParticipating: () => Promise<{
94
+ [_: string]: import("../index.js").GroupMetadata;
95
+ }>;
96
+ logger: import("../Utils/logger.js").ILogger;
97
+ getOrderDetails: (orderId: string, tokenBase64: string) => Promise<import("../index.js").OrderDetails>;
98
+ getCatalog: ({ jid, limit, cursor }: import("../index.js").GetCatalogOptions) => Promise<{
99
+ products: import("../index.js").Product[];
100
+ nextPageCursor: string | undefined;
101
+ }>;
102
+ getCollections: (jid?: string, limit?: number) => Promise<{
103
+ collections: import("../index.js").CatalogCollection[];
104
+ }>;
105
+ productCreate: (create: import("../index.js").ProductCreate) => Promise<import("../index.js").Product>;
106
+ productDelete: (productIds: string[]) => Promise<{
107
+ deleted: number;
108
+ }>;
109
+ productUpdate: (productId: string, update: import("../index.js").ProductUpdate) => Promise<import("../index.js").Product>;
110
+ updateBussinesProfile: (args: import("../Types/Bussines.js").UpdateBussinesProfileProps) => Promise<any>;
111
+ updateCoverPhoto: (photo: import("../index.js").WAMediaUpload) => Promise<number>;
112
+ removeCoverPhoto: (id: string) => Promise<any>;
113
+ sendMessageAck: (node: import("../index.js").BinaryNode, errorCode?: number) => Promise<void>;
114
+ sendRetryRequest: (node: import("../index.js").BinaryNode, forceIncludeKeys?: boolean) => Promise<void>;
115
+ rejectCall: (callId: string, callFrom: string) => Promise<void>;
116
+ fetchMessageHistory: (count: number, oldestMsgKey: import("../index.js").WAMessageKey, oldestMsgTimestamp: number | import("long").default) => Promise<string>;
117
+ requestPlaceholderResend: (messageKey: import("../index.js").WAMessageKey, msgData?: Partial<import("../index.js").WAMessage>) => Promise<string | undefined>;
118
+ messageRetryManager: import("../index.js").MessageRetryManager | null;
119
+ userDevicesCache: import("../index.js").PossiblyExtendedCacheStore | import("@cacheable/node-cache").NodeCache<import("../index.js").JidWithDevice[]>;
120
+ devicesMutex: {
121
+ mutex<T>(code: () => Promise<T> | T): Promise<T>;
122
+ };
123
+ issuePrivacyTokens: (jids: string[], timestamp?: number) => Promise<any>;
124
+ assertSessions: (jids: string[], force?: boolean) => Promise<boolean>;
125
+ relayMessage: (jid: string, message: import("../index.js").proto.IMessage, { messageId: msgId, participant, additionalAttributes, additionalNodes, useUserDevicesCache, useCachedGroupMetadata, statusJidList }: import("../index.js").MessageRelayOptions) => Promise<string>;
126
+ sendReceipt: (jid: string, participant: string | undefined, messageIds: string[], type: import("../index.js").MessageReceiptType) => Promise<void>;
127
+ sendReceipts: (keys: import("../index.js").WAMessageKey[], type: import("../index.js").MessageReceiptType) => Promise<void>;
128
+ readMessages: (keys: import("../index.js").WAMessageKey[]) => Promise<void>;
129
+ refreshMediaConn: (forceGet?: boolean) => Promise<import("../index.js").MediaConnInfo>;
130
+ getMediaHost: () => string;
131
+ waUploadToServer: import("../index.js").WAMediaUploadFunction;
132
+ fetchPrivacySettings: (force?: boolean) => Promise<{
133
+ [_: string]: string;
134
+ }>;
135
+ sendPeerDataOperationMessage: (pdoMessage: import("../index.js").proto.Message.IPeerDataOperationRequestMessage) => Promise<string>;
136
+ createParticipantNodes: (recipientJids: string[], message: import("../index.js").proto.IMessage, extraAttrs?: import("../index.js").BinaryNode["attrs"], dsmMessage?: import("../index.js").proto.IMessage) => Promise<{
137
+ nodes: import("../index.js").BinaryNode[];
138
+ shouldIncludeDeviceIdentity: boolean;
139
+ }>;
140
+ getUSyncDevices: (jids: string[], useCache: boolean, ignoreZeroDevices: boolean) => Promise<(import("../index.js").JidWithDevice & {
141
+ jid: string;
142
+ })[]>;
143
+ updateMemberLabel: (jid: string, memberLabel: string) => Promise<string>;
144
+ updateMediaMessage: (message: import("../index.js").WAMessage) => Promise<import("../index.js").WAMessage>;
145
+ sendMessage: (jid: string, content: import("../index.js").AnyMessageContent, options?: import("../index.js").MiscMessageGenerationOptions) => Promise<import("../index.js").WAMessage | undefined>;
146
+ newsletterCreate: (name: string, description?: string) => Promise<import("../index.js").NewsletterMetadata>;
147
+ newsletterUpdate: (jid: string, updates: import("../index.js").NewsletterUpdate) => Promise<unknown>;
148
+ newsletterSubscribers: (jid: string) => Promise<{
149
+ subscribers: number;
150
+ }>;
151
+ newsletterMetadata: (type: "invite" | "jid", key: string) => Promise<import("../index.js").NewsletterMetadata | null>;
152
+ newsletterFollow: (jid: string) => Promise<unknown>;
153
+ newsletterUnfollow: (jid: string) => Promise<unknown>;
154
+ newsletterMute: (jid: string) => Promise<unknown>;
155
+ newsletterUnmute: (jid: string) => Promise<unknown>;
156
+ newsletterUpdateName: (jid: string, name: string) => Promise<unknown>;
157
+ newsletterUpdateDescription: (jid: string, description: string) => Promise<unknown>;
158
+ newsletterUpdatePicture: (jid: string, content: import("../index.js").WAMediaUpload) => Promise<unknown>;
159
+ newsletterRemovePicture: (jid: string) => Promise<unknown>;
160
+ newsletterReactMessage: (jid: string, serverId: string, reaction?: string) => Promise<void>;
161
+ newsletterFetchMessages: (jid: string, count: number, since: number, after: number) => Promise<any>;
162
+ subscribeNewsletterUpdates: (jid: string) => Promise<{
163
+ duration: string;
164
+ } | null>;
165
+ newsletterAdminCount: (jid: string) => Promise<number>;
166
+ newsletterChangeOwner: (jid: string, newOwnerJid: string) => Promise<void>;
167
+ newsletterDemote: (jid: string, userJid: string) => Promise<void>;
168
+ newsletterDelete: (jid: string) => Promise<void>;
169
+ groupMetadata: (jid: string) => Promise<import("../index.js").GroupMetadata>;
170
+ groupCreate: (subject: string, participants: string[]) => Promise<import("../index.js").GroupMetadata>;
171
+ groupLeave: (id: string) => Promise<void>;
172
+ groupUpdateSubject: (jid: string, subject: string) => Promise<void>;
173
+ groupRequestParticipantsList: (jid: string) => Promise<{
174
+ [key: string]: string;
175
+ }[]>;
176
+ groupRequestParticipantsUpdate: (jid: string, participants: string[], action: "approve" | "reject") => Promise<{
177
+ status: string;
178
+ jid: string | undefined;
179
+ }[]>;
180
+ groupParticipantsUpdate: (jid: string, participants: string[], action: import("../index.js").ParticipantAction) => Promise<{
181
+ status: string;
182
+ jid: string | undefined;
183
+ content: import("../index.js").BinaryNode;
184
+ }[]>;
185
+ groupUpdateDescription: (jid: string, description?: string) => Promise<void>;
186
+ groupInviteCode: (jid: string) => Promise<string | undefined>;
187
+ groupRevokeInvite: (jid: string) => Promise<string | undefined>;
188
+ groupAcceptInvite: (code: string) => Promise<string | undefined>;
189
+ groupRevokeInviteV4: (groupJid: string, invitedJid: string) => Promise<boolean>;
190
+ groupAcceptInviteV4: (key: string | import("../index.js").WAMessageKey, inviteMessage: import("../index.js").proto.Message.IGroupInviteMessage) => Promise<any>;
191
+ groupGetInviteInfo: (code: string) => Promise<import("../index.js").GroupMetadata>;
192
+ groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
193
+ groupSettingUpdate: (jid: string, setting: "announcement" | "not_announcement" | "locked" | "unlocked") => Promise<void>;
194
+ groupMemberAddMode: (jid: string, mode: "admin_add" | "all_member_add") => Promise<void>;
195
+ groupJoinApprovalMode: (jid: string, mode: "on" | "off") => Promise<void>;
196
+ groupFetchAllParticipating: () => Promise<{
197
+ [_: string]: import("../index.js").GroupMetadata;
198
+ }>;
199
+ serverProps: {
200
+ privacyTokenOn1to1: boolean;
201
+ profilePicPrivacyToken: boolean;
202
+ lidTrustedTokenIssueToLid: boolean;
203
+ };
204
+ createCallLink: (type: "audio" | "video", event?: {
205
+ startTime: number;
206
+ }, timeoutMs?: number) => Promise<string | undefined>;
207
+ getBotListV2: () => Promise<import("../index.js").BotListInfo[]>;
208
+ messageMutex: {
209
+ mutex<T>(code: () => Promise<T> | T): Promise<T>;
210
+ };
211
+ receiptMutex: {
212
+ mutex<T>(code: () => Promise<T> | T): Promise<T>;
213
+ };
214
+ appStatePatchMutex: {
215
+ mutex<T>(code: () => Promise<T> | T): Promise<T>;
216
+ };
217
+ notificationMutex: {
218
+ mutex<T>(code: () => Promise<T> | T): Promise<T>;
219
+ };
220
+ upsertMessage: (msg: import("../index.js").WAMessage, type: import("../index.js").MessageUpsertType) => Promise<void>;
221
+ appPatch: (patchCreate: import("../index.js").WAPatchCreate) => Promise<void>;
222
+ sendPresenceUpdate: (type: import("../index.js").WAPresence, toJid?: string) => Promise<void>;
223
+ presenceSubscribe: (toJid: string) => Promise<void>;
224
+ profilePictureUrl: (jid: string, type?: "preview" | "image", timeoutMs?: number) => Promise<string | undefined>;
225
+ fetchBlocklist: () => Promise<(string | undefined)[]>;
226
+ fetchStatus: (...jids: string[]) => Promise<import("../index.js").USyncQueryResultList[] | undefined>;
227
+ fetchDisappearingDuration: (...jids: string[]) => Promise<import("../index.js").USyncQueryResultList[] | undefined>;
228
+ updateProfilePicture: (jid: string, content: import("../index.js").WAMediaUpload, dimensions?: {
229
+ width: number;
230
+ height: number;
231
+ }) => Promise<void>;
232
+ removeProfilePicture: (jid: string) => Promise<void>;
233
+ updateProfileStatus: (status: string) => Promise<void>;
234
+ updateProfileName: (name: string) => Promise<void>;
235
+ updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise<void>;
236
+ updateDisableLinkPreviewsPrivacy: (isPreviewsDisabled: boolean) => Promise<void>;
237
+ updateCallPrivacy: (value: import("../index.js").WAPrivacyCallValue) => Promise<void>;
238
+ updateMessagesPrivacy: (value: import("../index.js").WAPrivacyMessagesValue) => Promise<void>;
239
+ updateLastSeenPrivacy: (value: import("../index.js").WAPrivacyValue) => Promise<void>;
240
+ updateOnlinePrivacy: (value: import("../index.js").WAPrivacyOnlineValue) => Promise<void>;
241
+ updateProfilePicturePrivacy: (value: import("../index.js").WAPrivacyValue) => Promise<void>;
242
+ updateStatusPrivacy: (value: import("../index.js").WAPrivacyValue) => Promise<void>;
243
+ updateReadReceiptsPrivacy: (value: import("../index.js").WAReadReceiptsValue) => Promise<void>;
244
+ updateGroupsAddPrivacy: (value: import("../index.js").WAPrivacyGroupAddValue) => Promise<void>;
245
+ updateDefaultDisappearingMode: (duration: number) => Promise<void>;
246
+ getBusinessProfile: (jid: string) => Promise<import("../index.js").WABusinessProfile | void>;
247
+ resyncAppState: (collections: readonly ("critical_unblock_low" | "regular_high" | "regular_low" | "critical_block" | "regular")[], isInitialSync: boolean) => Promise<void>;
248
+ chatModify: (mod: import("../index.js").ChatModification, jid: string) => Promise<void>;
249
+ cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: number | string) => Promise<void>;
250
+ addOrEditContact: (jid: string, contact: import("../index.js").proto.SyncActionValue.IContactAction) => Promise<void>;
251
+ removeContact: (jid: string) => Promise<void>;
252
+ placeholderResendCache: import("../index.js").CacheStore;
253
+ addLabel: (jid: string, labels: import("../Types/Label.js").LabelActionBody) => Promise<void>;
254
+ addChatLabel: (jid: string, labelId: string) => Promise<void>;
255
+ removeChatLabel: (jid: string, labelId: string) => Promise<void>;
256
+ addMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
257
+ removeMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
258
+ star: (jid: string, messages: {
259
+ id: string;
260
+ fromMe?: boolean;
261
+ }[], star: boolean) => Promise<void>;
262
+ addOrEditQuickReply: (quickReply: import("../Types/Bussines.js").QuickReplyAction) => Promise<void>;
263
+ removeQuickReply: (timestamp: string) => Promise<void>;
264
+ type: "md";
265
+ ws: import("./Client/index.js").WebSocketClient;
266
+ ev: import("../index.js").YuiEventEmitter & {
267
+ process(handler: (events: Partial<import("../index.js").YuiEventMap>) => void | Promise<void>): () => void;
268
+ buffer(): void;
269
+ createBufferedFunction<A extends any[], T>(work: (...args: A) => Promise<T>): (...args: A) => Promise<T>;
270
+ flush(): boolean;
271
+ isBuffering(): boolean;
272
+ destroy(): void;
273
+ };
274
+ authState: {
275
+ creds: import("../index.js").AuthenticationCreds;
276
+ keys: import("../index.js").SignalKeyStoreWithTransaction;
277
+ };
278
+ signalRepository: import("../index.js").SignalRepositoryWithLIDStore;
279
+ user: import("../index.js").Contact | undefined;
280
+ generateMessageTag: () => string;
281
+ query: (node: import("../index.js").BinaryNode, timeoutMs?: number) => Promise<any>;
282
+ waitForMessage: <T>(msgId: string, timeoutMs?: number | undefined) => Promise<T | undefined>;
283
+ waitForSocketOpen: () => Promise<void>;
284
+ sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>;
285
+ sendNode: (frame: import("../index.js").BinaryNode) => Promise<void>;
286
+ logout: (msg?: string) => Promise<void>;
287
+ end: (error: Error | undefined) => Promise<void>;
288
+ registerSocketEndHandler: (handler: (error: Error | undefined) => void | Promise<void>) => void;
289
+ onUnexpectedError: (err: Error | Boom, msg: string) => void;
290
+ uploadPreKeys: (count?: number) => Promise<void>;
291
+ uploadPreKeysToServerIfRequired: () => Promise<void>;
292
+ digestKeyBundle: () => Promise<void>;
293
+ rotateSignedPreKey: () => Promise<void>;
294
+ requestPairingCode: (phoneNumber: string, customPairingCode?: string) => Promise<string>;
295
+ updateServerTimeOffset: ({ attrs }: import("../index.js").BinaryNode) => void;
296
+ sendUnifiedSession: () => Promise<void>;
297
+ wamBuffer: import("../index.js").BinaryInfo;
298
+ waitForConnectionUpdate: (check: (u: Partial<import("../index.js").ConnectionState>) => Promise<boolean | undefined>, timeoutMs?: number) => Promise<void>;
299
+ sendWAMBuffer: (wamBuffer: Buffer) => Promise<any>;
300
+ executeUSyncQuery: (usyncQuery: import("../index.js").USyncQuery) => Promise<import("../index.js").USyncQueryResult | undefined>;
301
+ onWhatsApp: (...phoneNumber: string[]) => Promise<{
302
+ jid: string;
303
+ exists: boolean;
304
+ }[] | undefined>;
305
+ fetchAccountReachoutTimelock: () => Promise<import("../index.js").ReachoutTimelockState>;
306
+ fetchNewChatMessageCap: () => Promise<import("../index.js").NewChatMessageCapInfo>;
307
+ } & {
308
+ getSender: (msg: import("../index.js").WAMessage) => Promise<import("../index.js").SenderInfo>;
309
+ reply: (msg: import("../index.js").WAMessage, content: string | {
310
+ [x: string]: unknown;
311
+ }, options?: import("../index.js").MiscMessageGenerationOptions) => Promise<import("../index.js").WAMessage | undefined>;
312
+ react: (msg: import("../index.js").WAMessage, emoji: string) => Promise<import("../index.js").WAMessage | undefined>;
313
+ sendSafe: (jid: string, content: string | {
314
+ [x: string]: unknown;
315
+ }, options?: import("../index.js").MiscMessageGenerationOptions, { timeoutMs }?: import("../index.js").SendSafeOptions) => Promise<import("../index.js").SendResult>;
316
+ sendButtons: (jid: string, { buttons, ...rest }: import("../index.js").SendButtonsOptions, options?: import("../index.js").MiscMessageGenerationOptions) => Promise<import("../index.js").WAMessage | undefined>;
317
+ sendCarousel: (jid: string, { cards, ...rest }: import("../index.js").SendCarouselOptions, options?: import("../index.js").MiscMessageGenerationOptions) => Promise<import("../index.js").WAMessage | undefined>;
318
+ disableButtons: (msg: import("../index.js").WAMessage, text?: string) => Promise<boolean>;
319
+ sendList: (jid: string, { sections, ...rest }: import("../index.js").SendListOptions, options?: import("../index.js").MiscMessageGenerationOptions) => Promise<import("../index.js").WAMessage | undefined>;
320
+ sendPoll: (jid: string, name: string, values: string[], poll?: Partial<Omit<import("../index.js").PollMessageOptions, "name" | "values">>, options?: import("../index.js").MiscMessageGenerationOptions) => Promise<import("../index.js").WAMessage | undefined>;
321
+ getPollVotes: (pollKey: import("../index.js").WAMessageKey | string) => {
322
+ pollKey: import("../index.js").WAMessageKey;
323
+ pollName: string;
324
+ votes: {
325
+ name: string;
326
+ voters: string[];
327
+ }[];
328
+ } | undefined;
329
+ downloadMedia: (msg: import("../index.js").WAMessage, options?: import("../index.js").DownloadMediaOptions) => Promise<Buffer>;
330
+ } & {
331
+ onReply: (matcher: import("../index.js").ReplyMatcher, run: import("../index.js").ReplyHandler, options?: import("../index.js").OnReplyOptions) => () => boolean;
332
+ onButton: (matcher: import("../index.js").ReplyMatcher, run: import("../index.js").ReplyHandler, options?: import("../index.js").OnReplyOptions) => () => boolean;
333
+ onList: (matcher: import("../index.js").ReplyMatcher, run: import("../index.js").ReplyHandler, options?: import("../index.js").OnReplyOptions) => () => boolean;
334
+ awaitReply: (msg: import("../index.js").WAMessage, { timeoutMs, filter }?: import("../index.js").AwaitReplyOptions) => Promise<import("../index.js").WAMessage | undefined>;
335
+ } & {
336
+ commands: {
337
+ add: (definition: import("../index.js").CommandDefinition) => /*elided*/ any;
338
+ remove: (name: string) => boolean;
339
+ get: (name: string) => import("../index.js").CommandDefinition | undefined;
340
+ list: () => import("../index.js").CommandDefinition[];
341
+ cooldowns: {
342
+ use: (user: string, action: string, ms: number) => number;
343
+ left: (user: string, action: string) => number;
344
+ reset: (user: string, action?: string) => void;
345
+ clear: () => void;
346
+ };
347
+ handle: (msg: import("../index.js").WAMessage) => Promise<boolean>;
348
+ listen: () => () => void | undefined;
349
+ };
350
+ schedule: {
351
+ at: (when: Date | number | string, jid: string, content: {
352
+ [x: string]: unknown;
353
+ }) => string;
354
+ after: (delay: string | number, jid: string, content: {
355
+ [x: string]: unknown;
356
+ }) => string;
357
+ every: (interval: string | number, jid: string, content: {
358
+ [x: string]: unknown;
359
+ }, extra?: {
360
+ times?: number;
361
+ }) => string;
362
+ cron: (expression: string, jid: string, content: {
363
+ [x: string]: unknown;
364
+ }, extra?: {
365
+ times?: number;
366
+ }) => string;
367
+ list: () => import("../index.js").ScheduledJob[];
368
+ cancel: (id: string) => boolean;
369
+ clear: () => void;
370
+ start: () => void;
371
+ stop: () => void;
372
+ flush: () => Promise<void>;
373
+ };
374
+ cooldown: (user: string, action: string, ms: number) => number;
375
+ sendMessage: (jid: string, content: import("../index.js").AnyMessageContent, options?: import("../index.js").MiscMessageGenerationOptions) => Promise<import("../index.js").WAMessage | undefined>;
376
+ sendMessageNow: (jid: string, content: import("../index.js").AnyMessageContent, options?: import("../index.js").MiscMessageGenerationOptions) => Promise<import("../index.js").WAMessage | undefined>;
377
+ messageStore: {
378
+ save: (msg: Pick<import("../index.js").WAMessage, "key" | "message"> | null | undefined) => void;
379
+ get: (key: Pick<import("../index.js").WAMessageKey, "id">) => import("../index.js").proto.IMessage | undefined;
380
+ readonly size: number;
381
+ clear: () => void;
382
+ } | undefined;
383
+ groupCache: {
384
+ get: (jid: string) => import("../index.js").GroupMetadata | undefined;
385
+ set: (jid: string, data: import("../index.js").GroupMetadata) => void;
386
+ delete: (jid: string) => boolean;
387
+ clear: () => void;
388
+ readonly size: number;
389
+ } | undefined;
390
+ confirm: (msg: import("../index.js").WAMessage, text: string, options?: import("../index.js").ConfirmOptions) => Promise<boolean>;
391
+ paginate: (msg: import("../index.js").WAMessage, items: unknown[], options?: import("../index.js").PaginateOptions) => Promise<import("../index.js").WAMessage | undefined>;
392
+ menu: (msg: import("../index.js").WAMessage, definition: import("../index.js").MenuDefinition) => Promise<import("../index.js").WAMessage | undefined>;
393
+ sendGuardedButtons: (msg: import("../index.js").WAMessage, options: import("../index.js").GuardedButtonsOptions, onTap: (tap: import("../index.js").TapContext & {
394
+ id: string;
395
+ }) => void | Promise<void>) => Promise<import("../index.js").WAMessage | undefined>;
396
+ sendRepeatable: (msg: import("../index.js").WAMessage, source: string | {
397
+ [x: string]: unknown;
398
+ } | (() => string | {
399
+ [x: string]: unknown;
400
+ } | Promise<string | {
401
+ [x: string]: unknown;
402
+ }>), options?: import("../index.js").RepeatableOptions) => Promise<import("../index.js").WAMessage | undefined>;
403
+ getAdmins: (groupJid: string) => Promise<import("../index.js").GroupParticipant[]>;
404
+ isAdmin: (groupJid: string, who: import("../index.js").GroupMember) => Promise<boolean>;
405
+ isBotAdmin: (groupJid: string) => Promise<boolean>;
406
+ kick: (groupJid: string, who: string | string[]) => Promise<unknown>;
407
+ addMembers: (groupJid: string, who: string | string[]) => Promise<unknown>;
408
+ promote: (groupJid: string, who: string | string[]) => Promise<unknown>;
409
+ demote: (groupJid: string, who: string | string[]) => Promise<unknown>;
410
+ getStats: () => import("../index.js").StatsSnapshot;
411
+ resetStats: () => void;
412
+ getMessageStatus: (message: string | Pick<import("../index.js").WAMessageKey, "id">) => import("../index.js").MessageDelivery | undefined;
413
+ health: ({ ping, timeoutMs }?: {
414
+ ping?: boolean;
415
+ timeoutMs?: number;
416
+ }) => Promise<import("../index.js").HealthReport>;
417
+ queue: {
418
+ readonly size: number;
419
+ clear: () => number;
420
+ };
421
+ }>;
422
+ /** the live socket (changes after a reconnect) */
423
+ readonly sock: ({
424
+ communityMetadata: (jid: string) => Promise<import("../index.js").GroupMetadata>;
425
+ communityCreate: (subject: string, body: string) => Promise<import("../index.js").GroupMetadata | null>;
426
+ communityCreateGroup: (subject: string, participants: string[], parentCommunityJid: string) => Promise<import("../index.js").GroupMetadata | null>;
427
+ communityLeave: (id: string) => Promise<void>;
428
+ communityUpdateSubject: (jid: string, subject: string) => Promise<void>;
429
+ communityLinkGroup: (groupJid: string, parentCommunityJid: string) => Promise<void>;
430
+ communityUnlinkGroup: (groupJid: string, parentCommunityJid: string) => Promise<void>;
431
+ communityFetchLinkedGroups: (jid: string) => Promise<{
432
+ communityJid: string;
433
+ isCommunity: boolean;
434
+ linkedGroups: {
435
+ id: string | undefined;
436
+ subject: string;
437
+ creation: number | undefined;
438
+ owner: string | undefined;
439
+ size: number | undefined;
440
+ }[];
441
+ }>;
442
+ communityRequestParticipantsList: (jid: string) => Promise<{
443
+ [key: string]: string;
444
+ }[]>;
445
+ communityRequestParticipantsUpdate: (jid: string, participants: string[], action: "approve" | "reject") => Promise<{
446
+ status: string;
447
+ jid: string | undefined;
448
+ }[]>;
449
+ communityParticipantsUpdate: (jid: string, participants: string[], action: import("../index.js").ParticipantAction) => Promise<{
450
+ status: string;
451
+ jid: string | undefined;
452
+ content: import("../index.js").BinaryNode;
453
+ }[]>;
454
+ communityUpdateDescription: (jid: string, description?: string) => Promise<void>;
455
+ communityInviteCode: (jid: string) => Promise<string | undefined>;
456
+ communityRevokeInvite: (jid: string) => Promise<string | undefined>;
457
+ communityAcceptInvite: (code: string) => Promise<string | undefined>;
458
+ communityRevokeInviteV4: (communityJid: string, invitedJid: string) => Promise<boolean>;
459
+ communityAcceptInviteV4: (key: string | import("../index.js").WAMessageKey, inviteMessage: import("../index.js").proto.Message.IGroupInviteMessage) => Promise<any>;
460
+ communityGetInviteInfo: (code: string) => Promise<import("../index.js").GroupMetadata>;
461
+ communityToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
462
+ communitySettingUpdate: (jid: string, setting: "announcement" | "not_announcement" | "locked" | "unlocked") => Promise<void>;
463
+ communityMemberAddMode: (jid: string, mode: "admin_add" | "all_member_add") => Promise<void>;
464
+ communityJoinApprovalMode: (jid: string, mode: "on" | "off") => Promise<void>;
465
+ communityFetchAllParticipating: () => Promise<{
466
+ [_: string]: import("../index.js").GroupMetadata;
467
+ }>;
468
+ logger: import("../Utils/logger.js").ILogger;
469
+ getOrderDetails: (orderId: string, tokenBase64: string) => Promise<import("../index.js").OrderDetails>;
470
+ getCatalog: ({ jid, limit, cursor }: import("../index.js").GetCatalogOptions) => Promise<{
471
+ products: import("../index.js").Product[];
472
+ nextPageCursor: string | undefined;
473
+ }>;
474
+ getCollections: (jid?: string, limit?: number) => Promise<{
475
+ collections: import("../index.js").CatalogCollection[];
476
+ }>;
477
+ productCreate: (create: import("../index.js").ProductCreate) => Promise<import("../index.js").Product>;
478
+ productDelete: (productIds: string[]) => Promise<{
479
+ deleted: number;
480
+ }>;
481
+ productUpdate: (productId: string, update: import("../index.js").ProductUpdate) => Promise<import("../index.js").Product>;
482
+ updateBussinesProfile: (args: import("../Types/Bussines.js").UpdateBussinesProfileProps) => Promise<any>;
483
+ updateCoverPhoto: (photo: import("../index.js").WAMediaUpload) => Promise<number>;
484
+ removeCoverPhoto: (id: string) => Promise<any>;
485
+ sendMessageAck: (node: import("../index.js").BinaryNode, errorCode?: number) => Promise<void>;
486
+ sendRetryRequest: (node: import("../index.js").BinaryNode, forceIncludeKeys?: boolean) => Promise<void>;
487
+ rejectCall: (callId: string, callFrom: string) => Promise<void>;
488
+ fetchMessageHistory: (count: number, oldestMsgKey: import("../index.js").WAMessageKey, oldestMsgTimestamp: number | import("long").default) => Promise<string>;
489
+ requestPlaceholderResend: (messageKey: import("../index.js").WAMessageKey, msgData?: Partial<import("../index.js").WAMessage>) => Promise<string | undefined>;
490
+ messageRetryManager: import("../index.js").MessageRetryManager | null;
491
+ userDevicesCache: import("../index.js").PossiblyExtendedCacheStore | import("@cacheable/node-cache").NodeCache<import("../index.js").JidWithDevice[]>;
492
+ devicesMutex: {
493
+ mutex<T>(code: () => Promise<T> | T): Promise<T>;
494
+ };
495
+ issuePrivacyTokens: (jids: string[], timestamp?: number) => Promise<any>;
496
+ assertSessions: (jids: string[], force?: boolean) => Promise<boolean>;
497
+ relayMessage: (jid: string, message: import("../index.js").proto.IMessage, { messageId: msgId, participant, additionalAttributes, additionalNodes, useUserDevicesCache, useCachedGroupMetadata, statusJidList }: import("../index.js").MessageRelayOptions) => Promise<string>;
498
+ sendReceipt: (jid: string, participant: string | undefined, messageIds: string[], type: import("../index.js").MessageReceiptType) => Promise<void>;
499
+ sendReceipts: (keys: import("../index.js").WAMessageKey[], type: import("../index.js").MessageReceiptType) => Promise<void>;
500
+ readMessages: (keys: import("../index.js").WAMessageKey[]) => Promise<void>;
501
+ refreshMediaConn: (forceGet?: boolean) => Promise<import("../index.js").MediaConnInfo>;
502
+ getMediaHost: () => string;
503
+ waUploadToServer: import("../index.js").WAMediaUploadFunction;
504
+ fetchPrivacySettings: (force?: boolean) => Promise<{
505
+ [_: string]: string;
506
+ }>;
507
+ sendPeerDataOperationMessage: (pdoMessage: import("../index.js").proto.Message.IPeerDataOperationRequestMessage) => Promise<string>;
508
+ createParticipantNodes: (recipientJids: string[], message: import("../index.js").proto.IMessage, extraAttrs?: import("../index.js").BinaryNode["attrs"], dsmMessage?: import("../index.js").proto.IMessage) => Promise<{
509
+ nodes: import("../index.js").BinaryNode[];
510
+ shouldIncludeDeviceIdentity: boolean;
511
+ }>;
512
+ getUSyncDevices: (jids: string[], useCache: boolean, ignoreZeroDevices: boolean) => Promise<(import("../index.js").JidWithDevice & {
513
+ jid: string;
514
+ })[]>;
515
+ updateMemberLabel: (jid: string, memberLabel: string) => Promise<string>;
516
+ updateMediaMessage: (message: import("../index.js").WAMessage) => Promise<import("../index.js").WAMessage>;
517
+ sendMessage: (jid: string, content: import("../index.js").AnyMessageContent, options?: import("../index.js").MiscMessageGenerationOptions) => Promise<import("../index.js").WAMessage | undefined>;
518
+ newsletterCreate: (name: string, description?: string) => Promise<import("../index.js").NewsletterMetadata>;
519
+ newsletterUpdate: (jid: string, updates: import("../index.js").NewsletterUpdate) => Promise<unknown>;
520
+ newsletterSubscribers: (jid: string) => Promise<{
521
+ subscribers: number;
522
+ }>;
523
+ newsletterMetadata: (type: "invite" | "jid", key: string) => Promise<import("../index.js").NewsletterMetadata | null>;
524
+ newsletterFollow: (jid: string) => Promise<unknown>;
525
+ newsletterUnfollow: (jid: string) => Promise<unknown>;
526
+ newsletterMute: (jid: string) => Promise<unknown>;
527
+ newsletterUnmute: (jid: string) => Promise<unknown>;
528
+ newsletterUpdateName: (jid: string, name: string) => Promise<unknown>;
529
+ newsletterUpdateDescription: (jid: string, description: string) => Promise<unknown>;
530
+ newsletterUpdatePicture: (jid: string, content: import("../index.js").WAMediaUpload) => Promise<unknown>;
531
+ newsletterRemovePicture: (jid: string) => Promise<unknown>;
532
+ newsletterReactMessage: (jid: string, serverId: string, reaction?: string) => Promise<void>;
533
+ newsletterFetchMessages: (jid: string, count: number, since: number, after: number) => Promise<any>;
534
+ subscribeNewsletterUpdates: (jid: string) => Promise<{
535
+ duration: string;
536
+ } | null>;
537
+ newsletterAdminCount: (jid: string) => Promise<number>;
538
+ newsletterChangeOwner: (jid: string, newOwnerJid: string) => Promise<void>;
539
+ newsletterDemote: (jid: string, userJid: string) => Promise<void>;
540
+ newsletterDelete: (jid: string) => Promise<void>;
541
+ groupMetadata: (jid: string) => Promise<import("../index.js").GroupMetadata>;
542
+ groupCreate: (subject: string, participants: string[]) => Promise<import("../index.js").GroupMetadata>;
543
+ groupLeave: (id: string) => Promise<void>;
544
+ groupUpdateSubject: (jid: string, subject: string) => Promise<void>;
545
+ groupRequestParticipantsList: (jid: string) => Promise<{
546
+ [key: string]: string;
547
+ }[]>;
548
+ groupRequestParticipantsUpdate: (jid: string, participants: string[], action: "approve" | "reject") => Promise<{
549
+ status: string;
550
+ jid: string | undefined;
551
+ }[]>;
552
+ groupParticipantsUpdate: (jid: string, participants: string[], action: import("../index.js").ParticipantAction) => Promise<{
553
+ status: string;
554
+ jid: string | undefined;
555
+ content: import("../index.js").BinaryNode;
556
+ }[]>;
557
+ groupUpdateDescription: (jid: string, description?: string) => Promise<void>;
558
+ groupInviteCode: (jid: string) => Promise<string | undefined>;
559
+ groupRevokeInvite: (jid: string) => Promise<string | undefined>;
560
+ groupAcceptInvite: (code: string) => Promise<string | undefined>;
561
+ groupRevokeInviteV4: (groupJid: string, invitedJid: string) => Promise<boolean>;
562
+ groupAcceptInviteV4: (key: string | import("../index.js").WAMessageKey, inviteMessage: import("../index.js").proto.Message.IGroupInviteMessage) => Promise<any>;
563
+ groupGetInviteInfo: (code: string) => Promise<import("../index.js").GroupMetadata>;
564
+ groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
565
+ groupSettingUpdate: (jid: string, setting: "announcement" | "not_announcement" | "locked" | "unlocked") => Promise<void>;
566
+ groupMemberAddMode: (jid: string, mode: "admin_add" | "all_member_add") => Promise<void>;
567
+ groupJoinApprovalMode: (jid: string, mode: "on" | "off") => Promise<void>;
568
+ groupFetchAllParticipating: () => Promise<{
569
+ [_: string]: import("../index.js").GroupMetadata;
570
+ }>;
571
+ serverProps: {
572
+ privacyTokenOn1to1: boolean;
573
+ profilePicPrivacyToken: boolean;
574
+ lidTrustedTokenIssueToLid: boolean;
575
+ };
576
+ createCallLink: (type: "audio" | "video", event?: {
577
+ startTime: number;
578
+ }, timeoutMs?: number) => Promise<string | undefined>;
579
+ getBotListV2: () => Promise<import("../index.js").BotListInfo[]>;
580
+ messageMutex: {
581
+ mutex<T>(code: () => Promise<T> | T): Promise<T>;
582
+ };
583
+ receiptMutex: {
584
+ mutex<T>(code: () => Promise<T> | T): Promise<T>;
585
+ };
586
+ appStatePatchMutex: {
587
+ mutex<T>(code: () => Promise<T> | T): Promise<T>;
588
+ };
589
+ notificationMutex: {
590
+ mutex<T>(code: () => Promise<T> | T): Promise<T>;
591
+ };
592
+ upsertMessage: (msg: import("../index.js").WAMessage, type: import("../index.js").MessageUpsertType) => Promise<void>;
593
+ appPatch: (patchCreate: import("../index.js").WAPatchCreate) => Promise<void>;
594
+ sendPresenceUpdate: (type: import("../index.js").WAPresence, toJid?: string) => Promise<void>;
595
+ presenceSubscribe: (toJid: string) => Promise<void>;
596
+ profilePictureUrl: (jid: string, type?: "preview" | "image", timeoutMs?: number) => Promise<string | undefined>;
597
+ fetchBlocklist: () => Promise<(string | undefined)[]>;
598
+ fetchStatus: (...jids: string[]) => Promise<import("../index.js").USyncQueryResultList[] | undefined>;
599
+ fetchDisappearingDuration: (...jids: string[]) => Promise<import("../index.js").USyncQueryResultList[] | undefined>;
600
+ updateProfilePicture: (jid: string, content: import("../index.js").WAMediaUpload, dimensions?: {
601
+ width: number;
602
+ height: number;
603
+ }) => Promise<void>;
604
+ removeProfilePicture: (jid: string) => Promise<void>;
605
+ updateProfileStatus: (status: string) => Promise<void>;
606
+ updateProfileName: (name: string) => Promise<void>;
607
+ updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise<void>;
608
+ updateDisableLinkPreviewsPrivacy: (isPreviewsDisabled: boolean) => Promise<void>;
609
+ updateCallPrivacy: (value: import("../index.js").WAPrivacyCallValue) => Promise<void>;
610
+ updateMessagesPrivacy: (value: import("../index.js").WAPrivacyMessagesValue) => Promise<void>;
611
+ updateLastSeenPrivacy: (value: import("../index.js").WAPrivacyValue) => Promise<void>;
612
+ updateOnlinePrivacy: (value: import("../index.js").WAPrivacyOnlineValue) => Promise<void>;
613
+ updateProfilePicturePrivacy: (value: import("../index.js").WAPrivacyValue) => Promise<void>;
614
+ updateStatusPrivacy: (value: import("../index.js").WAPrivacyValue) => Promise<void>;
615
+ updateReadReceiptsPrivacy: (value: import("../index.js").WAReadReceiptsValue) => Promise<void>;
616
+ updateGroupsAddPrivacy: (value: import("../index.js").WAPrivacyGroupAddValue) => Promise<void>;
617
+ updateDefaultDisappearingMode: (duration: number) => Promise<void>;
618
+ getBusinessProfile: (jid: string) => Promise<import("../index.js").WABusinessProfile | void>;
619
+ resyncAppState: (collections: readonly ("critical_unblock_low" | "regular_high" | "regular_low" | "critical_block" | "regular")[], isInitialSync: boolean) => Promise<void>;
620
+ chatModify: (mod: import("../index.js").ChatModification, jid: string) => Promise<void>;
621
+ cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: number | string) => Promise<void>;
622
+ addOrEditContact: (jid: string, contact: import("../index.js").proto.SyncActionValue.IContactAction) => Promise<void>;
623
+ removeContact: (jid: string) => Promise<void>;
624
+ placeholderResendCache: import("../index.js").CacheStore;
625
+ addLabel: (jid: string, labels: import("../Types/Label.js").LabelActionBody) => Promise<void>;
626
+ addChatLabel: (jid: string, labelId: string) => Promise<void>;
627
+ removeChatLabel: (jid: string, labelId: string) => Promise<void>;
628
+ addMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
629
+ removeMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
630
+ star: (jid: string, messages: {
631
+ id: string;
632
+ fromMe?: boolean;
633
+ }[], star: boolean) => Promise<void>;
634
+ addOrEditQuickReply: (quickReply: import("../Types/Bussines.js").QuickReplyAction) => Promise<void>;
635
+ removeQuickReply: (timestamp: string) => Promise<void>;
636
+ type: "md";
637
+ ws: import("./Client/index.js").WebSocketClient;
638
+ ev: import("../index.js").YuiEventEmitter & {
639
+ process(handler: (events: Partial<import("../index.js").YuiEventMap>) => void | Promise<void>): () => void;
640
+ buffer(): void;
641
+ createBufferedFunction<A extends any[], T>(work: (...args: A) => Promise<T>): (...args: A) => Promise<T>;
642
+ flush(): boolean;
643
+ isBuffering(): boolean;
644
+ destroy(): void;
645
+ };
646
+ authState: {
647
+ creds: import("../index.js").AuthenticationCreds;
648
+ keys: import("../index.js").SignalKeyStoreWithTransaction;
649
+ };
650
+ signalRepository: import("../index.js").SignalRepositoryWithLIDStore;
651
+ user: import("../index.js").Contact | undefined;
652
+ generateMessageTag: () => string;
653
+ query: (node: import("../index.js").BinaryNode, timeoutMs?: number) => Promise<any>;
654
+ waitForMessage: <T>(msgId: string, timeoutMs?: number | undefined) => Promise<T | undefined>;
655
+ waitForSocketOpen: () => Promise<void>;
656
+ sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>;
657
+ sendNode: (frame: import("../index.js").BinaryNode) => Promise<void>;
658
+ logout: (msg?: string) => Promise<void>;
659
+ end: (error: Error | undefined) => Promise<void>;
660
+ registerSocketEndHandler: (handler: (error: Error | undefined) => void | Promise<void>) => void;
661
+ onUnexpectedError: (err: Error | Boom, msg: string) => void;
662
+ uploadPreKeys: (count?: number) => Promise<void>;
663
+ uploadPreKeysToServerIfRequired: () => Promise<void>;
664
+ digestKeyBundle: () => Promise<void>;
665
+ rotateSignedPreKey: () => Promise<void>;
666
+ requestPairingCode: (phoneNumber: string, customPairingCode?: string) => Promise<string>;
667
+ updateServerTimeOffset: ({ attrs }: import("../index.js").BinaryNode) => void;
668
+ sendUnifiedSession: () => Promise<void>;
669
+ wamBuffer: import("../index.js").BinaryInfo;
670
+ waitForConnectionUpdate: (check: (u: Partial<import("../index.js").ConnectionState>) => Promise<boolean | undefined>, timeoutMs?: number) => Promise<void>;
671
+ sendWAMBuffer: (wamBuffer: Buffer) => Promise<any>;
672
+ executeUSyncQuery: (usyncQuery: import("../index.js").USyncQuery) => Promise<import("../index.js").USyncQueryResult | undefined>;
673
+ onWhatsApp: (...phoneNumber: string[]) => Promise<{
674
+ jid: string;
675
+ exists: boolean;
676
+ }[] | undefined>;
677
+ fetchAccountReachoutTimelock: () => Promise<import("../index.js").ReachoutTimelockState>;
678
+ fetchNewChatMessageCap: () => Promise<import("../index.js").NewChatMessageCapInfo>;
679
+ } & {
680
+ getSender: (msg: import("../index.js").WAMessage) => Promise<import("../index.js").SenderInfo>;
681
+ reply: (msg: import("../index.js").WAMessage, content: string | {
682
+ [x: string]: unknown;
683
+ }, options?: import("../index.js").MiscMessageGenerationOptions) => Promise<import("../index.js").WAMessage | undefined>;
684
+ react: (msg: import("../index.js").WAMessage, emoji: string) => Promise<import("../index.js").WAMessage | undefined>;
685
+ sendSafe: (jid: string, content: string | {
686
+ [x: string]: unknown;
687
+ }, options?: import("../index.js").MiscMessageGenerationOptions, { timeoutMs }?: import("../index.js").SendSafeOptions) => Promise<import("../index.js").SendResult>;
688
+ sendButtons: (jid: string, { buttons, ...rest }: import("../index.js").SendButtonsOptions, options?: import("../index.js").MiscMessageGenerationOptions) => Promise<import("../index.js").WAMessage | undefined>;
689
+ sendCarousel: (jid: string, { cards, ...rest }: import("../index.js").SendCarouselOptions, options?: import("../index.js").MiscMessageGenerationOptions) => Promise<import("../index.js").WAMessage | undefined>;
690
+ disableButtons: (msg: import("../index.js").WAMessage, text?: string) => Promise<boolean>;
691
+ sendList: (jid: string, { sections, ...rest }: import("../index.js").SendListOptions, options?: import("../index.js").MiscMessageGenerationOptions) => Promise<import("../index.js").WAMessage | undefined>;
692
+ sendPoll: (jid: string, name: string, values: string[], poll?: Partial<Omit<import("../index.js").PollMessageOptions, "name" | "values">>, options?: import("../index.js").MiscMessageGenerationOptions) => Promise<import("../index.js").WAMessage | undefined>;
693
+ getPollVotes: (pollKey: import("../index.js").WAMessageKey | string) => {
694
+ pollKey: import("../index.js").WAMessageKey;
695
+ pollName: string;
696
+ votes: {
697
+ name: string;
698
+ voters: string[];
699
+ }[];
700
+ } | undefined;
701
+ downloadMedia: (msg: import("../index.js").WAMessage, options?: import("../index.js").DownloadMediaOptions) => Promise<Buffer>;
702
+ } & {
703
+ onReply: (matcher: import("../index.js").ReplyMatcher, run: import("../index.js").ReplyHandler, options?: import("../index.js").OnReplyOptions) => () => boolean;
704
+ onButton: (matcher: import("../index.js").ReplyMatcher, run: import("../index.js").ReplyHandler, options?: import("../index.js").OnReplyOptions) => () => boolean;
705
+ onList: (matcher: import("../index.js").ReplyMatcher, run: import("../index.js").ReplyHandler, options?: import("../index.js").OnReplyOptions) => () => boolean;
706
+ awaitReply: (msg: import("../index.js").WAMessage, { timeoutMs, filter }?: import("../index.js").AwaitReplyOptions) => Promise<import("../index.js").WAMessage | undefined>;
707
+ } & {
708
+ commands: {
709
+ add: (definition: import("../index.js").CommandDefinition) => /*elided*/ any;
710
+ remove: (name: string) => boolean;
711
+ get: (name: string) => import("../index.js").CommandDefinition | undefined;
712
+ list: () => import("../index.js").CommandDefinition[];
713
+ cooldowns: {
714
+ use: (user: string, action: string, ms: number) => number;
715
+ left: (user: string, action: string) => number;
716
+ reset: (user: string, action?: string) => void;
717
+ clear: () => void;
718
+ };
719
+ handle: (msg: import("../index.js").WAMessage) => Promise<boolean>;
720
+ listen: () => () => void | undefined;
721
+ };
722
+ schedule: {
723
+ at: (when: Date | number | string, jid: string, content: {
724
+ [x: string]: unknown;
725
+ }) => string;
726
+ after: (delay: string | number, jid: string, content: {
727
+ [x: string]: unknown;
728
+ }) => string;
729
+ every: (interval: string | number, jid: string, content: {
730
+ [x: string]: unknown;
731
+ }, extra?: {
732
+ times?: number;
733
+ }) => string;
734
+ cron: (expression: string, jid: string, content: {
735
+ [x: string]: unknown;
736
+ }, extra?: {
737
+ times?: number;
738
+ }) => string;
739
+ list: () => import("../index.js").ScheduledJob[];
740
+ cancel: (id: string) => boolean;
741
+ clear: () => void;
742
+ start: () => void;
743
+ stop: () => void;
744
+ flush: () => Promise<void>;
745
+ };
746
+ cooldown: (user: string, action: string, ms: number) => number;
747
+ sendMessage: (jid: string, content: import("../index.js").AnyMessageContent, options?: import("../index.js").MiscMessageGenerationOptions) => Promise<import("../index.js").WAMessage | undefined>;
748
+ sendMessageNow: (jid: string, content: import("../index.js").AnyMessageContent, options?: import("../index.js").MiscMessageGenerationOptions) => Promise<import("../index.js").WAMessage | undefined>;
749
+ messageStore: {
750
+ save: (msg: Pick<import("../index.js").WAMessage, "key" | "message"> | null | undefined) => void;
751
+ get: (key: Pick<import("../index.js").WAMessageKey, "id">) => import("../index.js").proto.IMessage | undefined;
752
+ readonly size: number;
753
+ clear: () => void;
754
+ } | undefined;
755
+ groupCache: {
756
+ get: (jid: string) => import("../index.js").GroupMetadata | undefined;
757
+ set: (jid: string, data: import("../index.js").GroupMetadata) => void;
758
+ delete: (jid: string) => boolean;
759
+ clear: () => void;
760
+ readonly size: number;
761
+ } | undefined;
762
+ confirm: (msg: import("../index.js").WAMessage, text: string, options?: import("../index.js").ConfirmOptions) => Promise<boolean>;
763
+ paginate: (msg: import("../index.js").WAMessage, items: unknown[], options?: import("../index.js").PaginateOptions) => Promise<import("../index.js").WAMessage | undefined>;
764
+ menu: (msg: import("../index.js").WAMessage, definition: import("../index.js").MenuDefinition) => Promise<import("../index.js").WAMessage | undefined>;
765
+ sendGuardedButtons: (msg: import("../index.js").WAMessage, options: import("../index.js").GuardedButtonsOptions, onTap: (tap: import("../index.js").TapContext & {
766
+ id: string;
767
+ }) => void | Promise<void>) => Promise<import("../index.js").WAMessage | undefined>;
768
+ sendRepeatable: (msg: import("../index.js").WAMessage, source: string | {
769
+ [x: string]: unknown;
770
+ } | (() => string | {
771
+ [x: string]: unknown;
772
+ } | Promise<string | {
773
+ [x: string]: unknown;
774
+ }>), options?: import("../index.js").RepeatableOptions) => Promise<import("../index.js").WAMessage | undefined>;
775
+ getAdmins: (groupJid: string) => Promise<import("../index.js").GroupParticipant[]>;
776
+ isAdmin: (groupJid: string, who: import("../index.js").GroupMember) => Promise<boolean>;
777
+ isBotAdmin: (groupJid: string) => Promise<boolean>;
778
+ kick: (groupJid: string, who: string | string[]) => Promise<unknown>;
779
+ addMembers: (groupJid: string, who: string | string[]) => Promise<unknown>;
780
+ promote: (groupJid: string, who: string | string[]) => Promise<unknown>;
781
+ demote: (groupJid: string, who: string | string[]) => Promise<unknown>;
782
+ getStats: () => import("../index.js").StatsSnapshot;
783
+ resetStats: () => void;
784
+ getMessageStatus: (message: string | Pick<import("../index.js").WAMessageKey, "id">) => import("../index.js").MessageDelivery | undefined;
785
+ health: ({ ping, timeoutMs }?: {
786
+ ping?: boolean;
787
+ timeoutMs?: number;
788
+ }) => Promise<import("../index.js").HealthReport>;
789
+ queue: {
790
+ readonly size: number;
791
+ clear: () => number;
792
+ };
793
+ }) | undefined;
794
+ /** closes the connection but keeps the login */
795
+ stop: () => Promise<boolean>;
796
+ /** logs out of WhatsApp and deletes the saved login */
797
+ logout: () => Promise<boolean>;
798
+ }>;
799
+ export type Bot = Awaited<ReturnType<typeof connectBot>>;
800
+ //# sourceMappingURL=connect-bot.d.ts.map