zaileys 0.29.18-beta → 0.29.20

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.
package/dist/index.d.mts CHANGED
@@ -1,12 +1,18 @@
1
+ import { Ora } from 'ora';
1
2
  import { z } from 'zod';
3
+ import { Readable } from 'stream';
2
4
 
3
5
  declare const ClientClassesType: z.ZodDiscriminatedUnion<"authType", [z.ZodObject<{
6
+ authType: z.ZodLiteral<"pairing">;
7
+ phoneNumber: z.ZodNumber;
8
+ } & {
4
9
  prefix: z.ZodOptional<z.ZodString>;
5
10
  ignoreMe: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
6
11
  showLogs: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
7
12
  autoMentions: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
8
13
  autoOnline: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
9
14
  autoRead: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
15
+ autoPresence: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
10
16
  autoRejectCall: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
11
17
  database: z.ZodDefault<z.ZodOptional<z.ZodObject<{
12
18
  type: z.ZodDefault<z.ZodEnum<["sqlite", "postgresql", "mysql"]>>;
@@ -28,17 +34,14 @@ declare const ClientClassesType: z.ZodDiscriminatedUnion<"authType", [z.ZodObjec
28
34
  url?: string | undefined;
29
35
  } | undefined;
30
36
  }>>>;
31
- citation: z.ZodEffects<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnion<[z.ZodArray<z.ZodNumber, "many">, z.ZodPromise<z.ZodArray<z.ZodNumber, "many">>]>>>>, Record<string, any>, Record<string, (...args: unknown[]) => number[] | Promise<number[]>> | undefined>;
32
- authType: z.ZodLiteral<"pairing">;
33
- phoneNumber: z.ZodNumber;
37
+ citation: z.ZodEffects<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnion<[z.ZodArray<z.ZodNumber, "many">, z.ZodPromise<z.ZodArray<z.ZodNumber, "many">>]>>>>, Record<string, number[]>, Record<string, (...args: unknown[]) => number[] | Promise<number[]>> | undefined>;
34
38
  }, "strip", z.ZodTypeAny, {
35
- authType: "pairing";
36
- phoneNumber: number;
37
39
  ignoreMe: boolean;
38
40
  showLogs: boolean;
39
41
  autoMentions: boolean;
40
42
  autoOnline: boolean;
41
43
  autoRead: boolean;
44
+ autoPresence: boolean;
42
45
  autoRejectCall: boolean;
43
46
  database: {
44
47
  type: "sqlite" | "postgresql" | "mysql";
@@ -46,7 +49,9 @@ declare const ClientClassesType: z.ZodDiscriminatedUnion<"authType", [z.ZodObjec
46
49
  url: string;
47
50
  };
48
51
  };
49
- citation: Record<string, any>;
52
+ citation: Record<string, number[]>;
53
+ authType: "pairing";
54
+ phoneNumber: number;
50
55
  prefix?: string | undefined;
51
56
  }, {
52
57
  authType: "pairing";
@@ -57,6 +62,7 @@ declare const ClientClassesType: z.ZodDiscriminatedUnion<"authType", [z.ZodObjec
57
62
  autoMentions?: boolean | undefined;
58
63
  autoOnline?: boolean | undefined;
59
64
  autoRead?: boolean | undefined;
65
+ autoPresence?: boolean | undefined;
60
66
  autoRejectCall?: boolean | undefined;
61
67
  database?: {
62
68
  type?: "sqlite" | "postgresql" | "mysql" | undefined;
@@ -66,12 +72,16 @@ declare const ClientClassesType: z.ZodDiscriminatedUnion<"authType", [z.ZodObjec
66
72
  } | undefined;
67
73
  citation?: Record<string, (...args: unknown[]) => number[] | Promise<number[]>> | undefined;
68
74
  }>, z.ZodObject<{
75
+ authType: z.ZodLiteral<"qr">;
76
+ phoneNumber: z.ZodOptional<z.ZodUndefined>;
77
+ } & {
69
78
  prefix: z.ZodOptional<z.ZodString>;
70
79
  ignoreMe: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
71
80
  showLogs: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
72
81
  autoMentions: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
73
82
  autoOnline: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
74
83
  autoRead: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
84
+ autoPresence: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
75
85
  autoRejectCall: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
76
86
  database: z.ZodDefault<z.ZodOptional<z.ZodObject<{
77
87
  type: z.ZodDefault<z.ZodEnum<["sqlite", "postgresql", "mysql"]>>;
@@ -93,16 +103,14 @@ declare const ClientClassesType: z.ZodDiscriminatedUnion<"authType", [z.ZodObjec
93
103
  url?: string | undefined;
94
104
  } | undefined;
95
105
  }>>>;
96
- citation: z.ZodEffects<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnion<[z.ZodArray<z.ZodNumber, "many">, z.ZodPromise<z.ZodArray<z.ZodNumber, "many">>]>>>>, Record<string, any>, Record<string, (...args: unknown[]) => number[] | Promise<number[]>> | undefined>;
97
- authType: z.ZodLiteral<"qr">;
98
- phoneNumber: z.ZodOptional<z.ZodUndefined>;
106
+ citation: z.ZodEffects<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnion<[z.ZodArray<z.ZodNumber, "many">, z.ZodPromise<z.ZodArray<z.ZodNumber, "many">>]>>>>, Record<string, number[]>, Record<string, (...args: unknown[]) => number[] | Promise<number[]>> | undefined>;
99
107
  }, "strip", z.ZodTypeAny, {
100
- authType: "qr";
101
108
  ignoreMe: boolean;
102
109
  showLogs: boolean;
103
110
  autoMentions: boolean;
104
111
  autoOnline: boolean;
105
112
  autoRead: boolean;
113
+ autoPresence: boolean;
106
114
  autoRejectCall: boolean;
107
115
  database: {
108
116
  type: "sqlite" | "postgresql" | "mysql";
@@ -110,18 +118,19 @@ declare const ClientClassesType: z.ZodDiscriminatedUnion<"authType", [z.ZodObjec
110
118
  url: string;
111
119
  };
112
120
  };
113
- citation: Record<string, any>;
114
- phoneNumber?: undefined;
121
+ citation: Record<string, number[]>;
122
+ authType: "qr";
115
123
  prefix?: string | undefined;
124
+ phoneNumber?: undefined;
116
125
  }, {
117
126
  authType: "qr";
118
- phoneNumber?: undefined;
119
127
  prefix?: string | undefined;
120
128
  ignoreMe?: boolean | undefined;
121
129
  showLogs?: boolean | undefined;
122
130
  autoMentions?: boolean | undefined;
123
131
  autoOnline?: boolean | undefined;
124
132
  autoRead?: boolean | undefined;
133
+ autoPresence?: boolean | undefined;
125
134
  autoRejectCall?: boolean | undefined;
126
135
  database?: {
127
136
  type?: "sqlite" | "postgresql" | "mysql" | undefined;
@@ -130,6 +139,7 @@ declare const ClientClassesType: z.ZodDiscriminatedUnion<"authType", [z.ZodObjec
130
139
  } | undefined;
131
140
  } | undefined;
132
141
  citation?: Record<string, (...args: unknown[]) => number[] | Promise<number[]>> | undefined;
142
+ phoneNumber?: undefined;
133
143
  }>]>;
134
144
 
135
145
  declare const EventConnectionType: z.ZodObject<{
@@ -140,74 +150,1342 @@ declare const EventConnectionType: z.ZodObject<{
140
150
  status: "connecting" | "open" | "close";
141
151
  }>;
142
152
  declare const EventMessagesType: z.ZodObject<{
143
- messages: z.ZodObject<{
144
- remoteJid: z.ZodString;
145
- id: z.ZodString;
153
+ chatId: z.ZodString;
154
+ channelId: z.ZodString;
155
+ receiverId: z.ZodString;
156
+ receiverName: z.ZodString;
157
+ roomId: z.ZodString;
158
+ roomName: z.ZodString;
159
+ senderId: z.ZodString;
160
+ senderName: z.ZodString;
161
+ senderDevice: z.ZodEnum<["unknown", "android", "ios", "desktop", "web"]>;
162
+ chatType: z.ZodEnum<["text", "text", "image", "contact", "location", "document", "audio", "video", "protocol", "contactsArray", "highlyStructured", "sendPayment", "liveLocation", "requestPayment", "declinePaymentRequest", "cancelPaymentRequest", "template", "sticker", "groupInvite", "templateButtonReply", "product", "deviceSent", "list", "viewOnce", "order", "listResponse", "ephemeral", "invoice", "buttons", "buttonsResponse", "paymentInvite", "interactive", "reaction", "sticker", "interactiveResponse", "pollCreation", "pollUpdate", "keepInChat", "document", "requestPhoneNumber", "viewOnce", "reaction", "text", "viewOnce", "pollCreation", "scheduledCallCreation", "groupMentioned", "pinInChat", "pollCreation", "scheduledCallEdit", "ptv", "botInvoke", "callLog", "encComment", "bcall", "lottieSticker", "event", "comment", "text", "text", "placeholder", "encEventUpdate"]>;
163
+ timestamp: z.ZodNumber;
164
+ mentions: z.ZodArray<z.ZodString, "many">;
165
+ text: z.ZodNullable<z.ZodString>;
166
+ links: z.ZodArray<z.ZodString, "many">;
167
+ isPrefix: z.ZodBoolean;
168
+ isFromMe: z.ZodBoolean;
169
+ isTagMe: z.ZodBoolean;
170
+ isGroup: z.ZodBoolean;
171
+ isStory: z.ZodBoolean;
172
+ isViewOnce: z.ZodBoolean;
173
+ isEdited: z.ZodBoolean;
174
+ isDeleted: z.ZodBoolean;
175
+ isPinned: z.ZodBoolean;
176
+ isUnPinned: z.ZodBoolean;
177
+ isChannel: z.ZodBoolean;
178
+ isBroadcast: z.ZodBoolean;
179
+ isEphemeral: z.ZodBoolean;
180
+ isForwarded: z.ZodBoolean;
181
+ citation: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
182
+ media: z.ZodNullable<z.ZodObject<{
183
+ buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
184
+ stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
185
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
186
+ buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
187
+ stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
188
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
189
+ buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
190
+ stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
191
+ }, z.ZodTypeAny, "passthrough">>>;
192
+ message: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodRecord<z.ZodString, z.ZodAny>>;
193
+ } & {
194
+ replied: z.ZodNullable<z.ZodObject<{
195
+ chatId: z.ZodString;
196
+ channelId: z.ZodString;
197
+ receiverId: z.ZodString;
198
+ receiverName: z.ZodString;
199
+ roomId: z.ZodString;
200
+ roomName: z.ZodString;
201
+ senderId: z.ZodString;
202
+ senderName: z.ZodString;
203
+ senderDevice: z.ZodEnum<["unknown", "android", "ios", "desktop", "web"]>;
204
+ chatType: z.ZodEnum<["text", "text", "image", "contact", "location", "document", "audio", "video", "protocol", "contactsArray", "highlyStructured", "sendPayment", "liveLocation", "requestPayment", "declinePaymentRequest", "cancelPaymentRequest", "template", "sticker", "groupInvite", "templateButtonReply", "product", "deviceSent", "list", "viewOnce", "order", "listResponse", "ephemeral", "invoice", "buttons", "buttonsResponse", "paymentInvite", "interactive", "reaction", "sticker", "interactiveResponse", "pollCreation", "pollUpdate", "keepInChat", "document", "requestPhoneNumber", "viewOnce", "reaction", "text", "viewOnce", "pollCreation", "scheduledCallCreation", "groupMentioned", "pinInChat", "pollCreation", "scheduledCallEdit", "ptv", "botInvoke", "callLog", "encComment", "bcall", "lottieSticker", "event", "comment", "text", "text", "placeholder", "encEventUpdate"]>;
205
+ timestamp: z.ZodNumber;
206
+ mentions: z.ZodArray<z.ZodString, "many">;
207
+ text: z.ZodNullable<z.ZodString>;
208
+ links: z.ZodArray<z.ZodString, "many">;
209
+ isPrefix: z.ZodBoolean;
210
+ isFromMe: z.ZodBoolean;
211
+ isTagMe: z.ZodBoolean;
212
+ isGroup: z.ZodBoolean;
213
+ isStory: z.ZodBoolean;
214
+ isViewOnce: z.ZodBoolean;
215
+ isEdited: z.ZodBoolean;
216
+ isDeleted: z.ZodBoolean;
217
+ isPinned: z.ZodBoolean;
218
+ isUnPinned: z.ZodBoolean;
219
+ isChannel: z.ZodBoolean;
220
+ isBroadcast: z.ZodBoolean;
221
+ isEphemeral: z.ZodBoolean;
222
+ isForwarded: z.ZodBoolean;
223
+ citation: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
224
+ media: z.ZodNullable<z.ZodObject<{
225
+ buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
226
+ stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
227
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
228
+ buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
229
+ stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
230
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
231
+ buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
232
+ stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
233
+ }, z.ZodTypeAny, "passthrough">>>;
234
+ message: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodRecord<z.ZodString, z.ZodAny>>;
146
235
  }, "strip", z.ZodTypeAny, {
147
- id: string;
148
- remoteJid: string;
236
+ message: (...args: unknown[]) => Record<string, any>;
237
+ citation: Record<string, boolean> | null;
238
+ text: string | null;
239
+ timestamp: number;
240
+ chatId: string;
241
+ channelId: string;
242
+ receiverId: string;
243
+ receiverName: string;
244
+ roomId: string;
245
+ roomName: string;
246
+ senderId: string;
247
+ senderName: string;
248
+ senderDevice: "unknown" | "android" | "ios" | "desktop" | "web";
249
+ chatType: "text" | "image" | "contact" | "location" | "document" | "audio" | "video" | "protocol" | "contactsArray" | "highlyStructured" | "sendPayment" | "liveLocation" | "requestPayment" | "declinePaymentRequest" | "cancelPaymentRequest" | "template" | "sticker" | "groupInvite" | "templateButtonReply" | "product" | "deviceSent" | "list" | "viewOnce" | "order" | "listResponse" | "ephemeral" | "invoice" | "buttons" | "buttonsResponse" | "paymentInvite" | "interactive" | "reaction" | "interactiveResponse" | "pollCreation" | "pollUpdate" | "keepInChat" | "requestPhoneNumber" | "scheduledCallCreation" | "groupMentioned" | "pinInChat" | "scheduledCallEdit" | "ptv" | "botInvoke" | "callLog" | "encComment" | "bcall" | "lottieSticker" | "event" | "comment" | "placeholder" | "encEventUpdate";
250
+ mentions: string[];
251
+ links: string[];
252
+ isPrefix: boolean;
253
+ isFromMe: boolean;
254
+ isTagMe: boolean;
255
+ isGroup: boolean;
256
+ isStory: boolean;
257
+ isViewOnce: boolean;
258
+ isEdited: boolean;
259
+ isDeleted: boolean;
260
+ isPinned: boolean;
261
+ isUnPinned: boolean;
262
+ isChannel: boolean;
263
+ isBroadcast: boolean;
264
+ isEphemeral: boolean;
265
+ isForwarded: boolean;
266
+ media: z.objectOutputType<{
267
+ buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
268
+ stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
269
+ }, z.ZodTypeAny, "passthrough"> | null;
149
270
  }, {
150
- id: string;
151
- remoteJid: string;
152
- }>;
271
+ message: (...args: unknown[]) => Record<string, any>;
272
+ citation: Record<string, boolean> | null;
273
+ text: string | null;
274
+ timestamp: number;
275
+ chatId: string;
276
+ channelId: string;
277
+ receiverId: string;
278
+ receiverName: string;
279
+ roomId: string;
280
+ roomName: string;
281
+ senderId: string;
282
+ senderName: string;
283
+ senderDevice: "unknown" | "android" | "ios" | "desktop" | "web";
284
+ chatType: "text" | "image" | "contact" | "location" | "document" | "audio" | "video" | "protocol" | "contactsArray" | "highlyStructured" | "sendPayment" | "liveLocation" | "requestPayment" | "declinePaymentRequest" | "cancelPaymentRequest" | "template" | "sticker" | "groupInvite" | "templateButtonReply" | "product" | "deviceSent" | "list" | "viewOnce" | "order" | "listResponse" | "ephemeral" | "invoice" | "buttons" | "buttonsResponse" | "paymentInvite" | "interactive" | "reaction" | "interactiveResponse" | "pollCreation" | "pollUpdate" | "keepInChat" | "requestPhoneNumber" | "scheduledCallCreation" | "groupMentioned" | "pinInChat" | "scheduledCallEdit" | "ptv" | "botInvoke" | "callLog" | "encComment" | "bcall" | "lottieSticker" | "event" | "comment" | "placeholder" | "encEventUpdate";
285
+ mentions: string[];
286
+ links: string[];
287
+ isPrefix: boolean;
288
+ isFromMe: boolean;
289
+ isTagMe: boolean;
290
+ isGroup: boolean;
291
+ isStory: boolean;
292
+ isViewOnce: boolean;
293
+ isEdited: boolean;
294
+ isDeleted: boolean;
295
+ isPinned: boolean;
296
+ isUnPinned: boolean;
297
+ isChannel: boolean;
298
+ isBroadcast: boolean;
299
+ isEphemeral: boolean;
300
+ isForwarded: boolean;
301
+ media: z.objectInputType<{
302
+ buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
303
+ stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
304
+ }, z.ZodTypeAny, "passthrough"> | null;
305
+ }>>;
153
306
  }, "strip", z.ZodTypeAny, {
154
- messages: {
155
- id: string;
156
- remoteJid: string;
157
- };
307
+ message: (...args: unknown[]) => Record<string, any>;
308
+ citation: Record<string, boolean> | null;
309
+ text: string | null;
310
+ timestamp: number;
311
+ chatId: string;
312
+ channelId: string;
313
+ receiverId: string;
314
+ receiverName: string;
315
+ roomId: string;
316
+ roomName: string;
317
+ senderId: string;
318
+ senderName: string;
319
+ senderDevice: "unknown" | "android" | "ios" | "desktop" | "web";
320
+ chatType: "text" | "image" | "contact" | "location" | "document" | "audio" | "video" | "protocol" | "contactsArray" | "highlyStructured" | "sendPayment" | "liveLocation" | "requestPayment" | "declinePaymentRequest" | "cancelPaymentRequest" | "template" | "sticker" | "groupInvite" | "templateButtonReply" | "product" | "deviceSent" | "list" | "viewOnce" | "order" | "listResponse" | "ephemeral" | "invoice" | "buttons" | "buttonsResponse" | "paymentInvite" | "interactive" | "reaction" | "interactiveResponse" | "pollCreation" | "pollUpdate" | "keepInChat" | "requestPhoneNumber" | "scheduledCallCreation" | "groupMentioned" | "pinInChat" | "scheduledCallEdit" | "ptv" | "botInvoke" | "callLog" | "encComment" | "bcall" | "lottieSticker" | "event" | "comment" | "placeholder" | "encEventUpdate";
321
+ mentions: string[];
322
+ links: string[];
323
+ isPrefix: boolean;
324
+ isFromMe: boolean;
325
+ isTagMe: boolean;
326
+ isGroup: boolean;
327
+ isStory: boolean;
328
+ isViewOnce: boolean;
329
+ isEdited: boolean;
330
+ isDeleted: boolean;
331
+ isPinned: boolean;
332
+ isUnPinned: boolean;
333
+ isChannel: boolean;
334
+ isBroadcast: boolean;
335
+ isEphemeral: boolean;
336
+ isForwarded: boolean;
337
+ media: z.objectOutputType<{
338
+ buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
339
+ stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
340
+ }, z.ZodTypeAny, "passthrough"> | null;
341
+ replied: {
342
+ message: (...args: unknown[]) => Record<string, any>;
343
+ citation: Record<string, boolean> | null;
344
+ text: string | null;
345
+ timestamp: number;
346
+ chatId: string;
347
+ channelId: string;
348
+ receiverId: string;
349
+ receiverName: string;
350
+ roomId: string;
351
+ roomName: string;
352
+ senderId: string;
353
+ senderName: string;
354
+ senderDevice: "unknown" | "android" | "ios" | "desktop" | "web";
355
+ chatType: "text" | "image" | "contact" | "location" | "document" | "audio" | "video" | "protocol" | "contactsArray" | "highlyStructured" | "sendPayment" | "liveLocation" | "requestPayment" | "declinePaymentRequest" | "cancelPaymentRequest" | "template" | "sticker" | "groupInvite" | "templateButtonReply" | "product" | "deviceSent" | "list" | "viewOnce" | "order" | "listResponse" | "ephemeral" | "invoice" | "buttons" | "buttonsResponse" | "paymentInvite" | "interactive" | "reaction" | "interactiveResponse" | "pollCreation" | "pollUpdate" | "keepInChat" | "requestPhoneNumber" | "scheduledCallCreation" | "groupMentioned" | "pinInChat" | "scheduledCallEdit" | "ptv" | "botInvoke" | "callLog" | "encComment" | "bcall" | "lottieSticker" | "event" | "comment" | "placeholder" | "encEventUpdate";
356
+ mentions: string[];
357
+ links: string[];
358
+ isPrefix: boolean;
359
+ isFromMe: boolean;
360
+ isTagMe: boolean;
361
+ isGroup: boolean;
362
+ isStory: boolean;
363
+ isViewOnce: boolean;
364
+ isEdited: boolean;
365
+ isDeleted: boolean;
366
+ isPinned: boolean;
367
+ isUnPinned: boolean;
368
+ isChannel: boolean;
369
+ isBroadcast: boolean;
370
+ isEphemeral: boolean;
371
+ isForwarded: boolean;
372
+ media: z.objectOutputType<{
373
+ buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
374
+ stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
375
+ }, z.ZodTypeAny, "passthrough"> | null;
376
+ } | null;
158
377
  }, {
159
- messages: {
160
- id: string;
161
- remoteJid: string;
162
- };
378
+ message: (...args: unknown[]) => Record<string, any>;
379
+ citation: Record<string, boolean> | null;
380
+ text: string | null;
381
+ timestamp: number;
382
+ chatId: string;
383
+ channelId: string;
384
+ receiverId: string;
385
+ receiverName: string;
386
+ roomId: string;
387
+ roomName: string;
388
+ senderId: string;
389
+ senderName: string;
390
+ senderDevice: "unknown" | "android" | "ios" | "desktop" | "web";
391
+ chatType: "text" | "image" | "contact" | "location" | "document" | "audio" | "video" | "protocol" | "contactsArray" | "highlyStructured" | "sendPayment" | "liveLocation" | "requestPayment" | "declinePaymentRequest" | "cancelPaymentRequest" | "template" | "sticker" | "groupInvite" | "templateButtonReply" | "product" | "deviceSent" | "list" | "viewOnce" | "order" | "listResponse" | "ephemeral" | "invoice" | "buttons" | "buttonsResponse" | "paymentInvite" | "interactive" | "reaction" | "interactiveResponse" | "pollCreation" | "pollUpdate" | "keepInChat" | "requestPhoneNumber" | "scheduledCallCreation" | "groupMentioned" | "pinInChat" | "scheduledCallEdit" | "ptv" | "botInvoke" | "callLog" | "encComment" | "bcall" | "lottieSticker" | "event" | "comment" | "placeholder" | "encEventUpdate";
392
+ mentions: string[];
393
+ links: string[];
394
+ isPrefix: boolean;
395
+ isFromMe: boolean;
396
+ isTagMe: boolean;
397
+ isGroup: boolean;
398
+ isStory: boolean;
399
+ isViewOnce: boolean;
400
+ isEdited: boolean;
401
+ isDeleted: boolean;
402
+ isPinned: boolean;
403
+ isUnPinned: boolean;
404
+ isChannel: boolean;
405
+ isBroadcast: boolean;
406
+ isEphemeral: boolean;
407
+ isForwarded: boolean;
408
+ media: z.objectInputType<{
409
+ buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
410
+ stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
411
+ }, z.ZodTypeAny, "passthrough"> | null;
412
+ replied: {
413
+ message: (...args: unknown[]) => Record<string, any>;
414
+ citation: Record<string, boolean> | null;
415
+ text: string | null;
416
+ timestamp: number;
417
+ chatId: string;
418
+ channelId: string;
419
+ receiverId: string;
420
+ receiverName: string;
421
+ roomId: string;
422
+ roomName: string;
423
+ senderId: string;
424
+ senderName: string;
425
+ senderDevice: "unknown" | "android" | "ios" | "desktop" | "web";
426
+ chatType: "text" | "image" | "contact" | "location" | "document" | "audio" | "video" | "protocol" | "contactsArray" | "highlyStructured" | "sendPayment" | "liveLocation" | "requestPayment" | "declinePaymentRequest" | "cancelPaymentRequest" | "template" | "sticker" | "groupInvite" | "templateButtonReply" | "product" | "deviceSent" | "list" | "viewOnce" | "order" | "listResponse" | "ephemeral" | "invoice" | "buttons" | "buttonsResponse" | "paymentInvite" | "interactive" | "reaction" | "interactiveResponse" | "pollCreation" | "pollUpdate" | "keepInChat" | "requestPhoneNumber" | "scheduledCallCreation" | "groupMentioned" | "pinInChat" | "scheduledCallEdit" | "ptv" | "botInvoke" | "callLog" | "encComment" | "bcall" | "lottieSticker" | "event" | "comment" | "placeholder" | "encEventUpdate";
427
+ mentions: string[];
428
+ links: string[];
429
+ isPrefix: boolean;
430
+ isFromMe: boolean;
431
+ isTagMe: boolean;
432
+ isGroup: boolean;
433
+ isStory: boolean;
434
+ isViewOnce: boolean;
435
+ isEdited: boolean;
436
+ isDeleted: boolean;
437
+ isPinned: boolean;
438
+ isUnPinned: boolean;
439
+ isChannel: boolean;
440
+ isBroadcast: boolean;
441
+ isEphemeral: boolean;
442
+ isForwarded: boolean;
443
+ media: z.objectInputType<{
444
+ buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
445
+ stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
446
+ }, z.ZodTypeAny, "passthrough"> | null;
447
+ } | null;
163
448
  }>;
164
449
  declare const EventCallType: z.ZodObject<{
165
- call: z.ZodObject<{
450
+ callId: z.ZodString;
451
+ roomId: z.ZodString;
452
+ callerId: z.ZodString;
453
+ date: z.ZodDate;
454
+ offline: z.ZodBoolean;
455
+ status: z.ZodEnum<["accept", "offer", "reject", "ringing", "terminate", "timeout"]>;
456
+ isVideo: z.ZodBoolean;
457
+ isGroup: z.ZodBoolean;
458
+ }, "strip", z.ZodTypeAny, {
459
+ status: "accept" | "offer" | "reject" | "ringing" | "terminate" | "timeout";
460
+ date: Date;
461
+ roomId: string;
462
+ isGroup: boolean;
463
+ callId: string;
464
+ callerId: string;
465
+ offline: boolean;
466
+ isVideo: boolean;
467
+ }, {
468
+ status: "accept" | "offer" | "reject" | "ringing" | "terminate" | "timeout";
469
+ date: Date;
470
+ roomId: string;
471
+ isGroup: boolean;
472
+ callId: string;
473
+ callerId: string;
474
+ offline: boolean;
475
+ isVideo: boolean;
476
+ }>;
477
+ declare const EventEnumType: z.ZodEnum<["connection", "messages", "calls"]>;
478
+ type EventEnumType = z.infer<typeof EventEnumType>;
479
+ type EventCallbackType = {
480
+ connection: (ctx: z.infer<typeof EventConnectionType>) => void;
481
+ messages: (ctx: z.infer<typeof EventMessagesType>) => void;
482
+ calls: (ctx: z.infer<typeof EventCallType>) => void;
483
+ };
484
+
485
+ declare const TextWorkerBaseType: z.ZodUnion<[z.ZodString, z.ZodObject<{
486
+ image: z.ZodUnion<[z.ZodString, z.ZodUnion<[z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>, z.ZodType<Readable, z.ZodTypeDef, Readable>]>]>;
487
+ text: z.ZodOptional<z.ZodString>;
488
+ }, "strip", z.ZodTypeAny, {
489
+ image: string | Buffer<ArrayBufferLike> | Readable;
490
+ text?: string | undefined;
491
+ }, {
492
+ image: string | Buffer<ArrayBufferLike> | Readable;
493
+ text?: string | undefined;
494
+ }>, z.ZodObject<{
495
+ video: z.ZodUnion<[z.ZodString, z.ZodUnion<[z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>, z.ZodType<Readable, z.ZodTypeDef, Readable>]>]>;
496
+ text: z.ZodOptional<z.ZodString>;
497
+ }, "strip", z.ZodTypeAny, {
498
+ video: string | Buffer<ArrayBufferLike> | Readable;
499
+ text?: string | undefined;
500
+ }, {
501
+ video: string | Buffer<ArrayBufferLike> | Readable;
502
+ text?: string | undefined;
503
+ }>, z.ZodObject<{
504
+ videoNote: z.ZodUnion<[z.ZodString, z.ZodUnion<[z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>, z.ZodType<Readable, z.ZodTypeDef, Readable>]>]>;
505
+ }, "strip", z.ZodTypeAny, {
506
+ videoNote: string | Buffer<ArrayBufferLike> | Readable;
507
+ }, {
508
+ videoNote: string | Buffer<ArrayBufferLike> | Readable;
509
+ }>, z.ZodObject<{
510
+ gif: z.ZodUnion<[z.ZodString, z.ZodUnion<[z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>, z.ZodType<Readable, z.ZodTypeDef, Readable>]>]>;
511
+ text: z.ZodOptional<z.ZodString>;
512
+ }, "strip", z.ZodTypeAny, {
513
+ gif: string | Buffer<ArrayBufferLike> | Readable;
514
+ text?: string | undefined;
515
+ }, {
516
+ gif: string | Buffer<ArrayBufferLike> | Readable;
517
+ text?: string | undefined;
518
+ }>, z.ZodObject<{
519
+ audio: z.ZodUnion<[z.ZodString, z.ZodUnion<[z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>, z.ZodType<Readable, z.ZodTypeDef, Readable>]>]>;
520
+ }, "strip", z.ZodTypeAny, {
521
+ audio: string | Buffer<ArrayBufferLike> | Readable;
522
+ }, {
523
+ audio: string | Buffer<ArrayBufferLike> | Readable;
524
+ }>, z.ZodObject<{
525
+ audioNote: z.ZodUnion<[z.ZodString, z.ZodUnion<[z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>, z.ZodType<Readable, z.ZodTypeDef, Readable>]>]>;
526
+ }, "strip", z.ZodTypeAny, {
527
+ audioNote: string | Buffer<ArrayBufferLike> | Readable;
528
+ }, {
529
+ audioNote: string | Buffer<ArrayBufferLike> | Readable;
530
+ }>, z.ZodObject<{
531
+ sticker: z.ZodUnion<[z.ZodString, z.ZodUnion<[z.ZodType<Buffer<ArrayBufferLike>, z.ZodTypeDef, Buffer<ArrayBufferLike>>, z.ZodType<Readable, z.ZodTypeDef, Readable>]>]>;
532
+ }, "strip", z.ZodTypeAny, {
533
+ sticker: string | Buffer<ArrayBufferLike> | Readable;
534
+ }, {
535
+ sticker: string | Buffer<ArrayBufferLike> | Readable;
536
+ }>]>;
537
+ declare const TextWorkerOptionsType: z.ZodObject<{
538
+ roomId: z.ZodString;
539
+ asForwarded: z.ZodOptional<z.ZodBoolean>;
540
+ asViewOnce: z.ZodOptional<z.ZodBoolean>;
541
+ verifiedReply: z.ZodOptional<z.ZodEnum<["whatsapp", "meta", "chatgpt", "copilot", "instagram", "tiktok"]>>;
542
+ quoted: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodRecord<z.ZodString, z.ZodAny>>>;
543
+ }, "strip", z.ZodTypeAny, {
544
+ roomId: string;
545
+ asForwarded?: boolean | undefined;
546
+ asViewOnce?: boolean | undefined;
547
+ verifiedReply?: "whatsapp" | "meta" | "chatgpt" | "copilot" | "instagram" | "tiktok" | undefined;
548
+ quoted?: ((...args: unknown[]) => Record<string, any>) | undefined;
549
+ }, {
550
+ roomId: string;
551
+ asForwarded?: boolean | undefined;
552
+ asViewOnce?: boolean | undefined;
553
+ verifiedReply?: "whatsapp" | "meta" | "chatgpt" | "copilot" | "instagram" | "tiktok" | undefined;
554
+ quoted?: ((...args: unknown[]) => Record<string, any>) | undefined;
555
+ }>;
556
+ declare const LocationWorkerOptionsType: z.ZodObject<{
557
+ roomId: z.ZodString;
558
+ asForwarded: z.ZodOptional<z.ZodBoolean>;
559
+ asViewOnce: z.ZodOptional<z.ZodBoolean>;
560
+ verifiedReply: z.ZodOptional<z.ZodEnum<["whatsapp", "meta", "chatgpt", "copilot", "instagram", "tiktok"]>>;
561
+ quoted: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodRecord<z.ZodString, z.ZodAny>>>;
562
+ }, "strip", z.ZodTypeAny, {
563
+ roomId: string;
564
+ asForwarded?: boolean | undefined;
565
+ asViewOnce?: boolean | undefined;
566
+ verifiedReply?: "whatsapp" | "meta" | "chatgpt" | "copilot" | "instagram" | "tiktok" | undefined;
567
+ quoted?: ((...args: unknown[]) => Record<string, any>) | undefined;
568
+ }, {
569
+ roomId: string;
570
+ asForwarded?: boolean | undefined;
571
+ asViewOnce?: boolean | undefined;
572
+ verifiedReply?: "whatsapp" | "meta" | "chatgpt" | "copilot" | "instagram" | "tiktok" | undefined;
573
+ quoted?: ((...args: unknown[]) => Record<string, any>) | undefined;
574
+ }>;
575
+ declare const LocationWorkerBaseType: z.ZodObject<{
576
+ latitude: z.ZodNumber;
577
+ longitude: z.ZodNumber;
578
+ title: z.ZodOptional<z.ZodString>;
579
+ footer: z.ZodOptional<z.ZodString>;
580
+ }, "strip", z.ZodTypeAny, {
581
+ latitude: number;
582
+ longitude: number;
583
+ title?: string | undefined;
584
+ footer?: string | undefined;
585
+ }, {
586
+ latitude: number;
587
+ longitude: number;
588
+ title?: string | undefined;
589
+ footer?: string | undefined;
590
+ }>;
591
+ declare const ContactWorkerOptionsType: z.ZodObject<{
592
+ roomId: z.ZodString;
593
+ asForwarded: z.ZodOptional<z.ZodBoolean>;
594
+ asViewOnce: z.ZodOptional<z.ZodBoolean>;
595
+ verifiedReply: z.ZodOptional<z.ZodEnum<["whatsapp", "meta", "chatgpt", "copilot", "instagram", "tiktok"]>>;
596
+ quoted: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodRecord<z.ZodString, z.ZodAny>>>;
597
+ }, "strip", z.ZodTypeAny, {
598
+ roomId: string;
599
+ asForwarded?: boolean | undefined;
600
+ asViewOnce?: boolean | undefined;
601
+ verifiedReply?: "whatsapp" | "meta" | "chatgpt" | "copilot" | "instagram" | "tiktok" | undefined;
602
+ quoted?: ((...args: unknown[]) => Record<string, any>) | undefined;
603
+ }, {
604
+ roomId: string;
605
+ asForwarded?: boolean | undefined;
606
+ asViewOnce?: boolean | undefined;
607
+ verifiedReply?: "whatsapp" | "meta" | "chatgpt" | "copilot" | "instagram" | "tiktok" | undefined;
608
+ quoted?: ((...args: unknown[]) => Record<string, any>) | undefined;
609
+ }>;
610
+ declare const ContactWorkerBaseType: z.ZodObject<{
611
+ fullname: z.ZodString;
612
+ nickname: z.ZodOptional<z.ZodString>;
613
+ organization: z.ZodOptional<z.ZodString>;
614
+ role: z.ZodOptional<z.ZodString>;
615
+ email: z.ZodOptional<z.ZodString>;
616
+ whatsAppNumber: z.ZodNumber;
617
+ callNumber: z.ZodOptional<z.ZodNumber>;
618
+ voiceNumber: z.ZodOptional<z.ZodNumber>;
619
+ website: z.ZodOptional<z.ZodString>;
620
+ homeAddress: z.ZodOptional<z.ZodString>;
621
+ workAddress: z.ZodOptional<z.ZodString>;
622
+ avatar: z.ZodOptional<z.ZodString>;
623
+ }, "strip", z.ZodTypeAny, {
624
+ fullname: string;
625
+ whatsAppNumber: number;
626
+ nickname?: string | undefined;
627
+ organization?: string | undefined;
628
+ role?: string | undefined;
629
+ email?: string | undefined;
630
+ callNumber?: number | undefined;
631
+ voiceNumber?: number | undefined;
632
+ website?: string | undefined;
633
+ homeAddress?: string | undefined;
634
+ workAddress?: string | undefined;
635
+ avatar?: string | undefined;
636
+ }, {
637
+ fullname: string;
638
+ whatsAppNumber: number;
639
+ nickname?: string | undefined;
640
+ organization?: string | undefined;
641
+ role?: string | undefined;
642
+ email?: string | undefined;
643
+ callNumber?: number | undefined;
644
+ voiceNumber?: number | undefined;
645
+ website?: string | undefined;
646
+ homeAddress?: string | undefined;
647
+ workAddress?: string | undefined;
648
+ avatar?: string | undefined;
649
+ }>;
650
+ declare const ReactionWorkerOptionsType: z.ZodObject<Pick<{
651
+ roomId: z.ZodString;
652
+ asForwarded: z.ZodOptional<z.ZodBoolean>;
653
+ asViewOnce: z.ZodOptional<z.ZodBoolean>;
654
+ verifiedReply: z.ZodOptional<z.ZodEnum<["whatsapp", "meta", "chatgpt", "copilot", "instagram", "tiktok"]>>;
655
+ quoted: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodRecord<z.ZodString, z.ZodAny>>>;
656
+ }, "roomId"> & {
657
+ message: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodRecord<z.ZodString, z.ZodAny>>;
658
+ }, "strip", z.ZodTypeAny, {
659
+ message: (...args: unknown[]) => Record<string, any>;
660
+ roomId: string;
661
+ }, {
662
+ message: (...args: unknown[]) => Record<string, any>;
663
+ roomId: string;
664
+ }>;
665
+ declare const ReactionWorkerBaseType: z.ZodString;
666
+ declare const PinWorkerOptionsType: z.ZodObject<Pick<{
667
+ roomId: z.ZodString;
668
+ asForwarded: z.ZodOptional<z.ZodBoolean>;
669
+ asViewOnce: z.ZodOptional<z.ZodBoolean>;
670
+ verifiedReply: z.ZodOptional<z.ZodEnum<["whatsapp", "meta", "chatgpt", "copilot", "instagram", "tiktok"]>>;
671
+ quoted: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodRecord<z.ZodString, z.ZodAny>>>;
672
+ }, "roomId"> & {
673
+ message: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodRecord<z.ZodString, z.ZodAny>>;
674
+ }, "strip", z.ZodTypeAny, {
675
+ message: (...args: unknown[]) => Record<string, any>;
676
+ roomId: string;
677
+ }, {
678
+ message: (...args: unknown[]) => Record<string, any>;
679
+ roomId: string;
680
+ }>;
681
+ declare const PinWorkerBaseType: z.ZodObject<{
682
+ action: z.ZodEnum<["pin", "unpin"]>;
683
+ expired: z.ZodEnum<["24h", "7d", "30d"]>;
684
+ }, "strip", z.ZodTypeAny, {
685
+ action: "pin" | "unpin";
686
+ expired: "24h" | "7d" | "30d";
687
+ }, {
688
+ action: "pin" | "unpin";
689
+ expired: "24h" | "7d" | "30d";
690
+ }>;
691
+ declare const PollWorkerOptionsType: z.ZodObject<Pick<{
692
+ roomId: z.ZodString;
693
+ asForwarded: z.ZodOptional<z.ZodBoolean>;
694
+ asViewOnce: z.ZodOptional<z.ZodBoolean>;
695
+ verifiedReply: z.ZodOptional<z.ZodEnum<["whatsapp", "meta", "chatgpt", "copilot", "instagram", "tiktok"]>>;
696
+ quoted: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodRecord<z.ZodString, z.ZodAny>>>;
697
+ }, "roomId">, "strip", z.ZodTypeAny, {
698
+ roomId: string;
699
+ }, {
700
+ roomId: string;
701
+ }>;
702
+ declare const PollWorkerBaseType: z.ZodObject<{
703
+ name: z.ZodString;
704
+ answers: z.ZodArray<z.ZodString, "many">;
705
+ multipleAnswers: z.ZodOptional<z.ZodBoolean>;
706
+ }, "strip", z.ZodTypeAny, {
707
+ name: string;
708
+ answers: string[];
709
+ multipleAnswers?: boolean | undefined;
710
+ }, {
711
+ name: string;
712
+ answers: string[];
713
+ multipleAnswers?: boolean | undefined;
714
+ }>;
715
+ declare const EditWorkerOptionsType: z.ZodObject<Pick<{
716
+ roomId: z.ZodString;
717
+ asForwarded: z.ZodOptional<z.ZodBoolean>;
718
+ asViewOnce: z.ZodOptional<z.ZodBoolean>;
719
+ verifiedReply: z.ZodOptional<z.ZodEnum<["whatsapp", "meta", "chatgpt", "copilot", "instagram", "tiktok"]>>;
720
+ quoted: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodRecord<z.ZodString, z.ZodAny>>>;
721
+ }, "roomId"> & {
722
+ message: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodRecord<z.ZodString, z.ZodAny>>;
723
+ }, "strip", z.ZodTypeAny, {
724
+ message: (...args: unknown[]) => Record<string, any>;
725
+ roomId: string;
726
+ }, {
727
+ message: (...args: unknown[]) => Record<string, any>;
728
+ roomId: string;
729
+ }>;
730
+ declare const EditWorkerBaseType: z.ZodString;
731
+ declare const DeleteWorkerOptionsType: z.ZodObject<Pick<{
732
+ roomId: z.ZodString;
733
+ asForwarded: z.ZodOptional<z.ZodBoolean>;
734
+ asViewOnce: z.ZodOptional<z.ZodBoolean>;
735
+ verifiedReply: z.ZodOptional<z.ZodEnum<["whatsapp", "meta", "chatgpt", "copilot", "instagram", "tiktok"]>>;
736
+ quoted: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodRecord<z.ZodString, z.ZodAny>>>;
737
+ }, "roomId">, "strip", z.ZodTypeAny, {
738
+ roomId: string;
739
+ }, {
740
+ roomId: string;
741
+ }>;
742
+ declare const DeleteWorkerBaseType: z.ZodObject<{
743
+ message: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodRecord<z.ZodString, z.ZodAny>>;
744
+ }, "strip", z.ZodTypeAny, {
745
+ message: (...args: unknown[]) => Record<string, any>;
746
+ }, {
747
+ message: (...args: unknown[]) => Record<string, any>;
748
+ }>;
749
+ declare const RejectCallWorkerBaseType: z.ZodObject<{
750
+ callId: z.ZodString;
751
+ callerId: z.ZodString;
752
+ }, "strip", z.ZodTypeAny, {
753
+ callId: string;
754
+ callerId: string;
755
+ }, {
756
+ callId: string;
757
+ callerId: string;
758
+ }>;
759
+ declare const MuteWorkerOptionsType: z.ZodObject<Pick<{
760
+ roomId: z.ZodString;
761
+ asForwarded: z.ZodOptional<z.ZodBoolean>;
762
+ asViewOnce: z.ZodOptional<z.ZodBoolean>;
763
+ verifiedReply: z.ZodOptional<z.ZodEnum<["whatsapp", "meta", "chatgpt", "copilot", "instagram", "tiktok"]>>;
764
+ quoted: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodRecord<z.ZodString, z.ZodAny>>>;
765
+ }, "roomId">, "strip", z.ZodTypeAny, {
766
+ roomId: string;
767
+ }, {
768
+ roomId: string;
769
+ }>;
770
+ declare const MuteWorkerBaseType: z.ZodObject<{
771
+ expired: z.ZodEnum<["remove", "8h", "7d"]>;
772
+ }, "strip", z.ZodTypeAny, {
773
+ expired: "7d" | "remove" | "8h";
774
+ }, {
775
+ expired: "7d" | "remove" | "8h";
776
+ }>;
777
+ declare const ProfileWorkerBaseType: z.ZodString;
778
+ declare const ProfileWorkerBaseOutputType: z.ZodObject<{
779
+ type: z.ZodEnum<["group", "user"]>;
780
+ id: z.ZodString;
781
+ name: z.ZodString;
782
+ bio: z.ZodString;
783
+ avatar: z.ZodString;
784
+ ephemeralDuration: z.ZodOptional<z.ZodNumber>;
785
+ isRestrict: z.ZodOptional<z.ZodBoolean>;
786
+ isAnnounce: z.ZodOptional<z.ZodBoolean>;
787
+ isCommunity: z.ZodOptional<z.ZodBoolean>;
788
+ isCommunityAnnounce: z.ZodOptional<z.ZodBoolean>;
789
+ isJoinApprovalMode: z.ZodOptional<z.ZodBoolean>;
790
+ isMemberAddMode: z.ZodOptional<z.ZodBoolean>;
791
+ owner: z.ZodNullable<z.ZodObject<{
792
+ type: z.ZodLiteral<"user">;
166
793
  id: z.ZodString;
167
- from: z.ZodString;
168
- timestamp: z.ZodNumber;
169
794
  }, "strip", z.ZodTypeAny, {
795
+ type: "user";
170
796
  id: string;
171
- timestamp: number;
172
- from: string;
173
797
  }, {
798
+ type: "user";
174
799
  id: string;
175
- timestamp: number;
176
- from: string;
177
- }>;
800
+ }>>;
801
+ roomCreatedAt: z.ZodOptional<z.ZodNumber>;
802
+ nameUpdatedAt: z.ZodOptional<z.ZodNumber>;
803
+ bioUpdatedAt: z.ZodOptional<z.ZodNumber>;
804
+ membersLength: z.ZodOptional<z.ZodNumber>;
805
+ members: z.ZodOptional<z.ZodArray<z.ZodObject<{
806
+ type: z.ZodEnum<["user", "admin", "superadmin"]>;
807
+ id: z.ZodString;
808
+ }, "strip", z.ZodTypeAny, {
809
+ type: "user" | "admin" | "superadmin";
810
+ id: string;
811
+ }, {
812
+ type: "user" | "admin" | "superadmin";
813
+ id: string;
814
+ }>, "many">>;
178
815
  }, "strip", z.ZodTypeAny, {
179
- call: {
816
+ type: "user" | "group";
817
+ id: string;
818
+ name: string;
819
+ avatar: string;
820
+ bio: string;
821
+ owner: {
822
+ type: "user";
180
823
  id: string;
181
- timestamp: number;
182
- from: string;
183
- };
824
+ } | null;
825
+ ephemeralDuration?: number | undefined;
826
+ isRestrict?: boolean | undefined;
827
+ isAnnounce?: boolean | undefined;
828
+ isCommunity?: boolean | undefined;
829
+ isCommunityAnnounce?: boolean | undefined;
830
+ isJoinApprovalMode?: boolean | undefined;
831
+ isMemberAddMode?: boolean | undefined;
832
+ roomCreatedAt?: number | undefined;
833
+ nameUpdatedAt?: number | undefined;
834
+ bioUpdatedAt?: number | undefined;
835
+ membersLength?: number | undefined;
836
+ members?: {
837
+ type: "user" | "admin" | "superadmin";
838
+ id: string;
839
+ }[] | undefined;
184
840
  }, {
185
- call: {
841
+ type: "user" | "group";
842
+ id: string;
843
+ name: string;
844
+ avatar: string;
845
+ bio: string;
846
+ owner: {
847
+ type: "user";
186
848
  id: string;
187
- timestamp: number;
188
- from: string;
189
- };
849
+ } | null;
850
+ ephemeralDuration?: number | undefined;
851
+ isRestrict?: boolean | undefined;
852
+ isAnnounce?: boolean | undefined;
853
+ isCommunity?: boolean | undefined;
854
+ isCommunityAnnounce?: boolean | undefined;
855
+ isJoinApprovalMode?: boolean | undefined;
856
+ isMemberAddMode?: boolean | undefined;
857
+ roomCreatedAt?: number | undefined;
858
+ nameUpdatedAt?: number | undefined;
859
+ bioUpdatedAt?: number | undefined;
860
+ membersLength?: number | undefined;
861
+ members?: {
862
+ type: "user" | "admin" | "superadmin";
863
+ id: string;
864
+ }[] | undefined;
190
865
  }>;
191
- declare const EventEnumType: z.ZodEnum<["connection", "messages", "call"]>;
192
- type EventEnumType = z.infer<typeof EventEnumType>;
193
- type EventCallbackType = {
194
- connection: (data: z.infer<typeof EventConnectionType>) => void;
195
- messages: (data: z.infer<typeof EventMessagesType>) => void;
196
- call: (data: z.infer<typeof EventCallType>) => void;
197
- };
866
+ declare const PresenceWorkerOptionsType: z.ZodObject<Pick<{
867
+ roomId: z.ZodString;
868
+ asForwarded: z.ZodOptional<z.ZodBoolean>;
869
+ asViewOnce: z.ZodOptional<z.ZodBoolean>;
870
+ verifiedReply: z.ZodOptional<z.ZodEnum<["whatsapp", "meta", "chatgpt", "copilot", "instagram", "tiktok"]>>;
871
+ quoted: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodRecord<z.ZodString, z.ZodAny>>>;
872
+ }, "roomId">, "strip", z.ZodTypeAny, {
873
+ roomId: string;
874
+ }, {
875
+ roomId: string;
876
+ }>;
877
+ declare const PresenceWorkerBaseType: z.ZodEnum<["typing", "recording", "online", "offline", "paused"]>;
878
+
879
+ declare class Worker {
880
+ private wa;
881
+ constructor(wa: {
882
+ client: Client;
883
+ db: Client["db"];
884
+ socket: Client["socket"];
885
+ });
886
+ private sendMessage;
887
+ text(text: z.infer<typeof TextWorkerBaseType>, options: z.infer<typeof TextWorkerOptionsType>): Promise<{
888
+ message: (...args: unknown[]) => Record<string, any>;
889
+ citation: Record<string, boolean> | null;
890
+ text: string | null;
891
+ timestamp: number;
892
+ chatId: string;
893
+ channelId: string;
894
+ receiverId: string;
895
+ receiverName: string;
896
+ roomId: string;
897
+ roomName: string;
898
+ senderId: string;
899
+ senderName: string;
900
+ senderDevice: "unknown" | "android" | "ios" | "desktop" | "web";
901
+ chatType: "text" | "image" | "contact" | "location" | "document" | "audio" | "video" | "protocol" | "contactsArray" | "highlyStructured" | "sendPayment" | "liveLocation" | "requestPayment" | "declinePaymentRequest" | "cancelPaymentRequest" | "template" | "sticker" | "groupInvite" | "templateButtonReply" | "product" | "deviceSent" | "list" | "viewOnce" | "order" | "listResponse" | "ephemeral" | "invoice" | "buttons" | "buttonsResponse" | "paymentInvite" | "interactive" | "reaction" | "interactiveResponse" | "pollCreation" | "pollUpdate" | "keepInChat" | "requestPhoneNumber" | "scheduledCallCreation" | "groupMentioned" | "pinInChat" | "scheduledCallEdit" | "ptv" | "botInvoke" | "callLog" | "encComment" | "bcall" | "lottieSticker" | "event" | "comment" | "placeholder" | "encEventUpdate";
902
+ mentions: string[];
903
+ links: string[];
904
+ isPrefix: boolean;
905
+ isFromMe: boolean;
906
+ isTagMe: boolean;
907
+ isGroup: boolean;
908
+ isStory: boolean;
909
+ isViewOnce: boolean;
910
+ isEdited: boolean;
911
+ isDeleted: boolean;
912
+ isPinned: boolean;
913
+ isUnPinned: boolean;
914
+ isChannel: boolean;
915
+ isBroadcast: boolean;
916
+ isEphemeral: boolean;
917
+ isForwarded: boolean;
918
+ media: z.objectOutputType<{
919
+ buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
920
+ stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
921
+ }, z.ZodTypeAny, "passthrough"> | null;
922
+ replied: {
923
+ message: (...args: unknown[]) => Record<string, any>;
924
+ citation: Record<string, boolean> | null;
925
+ text: string | null;
926
+ timestamp: number;
927
+ chatId: string;
928
+ channelId: string;
929
+ receiverId: string;
930
+ receiverName: string;
931
+ roomId: string;
932
+ roomName: string;
933
+ senderId: string;
934
+ senderName: string;
935
+ senderDevice: "unknown" | "android" | "ios" | "desktop" | "web";
936
+ chatType: "text" | "image" | "contact" | "location" | "document" | "audio" | "video" | "protocol" | "contactsArray" | "highlyStructured" | "sendPayment" | "liveLocation" | "requestPayment" | "declinePaymentRequest" | "cancelPaymentRequest" | "template" | "sticker" | "groupInvite" | "templateButtonReply" | "product" | "deviceSent" | "list" | "viewOnce" | "order" | "listResponse" | "ephemeral" | "invoice" | "buttons" | "buttonsResponse" | "paymentInvite" | "interactive" | "reaction" | "interactiveResponse" | "pollCreation" | "pollUpdate" | "keepInChat" | "requestPhoneNumber" | "scheduledCallCreation" | "groupMentioned" | "pinInChat" | "scheduledCallEdit" | "ptv" | "botInvoke" | "callLog" | "encComment" | "bcall" | "lottieSticker" | "event" | "comment" | "placeholder" | "encEventUpdate";
937
+ mentions: string[];
938
+ links: string[];
939
+ isPrefix: boolean;
940
+ isFromMe: boolean;
941
+ isTagMe: boolean;
942
+ isGroup: boolean;
943
+ isStory: boolean;
944
+ isViewOnce: boolean;
945
+ isEdited: boolean;
946
+ isDeleted: boolean;
947
+ isPinned: boolean;
948
+ isUnPinned: boolean;
949
+ isChannel: boolean;
950
+ isBroadcast: boolean;
951
+ isEphemeral: boolean;
952
+ isForwarded: boolean;
953
+ media: z.objectOutputType<{
954
+ buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
955
+ stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
956
+ }, z.ZodTypeAny, "passthrough"> | null;
957
+ } | null;
958
+ } | null | undefined>;
959
+ location(loc: z.infer<typeof LocationWorkerBaseType>, options: z.infer<typeof LocationWorkerOptionsType>): Promise<{
960
+ message: (...args: unknown[]) => Record<string, any>;
961
+ citation: Record<string, boolean> | null;
962
+ text: string | null;
963
+ timestamp: number;
964
+ chatId: string;
965
+ channelId: string;
966
+ receiverId: string;
967
+ receiverName: string;
968
+ roomId: string;
969
+ roomName: string;
970
+ senderId: string;
971
+ senderName: string;
972
+ senderDevice: "unknown" | "android" | "ios" | "desktop" | "web";
973
+ chatType: "text" | "image" | "contact" | "location" | "document" | "audio" | "video" | "protocol" | "contactsArray" | "highlyStructured" | "sendPayment" | "liveLocation" | "requestPayment" | "declinePaymentRequest" | "cancelPaymentRequest" | "template" | "sticker" | "groupInvite" | "templateButtonReply" | "product" | "deviceSent" | "list" | "viewOnce" | "order" | "listResponse" | "ephemeral" | "invoice" | "buttons" | "buttonsResponse" | "paymentInvite" | "interactive" | "reaction" | "interactiveResponse" | "pollCreation" | "pollUpdate" | "keepInChat" | "requestPhoneNumber" | "scheduledCallCreation" | "groupMentioned" | "pinInChat" | "scheduledCallEdit" | "ptv" | "botInvoke" | "callLog" | "encComment" | "bcall" | "lottieSticker" | "event" | "comment" | "placeholder" | "encEventUpdate";
974
+ mentions: string[];
975
+ links: string[];
976
+ isPrefix: boolean;
977
+ isFromMe: boolean;
978
+ isTagMe: boolean;
979
+ isGroup: boolean;
980
+ isStory: boolean;
981
+ isViewOnce: boolean;
982
+ isEdited: boolean;
983
+ isDeleted: boolean;
984
+ isPinned: boolean;
985
+ isUnPinned: boolean;
986
+ isChannel: boolean;
987
+ isBroadcast: boolean;
988
+ isEphemeral: boolean;
989
+ isForwarded: boolean;
990
+ media: z.objectOutputType<{
991
+ buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
992
+ stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
993
+ }, z.ZodTypeAny, "passthrough"> | null;
994
+ replied: {
995
+ message: (...args: unknown[]) => Record<string, any>;
996
+ citation: Record<string, boolean> | null;
997
+ text: string | null;
998
+ timestamp: number;
999
+ chatId: string;
1000
+ channelId: string;
1001
+ receiverId: string;
1002
+ receiverName: string;
1003
+ roomId: string;
1004
+ roomName: string;
1005
+ senderId: string;
1006
+ senderName: string;
1007
+ senderDevice: "unknown" | "android" | "ios" | "desktop" | "web";
1008
+ chatType: "text" | "image" | "contact" | "location" | "document" | "audio" | "video" | "protocol" | "contactsArray" | "highlyStructured" | "sendPayment" | "liveLocation" | "requestPayment" | "declinePaymentRequest" | "cancelPaymentRequest" | "template" | "sticker" | "groupInvite" | "templateButtonReply" | "product" | "deviceSent" | "list" | "viewOnce" | "order" | "listResponse" | "ephemeral" | "invoice" | "buttons" | "buttonsResponse" | "paymentInvite" | "interactive" | "reaction" | "interactiveResponse" | "pollCreation" | "pollUpdate" | "keepInChat" | "requestPhoneNumber" | "scheduledCallCreation" | "groupMentioned" | "pinInChat" | "scheduledCallEdit" | "ptv" | "botInvoke" | "callLog" | "encComment" | "bcall" | "lottieSticker" | "event" | "comment" | "placeholder" | "encEventUpdate";
1009
+ mentions: string[];
1010
+ links: string[];
1011
+ isPrefix: boolean;
1012
+ isFromMe: boolean;
1013
+ isTagMe: boolean;
1014
+ isGroup: boolean;
1015
+ isStory: boolean;
1016
+ isViewOnce: boolean;
1017
+ isEdited: boolean;
1018
+ isDeleted: boolean;
1019
+ isPinned: boolean;
1020
+ isUnPinned: boolean;
1021
+ isChannel: boolean;
1022
+ isBroadcast: boolean;
1023
+ isEphemeral: boolean;
1024
+ isForwarded: boolean;
1025
+ media: z.objectOutputType<{
1026
+ buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
1027
+ stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
1028
+ }, z.ZodTypeAny, "passthrough"> | null;
1029
+ } | null;
1030
+ } | null>;
1031
+ contact(vcard: z.infer<typeof ContactWorkerBaseType>, options: z.infer<typeof ContactWorkerOptionsType>): Promise<{
1032
+ message: (...args: unknown[]) => Record<string, any>;
1033
+ citation: Record<string, boolean> | null;
1034
+ text: string | null;
1035
+ timestamp: number;
1036
+ chatId: string;
1037
+ channelId: string;
1038
+ receiverId: string;
1039
+ receiverName: string;
1040
+ roomId: string;
1041
+ roomName: string;
1042
+ senderId: string;
1043
+ senderName: string;
1044
+ senderDevice: "unknown" | "android" | "ios" | "desktop" | "web";
1045
+ chatType: "text" | "image" | "contact" | "location" | "document" | "audio" | "video" | "protocol" | "contactsArray" | "highlyStructured" | "sendPayment" | "liveLocation" | "requestPayment" | "declinePaymentRequest" | "cancelPaymentRequest" | "template" | "sticker" | "groupInvite" | "templateButtonReply" | "product" | "deviceSent" | "list" | "viewOnce" | "order" | "listResponse" | "ephemeral" | "invoice" | "buttons" | "buttonsResponse" | "paymentInvite" | "interactive" | "reaction" | "interactiveResponse" | "pollCreation" | "pollUpdate" | "keepInChat" | "requestPhoneNumber" | "scheduledCallCreation" | "groupMentioned" | "pinInChat" | "scheduledCallEdit" | "ptv" | "botInvoke" | "callLog" | "encComment" | "bcall" | "lottieSticker" | "event" | "comment" | "placeholder" | "encEventUpdate";
1046
+ mentions: string[];
1047
+ links: string[];
1048
+ isPrefix: boolean;
1049
+ isFromMe: boolean;
1050
+ isTagMe: boolean;
1051
+ isGroup: boolean;
1052
+ isStory: boolean;
1053
+ isViewOnce: boolean;
1054
+ isEdited: boolean;
1055
+ isDeleted: boolean;
1056
+ isPinned: boolean;
1057
+ isUnPinned: boolean;
1058
+ isChannel: boolean;
1059
+ isBroadcast: boolean;
1060
+ isEphemeral: boolean;
1061
+ isForwarded: boolean;
1062
+ media: z.objectOutputType<{
1063
+ buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
1064
+ stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
1065
+ }, z.ZodTypeAny, "passthrough"> | null;
1066
+ replied: {
1067
+ message: (...args: unknown[]) => Record<string, any>;
1068
+ citation: Record<string, boolean> | null;
1069
+ text: string | null;
1070
+ timestamp: number;
1071
+ chatId: string;
1072
+ channelId: string;
1073
+ receiverId: string;
1074
+ receiverName: string;
1075
+ roomId: string;
1076
+ roomName: string;
1077
+ senderId: string;
1078
+ senderName: string;
1079
+ senderDevice: "unknown" | "android" | "ios" | "desktop" | "web";
1080
+ chatType: "text" | "image" | "contact" | "location" | "document" | "audio" | "video" | "protocol" | "contactsArray" | "highlyStructured" | "sendPayment" | "liveLocation" | "requestPayment" | "declinePaymentRequest" | "cancelPaymentRequest" | "template" | "sticker" | "groupInvite" | "templateButtonReply" | "product" | "deviceSent" | "list" | "viewOnce" | "order" | "listResponse" | "ephemeral" | "invoice" | "buttons" | "buttonsResponse" | "paymentInvite" | "interactive" | "reaction" | "interactiveResponse" | "pollCreation" | "pollUpdate" | "keepInChat" | "requestPhoneNumber" | "scheduledCallCreation" | "groupMentioned" | "pinInChat" | "scheduledCallEdit" | "ptv" | "botInvoke" | "callLog" | "encComment" | "bcall" | "lottieSticker" | "event" | "comment" | "placeholder" | "encEventUpdate";
1081
+ mentions: string[];
1082
+ links: string[];
1083
+ isPrefix: boolean;
1084
+ isFromMe: boolean;
1085
+ isTagMe: boolean;
1086
+ isGroup: boolean;
1087
+ isStory: boolean;
1088
+ isViewOnce: boolean;
1089
+ isEdited: boolean;
1090
+ isDeleted: boolean;
1091
+ isPinned: boolean;
1092
+ isUnPinned: boolean;
1093
+ isChannel: boolean;
1094
+ isBroadcast: boolean;
1095
+ isEphemeral: boolean;
1096
+ isForwarded: boolean;
1097
+ media: z.objectOutputType<{
1098
+ buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
1099
+ stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
1100
+ }, z.ZodTypeAny, "passthrough"> | null;
1101
+ } | null;
1102
+ } | null>;
1103
+ reaction(emoticon: z.infer<typeof ReactionWorkerBaseType>, options: z.infer<typeof ReactionWorkerOptionsType>): Promise<{
1104
+ message: (...args: unknown[]) => Record<string, any>;
1105
+ citation: Record<string, boolean> | null;
1106
+ text: string | null;
1107
+ timestamp: number;
1108
+ chatId: string;
1109
+ channelId: string;
1110
+ receiverId: string;
1111
+ receiverName: string;
1112
+ roomId: string;
1113
+ roomName: string;
1114
+ senderId: string;
1115
+ senderName: string;
1116
+ senderDevice: "unknown" | "android" | "ios" | "desktop" | "web";
1117
+ chatType: "text" | "image" | "contact" | "location" | "document" | "audio" | "video" | "protocol" | "contactsArray" | "highlyStructured" | "sendPayment" | "liveLocation" | "requestPayment" | "declinePaymentRequest" | "cancelPaymentRequest" | "template" | "sticker" | "groupInvite" | "templateButtonReply" | "product" | "deviceSent" | "list" | "viewOnce" | "order" | "listResponse" | "ephemeral" | "invoice" | "buttons" | "buttonsResponse" | "paymentInvite" | "interactive" | "reaction" | "interactiveResponse" | "pollCreation" | "pollUpdate" | "keepInChat" | "requestPhoneNumber" | "scheduledCallCreation" | "groupMentioned" | "pinInChat" | "scheduledCallEdit" | "ptv" | "botInvoke" | "callLog" | "encComment" | "bcall" | "lottieSticker" | "event" | "comment" | "placeholder" | "encEventUpdate";
1118
+ mentions: string[];
1119
+ links: string[];
1120
+ isPrefix: boolean;
1121
+ isFromMe: boolean;
1122
+ isTagMe: boolean;
1123
+ isGroup: boolean;
1124
+ isStory: boolean;
1125
+ isViewOnce: boolean;
1126
+ isEdited: boolean;
1127
+ isDeleted: boolean;
1128
+ isPinned: boolean;
1129
+ isUnPinned: boolean;
1130
+ isChannel: boolean;
1131
+ isBroadcast: boolean;
1132
+ isEphemeral: boolean;
1133
+ isForwarded: boolean;
1134
+ media: z.objectOutputType<{
1135
+ buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
1136
+ stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
1137
+ }, z.ZodTypeAny, "passthrough"> | null;
1138
+ replied: {
1139
+ message: (...args: unknown[]) => Record<string, any>;
1140
+ citation: Record<string, boolean> | null;
1141
+ text: string | null;
1142
+ timestamp: number;
1143
+ chatId: string;
1144
+ channelId: string;
1145
+ receiverId: string;
1146
+ receiverName: string;
1147
+ roomId: string;
1148
+ roomName: string;
1149
+ senderId: string;
1150
+ senderName: string;
1151
+ senderDevice: "unknown" | "android" | "ios" | "desktop" | "web";
1152
+ chatType: "text" | "image" | "contact" | "location" | "document" | "audio" | "video" | "protocol" | "contactsArray" | "highlyStructured" | "sendPayment" | "liveLocation" | "requestPayment" | "declinePaymentRequest" | "cancelPaymentRequest" | "template" | "sticker" | "groupInvite" | "templateButtonReply" | "product" | "deviceSent" | "list" | "viewOnce" | "order" | "listResponse" | "ephemeral" | "invoice" | "buttons" | "buttonsResponse" | "paymentInvite" | "interactive" | "reaction" | "interactiveResponse" | "pollCreation" | "pollUpdate" | "keepInChat" | "requestPhoneNumber" | "scheduledCallCreation" | "groupMentioned" | "pinInChat" | "scheduledCallEdit" | "ptv" | "botInvoke" | "callLog" | "encComment" | "bcall" | "lottieSticker" | "event" | "comment" | "placeholder" | "encEventUpdate";
1153
+ mentions: string[];
1154
+ links: string[];
1155
+ isPrefix: boolean;
1156
+ isFromMe: boolean;
1157
+ isTagMe: boolean;
1158
+ isGroup: boolean;
1159
+ isStory: boolean;
1160
+ isViewOnce: boolean;
1161
+ isEdited: boolean;
1162
+ isDeleted: boolean;
1163
+ isPinned: boolean;
1164
+ isUnPinned: boolean;
1165
+ isChannel: boolean;
1166
+ isBroadcast: boolean;
1167
+ isEphemeral: boolean;
1168
+ isForwarded: boolean;
1169
+ media: z.objectOutputType<{
1170
+ buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
1171
+ stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
1172
+ }, z.ZodTypeAny, "passthrough"> | null;
1173
+ } | null;
1174
+ } | null>;
1175
+ pin(pin: z.infer<typeof PinWorkerBaseType>, options: z.infer<typeof PinWorkerOptionsType>): Promise<{
1176
+ message: (...args: unknown[]) => Record<string, any>;
1177
+ citation: Record<string, boolean> | null;
1178
+ text: string | null;
1179
+ timestamp: number;
1180
+ chatId: string;
1181
+ channelId: string;
1182
+ receiverId: string;
1183
+ receiverName: string;
1184
+ roomId: string;
1185
+ roomName: string;
1186
+ senderId: string;
1187
+ senderName: string;
1188
+ senderDevice: "unknown" | "android" | "ios" | "desktop" | "web";
1189
+ chatType: "text" | "image" | "contact" | "location" | "document" | "audio" | "video" | "protocol" | "contactsArray" | "highlyStructured" | "sendPayment" | "liveLocation" | "requestPayment" | "declinePaymentRequest" | "cancelPaymentRequest" | "template" | "sticker" | "groupInvite" | "templateButtonReply" | "product" | "deviceSent" | "list" | "viewOnce" | "order" | "listResponse" | "ephemeral" | "invoice" | "buttons" | "buttonsResponse" | "paymentInvite" | "interactive" | "reaction" | "interactiveResponse" | "pollCreation" | "pollUpdate" | "keepInChat" | "requestPhoneNumber" | "scheduledCallCreation" | "groupMentioned" | "pinInChat" | "scheduledCallEdit" | "ptv" | "botInvoke" | "callLog" | "encComment" | "bcall" | "lottieSticker" | "event" | "comment" | "placeholder" | "encEventUpdate";
1190
+ mentions: string[];
1191
+ links: string[];
1192
+ isPrefix: boolean;
1193
+ isFromMe: boolean;
1194
+ isTagMe: boolean;
1195
+ isGroup: boolean;
1196
+ isStory: boolean;
1197
+ isViewOnce: boolean;
1198
+ isEdited: boolean;
1199
+ isDeleted: boolean;
1200
+ isPinned: boolean;
1201
+ isUnPinned: boolean;
1202
+ isChannel: boolean;
1203
+ isBroadcast: boolean;
1204
+ isEphemeral: boolean;
1205
+ isForwarded: boolean;
1206
+ media: z.objectOutputType<{
1207
+ buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
1208
+ stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
1209
+ }, z.ZodTypeAny, "passthrough"> | null;
1210
+ replied: {
1211
+ message: (...args: unknown[]) => Record<string, any>;
1212
+ citation: Record<string, boolean> | null;
1213
+ text: string | null;
1214
+ timestamp: number;
1215
+ chatId: string;
1216
+ channelId: string;
1217
+ receiverId: string;
1218
+ receiverName: string;
1219
+ roomId: string;
1220
+ roomName: string;
1221
+ senderId: string;
1222
+ senderName: string;
1223
+ senderDevice: "unknown" | "android" | "ios" | "desktop" | "web";
1224
+ chatType: "text" | "image" | "contact" | "location" | "document" | "audio" | "video" | "protocol" | "contactsArray" | "highlyStructured" | "sendPayment" | "liveLocation" | "requestPayment" | "declinePaymentRequest" | "cancelPaymentRequest" | "template" | "sticker" | "groupInvite" | "templateButtonReply" | "product" | "deviceSent" | "list" | "viewOnce" | "order" | "listResponse" | "ephemeral" | "invoice" | "buttons" | "buttonsResponse" | "paymentInvite" | "interactive" | "reaction" | "interactiveResponse" | "pollCreation" | "pollUpdate" | "keepInChat" | "requestPhoneNumber" | "scheduledCallCreation" | "groupMentioned" | "pinInChat" | "scheduledCallEdit" | "ptv" | "botInvoke" | "callLog" | "encComment" | "bcall" | "lottieSticker" | "event" | "comment" | "placeholder" | "encEventUpdate";
1225
+ mentions: string[];
1226
+ links: string[];
1227
+ isPrefix: boolean;
1228
+ isFromMe: boolean;
1229
+ isTagMe: boolean;
1230
+ isGroup: boolean;
1231
+ isStory: boolean;
1232
+ isViewOnce: boolean;
1233
+ isEdited: boolean;
1234
+ isDeleted: boolean;
1235
+ isPinned: boolean;
1236
+ isUnPinned: boolean;
1237
+ isChannel: boolean;
1238
+ isBroadcast: boolean;
1239
+ isEphemeral: boolean;
1240
+ isForwarded: boolean;
1241
+ media: z.objectOutputType<{
1242
+ buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
1243
+ stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
1244
+ }, z.ZodTypeAny, "passthrough"> | null;
1245
+ } | null;
1246
+ } | null>;
1247
+ poll(poll: z.infer<typeof PollWorkerBaseType>, options: z.infer<typeof PollWorkerOptionsType>): Promise<{
1248
+ message: (...args: unknown[]) => Record<string, any>;
1249
+ citation: Record<string, boolean> | null;
1250
+ text: string | null;
1251
+ timestamp: number;
1252
+ chatId: string;
1253
+ channelId: string;
1254
+ receiverId: string;
1255
+ receiverName: string;
1256
+ roomId: string;
1257
+ roomName: string;
1258
+ senderId: string;
1259
+ senderName: string;
1260
+ senderDevice: "unknown" | "android" | "ios" | "desktop" | "web";
1261
+ chatType: "text" | "image" | "contact" | "location" | "document" | "audio" | "video" | "protocol" | "contactsArray" | "highlyStructured" | "sendPayment" | "liveLocation" | "requestPayment" | "declinePaymentRequest" | "cancelPaymentRequest" | "template" | "sticker" | "groupInvite" | "templateButtonReply" | "product" | "deviceSent" | "list" | "viewOnce" | "order" | "listResponse" | "ephemeral" | "invoice" | "buttons" | "buttonsResponse" | "paymentInvite" | "interactive" | "reaction" | "interactiveResponse" | "pollCreation" | "pollUpdate" | "keepInChat" | "requestPhoneNumber" | "scheduledCallCreation" | "groupMentioned" | "pinInChat" | "scheduledCallEdit" | "ptv" | "botInvoke" | "callLog" | "encComment" | "bcall" | "lottieSticker" | "event" | "comment" | "placeholder" | "encEventUpdate";
1262
+ mentions: string[];
1263
+ links: string[];
1264
+ isPrefix: boolean;
1265
+ isFromMe: boolean;
1266
+ isTagMe: boolean;
1267
+ isGroup: boolean;
1268
+ isStory: boolean;
1269
+ isViewOnce: boolean;
1270
+ isEdited: boolean;
1271
+ isDeleted: boolean;
1272
+ isPinned: boolean;
1273
+ isUnPinned: boolean;
1274
+ isChannel: boolean;
1275
+ isBroadcast: boolean;
1276
+ isEphemeral: boolean;
1277
+ isForwarded: boolean;
1278
+ media: z.objectOutputType<{
1279
+ buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
1280
+ stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
1281
+ }, z.ZodTypeAny, "passthrough"> | null;
1282
+ replied: {
1283
+ message: (...args: unknown[]) => Record<string, any>;
1284
+ citation: Record<string, boolean> | null;
1285
+ text: string | null;
1286
+ timestamp: number;
1287
+ chatId: string;
1288
+ channelId: string;
1289
+ receiverId: string;
1290
+ receiverName: string;
1291
+ roomId: string;
1292
+ roomName: string;
1293
+ senderId: string;
1294
+ senderName: string;
1295
+ senderDevice: "unknown" | "android" | "ios" | "desktop" | "web";
1296
+ chatType: "text" | "image" | "contact" | "location" | "document" | "audio" | "video" | "protocol" | "contactsArray" | "highlyStructured" | "sendPayment" | "liveLocation" | "requestPayment" | "declinePaymentRequest" | "cancelPaymentRequest" | "template" | "sticker" | "groupInvite" | "templateButtonReply" | "product" | "deviceSent" | "list" | "viewOnce" | "order" | "listResponse" | "ephemeral" | "invoice" | "buttons" | "buttonsResponse" | "paymentInvite" | "interactive" | "reaction" | "interactiveResponse" | "pollCreation" | "pollUpdate" | "keepInChat" | "requestPhoneNumber" | "scheduledCallCreation" | "groupMentioned" | "pinInChat" | "scheduledCallEdit" | "ptv" | "botInvoke" | "callLog" | "encComment" | "bcall" | "lottieSticker" | "event" | "comment" | "placeholder" | "encEventUpdate";
1297
+ mentions: string[];
1298
+ links: string[];
1299
+ isPrefix: boolean;
1300
+ isFromMe: boolean;
1301
+ isTagMe: boolean;
1302
+ isGroup: boolean;
1303
+ isStory: boolean;
1304
+ isViewOnce: boolean;
1305
+ isEdited: boolean;
1306
+ isDeleted: boolean;
1307
+ isPinned: boolean;
1308
+ isUnPinned: boolean;
1309
+ isChannel: boolean;
1310
+ isBroadcast: boolean;
1311
+ isEphemeral: boolean;
1312
+ isForwarded: boolean;
1313
+ media: z.objectOutputType<{
1314
+ buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
1315
+ stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
1316
+ }, z.ZodTypeAny, "passthrough"> | null;
1317
+ } | null;
1318
+ } | null>;
1319
+ edit(text: z.infer<typeof EditWorkerBaseType>, options: z.infer<typeof EditWorkerOptionsType>): Promise<{
1320
+ message: (...args: unknown[]) => Record<string, any>;
1321
+ citation: Record<string, boolean> | null;
1322
+ text: string | null;
1323
+ timestamp: number;
1324
+ chatId: string;
1325
+ channelId: string;
1326
+ receiverId: string;
1327
+ receiverName: string;
1328
+ roomId: string;
1329
+ roomName: string;
1330
+ senderId: string;
1331
+ senderName: string;
1332
+ senderDevice: "unknown" | "android" | "ios" | "desktop" | "web";
1333
+ chatType: "text" | "image" | "contact" | "location" | "document" | "audio" | "video" | "protocol" | "contactsArray" | "highlyStructured" | "sendPayment" | "liveLocation" | "requestPayment" | "declinePaymentRequest" | "cancelPaymentRequest" | "template" | "sticker" | "groupInvite" | "templateButtonReply" | "product" | "deviceSent" | "list" | "viewOnce" | "order" | "listResponse" | "ephemeral" | "invoice" | "buttons" | "buttonsResponse" | "paymentInvite" | "interactive" | "reaction" | "interactiveResponse" | "pollCreation" | "pollUpdate" | "keepInChat" | "requestPhoneNumber" | "scheduledCallCreation" | "groupMentioned" | "pinInChat" | "scheduledCallEdit" | "ptv" | "botInvoke" | "callLog" | "encComment" | "bcall" | "lottieSticker" | "event" | "comment" | "placeholder" | "encEventUpdate";
1334
+ mentions: string[];
1335
+ links: string[];
1336
+ isPrefix: boolean;
1337
+ isFromMe: boolean;
1338
+ isTagMe: boolean;
1339
+ isGroup: boolean;
1340
+ isStory: boolean;
1341
+ isViewOnce: boolean;
1342
+ isEdited: boolean;
1343
+ isDeleted: boolean;
1344
+ isPinned: boolean;
1345
+ isUnPinned: boolean;
1346
+ isChannel: boolean;
1347
+ isBroadcast: boolean;
1348
+ isEphemeral: boolean;
1349
+ isForwarded: boolean;
1350
+ media: z.objectOutputType<{
1351
+ buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
1352
+ stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
1353
+ }, z.ZodTypeAny, "passthrough"> | null;
1354
+ replied: {
1355
+ message: (...args: unknown[]) => Record<string, any>;
1356
+ citation: Record<string, boolean> | null;
1357
+ text: string | null;
1358
+ timestamp: number;
1359
+ chatId: string;
1360
+ channelId: string;
1361
+ receiverId: string;
1362
+ receiverName: string;
1363
+ roomId: string;
1364
+ roomName: string;
1365
+ senderId: string;
1366
+ senderName: string;
1367
+ senderDevice: "unknown" | "android" | "ios" | "desktop" | "web";
1368
+ chatType: "text" | "image" | "contact" | "location" | "document" | "audio" | "video" | "protocol" | "contactsArray" | "highlyStructured" | "sendPayment" | "liveLocation" | "requestPayment" | "declinePaymentRequest" | "cancelPaymentRequest" | "template" | "sticker" | "groupInvite" | "templateButtonReply" | "product" | "deviceSent" | "list" | "viewOnce" | "order" | "listResponse" | "ephemeral" | "invoice" | "buttons" | "buttonsResponse" | "paymentInvite" | "interactive" | "reaction" | "interactiveResponse" | "pollCreation" | "pollUpdate" | "keepInChat" | "requestPhoneNumber" | "scheduledCallCreation" | "groupMentioned" | "pinInChat" | "scheduledCallEdit" | "ptv" | "botInvoke" | "callLog" | "encComment" | "bcall" | "lottieSticker" | "event" | "comment" | "placeholder" | "encEventUpdate";
1369
+ mentions: string[];
1370
+ links: string[];
1371
+ isPrefix: boolean;
1372
+ isFromMe: boolean;
1373
+ isTagMe: boolean;
1374
+ isGroup: boolean;
1375
+ isStory: boolean;
1376
+ isViewOnce: boolean;
1377
+ isEdited: boolean;
1378
+ isDeleted: boolean;
1379
+ isPinned: boolean;
1380
+ isUnPinned: boolean;
1381
+ isChannel: boolean;
1382
+ isBroadcast: boolean;
1383
+ isEphemeral: boolean;
1384
+ isForwarded: boolean;
1385
+ media: z.objectOutputType<{
1386
+ buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
1387
+ stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
1388
+ }, z.ZodTypeAny, "passthrough"> | null;
1389
+ } | null;
1390
+ } | null>;
1391
+ delete(del: z.infer<typeof DeleteWorkerBaseType>, options: z.infer<typeof DeleteWorkerOptionsType>): Promise<{
1392
+ message: (...args: unknown[]) => Record<string, any>;
1393
+ citation: Record<string, boolean> | null;
1394
+ text: string | null;
1395
+ timestamp: number;
1396
+ chatId: string;
1397
+ channelId: string;
1398
+ receiverId: string;
1399
+ receiverName: string;
1400
+ roomId: string;
1401
+ roomName: string;
1402
+ senderId: string;
1403
+ senderName: string;
1404
+ senderDevice: "unknown" | "android" | "ios" | "desktop" | "web";
1405
+ chatType: "text" | "image" | "contact" | "location" | "document" | "audio" | "video" | "protocol" | "contactsArray" | "highlyStructured" | "sendPayment" | "liveLocation" | "requestPayment" | "declinePaymentRequest" | "cancelPaymentRequest" | "template" | "sticker" | "groupInvite" | "templateButtonReply" | "product" | "deviceSent" | "list" | "viewOnce" | "order" | "listResponse" | "ephemeral" | "invoice" | "buttons" | "buttonsResponse" | "paymentInvite" | "interactive" | "reaction" | "interactiveResponse" | "pollCreation" | "pollUpdate" | "keepInChat" | "requestPhoneNumber" | "scheduledCallCreation" | "groupMentioned" | "pinInChat" | "scheduledCallEdit" | "ptv" | "botInvoke" | "callLog" | "encComment" | "bcall" | "lottieSticker" | "event" | "comment" | "placeholder" | "encEventUpdate";
1406
+ mentions: string[];
1407
+ links: string[];
1408
+ isPrefix: boolean;
1409
+ isFromMe: boolean;
1410
+ isTagMe: boolean;
1411
+ isGroup: boolean;
1412
+ isStory: boolean;
1413
+ isViewOnce: boolean;
1414
+ isEdited: boolean;
1415
+ isDeleted: boolean;
1416
+ isPinned: boolean;
1417
+ isUnPinned: boolean;
1418
+ isChannel: boolean;
1419
+ isBroadcast: boolean;
1420
+ isEphemeral: boolean;
1421
+ isForwarded: boolean;
1422
+ media: z.objectOutputType<{
1423
+ buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
1424
+ stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
1425
+ }, z.ZodTypeAny, "passthrough"> | null;
1426
+ replied: {
1427
+ message: (...args: unknown[]) => Record<string, any>;
1428
+ citation: Record<string, boolean> | null;
1429
+ text: string | null;
1430
+ timestamp: number;
1431
+ chatId: string;
1432
+ channelId: string;
1433
+ receiverId: string;
1434
+ receiverName: string;
1435
+ roomId: string;
1436
+ roomName: string;
1437
+ senderId: string;
1438
+ senderName: string;
1439
+ senderDevice: "unknown" | "android" | "ios" | "desktop" | "web";
1440
+ chatType: "text" | "image" | "contact" | "location" | "document" | "audio" | "video" | "protocol" | "contactsArray" | "highlyStructured" | "sendPayment" | "liveLocation" | "requestPayment" | "declinePaymentRequest" | "cancelPaymentRequest" | "template" | "sticker" | "groupInvite" | "templateButtonReply" | "product" | "deviceSent" | "list" | "viewOnce" | "order" | "listResponse" | "ephemeral" | "invoice" | "buttons" | "buttonsResponse" | "paymentInvite" | "interactive" | "reaction" | "interactiveResponse" | "pollCreation" | "pollUpdate" | "keepInChat" | "requestPhoneNumber" | "scheduledCallCreation" | "groupMentioned" | "pinInChat" | "scheduledCallEdit" | "ptv" | "botInvoke" | "callLog" | "encComment" | "bcall" | "lottieSticker" | "event" | "comment" | "placeholder" | "encEventUpdate";
1441
+ mentions: string[];
1442
+ links: string[];
1443
+ isPrefix: boolean;
1444
+ isFromMe: boolean;
1445
+ isTagMe: boolean;
1446
+ isGroup: boolean;
1447
+ isStory: boolean;
1448
+ isViewOnce: boolean;
1449
+ isEdited: boolean;
1450
+ isDeleted: boolean;
1451
+ isPinned: boolean;
1452
+ isUnPinned: boolean;
1453
+ isChannel: boolean;
1454
+ isBroadcast: boolean;
1455
+ isEphemeral: boolean;
1456
+ isForwarded: boolean;
1457
+ media: z.objectOutputType<{
1458
+ buffer: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
1459
+ stream: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>;
1460
+ }, z.ZodTypeAny, "passthrough"> | null;
1461
+ } | null;
1462
+ } | null>;
1463
+ rejectCall(call: z.infer<typeof RejectCallWorkerBaseType>): Promise<void | undefined>;
1464
+ mute(mute: z.infer<typeof MuteWorkerBaseType>, options: z.infer<typeof MuteWorkerOptionsType>): Promise<void | undefined>;
1465
+ profile(roomId: z.infer<typeof ProfileWorkerBaseType>): Promise<z.infer<typeof ProfileWorkerBaseOutputType> | null>;
1466
+ presence(action: z.infer<typeof PresenceWorkerBaseType>, options: z.infer<typeof PresenceWorkerOptionsType>): Promise<void | undefined>;
1467
+ }
198
1468
 
199
1469
  declare class Client {
200
1470
  private props;
201
1471
  options: z.infer<typeof ClientClassesType> | undefined;
202
1472
  private chatId;
203
1473
  private logger;
204
- private event;
205
1474
  private db;
206
1475
  private socket;
207
1476
  private groupCache;
1477
+ private events;
1478
+ private spinners;
1479
+ private worker;
208
1480
  constructor(props: z.input<typeof ClientClassesType>);
209
1481
  initialize(): Promise<void>;
1482
+ startSpinner(key: string, message: string): Ora;
1483
+ stopSpinner(key: string, succeed: boolean, message?: string): void;
1484
+ failSpinner(key: string, message?: string): void;
210
1485
  on<T extends EventEnumType>(event: T, handler: EventCallbackType[T]): void;
1486
+ emit<T extends EventEnumType>(event: T, ...args: Parameters<EventCallbackType[T]>): void;
1487
+ }
1488
+ interface Client extends Worker {
211
1489
  }
212
1490
 
213
1491
  export { Client as default };