@arcaelas/whatsapp 1.2.2 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/build/{Chat.js → cjs/Chat.js} +1 -1
  2. package/build/cjs/Chat.js.map +1 -0
  3. package/build/{Contact.d.ts → cjs/Contact.d.ts} +28 -0
  4. package/build/{Contact.js → cjs/Contact.js} +6 -5
  5. package/build/cjs/Contact.js.map +1 -0
  6. package/build/{Message.d.ts → cjs/Message.d.ts} +62 -7
  7. package/build/{Message.js → cjs/Message.js} +42 -22
  8. package/build/cjs/Message.js.map +1 -0
  9. package/build/{WhatsApp.js → cjs/WhatsApp.js} +11 -6
  10. package/build/cjs/WhatsApp.js.map +1 -0
  11. package/build/cjs/index.js +17 -0
  12. package/build/cjs/index.js.map +1 -0
  13. package/build/cjs/package.json +1 -0
  14. package/build/{store → cjs/store}/driver/FileEngine.d.ts +1 -1
  15. package/build/{store → cjs/store}/driver/FileEngine.js +2 -2
  16. package/build/cjs/store/driver/FileEngine.js.map +1 -0
  17. package/build/{store → cjs/store}/driver/RedisEngine.d.ts +1 -1
  18. package/build/cjs/store/driver/RedisEngine.js.map +1 -0
  19. package/build/cjs/store/engine.js.map +1 -0
  20. package/build/cjs/store/index.d.ts +8 -0
  21. package/build/{store → cjs/store}/index.js +2 -2
  22. package/build/cjs/store/index.js.map +1 -0
  23. package/build/esm/Chat.d.ts +335 -0
  24. package/build/esm/Chat.js +390 -0
  25. package/build/esm/Chat.js.map +1 -0
  26. package/build/esm/Contact.d.ts +856 -0
  27. package/build/esm/Contact.js +183 -0
  28. package/build/esm/Contact.js.map +1 -0
  29. package/build/esm/Message.d.ts +580 -0
  30. package/build/esm/Message.js +459 -0
  31. package/build/esm/Message.js.map +1 -0
  32. package/build/esm/WhatsApp.d.ts +68 -0
  33. package/build/esm/WhatsApp.js +364 -0
  34. package/build/esm/WhatsApp.js.map +1 -0
  35. package/build/esm/index.d.ts +13 -0
  36. package/build/esm/index.js +10 -0
  37. package/build/esm/index.js.map +1 -0
  38. package/build/esm/package.json +1 -0
  39. package/build/esm/store/driver/FileEngine.d.ts +23 -0
  40. package/build/esm/store/driver/FileEngine.js +86 -0
  41. package/build/esm/store/driver/FileEngine.js.map +1 -0
  42. package/build/esm/store/driver/RedisEngine.d.ts +38 -0
  43. package/build/esm/store/driver/RedisEngine.js +65 -0
  44. package/build/esm/store/driver/RedisEngine.js.map +1 -0
  45. package/build/esm/store/engine.d.ts +54 -0
  46. package/build/esm/store/engine.js +6 -0
  47. package/build/{store → esm/store}/engine.js.map +1 -1
  48. package/build/esm/store/index.d.ts +8 -0
  49. package/build/esm/store/index.js +7 -0
  50. package/build/esm/store/index.js.map +1 -0
  51. package/package.json +70 -58
  52. package/API.md +0 -776
  53. package/CHANGELOG.md +0 -53
  54. package/DOC.md +0 -532
  55. package/build/Chat.js.map +0 -1
  56. package/build/Contact.js.map +0 -1
  57. package/build/Message.js.map +0 -1
  58. package/build/WhatsApp.js.map +0 -1
  59. package/build/index.js +0 -2
  60. package/build/index.js.map +0 -7
  61. package/build/store/driver/FileEngine.js.map +0 -1
  62. package/build/store/driver/RedisEngine.js.map +0 -1
  63. package/build/store/index.d.ts +0 -8
  64. package/build/store/index.js.map +0 -1
  65. package/context7.json +0 -4
  66. package/tsconfig.json +0 -27
  67. /package/build/{Chat.d.ts → cjs/Chat.d.ts} +0 -0
  68. /package/build/{WhatsApp.d.ts → cjs/WhatsApp.d.ts} +0 -0
  69. /package/build/{index.d.ts → cjs/index.d.ts} +0 -0
  70. /package/build/{store → cjs/store}/driver/RedisEngine.js +0 -0
  71. /package/build/{store → cjs/store}/engine.d.ts +0 -0
  72. /package/build/{store → cjs/store}/engine.js +0 -0
