@lzif/zaileys 1.0.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.
@@ -0,0 +1,1184 @@
1
+ import * as baileys from 'baileys';
2
+ import baileys__default, { AuthenticationState, WAMessage, proto, ParticipantAction, WAPrivacyValue, WAPrivacyOnlineValue, WAReadReceiptsValue, WAPrivacyGroupAddValue } from 'baileys';
3
+ import { JetDB } from 'jetdb';
4
+ import z, { z as z$1 } from 'zod';
5
+ import pino from 'pino';
6
+ import Stream from 'stream';
7
+ import _ from 'lodash';
8
+
9
+ declare const useAuthState: (folder: string) => Promise<{
10
+ state: AuthenticationState;
11
+ saveCreds: () => Promise<void>;
12
+ }>;
13
+
14
+ declare class CleanUpManager {
15
+ private client;
16
+ private interval;
17
+ constructor(client: Client);
18
+ start(): void;
19
+ stop(): void;
20
+ run(): Promise<void>;
21
+ }
22
+
23
+ declare class HealthManager {
24
+ private client;
25
+ private keysDb;
26
+ constructor(client: Client);
27
+ private setupLogFilters;
28
+ repair(jid: string): Promise<void>;
29
+ get logger(): pino.Logger<never, boolean>;
30
+ }
31
+
32
+ declare const SignalType: z.ZodEnum<{
33
+ delete: "delete";
34
+ forward: "forward";
35
+ button: "button";
36
+ edit: "edit";
37
+ }>;
38
+ declare const SignalOptionsType: z.ZodUnion<[z.ZodString, z.ZodIntersection<z.ZodUnion<readonly [z.ZodObject<{
39
+ text: z.ZodString;
40
+ }, z.core.$loose>, z.ZodObject<{
41
+ image: z.ZodUnion<[z.ZodUnion<[z.ZodURL, z.ZodBase64]>, z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>]>;
42
+ caption: z.ZodOptional<z.ZodString>;
43
+ }, z.core.$loose>, z.ZodObject<{
44
+ audio: z.ZodUnion<[z.ZodUnion<[z.ZodURL, z.ZodBase64]>, z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>]>;
45
+ caption: z.ZodOptional<z.ZodString>;
46
+ ptt: z.ZodOptional<z.ZodBoolean>;
47
+ }, z.core.$loose>, z.ZodObject<{
48
+ video: z.ZodUnion<[z.ZodUnion<[z.ZodURL, z.ZodBase64]>, z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>]>;
49
+ caption: z.ZodOptional<z.ZodString>;
50
+ ptv: z.ZodOptional<z.ZodBoolean>;
51
+ }, z.core.$loose>, z.ZodObject<{
52
+ sticker: z.ZodUnion<[z.ZodUnion<[z.ZodURL, z.ZodBase64]>, z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>]>;
53
+ shape: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
54
+ default: "default";
55
+ rounded: "rounded";
56
+ circle: "circle";
57
+ oval: "oval";
58
+ }>>>;
59
+ caption: z.ZodOptional<z.ZodString>;
60
+ }, z.core.$loose>, z.ZodObject<{
61
+ document: z.ZodUnion<[z.ZodUnion<[z.ZodURL, z.ZodBase64]>, z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>]>;
62
+ caption: z.ZodOptional<z.ZodString>;
63
+ fileName: z.ZodOptional<z.ZodString>;
64
+ }, z.core.$loose>, z.ZodObject<{
65
+ location: z.ZodOptional<z.ZodObject<{
66
+ latitude: z.ZodNumber;
67
+ longitude: z.ZodNumber;
68
+ url: z.ZodOptional<z.ZodURL>;
69
+ title: z.ZodOptional<z.ZodString>;
70
+ footer: z.ZodOptional<z.ZodString>;
71
+ }, z.core.$strip>>;
72
+ }, z.core.$loose>, z.ZodObject<{
73
+ contacts: z.ZodObject<{
74
+ title: z.ZodOptional<z.ZodString>;
75
+ contacts: z.ZodArray<z.ZodObject<{
76
+ fullname: z.ZodString;
77
+ phoneNumber: z.ZodNumber;
78
+ organization: z.ZodOptional<z.ZodString>;
79
+ }, z.core.$strip>>;
80
+ }, z.core.$strip>;
81
+ }, z.core.$loose>, z.ZodObject<{
82
+ poll: z.ZodObject<{
83
+ name: z.ZodString;
84
+ answers: z.ZodArray<z.ZodString>;
85
+ isMultiple: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
86
+ }, z.core.$strip>;
87
+ }, z.core.$strip>]>, z.ZodObject<{
88
+ isViewOnce: z.ZodOptional<z.ZodBoolean>;
89
+ replied: z.ZodOptional<z.ZodCustom<WAMessage, WAMessage>>;
90
+ isForwardedMany: z.ZodOptional<z.ZodBoolean>;
91
+ banner: z.ZodOptional<z.ZodCustom<proto.ContextInfo.IExternalAdReplyInfo, proto.ContextInfo.IExternalAdReplyInfo>>;
92
+ }, z.core.$strip>>]>;
93
+ declare const ButtonOptionsType: z.ZodIntersection<z.ZodObject<{
94
+ text: z.ZodString;
95
+ }, z.core.$loose>, z.ZodObject<{
96
+ buttons: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
97
+ type: z.ZodLiteral<"simple">;
98
+ footer: z.ZodOptional<z.ZodString>;
99
+ data: z.ZodArray<z.ZodObject<{
100
+ id: z.ZodString;
101
+ text: z.ZodString;
102
+ }, z.core.$strip>>;
103
+ }, z.core.$strip>, z.ZodObject<{
104
+ type: z.ZodLiteral<"interactive">;
105
+ footer: z.ZodOptional<z.ZodString>;
106
+ data: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
107
+ type: z.ZodLiteral<"quick_reply">;
108
+ text: z.ZodString;
109
+ }, z.core.$strip>, z.ZodObject<{
110
+ type: z.ZodLiteral<"cta_url">;
111
+ url: z.ZodURL;
112
+ text: z.ZodString;
113
+ }, z.core.$strip>, z.ZodObject<{
114
+ type: z.ZodLiteral<"cta_copy">;
115
+ copy: z.ZodString;
116
+ text: z.ZodString;
117
+ }, z.core.$strip>, z.ZodObject<{
118
+ type: z.ZodLiteral<"cta_call">;
119
+ text: z.ZodString;
120
+ phoneNumber: z.ZodString;
121
+ }, z.core.$strip>, z.ZodObject<{
122
+ type: z.ZodLiteral<"single_select">;
123
+ text: z.ZodString;
124
+ section: z.ZodArray<z.ZodObject<{
125
+ title: z.ZodString;
126
+ highlight_label: z.ZodOptional<z.ZodString>;
127
+ rows: z.ZodArray<z.ZodObject<{
128
+ id: z.ZodString;
129
+ title: z.ZodString;
130
+ header: z.ZodOptional<z.ZodString>;
131
+ description: z.ZodOptional<z.ZodString>;
132
+ }, z.core.$strip>>;
133
+ }, z.core.$strip>>;
134
+ }, z.core.$strip>]>>;
135
+ }, z.core.$strip>]>>;
136
+ isViewOnce: z.ZodOptional<z.ZodBoolean>;
137
+ replied: z.ZodOptional<z.ZodCustom<WAMessage, WAMessage>>;
138
+ isForwardedMany: z.ZodOptional<z.ZodBoolean>;
139
+ }, z.core.$strip>>;
140
+
141
+ declare class Signal {
142
+ protected client: Client;
143
+ constructor(client: Client);
144
+ protected signal(roomId: string, options: z.infer<typeof SignalOptionsType>, type?: z.infer<typeof SignalType>, message?: WAMessage): Promise<WAMessage>;
145
+ send(roomId: string, options: z.infer<typeof SignalOptionsType>): Promise<WAMessage>;
146
+ forward(roomId: string, options: z.infer<typeof SignalOptionsType>): Promise<WAMessage>;
147
+ button(roomId: string, options: z.infer<typeof ButtonOptionsType>): Promise<WAMessage>;
148
+ edit(message: WAMessage, options: z.infer<typeof SignalOptionsType>): Promise<WAMessage>;
149
+ delete(message: WAMessage | WAMessage[]): Promise<WAMessage | (baileys.proto.IWebMessageInfo & {
150
+ key: baileys.WAMessageKey;
151
+ messageStubParameters?: any;
152
+ category?: string;
153
+ retryCount?: number;
154
+ })[]>;
155
+ presence(roomId: string, type: 'typing' | 'recording' | 'online' | 'offline' | 'paused'): Promise<void>;
156
+ reaction(message: WAMessage, reaction: string): Promise<WAMessage>;
157
+ memberLabel(roomId: string, label: string): Promise<string>;
158
+ }
159
+
160
+ declare class Community {
161
+ protected client: Client;
162
+ constructor(client: Client);
163
+ create(subject: string, description: string): Promise<baileys.GroupMetadata>;
164
+ createGroup(subject: string, participants: string[], parentId: string): Promise<baileys.GroupMetadata>;
165
+ leave(id: string): Promise<void>;
166
+ metadata(id: string): Promise<baileys.GroupMetadata>;
167
+ update(id: string, type: 'subject' | 'description', value: string): Promise<void>;
168
+ group(id: string, type: 'link' | 'unlink' | 'linked', groupJid?: string): Promise<void | {
169
+ communityJid: string;
170
+ isCommunity: boolean;
171
+ linkedGroups: {
172
+ id: string | undefined;
173
+ subject: string;
174
+ creation: number | undefined;
175
+ owner: string | undefined;
176
+ size: number | undefined;
177
+ }[];
178
+ }>;
179
+ participants(id: string, type: 'list' | 'request-update' | 'update' | 'all', action?: 'add' | 'remove' | 'promote' | 'demote' | 'approve' | 'reject', participants?: string[]): Promise<{
180
+ [key: string]: string;
181
+ }[] | {
182
+ status: string;
183
+ jid: string | undefined;
184
+ }[] | {
185
+ [_: string]: baileys.GroupMetadata;
186
+ }>;
187
+ invite(target: string | any, type: 'code' | 'revoke' | 'accept' | 'info' | 'revokeV4' | 'acceptV4', ...args: any[]): Promise<any>;
188
+ settings(id: string, type: 'ephemeral' | 'update' | 'memberAdd' | 'approval', value?: any): Promise<void>;
189
+ }
190
+ declare class SignalCommunity {
191
+ protected mlient: Client;
192
+ community: Community;
193
+ constructor(mlient: Client);
194
+ }
195
+
196
+ declare class Group {
197
+ protected client: Client;
198
+ constructor(client: Client);
199
+ create(name: string, participants: string[]): Promise<baileys.GroupMetadata>;
200
+ participant(roomId: string, participants: string[], action: ParticipantAction): Promise<{
201
+ status: string;
202
+ jid: string | undefined;
203
+ content: baileys.BinaryNode;
204
+ }[]>;
205
+ profile(roomId: string, update: string | Buffer, type: 'subject' | 'description' | 'picture'): Promise<void>;
206
+ setting(roomId: string, type: 'open' | 'close' | 'locked' | 'unlocked' | 'all_member_add' | 'admin_add'): Promise<void>;
207
+ leave(roomId: string): Promise<void>;
208
+ inviteCode(roomId: string, type: 'code' | 'revoke' | 'accept' | 'info'): Promise<string | baileys.GroupMetadata>;
209
+ metadata(roomId: string): Promise<any>;
210
+ requestJoin(roomId: string, participants: string[], type: 'approve' | 'reject'): Promise<{
211
+ status: string;
212
+ jid: string | undefined;
213
+ }[]>;
214
+ requestJoinList(roomId: string): Promise<{
215
+ [key: string]: string;
216
+ }[]>;
217
+ fetchAllGroups(): Promise<{
218
+ [_: string]: baileys.GroupMetadata;
219
+ }>;
220
+ ephemeral(roomId: string, type: 'off' | '24h' | '7d' | '90d'): Promise<void>;
221
+ }
222
+ declare class SignalGroup {
223
+ protected glient: Client;
224
+ group: Group;
225
+ constructor(glient: Client);
226
+ }
227
+
228
+ declare class Newsletter {
229
+ protected client: Client;
230
+ constructor(client: Client);
231
+ create(name: string, description: string): Promise<baileys.NewsletterMetadata>;
232
+ action(roomId: string, type: 'follow' | 'unfollow' | 'mute' | 'unmute' | ''): Promise<unknown>;
233
+ update(roomId: string, update: string | Buffer, type: 'name' | 'description' | 'picture'): Promise<unknown>;
234
+ metadata(roomId: string, type: 'invite' | 'jid'): Promise<baileys.NewsletterMetadata>;
235
+ subscribers(roomId: string): Promise<{
236
+ subscribers: number;
237
+ }>;
238
+ reaction(roomId: string, chatId: string, reaction: string): Promise<void>;
239
+ fetchMessages(roomId: string, count: number, since: Date, after: Date): Promise<any>;
240
+ adminCount(roomId: string): Promise<number>;
241
+ changeOwner(roomId: string, owner: string): Promise<void>;
242
+ demote(roomId: string, senderId: string): Promise<void>;
243
+ delete(roomId: string): Promise<void>;
244
+ removePicture(roomId: string): Promise<unknown>;
245
+ }
246
+ declare class SignalNewsletter {
247
+ protected nlient: Client;
248
+ newsletter: Newsletter;
249
+ constructor(nlient: Client);
250
+ }
251
+
252
+ declare class Privacy {
253
+ protected client: Client;
254
+ constructor(client: Client);
255
+ block(senderId: string): Promise<void>;
256
+ unblock(senderId: string): Promise<void>;
257
+ lastSeen(type: WAPrivacyValue): Promise<void>;
258
+ online(type: WAPrivacyOnlineValue): Promise<void>;
259
+ picture(type: WAPrivacyValue): Promise<void>;
260
+ status(type: WAPrivacyValue): Promise<void>;
261
+ readReceipt(type: WAReadReceiptsValue): Promise<void>;
262
+ groupsAdd(type: WAPrivacyGroupAddValue): Promise<void>;
263
+ ephemeral(type: 'off' | '24h' | '7d' | '90d'): Promise<void>;
264
+ blocklist(): Promise<string[]>;
265
+ getSettings(): Promise<{
266
+ [_: string]: string;
267
+ }>;
268
+ }
269
+ declare class SignalPrivacy {
270
+ protected plient: Client;
271
+ privacy: Privacy;
272
+ constructor(plient: Client);
273
+ }
274
+
275
+ declare const ListenerCallsType: z.ZodObject<{
276
+ callId: z.ZodString;
277
+ callerId: z.ZodString;
278
+ roomId: z.ZodString;
279
+ roomName: z.ZodString;
280
+ date: z.ZodDate;
281
+ offline: z.ZodBoolean;
282
+ status: z.ZodEnum<{
283
+ accept: "accept";
284
+ offer: "offer";
285
+ reject: "reject";
286
+ ringing: "ringing";
287
+ terminate: "terminate";
288
+ timeout: "timeout";
289
+ }>;
290
+ isVideo: z.ZodBoolean;
291
+ isGroup: z.ZodBoolean;
292
+ }, z.core.$strip>;
293
+ type CallsContext = z.infer<typeof ListenerCallsType>;
294
+
295
+ declare const ListenerConnectionType: z.ZodObject<{
296
+ status: z.ZodEnum<{
297
+ connecting: "connecting";
298
+ open: "open";
299
+ close: "close";
300
+ reload: "reload";
301
+ syncing: "syncing";
302
+ }>;
303
+ authType: z.ZodEnum<{
304
+ pairing: "pairing";
305
+ qr: "qr";
306
+ }>;
307
+ authTimeout: z.ZodOptional<z.ZodNumber>;
308
+ syncProgress: z.ZodOptional<z.ZodNumber>;
309
+ syncCompleted: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
310
+ qr: z.ZodOptional<z.ZodString>;
311
+ code: z.ZodOptional<z.ZodString>;
312
+ }, z.core.$strip>;
313
+ type ConnectionContext = z.infer<typeof ListenerConnectionType>;
314
+
315
+ declare const DEVICE_ENUM_TYPES: z.ZodEnum<{
316
+ unknown: "unknown";
317
+ android: "android";
318
+ ios: "ios";
319
+ desktop: "desktop";
320
+ web: "web";
321
+ }>;
322
+ declare const MESSAGE_ENUM_TYPES: z.ZodEnum<{
323
+ sticker: "sticker";
324
+ video: "video";
325
+ text: "text";
326
+ album: "album";
327
+ image: "image";
328
+ contact: "contact";
329
+ location: "location";
330
+ document: "document";
331
+ audio: "audio";
332
+ protocol: "protocol";
333
+ contacts: "contacts";
334
+ highlyStructured: "highlyStructured";
335
+ sendPayment: "sendPayment";
336
+ requestPayment: "requestPayment";
337
+ groupStatusMention: "groupStatusMention";
338
+ statusMention: "statusMention";
339
+ declinePaymentRequest: "declinePaymentRequest";
340
+ cancelPaymentRequest: "cancelPaymentRequest";
341
+ template: "template";
342
+ groupInvite: "groupInvite";
343
+ product: "product";
344
+ deviceSent: "deviceSent";
345
+ lists: "lists";
346
+ viewOnce: "viewOnce";
347
+ order: "order";
348
+ ephemeral: "ephemeral";
349
+ invoice: "invoice";
350
+ buttons: "buttons";
351
+ paymentInvite: "paymentInvite";
352
+ interactive: "interactive";
353
+ reaction: "reaction";
354
+ interactiveResponse: "interactiveResponse";
355
+ pollCreation: "pollCreation";
356
+ pollUpdate: "pollUpdate";
357
+ keepInChat: "keepInChat";
358
+ requestPhoneNumber: "requestPhoneNumber";
359
+ scheduledCallCreation: "scheduledCallCreation";
360
+ groupMentioned: "groupMentioned";
361
+ pinInChat: "pinInChat";
362
+ scheduledCallEdit: "scheduledCallEdit";
363
+ ptv: "ptv";
364
+ botInvoke: "botInvoke";
365
+ callLog: "callLog";
366
+ encComment: "encComment";
367
+ bcall: "bcall";
368
+ lottieSticker: "lottieSticker";
369
+ event: "event";
370
+ comment: "comment";
371
+ placeholder: "placeholder";
372
+ encEventUpdate: "encEventUpdate";
373
+ }>;
374
+ declare const BaseMessagesType: z.ZodObject<{
375
+ channelId: z.ZodString;
376
+ uniqueId: z.ZodString;
377
+ chatId: z.ZodString;
378
+ chatType: z.ZodEnum<{
379
+ sticker: "sticker";
380
+ video: "video";
381
+ text: "text";
382
+ album: "album";
383
+ image: "image";
384
+ contact: "contact";
385
+ location: "location";
386
+ document: "document";
387
+ audio: "audio";
388
+ protocol: "protocol";
389
+ contacts: "contacts";
390
+ highlyStructured: "highlyStructured";
391
+ sendPayment: "sendPayment";
392
+ requestPayment: "requestPayment";
393
+ groupStatusMention: "groupStatusMention";
394
+ statusMention: "statusMention";
395
+ declinePaymentRequest: "declinePaymentRequest";
396
+ cancelPaymentRequest: "cancelPaymentRequest";
397
+ template: "template";
398
+ groupInvite: "groupInvite";
399
+ product: "product";
400
+ deviceSent: "deviceSent";
401
+ lists: "lists";
402
+ viewOnce: "viewOnce";
403
+ order: "order";
404
+ ephemeral: "ephemeral";
405
+ invoice: "invoice";
406
+ buttons: "buttons";
407
+ paymentInvite: "paymentInvite";
408
+ interactive: "interactive";
409
+ reaction: "reaction";
410
+ interactiveResponse: "interactiveResponse";
411
+ pollCreation: "pollCreation";
412
+ pollUpdate: "pollUpdate";
413
+ keepInChat: "keepInChat";
414
+ requestPhoneNumber: "requestPhoneNumber";
415
+ scheduledCallCreation: "scheduledCallCreation";
416
+ groupMentioned: "groupMentioned";
417
+ pinInChat: "pinInChat";
418
+ scheduledCallEdit: "scheduledCallEdit";
419
+ ptv: "ptv";
420
+ botInvoke: "botInvoke";
421
+ callLog: "callLog";
422
+ encComment: "encComment";
423
+ bcall: "bcall";
424
+ lottieSticker: "lottieSticker";
425
+ event: "event";
426
+ comment: "comment";
427
+ placeholder: "placeholder";
428
+ encEventUpdate: "encEventUpdate";
429
+ }>;
430
+ receiverLid: z.ZodString;
431
+ receiverId: z.ZodString;
432
+ receiverName: z.ZodString;
433
+ roomId: z.ZodString;
434
+ roomName: z.ZodString;
435
+ senderLid: z.ZodString;
436
+ senderId: z.ZodString;
437
+ senderName: z.ZodString;
438
+ senderDevice: z.ZodEnum<{
439
+ unknown: "unknown";
440
+ android: "android";
441
+ ios: "ios";
442
+ desktop: "desktop";
443
+ web: "web";
444
+ }>;
445
+ timestamp: z.ZodNumber;
446
+ text: z.ZodNullable<z.ZodString>;
447
+ mentions: z.ZodArray<z.ZodString>;
448
+ links: z.ZodArray<z.ZodString>;
449
+ isBot: z.ZodBoolean;
450
+ isFromMe: z.ZodBoolean;
451
+ isPrefix: z.ZodBoolean;
452
+ isSpam: z.ZodBoolean;
453
+ isTagMe: z.ZodBoolean;
454
+ isStatusMention: z.ZodBoolean;
455
+ isGroupStatusMention: z.ZodBoolean;
456
+ isHideTags: z.ZodBoolean;
457
+ isGroup: z.ZodBoolean;
458
+ isNewsletter: z.ZodBoolean;
459
+ isQuestion: z.ZodBoolean;
460
+ isStory: z.ZodBoolean;
461
+ isViewOnce: z.ZodBoolean;
462
+ isEdited: z.ZodBoolean;
463
+ isDeleted: z.ZodBoolean;
464
+ isPinned: z.ZodBoolean;
465
+ isUnPinned: z.ZodBoolean;
466
+ isBroadcast: z.ZodBoolean;
467
+ isEphemeral: z.ZodBoolean;
468
+ isForwarded: z.ZodBoolean;
469
+ citation: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodFunction<z.core.$ZodFunctionArgs, z.ZodPromise<z.ZodBoolean>>>>;
470
+ media: z.ZodNullable<z.ZodObject<{
471
+ buffer: z.ZodFunction<z.core.$ZodFunctionArgs, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
472
+ stream: z.ZodFunction<z.core.$ZodFunctionArgs, z.ZodPromise<z.ZodCustom<Stream, Stream>>>;
473
+ }, z.core.$loose>>;
474
+ injection: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodAny>>;
475
+ message: z.ZodFunction<z.ZodTuple<readonly [], null>, z.ZodCustom<WAMessage, WAMessage>>;
476
+ }, z.core.$strip>;
477
+ declare const ListenerMessagesType: z.ZodObject<{
478
+ channelId: z.ZodString;
479
+ uniqueId: z.ZodString;
480
+ chatId: z.ZodString;
481
+ chatType: z.ZodEnum<{
482
+ sticker: "sticker";
483
+ video: "video";
484
+ text: "text";
485
+ album: "album";
486
+ image: "image";
487
+ contact: "contact";
488
+ location: "location";
489
+ document: "document";
490
+ audio: "audio";
491
+ protocol: "protocol";
492
+ contacts: "contacts";
493
+ highlyStructured: "highlyStructured";
494
+ sendPayment: "sendPayment";
495
+ requestPayment: "requestPayment";
496
+ groupStatusMention: "groupStatusMention";
497
+ statusMention: "statusMention";
498
+ declinePaymentRequest: "declinePaymentRequest";
499
+ cancelPaymentRequest: "cancelPaymentRequest";
500
+ template: "template";
501
+ groupInvite: "groupInvite";
502
+ product: "product";
503
+ deviceSent: "deviceSent";
504
+ lists: "lists";
505
+ viewOnce: "viewOnce";
506
+ order: "order";
507
+ ephemeral: "ephemeral";
508
+ invoice: "invoice";
509
+ buttons: "buttons";
510
+ paymentInvite: "paymentInvite";
511
+ interactive: "interactive";
512
+ reaction: "reaction";
513
+ interactiveResponse: "interactiveResponse";
514
+ pollCreation: "pollCreation";
515
+ pollUpdate: "pollUpdate";
516
+ keepInChat: "keepInChat";
517
+ requestPhoneNumber: "requestPhoneNumber";
518
+ scheduledCallCreation: "scheduledCallCreation";
519
+ groupMentioned: "groupMentioned";
520
+ pinInChat: "pinInChat";
521
+ scheduledCallEdit: "scheduledCallEdit";
522
+ ptv: "ptv";
523
+ botInvoke: "botInvoke";
524
+ callLog: "callLog";
525
+ encComment: "encComment";
526
+ bcall: "bcall";
527
+ lottieSticker: "lottieSticker";
528
+ event: "event";
529
+ comment: "comment";
530
+ placeholder: "placeholder";
531
+ encEventUpdate: "encEventUpdate";
532
+ }>;
533
+ receiverLid: z.ZodString;
534
+ receiverId: z.ZodString;
535
+ receiverName: z.ZodString;
536
+ roomId: z.ZodString;
537
+ roomName: z.ZodString;
538
+ senderLid: z.ZodString;
539
+ senderId: z.ZodString;
540
+ senderName: z.ZodString;
541
+ senderDevice: z.ZodEnum<{
542
+ unknown: "unknown";
543
+ android: "android";
544
+ ios: "ios";
545
+ desktop: "desktop";
546
+ web: "web";
547
+ }>;
548
+ timestamp: z.ZodNumber;
549
+ text: z.ZodNullable<z.ZodString>;
550
+ mentions: z.ZodArray<z.ZodString>;
551
+ links: z.ZodArray<z.ZodString>;
552
+ isBot: z.ZodBoolean;
553
+ isFromMe: z.ZodBoolean;
554
+ isPrefix: z.ZodBoolean;
555
+ isSpam: z.ZodBoolean;
556
+ isTagMe: z.ZodBoolean;
557
+ isStatusMention: z.ZodBoolean;
558
+ isGroupStatusMention: z.ZodBoolean;
559
+ isHideTags: z.ZodBoolean;
560
+ isGroup: z.ZodBoolean;
561
+ isNewsletter: z.ZodBoolean;
562
+ isQuestion: z.ZodBoolean;
563
+ isStory: z.ZodBoolean;
564
+ isViewOnce: z.ZodBoolean;
565
+ isEdited: z.ZodBoolean;
566
+ isDeleted: z.ZodBoolean;
567
+ isPinned: z.ZodBoolean;
568
+ isUnPinned: z.ZodBoolean;
569
+ isBroadcast: z.ZodBoolean;
570
+ isEphemeral: z.ZodBoolean;
571
+ isForwarded: z.ZodBoolean;
572
+ citation: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodFunction<z.core.$ZodFunctionArgs, z.ZodPromise<z.ZodBoolean>>>>;
573
+ media: z.ZodNullable<z.ZodObject<{
574
+ buffer: z.ZodFunction<z.core.$ZodFunctionArgs, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
575
+ stream: z.ZodFunction<z.core.$ZodFunctionArgs, z.ZodPromise<z.ZodCustom<Stream, Stream>>>;
576
+ }, z.core.$loose>>;
577
+ injection: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodAny>>;
578
+ message: z.ZodFunction<z.ZodTuple<readonly [], null>, z.ZodCustom<WAMessage, WAMessage>>;
579
+ replied: z.ZodNullable<z.ZodObject<{
580
+ channelId: z.ZodString;
581
+ uniqueId: z.ZodString;
582
+ chatId: z.ZodString;
583
+ chatType: z.ZodEnum<{
584
+ sticker: "sticker";
585
+ video: "video";
586
+ text: "text";
587
+ album: "album";
588
+ image: "image";
589
+ contact: "contact";
590
+ location: "location";
591
+ document: "document";
592
+ audio: "audio";
593
+ protocol: "protocol";
594
+ contacts: "contacts";
595
+ highlyStructured: "highlyStructured";
596
+ sendPayment: "sendPayment";
597
+ requestPayment: "requestPayment";
598
+ groupStatusMention: "groupStatusMention";
599
+ statusMention: "statusMention";
600
+ declinePaymentRequest: "declinePaymentRequest";
601
+ cancelPaymentRequest: "cancelPaymentRequest";
602
+ template: "template";
603
+ groupInvite: "groupInvite";
604
+ product: "product";
605
+ deviceSent: "deviceSent";
606
+ lists: "lists";
607
+ viewOnce: "viewOnce";
608
+ order: "order";
609
+ ephemeral: "ephemeral";
610
+ invoice: "invoice";
611
+ buttons: "buttons";
612
+ paymentInvite: "paymentInvite";
613
+ interactive: "interactive";
614
+ reaction: "reaction";
615
+ interactiveResponse: "interactiveResponse";
616
+ pollCreation: "pollCreation";
617
+ pollUpdate: "pollUpdate";
618
+ keepInChat: "keepInChat";
619
+ requestPhoneNumber: "requestPhoneNumber";
620
+ scheduledCallCreation: "scheduledCallCreation";
621
+ groupMentioned: "groupMentioned";
622
+ pinInChat: "pinInChat";
623
+ scheduledCallEdit: "scheduledCallEdit";
624
+ ptv: "ptv";
625
+ botInvoke: "botInvoke";
626
+ callLog: "callLog";
627
+ encComment: "encComment";
628
+ bcall: "bcall";
629
+ lottieSticker: "lottieSticker";
630
+ event: "event";
631
+ comment: "comment";
632
+ placeholder: "placeholder";
633
+ encEventUpdate: "encEventUpdate";
634
+ }>;
635
+ receiverLid: z.ZodString;
636
+ receiverId: z.ZodString;
637
+ receiverName: z.ZodString;
638
+ roomId: z.ZodString;
639
+ roomName: z.ZodString;
640
+ senderLid: z.ZodString;
641
+ senderId: z.ZodString;
642
+ senderName: z.ZodString;
643
+ senderDevice: z.ZodEnum<{
644
+ unknown: "unknown";
645
+ android: "android";
646
+ ios: "ios";
647
+ desktop: "desktop";
648
+ web: "web";
649
+ }>;
650
+ timestamp: z.ZodNumber;
651
+ text: z.ZodNullable<z.ZodString>;
652
+ mentions: z.ZodArray<z.ZodString>;
653
+ links: z.ZodArray<z.ZodString>;
654
+ isBot: z.ZodBoolean;
655
+ isFromMe: z.ZodBoolean;
656
+ isPrefix: z.ZodBoolean;
657
+ isSpam: z.ZodBoolean;
658
+ isTagMe: z.ZodBoolean;
659
+ isStatusMention: z.ZodBoolean;
660
+ isGroupStatusMention: z.ZodBoolean;
661
+ isHideTags: z.ZodBoolean;
662
+ isGroup: z.ZodBoolean;
663
+ isNewsletter: z.ZodBoolean;
664
+ isQuestion: z.ZodBoolean;
665
+ isStory: z.ZodBoolean;
666
+ isViewOnce: z.ZodBoolean;
667
+ isEdited: z.ZodBoolean;
668
+ isDeleted: z.ZodBoolean;
669
+ isPinned: z.ZodBoolean;
670
+ isUnPinned: z.ZodBoolean;
671
+ isBroadcast: z.ZodBoolean;
672
+ isEphemeral: z.ZodBoolean;
673
+ isForwarded: z.ZodBoolean;
674
+ citation: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodFunction<z.core.$ZodFunctionArgs, z.ZodPromise<z.ZodBoolean>>>>;
675
+ media: z.ZodNullable<z.ZodObject<{
676
+ buffer: z.ZodFunction<z.core.$ZodFunctionArgs, z.ZodPromise<z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>>>>;
677
+ stream: z.ZodFunction<z.core.$ZodFunctionArgs, z.ZodPromise<z.ZodCustom<Stream, Stream>>>;
678
+ }, z.core.$loose>>;
679
+ injection: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodAny>>;
680
+ message: z.ZodFunction<z.ZodTuple<readonly [], null>, z.ZodCustom<WAMessage, WAMessage>>;
681
+ }, z.core.$strip>>;
682
+ }, z.core.$strip>;
683
+ type MessagesContext = z.infer<typeof ListenerMessagesType>;
684
+
685
+ declare const LimiterType: z$1.ZodOptional<z$1.ZodObject<{
686
+ maxMessages: z$1.ZodDefault<z$1.ZodNumber>;
687
+ durationMs: z$1.ZodDefault<z$1.ZodNumber>;
688
+ }, z$1.core.$strip>>;
689
+ declare const CitationType: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodFunction<z$1.core.$ZodFunctionArgs, z$1.ZodPromise<z$1.ZodArray<z$1.ZodNumber>>>>>;
690
+ declare const FakeReplyType: z$1.ZodOptional<z$1.ZodObject<{
691
+ provider: z$1.ZodUnion<[z$1.ZodEnum<{
692
+ whatsapp: "whatsapp";
693
+ meta: "meta";
694
+ chatgpt: "chatgpt";
695
+ copilot: "copilot";
696
+ instagram: "instagram";
697
+ tiktok: "tiktok";
698
+ }>, z$1.ZodNumber]>;
699
+ }, z$1.core.$strip>>;
700
+ declare const StickerShapeType: z$1.ZodDefault<z$1.ZodEnum<{
701
+ default: "default";
702
+ rounded: "rounded";
703
+ circle: "circle";
704
+ oval: "oval";
705
+ }>>;
706
+ declare const StickerMetadataType: z$1.ZodOptional<z$1.ZodObject<{
707
+ packageName: z$1.ZodOptional<z$1.ZodString>;
708
+ authorName: z$1.ZodOptional<z$1.ZodString>;
709
+ quality: z$1.ZodOptional<z$1.ZodNumber>;
710
+ shape: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodEnum<{
711
+ default: "default";
712
+ rounded: "rounded";
713
+ circle: "circle";
714
+ oval: "oval";
715
+ }>>>;
716
+ }, z$1.core.$strip>>;
717
+ declare const autoCleanUp: z$1.ZodOptional<z$1.ZodObject<{
718
+ enabled: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
719
+ intervalMs: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodNumber>>;
720
+ maxAgeMs: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodNumber>>;
721
+ scopes: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodArray<z$1.ZodString>>>;
722
+ }, z$1.core.$strip>>;
723
+ declare const ClientBaseType: z$1.ZodObject<{
724
+ session: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodString>>;
725
+ prefix: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodArray<z$1.ZodString>]>>;
726
+ ignoreMe: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
727
+ showLogs: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
728
+ fancyLogs: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
729
+ syncFullHistory: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
730
+ disableFFmpeg: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
731
+ autoMarkAI: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
732
+ autoMentions: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
733
+ autoOnline: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
734
+ autoRead: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
735
+ autoPresence: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
736
+ autoRejectCall: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
737
+ pluginsDir: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodString>>;
738
+ pluginsHmr: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
739
+ autoCleanUp: z$1.ZodOptional<z$1.ZodObject<{
740
+ enabled: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
741
+ intervalMs: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodNumber>>;
742
+ maxAgeMs: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodNumber>>;
743
+ scopes: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodArray<z$1.ZodString>>>;
744
+ }, z$1.core.$strip>>;
745
+ limiter: z$1.ZodOptional<z$1.ZodObject<{
746
+ maxMessages: z$1.ZodDefault<z$1.ZodNumber>;
747
+ durationMs: z$1.ZodDefault<z$1.ZodNumber>;
748
+ }, z$1.core.$strip>>;
749
+ citation: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodFunction<z$1.core.$ZodFunctionArgs, z$1.ZodPromise<z$1.ZodArray<z$1.ZodNumber>>>>>;
750
+ fakeReply: z$1.ZodOptional<z$1.ZodObject<{
751
+ provider: z$1.ZodUnion<[z$1.ZodEnum<{
752
+ whatsapp: "whatsapp";
753
+ meta: "meta";
754
+ chatgpt: "chatgpt";
755
+ copilot: "copilot";
756
+ instagram: "instagram";
757
+ tiktok: "tiktok";
758
+ }>, z$1.ZodNumber]>;
759
+ }, z$1.core.$strip>>;
760
+ sticker: z$1.ZodOptional<z$1.ZodObject<{
761
+ packageName: z$1.ZodOptional<z$1.ZodString>;
762
+ authorName: z$1.ZodOptional<z$1.ZodString>;
763
+ quality: z$1.ZodOptional<z$1.ZodNumber>;
764
+ shape: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodEnum<{
765
+ default: "default";
766
+ rounded: "rounded";
767
+ circle: "circle";
768
+ oval: "oval";
769
+ }>>>;
770
+ }, z$1.core.$strip>>;
771
+ }, z$1.core.$strip>;
772
+ declare const ClientAuthPairingType: z$1.ZodObject<{
773
+ authType: z$1.ZodLiteral<"pairing">;
774
+ phoneNumber: z$1.ZodNumber;
775
+ }, z$1.core.$strip>;
776
+ declare const ClientAuthQRType: z$1.ZodObject<{
777
+ authType: z$1.ZodLiteral<"qr">;
778
+ }, z$1.core.$strip>;
779
+ declare const ClientOptionsType: z$1.ZodUnion<readonly [z$1.ZodObject<{
780
+ authType: z$1.ZodLiteral<"pairing">;
781
+ phoneNumber: z$1.ZodNumber;
782
+ session: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodString>>;
783
+ prefix: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodArray<z$1.ZodString>]>>;
784
+ ignoreMe: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
785
+ showLogs: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
786
+ fancyLogs: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
787
+ syncFullHistory: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
788
+ disableFFmpeg: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
789
+ autoMarkAI: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
790
+ autoMentions: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
791
+ autoOnline: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
792
+ autoRead: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
793
+ autoPresence: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
794
+ autoRejectCall: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
795
+ pluginsDir: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodString>>;
796
+ pluginsHmr: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
797
+ autoCleanUp: z$1.ZodOptional<z$1.ZodObject<{
798
+ enabled: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
799
+ intervalMs: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodNumber>>;
800
+ maxAgeMs: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodNumber>>;
801
+ scopes: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodArray<z$1.ZodString>>>;
802
+ }, z$1.core.$strip>>;
803
+ limiter: z$1.ZodOptional<z$1.ZodObject<{
804
+ maxMessages: z$1.ZodDefault<z$1.ZodNumber>;
805
+ durationMs: z$1.ZodDefault<z$1.ZodNumber>;
806
+ }, z$1.core.$strip>>;
807
+ citation: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodFunction<z$1.core.$ZodFunctionArgs, z$1.ZodPromise<z$1.ZodArray<z$1.ZodNumber>>>>>;
808
+ fakeReply: z$1.ZodOptional<z$1.ZodObject<{
809
+ provider: z$1.ZodUnion<[z$1.ZodEnum<{
810
+ whatsapp: "whatsapp";
811
+ meta: "meta";
812
+ chatgpt: "chatgpt";
813
+ copilot: "copilot";
814
+ instagram: "instagram";
815
+ tiktok: "tiktok";
816
+ }>, z$1.ZodNumber]>;
817
+ }, z$1.core.$strip>>;
818
+ sticker: z$1.ZodOptional<z$1.ZodObject<{
819
+ packageName: z$1.ZodOptional<z$1.ZodString>;
820
+ authorName: z$1.ZodOptional<z$1.ZodString>;
821
+ quality: z$1.ZodOptional<z$1.ZodNumber>;
822
+ shape: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodEnum<{
823
+ default: "default";
824
+ rounded: "rounded";
825
+ circle: "circle";
826
+ oval: "oval";
827
+ }>>>;
828
+ }, z$1.core.$strip>>;
829
+ }, z$1.core.$strip>, z$1.ZodObject<{
830
+ authType: z$1.ZodLiteral<"qr">;
831
+ session: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodString>>;
832
+ prefix: z$1.ZodOptional<z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodArray<z$1.ZodString>]>>;
833
+ ignoreMe: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
834
+ showLogs: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
835
+ fancyLogs: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
836
+ syncFullHistory: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
837
+ disableFFmpeg: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
838
+ autoMarkAI: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
839
+ autoMentions: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
840
+ autoOnline: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
841
+ autoRead: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
842
+ autoPresence: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
843
+ autoRejectCall: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
844
+ pluginsDir: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodString>>;
845
+ pluginsHmr: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
846
+ autoCleanUp: z$1.ZodOptional<z$1.ZodObject<{
847
+ enabled: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodBoolean>>;
848
+ intervalMs: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodNumber>>;
849
+ maxAgeMs: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodNumber>>;
850
+ scopes: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodArray<z$1.ZodString>>>;
851
+ }, z$1.core.$strip>>;
852
+ limiter: z$1.ZodOptional<z$1.ZodObject<{
853
+ maxMessages: z$1.ZodDefault<z$1.ZodNumber>;
854
+ durationMs: z$1.ZodDefault<z$1.ZodNumber>;
855
+ }, z$1.core.$strip>>;
856
+ citation: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodFunction<z$1.core.$ZodFunctionArgs, z$1.ZodPromise<z$1.ZodArray<z$1.ZodNumber>>>>>;
857
+ fakeReply: z$1.ZodOptional<z$1.ZodObject<{
858
+ provider: z$1.ZodUnion<[z$1.ZodEnum<{
859
+ whatsapp: "whatsapp";
860
+ meta: "meta";
861
+ chatgpt: "chatgpt";
862
+ copilot: "copilot";
863
+ instagram: "instagram";
864
+ tiktok: "tiktok";
865
+ }>, z$1.ZodNumber]>;
866
+ }, z$1.core.$strip>>;
867
+ sticker: z$1.ZodOptional<z$1.ZodObject<{
868
+ packageName: z$1.ZodOptional<z$1.ZodString>;
869
+ authorName: z$1.ZodOptional<z$1.ZodString>;
870
+ quality: z$1.ZodOptional<z$1.ZodNumber>;
871
+ shape: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodEnum<{
872
+ default: "default";
873
+ rounded: "rounded";
874
+ circle: "circle";
875
+ oval: "oval";
876
+ }>>>;
877
+ }, z$1.core.$strip>>;
878
+ }, z$1.core.$strip>]>;
879
+ declare const EventEnumType: z$1.ZodEnum<{
880
+ messages: "messages";
881
+ connection: "connection";
882
+ calls: "calls";
883
+ }>;
884
+ type EventCallbackType = {
885
+ connection: (ctx: ConnectionContext) => void;
886
+ messages: (ctx: MessagesContext) => void;
887
+ calls: (ctx: CallsContext) => void;
888
+ };
889
+
890
+ declare const ButtonInteractiveReplyType: z.ZodObject<{
891
+ type: z.ZodLiteral<"quick_reply">;
892
+ text: z.ZodString;
893
+ }, z.core.$strip>;
894
+ declare const ButtonInteractiveUrlType: z.ZodObject<{
895
+ type: z.ZodLiteral<"cta_url">;
896
+ url: z.ZodURL;
897
+ text: z.ZodString;
898
+ }, z.core.$strip>;
899
+ declare const ButtonInteractiveCopyType: z.ZodObject<{
900
+ type: z.ZodLiteral<"cta_copy">;
901
+ copy: z.ZodString;
902
+ text: z.ZodString;
903
+ }, z.core.$strip>;
904
+ declare const ButtonInteractiveCallType: z.ZodObject<{
905
+ type: z.ZodLiteral<"cta_call">;
906
+ text: z.ZodString;
907
+ phoneNumber: z.ZodString;
908
+ }, z.core.$strip>;
909
+ declare const ButtonInteractiveSingleSelectType: z.ZodObject<{
910
+ type: z.ZodLiteral<"single_select">;
911
+ text: z.ZodString;
912
+ section: z.ZodArray<z.ZodObject<{
913
+ title: z.ZodString;
914
+ highlight_label: z.ZodOptional<z.ZodString>;
915
+ rows: z.ZodArray<z.ZodObject<{
916
+ id: z.ZodString;
917
+ title: z.ZodString;
918
+ header: z.ZodOptional<z.ZodString>;
919
+ description: z.ZodOptional<z.ZodString>;
920
+ }, z.core.$strip>>;
921
+ }, z.core.$strip>>;
922
+ }, z.core.$strip>;
923
+ declare const ButtonInteractiveType: z.ZodObject<{
924
+ type: z.ZodLiteral<"interactive">;
925
+ footer: z.ZodOptional<z.ZodString>;
926
+ data: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
927
+ type: z.ZodLiteral<"quick_reply">;
928
+ text: z.ZodString;
929
+ }, z.core.$strip>, z.ZodObject<{
930
+ type: z.ZodLiteral<"cta_url">;
931
+ url: z.ZodURL;
932
+ text: z.ZodString;
933
+ }, z.core.$strip>, z.ZodObject<{
934
+ type: z.ZodLiteral<"cta_copy">;
935
+ copy: z.ZodString;
936
+ text: z.ZodString;
937
+ }, z.core.$strip>, z.ZodObject<{
938
+ type: z.ZodLiteral<"cta_call">;
939
+ text: z.ZodString;
940
+ phoneNumber: z.ZodString;
941
+ }, z.core.$strip>, z.ZodObject<{
942
+ type: z.ZodLiteral<"single_select">;
943
+ text: z.ZodString;
944
+ section: z.ZodArray<z.ZodObject<{
945
+ title: z.ZodString;
946
+ highlight_label: z.ZodOptional<z.ZodString>;
947
+ rows: z.ZodArray<z.ZodObject<{
948
+ id: z.ZodString;
949
+ title: z.ZodString;
950
+ header: z.ZodOptional<z.ZodString>;
951
+ description: z.ZodOptional<z.ZodString>;
952
+ }, z.core.$strip>>;
953
+ }, z.core.$strip>>;
954
+ }, z.core.$strip>]>>;
955
+ }, z.core.$strip>;
956
+ declare const ButtonSimpleType: z.ZodObject<{
957
+ type: z.ZodLiteral<"simple">;
958
+ footer: z.ZodOptional<z.ZodString>;
959
+ data: z.ZodArray<z.ZodObject<{
960
+ id: z.ZodString;
961
+ text: z.ZodString;
962
+ }, z.core.$strip>>;
963
+ }, z.core.$strip>;
964
+ declare const ButtonType: z.ZodUnion<readonly [z.ZodObject<{
965
+ type: z.ZodLiteral<"simple">;
966
+ footer: z.ZodOptional<z.ZodString>;
967
+ data: z.ZodArray<z.ZodObject<{
968
+ id: z.ZodString;
969
+ text: z.ZodString;
970
+ }, z.core.$strip>>;
971
+ }, z.core.$strip>, z.ZodObject<{
972
+ type: z.ZodLiteral<"interactive">;
973
+ footer: z.ZodOptional<z.ZodString>;
974
+ data: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
975
+ type: z.ZodLiteral<"quick_reply">;
976
+ text: z.ZodString;
977
+ }, z.core.$strip>, z.ZodObject<{
978
+ type: z.ZodLiteral<"cta_url">;
979
+ url: z.ZodURL;
980
+ text: z.ZodString;
981
+ }, z.core.$strip>, z.ZodObject<{
982
+ type: z.ZodLiteral<"cta_copy">;
983
+ copy: z.ZodString;
984
+ text: z.ZodString;
985
+ }, z.core.$strip>, z.ZodObject<{
986
+ type: z.ZodLiteral<"cta_call">;
987
+ text: z.ZodString;
988
+ phoneNumber: z.ZodString;
989
+ }, z.core.$strip>, z.ZodObject<{
990
+ type: z.ZodLiteral<"single_select">;
991
+ text: z.ZodString;
992
+ section: z.ZodArray<z.ZodObject<{
993
+ title: z.ZodString;
994
+ highlight_label: z.ZodOptional<z.ZodString>;
995
+ rows: z.ZodArray<z.ZodObject<{
996
+ id: z.ZodString;
997
+ title: z.ZodString;
998
+ header: z.ZodOptional<z.ZodString>;
999
+ description: z.ZodOptional<z.ZodString>;
1000
+ }, z.core.$strip>>;
1001
+ }, z.core.$strip>>;
1002
+ }, z.core.$strip>]>>;
1003
+ }, z.core.$strip>]>;
1004
+
1005
+ declare class Logs {
1006
+ private client;
1007
+ private logsInitialized;
1008
+ private logsDisplayed;
1009
+ private isReady;
1010
+ constructor(client: Client);
1011
+ getRoomColor(validator: any): "lime" | "orange" | "dimgray" | "blue";
1012
+ initialize(): void;
1013
+ private displayIndicator;
1014
+ message(message: Partial<MessagesContext>): void;
1015
+ call(call: Partial<CallsContext>): void;
1016
+ }
1017
+
1018
+ type MiddlewareContextType = {
1019
+ messages?: Partial<MessagesContext>;
1020
+ calls?: Partial<CallsContext>;
1021
+ };
1022
+
1023
+ type MiddlewareNext = () => Promise<void> | void;
1024
+ type MiddlewareHandler<T> = (ctx: MiddlewareContextType, next: MiddlewareNext) => Promise<void> | void;
1025
+ declare class Middleware<T> {
1026
+ private stack;
1027
+ use(handler: MiddlewareHandler<T>): this;
1028
+ run(ctx: MiddlewareContextType): Promise<void>;
1029
+ }
1030
+
1031
+ type PluginsHandlerType = (wa: Client, ctx: MiddlewareContextType) => Promise<void> | void;
1032
+ type PluginsConfigType = {
1033
+ matcher: (string | RegExp)[];
1034
+ metadata?: Record<string, any>;
1035
+ };
1036
+ type PluginDefinition = {
1037
+ handler: PluginsHandlerType;
1038
+ config: PluginsConfigType;
1039
+ parent: string | null;
1040
+ enabled: boolean;
1041
+ };
1042
+ declare class Plugins {
1043
+ private plugins;
1044
+ private pluginsDir;
1045
+ private globalEnabled;
1046
+ private disabledPlugins;
1047
+ private hmr;
1048
+ private watcher;
1049
+ constructor(pluginsDir?: string, hmr?: boolean);
1050
+ private getAllFiles;
1051
+ load(): Promise<void>;
1052
+ setupHmr(): void;
1053
+ private getPluginId;
1054
+ execute(wa: Client, ctx: MiddlewareContextType): Promise<void>;
1055
+ private match;
1056
+ enableAll(): void;
1057
+ disableAll(): void;
1058
+ enable(matcher: string | RegExp): boolean;
1059
+ disable(matcher: string | RegExp): boolean;
1060
+ enableByParent(parent: string): number;
1061
+ disableByParent(parent: string): number;
1062
+ isEnabled(): boolean;
1063
+ getLoadedPlugins(): PluginDefinition[];
1064
+ getPluginsInfo(): {
1065
+ matcher: (string | RegExp)[];
1066
+ metadata?: Record<string, any>;
1067
+ parent: string | null;
1068
+ enabled: boolean;
1069
+ }[];
1070
+ reload(): Promise<void>;
1071
+ stopHmr(): void;
1072
+ }
1073
+ declare const definePlugins: (handler: PluginsHandlerType, config: PluginsConfigType) => Omit<PluginDefinition, "parent" | "enabled">;
1074
+
1075
+ interface Client extends Signal, SignalGroup, SignalPrivacy, SignalNewsletter, SignalCommunity {
1076
+ }
1077
+ declare class Client {
1078
+ options: z.infer<typeof ClientOptionsType>;
1079
+ private _ready;
1080
+ logs: Logs;
1081
+ middleware: Middleware<any>;
1082
+ plugins: Plugins;
1083
+ health: HealthManager;
1084
+ cleanup: CleanUpManager;
1085
+ constructor(options: z.infer<typeof ClientOptionsType>);
1086
+ initialize(client?: Client): Promise<void>;
1087
+ ready(): Promise<void>;
1088
+ db(scope: string): JetDB;
1089
+ on<T extends z.infer<typeof EventEnumType>>(event: T, handler: EventCallbackType[T]): void;
1090
+ use<T>(handler: MiddlewareHandler<T>): this;
1091
+ get socket(): ReturnType<typeof baileys__default>;
1092
+ getRoomName(roomId: string): Promise<string>;
1093
+ inject<T = any>(key: string, value: T): void;
1094
+ getInjection<T = any>(key: string): T | undefined;
1095
+ removeInjection(key: string): void;
1096
+ clearInjections(): void;
1097
+ }
1098
+
1099
+ declare const registerAuthCreds: (client: Client) => Promise<void>;
1100
+
1101
+ declare const logColor: (text: string, color?: string[] | string) => string;
1102
+ declare const toJson: (object: unknown) => any;
1103
+ declare const toString: (object: unknown) => string;
1104
+ declare const shuffleString: (str?: string) => string;
1105
+ declare const findGlobalWord: (text?: string, word?: string) => boolean;
1106
+ declare const extractUrls: (text?: string) => string[];
1107
+ declare const randomize: (arr: string[]) => string;
1108
+ declare const pickKeysFromArray: (arr: any[], keys: string[]) => any;
1109
+ declare const findNestedByKeys: (data: unknown, target: Record<string, any> | Record<string, any>[]) => any;
1110
+ declare const modifyFn: <T extends (...args: any[]) => any>(fn: T, before?: (args: any[]) => void | any, after?: (result: any, args: any[]) => any) => T;
1111
+
1112
+ type MediaInput = string | ArrayBuffer | Buffer;
1113
+
1114
+ type AudioType = 'opus' | 'mp3';
1115
+
1116
+ declare class AudioModifier {
1117
+ private input;
1118
+ constructor(input: MediaInput);
1119
+ toOpus(): Promise<Buffer>;
1120
+ toMp3(): Promise<Buffer>;
1121
+ convert(type?: AudioType): Promise<Buffer>;
1122
+ }
1123
+ declare class VideoModifier {
1124
+ private input;
1125
+ constructor(input: MediaInput);
1126
+ toMp4(): Promise<Buffer>;
1127
+ thumbnail(): Promise<string>;
1128
+ }
1129
+ declare class ImageModifier {
1130
+ private input;
1131
+ constructor(input: MediaInput);
1132
+ toJpeg(): Promise<Buffer>;
1133
+ thumbnail(): Promise<string>;
1134
+ resize(width: number, height: number): Promise<Buffer>;
1135
+ }
1136
+ declare class StickerModifier {
1137
+ private input;
1138
+ private metadata?;
1139
+ constructor(input: MediaInput, metadata?: z.infer<typeof StickerMetadataType>);
1140
+ create(): Promise<Buffer>;
1141
+ }
1142
+ declare class DocumentModifier {
1143
+ private input;
1144
+ constructor(input: MediaInput);
1145
+ create(): Promise<{
1146
+ document: Buffer<ArrayBufferLike>;
1147
+ mimetype: string;
1148
+ fileName: string;
1149
+ jpegThumbnail: string;
1150
+ }>;
1151
+ }
1152
+ declare class MediaThumbnailModifier {
1153
+ private input;
1154
+ constructor(input: MediaInput);
1155
+ get(): Promise<string>;
1156
+ }
1157
+ declare class MediaModifier {
1158
+ audio(input: MediaInput): AudioModifier;
1159
+ video(input: MediaInput): VideoModifier;
1160
+ image(input: MediaInput): ImageModifier;
1161
+ sticker(input: MediaInput, metadata?: z.infer<typeof StickerMetadataType>): StickerModifier;
1162
+ document(input: MediaInput): DocumentModifier;
1163
+ thumbnail(input: MediaInput): MediaThumbnailModifier;
1164
+ toBuffer(input: MediaInput): Promise<Buffer>;
1165
+ }
1166
+ declare const mediaModifier: MediaModifier;
1167
+
1168
+ declare const generateId: (input: string | string[]) => string;
1169
+ declare const getUsersMentions: (text?: string) => string[];
1170
+ declare const extractJids: (text?: string) => string[];
1171
+ declare const numbersToJids: (numbers: number[]) => string[];
1172
+ declare const cleanMediaObject: (object: any) => _.Omit<any, "message" | "url" | "contextInfo" | "fileSha256" | "fileEncSha256" | "mediaKey" | "directPath" | "waveform" | "thumbnail" | "jpegThumbnail" | "thumbnailEncSha256" | "thumbnailSha256" | "thumbnailDirectPath" | "firstFrameSidecar" | "streamingSidecar" | "scansSidecar" | "callKey" | "key" | "midQualityFileSha256" | "historySyncNotification" | "appStateSyncKeyShare" | "appStateSyncKeyRequest" | "initialSecurityNotificationSettingSync" | "appStateFatalExceptionNotification" | "disappearingMode" | "peerDataOperationRequestMessage" | "peerDataOperationRequestResponseMessage" | "botFeedbackMessage">;
1173
+ declare const getDeepContent: (raw?: proto.IMessage | null) => {
1174
+ leaf: any;
1175
+ chain: string[];
1176
+ };
1177
+ declare const cleanJid: (jid: string) => number;
1178
+
1179
+ declare const ignoreLint: (data: any) => any;
1180
+ declare const getLatestLibVersion: () => Promise<any>;
1181
+ declare const removeAuthCreds: (session: string) => Promise<void>;
1182
+ declare const normalizeText: (text?: string) => string;
1183
+
1184
+ export { BaseMessagesType, ButtonInteractiveCallType, ButtonInteractiveCopyType, ButtonInteractiveReplyType, ButtonInteractiveSingleSelectType, ButtonInteractiveType, ButtonInteractiveUrlType, ButtonSimpleType, ButtonType, type CallsContext, CitationType, Client, ClientAuthPairingType, ClientAuthQRType, ClientBaseType, ClientOptionsType, type ConnectionContext, DEVICE_ENUM_TYPES, type EventCallbackType, EventEnumType, FakeReplyType, LimiterType, ListenerCallsType, ListenerConnectionType, ListenerMessagesType, MESSAGE_ENUM_TYPES, MediaModifier, type MessagesContext, type PluginDefinition, Plugins, type PluginsConfigType, type PluginsHandlerType, StickerMetadataType, StickerShapeType, autoCleanUp, cleanJid, cleanMediaObject, definePlugins, extractJids, extractUrls, findGlobalWord, findNestedByKeys, generateId, getDeepContent, getLatestLibVersion, getUsersMentions, ignoreLint, logColor, mediaModifier, modifyFn, normalizeText, numbersToJids, pickKeysFromArray, randomize, registerAuthCreds, removeAuthCreds, shuffleString, toJson, toString, useAuthState };