@@ -0,0 +1,856 @@
1
+ /**
2
+ * @file Contact.ts
3
+ * @description Clase Contact para gestión de contactos de WhatsApp
4
+ */
5
+ import type { WhatsApp } from './WhatsApp';
6
+ /**
7
+ * @description Objeto raw del contacto (protocolo).
8
+ */
9
+ export interface IContactRaw {
10
+ /** JID único del contacto */
11
+ id: string;
12
+ /** ID alternativo en formato LID */
13
+ lid?: string | null;
14
+ /** Nombre guardado en la agenda del usuario */
15
+ name?: string | null;
16
+ /** Nombre que el contacto configuró en su perfil (pushName) */
17
+ notify?: string | null;
18
+ /** Nombre de cuenta business verificada */
19
+ verifiedName?: string | null;
20
+ /** URL de la foto de perfil */
21
+ imgUrl?: string | null;
22
+ /** Bio/estado del perfil del contacto */
23
+ status?: string | null;
24
+ }
25
+ /**
26
+ * @description Datos persistidos de un contacto.
27
+ */
28
+ export interface IContact {
29
+ /** JID del contacto (ej: 123456@s.whatsapp.net) */
30
+ id: string;
31
+ /** Nombre del contacto */
32
+ name: string;
33
+ /** URL de la foto de perfil o null */
34
+ photo: string | null;
35
+ /** Número de teléfono sin formato */
36
+ phone: string;
37
+ /** Bio del contacto */
38
+ content: string;
39
+ /** Objeto raw del protocolo */
40
+ raw: IContactRaw;
41
+ }
42
+ /**
43
+ * @description
44
+ * Clase base para representar un contacto de WhatsApp.
45
+ * Usar Contact.get() para obtener instancias.
46
+ */
47
+ export declare class Contact {
48
+ readonly raw: IContactRaw;
49
+ constructor(data: IContact);
50
+ /** JID único del contacto */
51
+ get id(): string;
52
+ /** Nombre del contacto */
53
+ get name(): string;
54
+ /** URL de la foto de perfil o null */
55
+ get photo(): string | null;
56
+ /** Número de teléfono sin formato */
57
+ get phone(): string;
58
+ /** Bio del contacto */
59
+ get content(): string;
60
+ }
61
+ /**
62
+ * @description Construye IContact desde raw.
63
+ * @param raw Objeto raw del contacto.
64
+ * @returns IContact normalizado.
65
+ */
66
+ export declare function build_contact(raw: IContactRaw): IContact;
67
+ /**
68
+ * @description Factory que retorna la clase Contact enlazada al contexto.
69
+ * @param wa Instancia de WhatsApp.
70
+ * @returns Clase _Contact que extiende Contact.
71
+ */
72
+ export declare function contact(wa: WhatsApp): {
73
+ new (data: IContact): {
74
+ /**
75
+ * @description Cambia el nombre del contacto.
76
+ * @param name Nuevo nombre.
77
+ * @returns true si se guardó correctamente.
78
+ */
79
+ rename(name: string): Promise<boolean>;
80
+ /**
81
+ * @description Actualiza los datos del perfil desde WhatsApp.
82
+ * @returns this con datos actualizados, o null si falla.
83
+ */
84
+ refresh(): Promise</*elided*/ any | null>;
85
+ /**
86
+ * @description Obtiene o crea el chat con este contacto.
87
+ * @returns Chat asociado al contacto.
88
+ */
89
+ chat(): Promise<{
90
+ messages(offset?: number, limit?: number): Promise<InstanceType<{
91
+ new (data: import("./Message").IMessage): {
92
+ stream(): Promise<import("node:stream").Readable>;
93
+ content(): Promise<Buffer>;
94
+ readonly index: import("./Message").IMessageIndex;
95
+ readonly raw: import("baileys").WAMessage;
96
+ get id(): string;
97
+ get cid(): string;
98
+ get mid(): string | null;
99
+ get me(): boolean;
100
+ get author(): string;
101
+ get edited(): boolean;
102
+ get type(): import("./Message").MessageType;
103
+ get caption(): string;
104
+ get mime(): string;
105
+ get status(): import("./Message").MESSAGE_STATUS;
106
+ get starred(): boolean;
107
+ get forwarded(): boolean;
108
+ get created_at(): number;
109
+ get deleted_at(): number | null;
110
+ };
111
+ get(cid: string, mid: string): Promise<InstanceType</*elided*/ any> | null>;
112
+ react(cid: string, mid: string, emoji: string): Promise<boolean>;
113
+ remove(cid: string, mid: string): Promise<boolean>;
114
+ forward(cid: string, mid: string, to_cid: string): Promise<boolean>;
115
+ edit(cid: string, mid: string, text: string): Promise<boolean>;
116
+ text(cid: string, text: string): Promise<{
117
+ stream(): Promise<import("node:stream").Readable>;
118
+ content(): Promise<Buffer>;
119
+ readonly index: import("./Message").IMessageIndex;
120
+ readonly raw: import("baileys").WAMessage;
121
+ get id(): string;
122
+ get cid(): string;
123
+ get mid(): string | null;
124
+ get me(): boolean;
125
+ get author(): string;
126
+ get edited(): boolean;
127
+ get type(): import("./Message").MessageType;
128
+ get caption(): string;
129
+ get mime(): string;
130
+ get status(): import("./Message").MESSAGE_STATUS;
131
+ get starred(): boolean;
132
+ get forwarded(): boolean;
133
+ get created_at(): number;
134
+ get deleted_at(): number | null;
135
+ } | null>;
136
+ image(cid: string, buffer: Buffer, caption?: string): Promise<{
137
+ stream(): Promise<import("node:stream").Readable>;
138
+ content(): Promise<Buffer>;
139
+ readonly index: import("./Message").IMessageIndex;
140
+ readonly raw: import("baileys").WAMessage;
141
+ get id(): string;
142
+ get cid(): string;
143
+ get mid(): string | null;
144
+ get me(): boolean;
145
+ get author(): string;
146
+ get edited(): boolean;
147
+ get type(): import("./Message").MessageType;
148
+ get caption(): string;
149
+ get mime(): string;
150
+ get status(): import("./Message").MESSAGE_STATUS;
151
+ get starred(): boolean;
152
+ get forwarded(): boolean;
153
+ get created_at(): number;
154
+ get deleted_at(): number | null;
155
+ } | null>;
156
+ video(cid: string, buffer: Buffer, caption?: string): Promise<{
157
+ stream(): Promise<import("node:stream").Readable>;
158
+ content(): Promise<Buffer>;
159
+ readonly index: import("./Message").IMessageIndex;
160
+ readonly raw: import("baileys").WAMessage;
161
+ get id(): string;
162
+ get cid(): string;
163
+ get mid(): string | null;
164
+ get me(): boolean;
165
+ get author(): string;
166
+ get edited(): boolean;
167
+ get type(): import("./Message").MessageType;
168
+ get caption(): string;
169
+ get mime(): string;
170
+ get status(): import("./Message").MESSAGE_STATUS;
171
+ get starred(): boolean;
172
+ get forwarded(): boolean;
173
+ get created_at(): number;
174
+ get deleted_at(): number | null;
175
+ } | null>;
176
+ audio(cid: string, buffer: Buffer, ptt?: boolean): Promise<{
177
+ stream(): Promise<import("node:stream").Readable>;
178
+ content(): Promise<Buffer>;
179
+ readonly index: import("./Message").IMessageIndex;
180
+ readonly raw: import("baileys").WAMessage;
181
+ get id(): string;
182
+ get cid(): string;
183
+ get mid(): string | null;
184
+ get me(): boolean;
185
+ get author(): string;
186
+ get edited(): boolean;
187
+ get type(): import("./Message").MessageType;
188
+ get caption(): string;
189
+ get mime(): string;
190
+ get status(): import("./Message").MESSAGE_STATUS;
191
+ get starred(): boolean;
192
+ get forwarded(): boolean;
193
+ get created_at(): number;
194
+ get deleted_at(): number | null;
195
+ } | null>;
196
+ location(cid: string, opts: import("./Message").LocationOptions): Promise<{
197
+ stream(): Promise<import("node:stream").Readable>;
198
+ content(): Promise<Buffer>;
199
+ readonly index: import("./Message").IMessageIndex;
200
+ readonly raw: import("baileys").WAMessage;
201
+ get id(): string;
202
+ get cid(): string;
203
+ get mid(): string | null;
204
+ get me(): boolean;
205
+ get author(): string;
206
+ get edited(): boolean;
207
+ get type(): import("./Message").MessageType;
208
+ get caption(): string;
209
+ get mime(): string;
210
+ get status(): import("./Message").MESSAGE_STATUS;
211
+ get starred(): boolean;
212
+ get forwarded(): boolean;
213
+ get created_at(): number;
214
+ get deleted_at(): number | null;
215
+ } | null>;
216
+ poll(cid: string, opts: import("./Message").PollOptions): Promise<{
217
+ stream(): Promise<import("node:stream").Readable>;
218
+ content(): Promise<Buffer>;
219
+ readonly index: import("./Message").IMessageIndex;
220
+ readonly raw: import("baileys").WAMessage;
221
+ get id(): string;
222
+ get cid(): string;
223
+ get mid(): string | null;
224
+ get me(): boolean;
225
+ get author(): string;
226
+ get edited(): boolean;
227
+ get type(): import("./Message").MessageType;
228
+ get caption(): string;
229
+ get mime(): string;
230
+ get status(): import("./Message").MESSAGE_STATUS;
231
+ get starred(): boolean;
232
+ get forwarded(): boolean;
233
+ get created_at(): number;
234
+ get deleted_at(): number | null;
235
+ } | null>;
236
+ watch(cid: string, mid: string, handler: (msg: InstanceType</*elided*/ any>) => void): () => void;
237
+ notify(cid: string, mid: string): void;
238
+ }>[]>;
239
+ refresh(): Promise</*elided*/ any | null>;
240
+ readonly raw: import("./Chat").IChatRaw;
241
+ get id(): string;
242
+ get type(): "contact" | "group";
243
+ get name(): string;
244
+ get content(): string;
245
+ get pined(): boolean;
246
+ get archived(): boolean;
247
+ get muted(): number | false;
248
+ get readed(): boolean;
249
+ get readonly(): boolean;
250
+ } | null>;
251
+ readonly raw: IContactRaw;
252
+ /** JID único del contacto */
253
+ get id(): string;
254
+ /** Nombre del contacto */
255
+ get name(): string;
256
+ /** URL de la foto de perfil o null */
257
+ get photo(): string | null;
258
+ /** Número de teléfono sin formato */
259
+ get phone(): string;
260
+ /** Bio del contacto */
261
+ get content(): string;
262
+ };
263
+ /**
264
+ * @description Obtiene un contacto por su ID.
265
+ * @param uid JID del contacto (@s.whatsapp.net) o número de teléfono.
266
+ * @returns Contacto o null si no existe.
267
+ */
268
+ get(uid: string): Promise<{
269
+ /**
270
+ * @description Cambia el nombre del contacto.
271
+ * @param name Nuevo nombre.
272
+ * @returns true si se guardó correctamente.
273
+ */
274
+ rename(name: string): Promise<boolean>;
275
+ /**
276
+ * @description Actualiza los datos del perfil desde WhatsApp.
277
+ * @returns this con datos actualizados, o null si falla.
278
+ */
279
+ refresh(): Promise</*elided*/ any | null>;
280
+ /**
281
+ * @description Obtiene o crea el chat con este contacto.
282
+ * @returns Chat asociado al contacto.
283
+ */
284
+ chat(): Promise<{
285
+ messages(offset?: number, limit?: number): Promise<InstanceType<{
286
+ new (data: import("./Message").IMessage): {
287
+ stream(): Promise<import("node:stream").Readable>;
288
+ content(): Promise<Buffer>;
289
+ readonly index: import("./Message").IMessageIndex;
290
+ readonly raw: import("baileys").WAMessage;
291
+ get id(): string;
292
+ get cid(): string;
293
+ get mid(): string | null;
294
+ get me(): boolean;
295
+ get author(): string;
296
+ get edited(): boolean;
297
+ get type(): import("./Message").MessageType;
298
+ get caption(): string;
299
+ get mime(): string;
300
+ get status(): import("./Message").MESSAGE_STATUS;
301
+ get starred(): boolean;
302
+ get forwarded(): boolean;
303
+ get created_at(): number;
304
+ get deleted_at(): number | null;
305
+ };
306
+ get(cid: string, mid: string): Promise<InstanceType</*elided*/ any> | null>;
307
+ react(cid: string, mid: string, emoji: string): Promise<boolean>;
308
+ remove(cid: string, mid: string): Promise<boolean>;
309
+ forward(cid: string, mid: string, to_cid: string): Promise<boolean>;
310
+ edit(cid: string, mid: string, text: string): Promise<boolean>;
311
+ text(cid: string, text: string): Promise<{
312
+ stream(): Promise<import("node:stream").Readable>;
313
+ content(): Promise<Buffer>;
314
+ readonly index: import("./Message").IMessageIndex;
315
+ readonly raw: import("baileys").WAMessage;
316
+ get id(): string;
317
+ get cid(): string;
318
+ get mid(): string | null;
319
+ get me(): boolean;
320
+ get author(): string;
321
+ get edited(): boolean;
322
+ get type(): import("./Message").MessageType;
323
+ get caption(): string;
324
+ get mime(): string;
325
+ get status(): import("./Message").MESSAGE_STATUS;
326
+ get starred(): boolean;
327
+ get forwarded(): boolean;
328
+ get created_at(): number;
329
+ get deleted_at(): number | null;
330
+ } | null>;
331
+ image(cid: string, buffer: Buffer, caption?: string): Promise<{
332
+ stream(): Promise<import("node:stream").Readable>;
333
+ content(): Promise<Buffer>;
334
+ readonly index: import("./Message").IMessageIndex;
335
+ readonly raw: import("baileys").WAMessage;
336
+ get id(): string;
337
+ get cid(): string;
338
+ get mid(): string | null;
339
+ get me(): boolean;
340
+ get author(): string;
341
+ get edited(): boolean;
342
+ get type(): import("./Message").MessageType;
343
+ get caption(): string;
344
+ get mime(): string;
345
+ get status(): import("./Message").MESSAGE_STATUS;
346
+ get starred(): boolean;
347
+ get forwarded(): boolean;
348
+ get created_at(): number;
349
+ get deleted_at(): number | null;
350
+ } | null>;
351
+ video(cid: string, buffer: Buffer, caption?: string): Promise<{
352
+ stream(): Promise<import("node:stream").Readable>;
353
+ content(): Promise<Buffer>;
354
+ readonly index: import("./Message").IMessageIndex;
355
+ readonly raw: import("baileys").WAMessage;
356
+ get id(): string;
357
+ get cid(): string;
358
+ get mid(): string | null;
359
+ get me(): boolean;
360
+ get author(): string;
361
+ get edited(): boolean;
362
+ get type(): import("./Message").MessageType;
363
+ get caption(): string;
364
+ get mime(): string;
365
+ get status(): import("./Message").MESSAGE_STATUS;
366
+ get starred(): boolean;
367
+ get forwarded(): boolean;
368
+ get created_at(): number;
369
+ get deleted_at(): number | null;
370
+ } | null>;
371
+ audio(cid: string, buffer: Buffer, ptt?: boolean): Promise<{
372
+ stream(): Promise<import("node:stream").Readable>;
373
+ content(): Promise<Buffer>;
374
+ readonly index: import("./Message").IMessageIndex;
375
+ readonly raw: import("baileys").WAMessage;
376
+ get id(): string;
377
+ get cid(): string;
378
+ get mid(): string | null;
379
+ get me(): boolean;
380
+ get author(): string;
381
+ get edited(): boolean;
382
+ get type(): import("./Message").MessageType;
383
+ get caption(): string;
384
+ get mime(): string;
385
+ get status(): import("./Message").MESSAGE_STATUS;
386
+ get starred(): boolean;
387
+ get forwarded(): boolean;
388
+ get created_at(): number;
389
+ get deleted_at(): number | null;
390
+ } | null>;
391
+ location(cid: string, opts: import("./Message").LocationOptions): Promise<{
392
+ stream(): Promise<import("node:stream").Readable>;
393
+ content(): Promise<Buffer>;
394
+ readonly index: import("./Message").IMessageIndex;
395
+ readonly raw: import("baileys").WAMessage;
396
+ get id(): string;
397
+ get cid(): string;
398
+ get mid(): string | null;
399
+ get me(): boolean;
400
+ get author(): string;
401
+ get edited(): boolean;
402
+ get type(): import("./Message").MessageType;
403
+ get caption(): string;
404
+ get mime(): string;
405
+ get status(): import("./Message").MESSAGE_STATUS;
406
+ get starred(): boolean;
407
+ get forwarded(): boolean;
408
+ get created_at(): number;
409
+ get deleted_at(): number | null;
410
+ } | null>;
411
+ poll(cid: string, opts: import("./Message").PollOptions): Promise<{
412
+ stream(): Promise<import("node:stream").Readable>;
413
+ content(): Promise<Buffer>;
414
+ readonly index: import("./Message").IMessageIndex;
415
+ readonly raw: import("baileys").WAMessage;
416
+ get id(): string;
417
+ get cid(): string;
418
+ get mid(): string | null;
419
+ get me(): boolean;
420
+ get author(): string;
421
+ get edited(): boolean;
422
+ get type(): import("./Message").MessageType;
423
+ get caption(): string;
424
+ get mime(): string;
425
+ get status(): import("./Message").MESSAGE_STATUS;
426
+ get starred(): boolean;
427
+ get forwarded(): boolean;
428
+ get created_at(): number;
429
+ get deleted_at(): number | null;
430
+ } | null>;
431
+ watch(cid: string, mid: string, handler: (msg: InstanceType</*elided*/ any>) => void): () => void;
432
+ notify(cid: string, mid: string): void;
433
+ }>[]>;
434
+ refresh(): Promise</*elided*/ any | null>;
435
+ readonly raw: import("./Chat").IChatRaw;
436
+ get id(): string;
437
+ get type(): "contact" | "group";
438
+ get name(): string;
439
+ get content(): string;
440
+ get pined(): boolean;
441
+ get archived(): boolean;
442
+ get muted(): number | false;
443
+ get readed(): boolean;
444
+ get readonly(): boolean;
445
+ } | null>;
446
+ readonly raw: IContactRaw;
447
+ /** JID único del contacto */
448
+ get id(): string;
449
+ /** Nombre del contacto */
450
+ get name(): string;
451
+ /** URL de la foto de perfil o null */
452
+ get photo(): string | null;
453
+ /** Número de teléfono sin formato */
454
+ get phone(): string;
455
+ /** Bio del contacto */
456
+ get content(): string;
457
+ } | null>;
458
+ /**
459
+ * @description Actualiza los datos del perfil desde WhatsApp.
460
+ * @param uid JID del contacto.
461
+ * @returns Contacto actualizado o null.
462
+ */
463
+ refresh(uid: string): Promise<{
464
+ /**
465
+ * @description Cambia el nombre del contacto.
466
+ * @param name Nuevo nombre.
467
+ * @returns true si se guardó correctamente.
468
+ */
469
+ rename(name: string): Promise<boolean>;
470
+ /**
471
+ * @description Actualiza los datos del perfil desde WhatsApp.
472
+ * @returns this con datos actualizados, o null si falla.
473
+ */
474
+ refresh(): Promise</*elided*/ any | null>;
475
+ /**
476
+ * @description Obtiene o crea el chat con este contacto.
477
+ * @returns Chat asociado al contacto.
478
+ */
479
+ chat(): Promise<{
480
+ messages(offset?: number, limit?: number): Promise<InstanceType<{
481
+ new (data: import("./Message").IMessage): {
482
+ stream(): Promise<import("node:stream").Readable>;
483
+ content(): Promise<Buffer>;
484
+ readonly index: import("./Message").IMessageIndex;
485
+ readonly raw: import("baileys").WAMessage;
486
+ get id(): string;
487
+ get cid(): string;
488
+ get mid(): string | null;
489
+ get me(): boolean;
490
+ get author(): string;
491
+ get edited(): boolean;
492
+ get type(): import("./Message").MessageType;
493
+ get caption(): string;
494
+ get mime(): string;
495
+ get status(): import("./Message").MESSAGE_STATUS;
496
+ get starred(): boolean;
497
+ get forwarded(): boolean;
498
+ get created_at(): number;
499
+ get deleted_at(): number | null;
500
+ };
501
+ get(cid: string, mid: string): Promise<InstanceType</*elided*/ any> | null>;
502
+ react(cid: string, mid: string, emoji: string): Promise<boolean>;
503
+ remove(cid: string, mid: string): Promise<boolean>;
504
+ forward(cid: string, mid: string, to_cid: string): Promise<boolean>;
505
+ edit(cid: string, mid: string, text: string): Promise<boolean>;
506
+ text(cid: string, text: string): Promise<{
507
+ stream(): Promise<import("node:stream").Readable>;
508
+ content(): Promise<Buffer>;
509
+ readonly index: import("./Message").IMessageIndex;
510
+ readonly raw: import("baileys").WAMessage;
511
+ get id(): string;
512
+ get cid(): string;
513
+ get mid(): string | null;
514
+ get me(): boolean;
515
+ get author(): string;
516
+ get edited(): boolean;
517
+ get type(): import("./Message").MessageType;
518
+ get caption(): string;
519
+ get mime(): string;
520
+ get status(): import("./Message").MESSAGE_STATUS;
521
+ get starred(): boolean;
522
+ get forwarded(): boolean;
523
+ get created_at(): number;
524
+ get deleted_at(): number | null;
525
+ } | null>;
526
+ image(cid: string, buffer: Buffer, caption?: string): Promise<{
527
+ stream(): Promise<import("node:stream").Readable>;
528
+ content(): Promise<Buffer>;
529
+ readonly index: import("./Message").IMessageIndex;
530
+ readonly raw: import("baileys").WAMessage;
531
+ get id(): string;
532
+ get cid(): string;
533
+ get mid(): string | null;
534
+ get me(): boolean;
535
+ get author(): string;
536
+ get edited(): boolean;
537
+ get type(): import("./Message").MessageType;
538
+ get caption(): string;
539
+ get mime(): string;
540
+ get status(): import("./Message").MESSAGE_STATUS;
541
+ get starred(): boolean;
542
+ get forwarded(): boolean;
543
+ get created_at(): number;
544
+ get deleted_at(): number | null;
545
+ } | null>;
546
+ video(cid: string, buffer: Buffer, caption?: string): Promise<{
547
+ stream(): Promise<import("node:stream").Readable>;
548
+ content(): Promise<Buffer>;
549
+ readonly index: import("./Message").IMessageIndex;
550
+ readonly raw: import("baileys").WAMessage;
551
+ get id(): string;
552
+ get cid(): string;
553
+ get mid(): string | null;
554
+ get me(): boolean;
555
+ get author(): string;
556
+ get edited(): boolean;
557
+ get type(): import("./Message").MessageType;
558
+ get caption(): string;
559
+ get mime(): string;
560
+ get status(): import("./Message").MESSAGE_STATUS;
561
+ get starred(): boolean;
562
+ get forwarded(): boolean;
563
+ get created_at(): number;
564
+ get deleted_at(): number | null;
565
+ } | null>;
566
+ audio(cid: string, buffer: Buffer, ptt?: boolean): Promise<{
567
+ stream(): Promise<import("node:stream").Readable>;
568
+ content(): Promise<Buffer>;
569
+ readonly index: import("./Message").IMessageIndex;
570
+ readonly raw: import("baileys").WAMessage;
571
+ get id(): string;
572
+ get cid(): string;
573
+ get mid(): string | null;
574
+ get me(): boolean;
575
+ get author(): string;
576
+ get edited(): boolean;
577
+ get type(): import("./Message").MessageType;
578
+ get caption(): string;
579
+ get mime(): string;
580
+ get status(): import("./Message").MESSAGE_STATUS;
581
+ get starred(): boolean;
582
+ get forwarded(): boolean;
583
+ get created_at(): number;
584
+ get deleted_at(): number | null;
585
+ } | null>;
586
+ location(cid: string, opts: import("./Message").LocationOptions): Promise<{
587
+ stream(): Promise<import("node:stream").Readable>;
588
+ content(): Promise<Buffer>;
589
+ readonly index: import("./Message").IMessageIndex;
590
+ readonly raw: import("baileys").WAMessage;
591
+ get id(): string;
592
+ get cid(): string;
593
+ get mid(): string | null;
594
+ get me(): boolean;
595
+ get author(): string;
596
+ get edited(): boolean;
597
+ get type(): import("./Message").MessageType;
598
+ get caption(): string;
599
+ get mime(): string;
600
+ get status(): import("./Message").MESSAGE_STATUS;
601
+ get starred(): boolean;
602
+ get forwarded(): boolean;
603
+ get created_at(): number;
604
+ get deleted_at(): number | null;
605
+ } | null>;
606
+ poll(cid: string, opts: import("./Message").PollOptions): Promise<{
607
+ stream(): Promise<import("node:stream").Readable>;
608
+ content(): Promise<Buffer>;
609
+ readonly index: import("./Message").IMessageIndex;
610
+ readonly raw: import("baileys").WAMessage;
611
+ get id(): string;
612
+ get cid(): string;
613
+ get mid(): string | null;
614
+ get me(): boolean;
615
+ get author(): string;
616
+ get edited(): boolean;
617
+ get type(): import("./Message").MessageType;
618
+ get caption(): string;
619
+ get mime(): string;
620
+ get status(): import("./Message").MESSAGE_STATUS;
621
+ get starred(): boolean;
622
+ get forwarded(): boolean;
623
+ get created_at(): number;
624
+ get deleted_at(): number | null;
625
+ } | null>;
626
+ watch(cid: string, mid: string, handler: (msg: InstanceType</*elided*/ any>) => void): () => void;
627
+ notify(cid: string, mid: string): void;
628
+ }>[]>;
629
+ refresh(): Promise</*elided*/ any | null>;
630
+ readonly raw: import("./Chat").IChatRaw;
631
+ get id(): string;
632
+ get type(): "contact" | "group";
633
+ get name(): string;
634
+ get content(): string;
635
+ get pined(): boolean;
636
+ get archived(): boolean;
637
+ get muted(): number | false;
638
+ get readed(): boolean;
639
+ get readonly(): boolean;
640
+ } | null>;
641
+ readonly raw: IContactRaw;
642
+ /** JID único del contacto */
643
+ get id(): string;
644
+ /** Nombre del contacto */
645
+ get name(): string;
646
+ /** URL de la foto de perfil o null */
647
+ get photo(): string | null;
648
+ /** Número de teléfono sin formato */
649
+ get phone(): string;
650
+ /** Bio del contacto */
651
+ get content(): string;
652
+ } | null>;
653
+ /**
654
+ * @description Cambia el nombre de un contacto.
655
+ * @param uid JID del contacto.
656
+ * @param name Nuevo nombre.
657
+ * @returns true si se guardó correctamente.
658
+ */
659
+ rename(uid: string, name: string): Promise<boolean>;
660
+ /**
661
+ * @description Obtiene contactos paginados.
662
+ * @param offset Inicio de paginación.
663
+ * @param limit Cantidad máxima de resultados.
664
+ * @returns Array de contactos.
665
+ */
666
+ paginate(offset?: number, limit?: number): Promise<{
667
+ /**
668
+ * @description Cambia el nombre del contacto.
669
+ * @param name Nuevo nombre.
670
+ * @returns true si se guardó correctamente.
671
+ */
672
+ rename(name: string): Promise<boolean>;
673
+ /**
674
+ * @description Actualiza los datos del perfil desde WhatsApp.
675
+ * @returns this con datos actualizados, o null si falla.
676
+ */
677
+ refresh(): Promise</*elided*/ any | null>;
678
+ /**
679
+ * @description Obtiene o crea el chat con este contacto.
680
+ * @returns Chat asociado al contacto.
681
+ */
682
+ chat(): Promise<{
683
+ messages(offset?: number, limit?: number): Promise<InstanceType<{
684
+ new (data: import("./Message").IMessage): {
685
+ stream(): Promise<import("node:stream").Readable>;
686
+ content(): Promise<Buffer>;
687
+ readonly index: import("./Message").IMessageIndex;
688
+ readonly raw: import("baileys").WAMessage;
689
+ get id(): string;
690
+ get cid(): string;
691
+ get mid(): string | null;
692
+ get me(): boolean;
693
+ get author(): string;
694
+ get edited(): boolean;
695
+ get type(): import("./Message").MessageType;
696
+ get caption(): string;
697
+ get mime(): string;
698
+ get status(): import("./Message").MESSAGE_STATUS;
699
+ get starred(): boolean;
700
+ get forwarded(): boolean;
701
+ get created_at(): number;
702
+ get deleted_at(): number | null;
703
+ };
704
+ get(cid: string, mid: string): Promise<InstanceType</*elided*/ any> | null>;
705
+ react(cid: string, mid: string, emoji: string): Promise<boolean>;
706
+ remove(cid: string, mid: string): Promise<boolean>;
707
+ forward(cid: string, mid: string, to_cid: string): Promise<boolean>;
708
+ edit(cid: string, mid: string, text: string): Promise<boolean>;
709
+ text(cid: string, text: string): Promise<{
710
+ stream(): Promise<import("node:stream").Readable>;
711
+ content(): Promise<Buffer>;
712
+ readonly index: import("./Message").IMessageIndex;
713
+ readonly raw: import("baileys").WAMessage;
714
+ get id(): string;
715
+ get cid(): string;
716
+ get mid(): string | null;
717
+ get me(): boolean;
718
+ get author(): string;
719
+ get edited(): boolean;
720
+ get type(): import("./Message").MessageType;
721
+ get caption(): string;
722
+ get mime(): string;
723
+ get status(): import("./Message").MESSAGE_STATUS;
724
+ get starred(): boolean;
725
+ get forwarded(): boolean;
726
+ get created_at(): number;
727
+ get deleted_at(): number | null;
728
+ } | null>;
729
+ image(cid: string, buffer: Buffer, caption?: string): Promise<{
730
+ stream(): Promise<import("node:stream").Readable>;
731
+ content(): Promise<Buffer>;
732
+ readonly index: import("./Message").IMessageIndex;
733
+ readonly raw: import("baileys").WAMessage;
734
+ get id(): string;
735
+ get cid(): string;
736
+ get mid(): string | null;
737
+ get me(): boolean;
738
+ get author(): string;
739
+ get edited(): boolean;
740
+ get type(): import("./Message").MessageType;
741
+ get caption(): string;
742
+ get mime(): string;
743
+ get status(): import("./Message").MESSAGE_STATUS;
744
+ get starred(): boolean;
745
+ get forwarded(): boolean;
746
+ get created_at(): number;
747
+ get deleted_at(): number | null;
748
+ } | null>;
749
+ video(cid: string, buffer: Buffer, caption?: string): Promise<{
750
+ stream(): Promise<import("node:stream").Readable>;
751
+ content(): Promise<Buffer>;
752
+ readonly index: import("./Message").IMessageIndex;
753
+ readonly raw: import("baileys").WAMessage;
754
+ get id(): string;
755
+ get cid(): string;
756
+ get mid(): string | null;
757
+ get me(): boolean;
758
+ get author(): string;
759
+ get edited(): boolean;
760
+ get type(): import("./Message").MessageType;
761
+ get caption(): string;
762
+ get mime(): string;
763
+ get status(): import("./Message").MESSAGE_STATUS;
764
+ get starred(): boolean;
765
+ get forwarded(): boolean;
766
+ get created_at(): number;
767
+ get deleted_at(): number | null;
768
+ } | null>;
769
+ audio(cid: string, buffer: Buffer, ptt?: boolean): Promise<{
770
+ stream(): Promise<import("node:stream").Readable>;
771
+ content(): Promise<Buffer>;
772
+ readonly index: import("./Message").IMessageIndex;
773
+ readonly raw: import("baileys").WAMessage;
774
+ get id(): string;
775
+ get cid(): string;
776
+ get mid(): string | null;
777
+ get me(): boolean;
778
+ get author(): string;
779
+ get edited(): boolean;
780
+ get type(): import("./Message").MessageType;
781
+ get caption(): string;
782
+ get mime(): string;
783
+ get status(): import("./Message").MESSAGE_STATUS;
784
+ get starred(): boolean;
785
+ get forwarded(): boolean;
786
+ get created_at(): number;
787
+ get deleted_at(): number | null;
788
+ } | null>;
789
+ location(cid: string, opts: import("./Message").LocationOptions): Promise<{
790
+ stream(): Promise<import("node:stream").Readable>;
791
+ content(): Promise<Buffer>;
792
+ readonly index: import("./Message").IMessageIndex;
793
+ readonly raw: import("baileys").WAMessage;
794
+ get id(): string;
795
+ get cid(): string;
796
+ get mid(): string | null;
797
+ get me(): boolean;
798
+ get author(): string;
799
+ get edited(): boolean;
800
+ get type(): import("./Message").MessageType;
801
+ get caption(): string;
802
+ get mime(): string;
803
+ get status(): import("./Message").MESSAGE_STATUS;
804
+ get starred(): boolean;
805
+ get forwarded(): boolean;
806
+ get created_at(): number;
807
+ get deleted_at(): number | null;
808
+ } | null>;
809
+ poll(cid: string, opts: import("./Message").PollOptions): Promise<{
810
+ stream(): Promise<import("node:stream").Readable>;
811
+ content(): Promise<Buffer>;
812
+ readonly index: import("./Message").IMessageIndex;
813
+ readonly raw: import("baileys").WAMessage;
814
+ get id(): string;
815
+ get cid(): string;
816
+ get mid(): string | null;
817
+ get me(): boolean;
818
+ get author(): string;
819
+ get edited(): boolean;
820
+ get type(): import("./Message").MessageType;
821
+ get caption(): string;
822
+ get mime(): string;
823
+ get status(): import("./Message").MESSAGE_STATUS;
824
+ get starred(): boolean;
825
+ get forwarded(): boolean;
826
+ get created_at(): number;
827
+ get deleted_at(): number | null;
828
+ } | null>;
829
+ watch(cid: string, mid: string, handler: (msg: InstanceType</*elided*/ any>) => void): () => void;
830
+ notify(cid: string, mid: string): void;
831
+ }>[]>;
832
+ refresh(): Promise</*elided*/ any | null>;
833
+ readonly raw: import("./Chat").IChatRaw;
834
+ get id(): string;
835
+ get type(): "contact" | "group";
836
+ get name(): string;
837
+ get content(): string;
838
+ get pined(): boolean;
839
+ get archived(): boolean;
840
+ get muted(): number | false;
841
+ get readed(): boolean;
842
+ get readonly(): boolean;
843
+ } | null>;
844
+ readonly raw: IContactRaw;
845
+ /** JID único del contacto */
846
+ get id(): string;
847
+ /** Nombre del contacto */
848
+ get name(): string;
849
+ /** URL de la foto de perfil o null */
850
+ get photo(): string | null;
851
+ /** Número de teléfono sin formato */
852
+ get phone(): string;
853
+ /** Bio del contacto */
854
+ get content(): string;
855
+ }[]>;
856
+ };