@arcaelas/whatsapp 6.2.0 → 7.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/README.md +19 -15
  2. package/build/cjs/index.d.ts +9 -5
  3. package/build/cjs/index.js +8 -7
  4. package/build/cjs/lib/bot/decorator.d.ts +2 -9
  5. package/build/cjs/lib/bot/decorator.js +0 -1
  6. package/build/cjs/lib/bot/decorators.d.ts +48 -4
  7. package/build/cjs/lib/bot/decorators.js +2 -2
  8. package/build/cjs/lib/chat/index.d.ts +132 -152
  9. package/build/cjs/lib/chat/index.js +138 -219
  10. package/build/cjs/lib/contact/index.d.ts +114 -80
  11. package/build/cjs/lib/contact/index.js +187 -94
  12. package/build/cjs/lib/message/index.d.ts +400 -321
  13. package/build/cjs/lib/message/index.js +425 -913
  14. package/build/cjs/lib/status/index.d.ts +22 -33
  15. package/build/cjs/lib/status/index.js +52 -93
  16. package/build/cjs/lib/store/index.d.ts +16 -0
  17. package/build/cjs/lib/store/index.js +29 -3
  18. package/build/cjs/lib/whatsapp/index.d.ts +44 -212
  19. package/build/cjs/lib/whatsapp/index.js +473 -1099
  20. package/build/esm/index.d.ts +9 -5
  21. package/build/esm/index.js +6 -4
  22. package/build/esm/lib/bot/decorator.d.ts +2 -9
  23. package/build/esm/lib/bot/decorator.js +1 -1
  24. package/build/esm/lib/bot/decorators.d.ts +48 -4
  25. package/build/esm/lib/bot/decorators.js +2 -2
  26. package/build/esm/lib/chat/index.d.ts +132 -152
  27. package/build/esm/lib/chat/index.js +139 -219
  28. package/build/esm/lib/contact/index.d.ts +114 -80
  29. package/build/esm/lib/contact/index.js +186 -94
  30. package/build/esm/lib/message/index.d.ts +400 -321
  31. package/build/esm/lib/message/index.js +422 -913
  32. package/build/esm/lib/status/index.d.ts +22 -33
  33. package/build/esm/lib/status/index.js +49 -93
  34. package/build/esm/lib/store/index.d.ts +16 -0
  35. package/build/esm/lib/store/index.js +25 -0
  36. package/build/esm/lib/whatsapp/index.d.ts +44 -212
  37. package/build/esm/lib/whatsapp/index.js +476 -1101
  38. package/package.json +1 -1
  39. package/build/cjs/lib/internal.d.ts +0 -40
  40. package/build/cjs/lib/internal.js +0 -38
  41. package/build/esm/lib/internal.d.ts +0 -40
  42. package/build/esm/lib/internal.js +0 -34
@@ -3,13 +3,16 @@
3
3
  * @description Entidad Chat — conversaciones individuales y grupales.
4
4
  * Chat entity — individual and group conversations.
5
5
  */
6
- import { Message } from '../../lib/message';
7
- import type { WhatsApp } from '../../lib/whatsapp';
6
+ import type { WASocket } from 'baileys';
7
+ import type Contact from '../../lib/contact';
8
+ import type Message from '../../lib/message';
9
+ import { type Engine } from '../../lib/store';
10
+ import type WhatsApp from '../../lib/whatsapp';
8
11
  /**
9
- * Clase base del chat: recibe el raw y deriva todo con getters.
10
- * Base Chat class: receives the raw and derives everything via getters.
12
+ * Chat: recibe el raw y deriva todo con getters.
13
+ * Chat: receives the raw and derives everything via getters.
11
14
  */
12
- export declare class Chat {
15
+ export default class Chat {
13
16
  readonly _raw: {
14
17
  id: string;
15
18
  name?: string | null;
@@ -21,10 +24,10 @@ export declare class Chat {
21
24
  activity?: number | null;
22
25
  };
23
26
  /**
24
- * @internal Documento crudo del chat. `id` es el identificador del engine (JID, LID o
25
- * `@g.us`); `pinned` y `mute_end_time` son epoch ms.
26
- * Raw chat document. `id` is the engine identifier (JID, LID or `@g.us`); `pinned` and
27
- * `mute_end_time` are epoch ms.
27
+ * @internal Documento crudo. `id` es el identificador del engine (JID, LID o `@g.us`);
28
+ * `pinned`, `mute_end_time` y `activity` son epoch ms.
29
+ * Raw document. `id` is the engine identifier (JID, LID or `@g.us`); `pinned`,
30
+ * `mute_end_time` and `activity` are epoch ms.
28
31
  */
29
32
  constructor(_raw: {
30
33
  id: string;
@@ -52,12 +55,19 @@ export declare class Chat {
52
55
  get muted(): string | null;
53
56
  }
54
57
  /**
55
- * Factoría de Chat ligada al contexto WhatsApp.
56
- * Context-bound Chat factory.
58
+ * Chat ligado a la sesión viva: el socket y el engine llegan resueltos, así que sus métodos
59
+ * no vuelven a comprobarlos.
60
+ * Chat bound to the live session: socket and engine arrive resolved, so its methods do not
61
+ * check them again.
57
62
  *
58
- * @param wa - Instancia principal / Main WhatsApp instance
63
+ * @param init - Sesión activa: cliente, motor y socket / Active session: client, engine and socket
64
+ * @returns Clase `Chat` con acceso a la sesión / `Chat` class with session access
59
65
  */
60
- export declare function chat(wa: WhatsApp): {
66
+ export declare function chat(init: {
67
+ wa: WhatsApp;
68
+ engine: Engine;
69
+ socket: WASocket;
70
+ }): {
61
71
  new (_raw: {
62
72
  id: string;
63
73
  name?: string | null;
@@ -69,26 +79,26 @@ export declare function chat(wa: WhatsApp): {
69
79
  activity?: number | null;
70
80
  }): {
71
81
  /**
72
- * Participantes del chat: los integrantes en grupos, el contacto y yo en 1:1.
73
- * Chat participants: members for groups, the contact and myself for 1:1.
82
+ * Participantes: los integrantes en grupos, el contacto y yo en 1:1.
83
+ * Participants: members for groups, the contact and myself for 1:1.
74
84
  *
75
85
  * @param offset - Desplazamiento / Offset
76
86
  * @param limit - Tamaño de página / Page size
77
87
  * @returns Página de contactos / Contact page
78
88
  */
79
- members(offset?: number, limit?: number): Promise<InstanceType<typeof wa.Contact>[]>;
89
+ members(offset?: number, limit?: number): Promise<Contact[]>;
80
90
  /**
81
- * Descripción del chat: el asunto del grupo o, en un 1:1, la bio del contacto.
82
- * Es asíncrono porque ninguno de los dos vive en el documento del chat.
83
- * Chat description: the group's subject or, on a 1:1, the contact's bio. It is async
84
- * because neither of them lives in the chat document.
91
+ * Descripción: el asunto del grupo o, en un 1:1, la bio del contacto. Es asíncrono
92
+ * porque ninguna de las dos vive en el documento del chat.
93
+ * Description: the group's subject or, on a 1:1, the contact's bio. It is async because
94
+ * neither of them lives in the chat document.
85
95
  *
86
- * @returns Descripción, o cadena vacía si no hay / Description, or an empty string when absent
96
+ * @returns Descripción, o cadena vacía / Description, or an empty string
87
97
  */
88
98
  content(): Promise<string>;
89
99
  /**
90
- * Mensajes del chat paginados desde el más reciente.
91
- * Chat messages paginated from the most recent one.
100
+ * Mensajes del chat, del más reciente al más antiguo.
101
+ * Chat messages, from the most recent to the oldest.
92
102
  *
93
103
  * @param offset - Desplazamiento / Offset
94
104
  * @param limit - Tamaño de página / Page size
@@ -96,68 +106,58 @@ export declare function chat(wa: WhatsApp): {
96
106
  */
97
107
  messages(offset?: number, limit?: number): Promise<Message[]>;
98
108
  /**
99
- * Activa o desactiva el indicador «escribiendo…».
100
- * Toggles the "typing…" indicator.
109
+ * Publica el indicador «escribiendo…».
110
+ * Publishes the "typing…" indicator.
101
111
  *
102
- * @param value - true activa, false vuelve a pausa / true enables, false returns to paused
103
- * @returns true si el socket estaba disponible / true when the socket was available
112
+ * @param value - true escribe, false vuelve a pausa / true types, false returns to paused
104
113
  */
105
114
  typing(value: boolean): Promise<boolean>;
106
115
  /**
107
- * Activa o desactiva el indicador «grabando audio…».
108
- * Toggles the "recording audio…" indicator.
116
+ * Publica el indicador «grabando audio…».
117
+ * Publishes the "recording audio…" indicator.
109
118
  *
110
- * @param value - true activa, false vuelve a pausa / true enables, false returns to paused
111
- * @returns true si el socket estaba disponible / true when the socket was available
119
+ * @param value - true graba, false vuelve a pausa / true records, false returns to paused
112
120
  */
113
121
  recording(value: boolean): Promise<boolean>;
114
122
  /**
115
- * Archiva o desarchiva el chat en la cuenta de WhatsApp.
116
- * Archives or unarchives the chat on the WhatsApp account.
123
+ * Archiva o desarchiva el chat en la cuenta.
124
+ * Archives or unarchives the chat on the account.
117
125
  *
118
126
  * @param value - true archiva, false desarchiva / true archives, false unarchives
119
- * @returns true si la acción se envió / true when the action was sent
120
127
  */
121
128
  archive(value: boolean): Promise<boolean>;
122
129
  /**
123
- * Fija o desfija el chat en la cuenta de WhatsApp. WhatsApp acepta hasta 3 chats
124
- * fijados y descarta el cuarto sin avisar, así que el límite se verifica antes.
125
- * Pins or unpins the chat on the WhatsApp account. WhatsApp accepts up to 3 pinned
126
- * chats and silently drops the fourth, so the limit is checked beforehand.
130
+ * Fija o desfija el chat. Al fijar comprueba el límite, porque WhatsApp descarta el
131
+ * cuarto chat fijado sin avisar.
132
+ * Pins or unpins the chat. When pinning it checks the limit, since WhatsApp silently
133
+ * drops the fourth pinned chat.
127
134
  *
128
135
  * @param value - true fija, false desfija / true pins, false unpins
129
- * @returns false si el socket está caído o ya hay 3 chats fijados / false when the socket is down or 3 chats are already pinned
136
+ * @returns false si ya hay 3 chats fijados / false when 3 chats are already pinned
130
137
  */
131
138
  pin(value: boolean): Promise<boolean>;
132
139
  /**
133
- * Silencia el chat hasta la fecha indicada. `false` o una fecha pasada lo des-silencian.
134
- * Mutes the chat until the given date. `false` or a past date unmutes it.
140
+ * Silencia el chat hasta la fecha indicada; `false` o una fecha pasada lo reactivan.
141
+ * Mutes the chat until the given date; `false` or a past date unmutes it.
135
142
  *
136
- * @param until - Fecha límite (ISO, epoch ms o Date) o false / Deadline (ISO, epoch ms or Date) or false
137
- * @returns true si la acción se envió / true when the action was sent
143
+ * @param until - Fecha límite (ISO, epoch ms o Date), o false / Deadline (ISO, epoch ms or Date), or false
138
144
  */
139
145
  mute(until: string | number | Date | false): Promise<boolean>;
140
146
  /**
141
- * Marca el chat completo como leído en la cuenta de WhatsApp.
142
- * Marks the whole chat as read on the WhatsApp account.
143
- *
144
- * @returns true si la acción se envió / true when the action was sent
147
+ * Marca el chat completo como leído en la cuenta.
148
+ * Marks the whole chat as read on the account.
145
149
  */
146
150
  seen(): Promise<boolean>;
147
151
  /**
148
- * Vacía los mensajes del chat en la cuenta de WhatsApp y en el engine, conservando el chat.
149
- * Clears the chat messages on the WhatsApp account and in the engine, keeping the chat.
150
- *
151
- * @returns true siempre; la limpieza local es idempotente / always true; local cleanup is idempotent
152
+ * Vacía los mensajes del chat en la cuenta y en el engine, conservando el chat.
153
+ * Clears the chat messages on the account and in the engine, keeping the chat.
152
154
  */
153
155
  clear(): Promise<boolean>;
154
156
  /**
155
- * Elimina el chat y sus mensajes en la cuenta de WhatsApp y en el engine; en grupos
156
- * abandona el grupo.
157
- * Deletes the chat and its messages on the WhatsApp account and in the engine; for
158
- * groups it leaves the group.
159
- *
160
- * @returns true siempre; la limpieza local es idempotente / always true; local cleanup is idempotent
157
+ * Elimina el chat y sus mensajes en la cuenta y en el engine; en grupos, además sale
158
+ * del grupo.
159
+ * Deletes the chat and its messages on the account and in the engine; for groups it
160
+ * also leaves the group.
161
161
  */
162
162
  delete(): Promise<boolean>;
163
163
  readonly _raw: {
@@ -186,36 +186,36 @@ export declare function chat(wa: WhatsApp): {
186
186
  get muted(): string | null;
187
187
  };
188
188
  /**
189
- * Carga un chat por teléfono, JID, LID o id de grupo: el persistido en el engine o,
190
- * si todavía no existe, una instancia mínima lista para usar (no se persiste).
191
- * Loads a chat by phone, JID, LID or group id: the engine-persisted one or, when it
192
- * does not exist yet, a minimal ready-to-use instance (not persisted).
189
+ * Chat por teléfono, JID, LID o id de grupo: el persistido o, si no existe todavía,
190
+ * una instancia mínima lista para usar que no se persiste.
191
+ * Chat by phone, JID, LID or group id: the persisted one or, when it does not exist
192
+ * yet, a minimal ready-to-use instance that is not persisted.
193
193
  *
194
194
  * @param cid - Teléfono, JID, LID o id de grupo / Phone, JID, LID or group id
195
- * @returns Chat o null si el identificador es irresoluble / Chat or null when the identifier cannot be resolved
195
+ * @returns Chat, o null si el identificador es irresoluble / Chat, or null when the identifier cannot be resolved
196
196
  */
197
197
  get(cid: string | number): Promise<{
198
198
  /**
199
- * Participantes del chat: los integrantes en grupos, el contacto y yo en 1:1.
200
- * Chat participants: members for groups, the contact and myself for 1:1.
199
+ * Participantes: los integrantes en grupos, el contacto y yo en 1:1.
200
+ * Participants: members for groups, the contact and myself for 1:1.
201
201
  *
202
202
  * @param offset - Desplazamiento / Offset
203
203
  * @param limit - Tamaño de página / Page size
204
204
  * @returns Página de contactos / Contact page
205
205
  */
206
- members(offset?: number, limit?: number): Promise<InstanceType<typeof wa.Contact>[]>;
206
+ members(offset?: number, limit?: number): Promise<Contact[]>;
207
207
  /**
208
- * Descripción del chat: el asunto del grupo o, en un 1:1, la bio del contacto.
209
- * Es asíncrono porque ninguno de los dos vive en el documento del chat.
210
- * Chat description: the group's subject or, on a 1:1, the contact's bio. It is async
211
- * because neither of them lives in the chat document.
208
+ * Descripción: el asunto del grupo o, en un 1:1, la bio del contacto. Es asíncrono
209
+ * porque ninguna de las dos vive en el documento del chat.
210
+ * Description: the group's subject or, on a 1:1, the contact's bio. It is async because
211
+ * neither of them lives in the chat document.
212
212
  *
213
- * @returns Descripción, o cadena vacía si no hay / Description, or an empty string when absent
213
+ * @returns Descripción, o cadena vacía / Description, or an empty string
214
214
  */
215
215
  content(): Promise<string>;
216
216
  /**
217
- * Mensajes del chat paginados desde el más reciente.
218
- * Chat messages paginated from the most recent one.
217
+ * Mensajes del chat, del más reciente al más antiguo.
218
+ * Chat messages, from the most recent to the oldest.
219
219
  *
220
220
  * @param offset - Desplazamiento / Offset
221
221
  * @param limit - Tamaño de página / Page size
@@ -223,68 +223,58 @@ export declare function chat(wa: WhatsApp): {
223
223
  */
224
224
  messages(offset?: number, limit?: number): Promise<Message[]>;
225
225
  /**
226
- * Activa o desactiva el indicador «escribiendo…».
227
- * Toggles the "typing…" indicator.
226
+ * Publica el indicador «escribiendo…».
227
+ * Publishes the "typing…" indicator.
228
228
  *
229
- * @param value - true activa, false vuelve a pausa / true enables, false returns to paused
230
- * @returns true si el socket estaba disponible / true when the socket was available
229
+ * @param value - true escribe, false vuelve a pausa / true types, false returns to paused
231
230
  */
232
231
  typing(value: boolean): Promise<boolean>;
233
232
  /**
234
- * Activa o desactiva el indicador «grabando audio…».
235
- * Toggles the "recording audio…" indicator.
233
+ * Publica el indicador «grabando audio…».
234
+ * Publishes the "recording audio…" indicator.
236
235
  *
237
- * @param value - true activa, false vuelve a pausa / true enables, false returns to paused
238
- * @returns true si el socket estaba disponible / true when the socket was available
236
+ * @param value - true graba, false vuelve a pausa / true records, false returns to paused
239
237
  */
240
238
  recording(value: boolean): Promise<boolean>;
241
239
  /**
242
- * Archiva o desarchiva el chat en la cuenta de WhatsApp.
243
- * Archives or unarchives the chat on the WhatsApp account.
240
+ * Archiva o desarchiva el chat en la cuenta.
241
+ * Archives or unarchives the chat on the account.
244
242
  *
245
243
  * @param value - true archiva, false desarchiva / true archives, false unarchives
246
- * @returns true si la acción se envió / true when the action was sent
247
244
  */
248
245
  archive(value: boolean): Promise<boolean>;
249
246
  /**
250
- * Fija o desfija el chat en la cuenta de WhatsApp. WhatsApp acepta hasta 3 chats
251
- * fijados y descarta el cuarto sin avisar, así que el límite se verifica antes.
252
- * Pins or unpins the chat on the WhatsApp account. WhatsApp accepts up to 3 pinned
253
- * chats and silently drops the fourth, so the limit is checked beforehand.
247
+ * Fija o desfija el chat. Al fijar comprueba el límite, porque WhatsApp descarta el
248
+ * cuarto chat fijado sin avisar.
249
+ * Pins or unpins the chat. When pinning it checks the limit, since WhatsApp silently
250
+ * drops the fourth pinned chat.
254
251
  *
255
252
  * @param value - true fija, false desfija / true pins, false unpins
256
- * @returns false si el socket está caído o ya hay 3 chats fijados / false when the socket is down or 3 chats are already pinned
253
+ * @returns false si ya hay 3 chats fijados / false when 3 chats are already pinned
257
254
  */
258
255
  pin(value: boolean): Promise<boolean>;
259
256
  /**
260
- * Silencia el chat hasta la fecha indicada. `false` o una fecha pasada lo des-silencian.
261
- * Mutes the chat until the given date. `false` or a past date unmutes it.
257
+ * Silencia el chat hasta la fecha indicada; `false` o una fecha pasada lo reactivan.
258
+ * Mutes the chat until the given date; `false` or a past date unmutes it.
262
259
  *
263
- * @param until - Fecha límite (ISO, epoch ms o Date) o false / Deadline (ISO, epoch ms or Date) or false
264
- * @returns true si la acción se envió / true when the action was sent
260
+ * @param until - Fecha límite (ISO, epoch ms o Date), o false / Deadline (ISO, epoch ms or Date), or false
265
261
  */
266
262
  mute(until: string | number | Date | false): Promise<boolean>;
267
263
  /**
268
- * Marca el chat completo como leído en la cuenta de WhatsApp.
269
- * Marks the whole chat as read on the WhatsApp account.
270
- *
271
- * @returns true si la acción se envió / true when the action was sent
264
+ * Marca el chat completo como leído en la cuenta.
265
+ * Marks the whole chat as read on the account.
272
266
  */
273
267
  seen(): Promise<boolean>;
274
268
  /**
275
- * Vacía los mensajes del chat en la cuenta de WhatsApp y en el engine, conservando el chat.
276
- * Clears the chat messages on the WhatsApp account and in the engine, keeping the chat.
277
- *
278
- * @returns true siempre; la limpieza local es idempotente / always true; local cleanup is idempotent
269
+ * Vacía los mensajes del chat en la cuenta y en el engine, conservando el chat.
270
+ * Clears the chat messages on the account and in the engine, keeping the chat.
279
271
  */
280
272
  clear(): Promise<boolean>;
281
273
  /**
282
- * Elimina el chat y sus mensajes en la cuenta de WhatsApp y en el engine; en grupos
283
- * abandona el grupo.
284
- * Deletes the chat and its messages on the WhatsApp account and in the engine; for
285
- * groups it leaves the group.
286
- *
287
- * @returns true siempre; la limpieza local es idempotente / always true; local cleanup is idempotent
274
+ * Elimina el chat y sus mensajes en la cuenta y en el engine; en grupos, además sale
275
+ * del grupo.
276
+ * Deletes the chat and its messages on the account and in the engine; for groups it
277
+ * also leaves the group.
288
278
  */
289
279
  delete(): Promise<boolean>;
290
280
  readonly _raw: {
@@ -313,8 +303,8 @@ export declare function chat(wa: WhatsApp): {
313
303
  get muted(): string | null;
314
304
  } | null>;
315
305
  /**
316
- * Pagina los chats persistidos, del más reciente al más antiguo.
317
- * Paginates persisted chats, from the most recent to the oldest.
306
+ * Pagina los chats persistidos, del más activo al más antiguo.
307
+ * Paginates persisted chats, from the most active to the oldest.
318
308
  *
319
309
  * @param offset - Desplazamiento / Offset
320
310
  * @param limit - Tamaño de página / Page size
@@ -322,26 +312,26 @@ export declare function chat(wa: WhatsApp): {
322
312
  */
323
313
  list(offset?: number, limit?: number): Promise<{
324
314
  /**
325
- * Participantes del chat: los integrantes en grupos, el contacto y yo en 1:1.
326
- * Chat participants: members for groups, the contact and myself for 1:1.
315
+ * Participantes: los integrantes en grupos, el contacto y yo en 1:1.
316
+ * Participants: members for groups, the contact and myself for 1:1.
327
317
  *
328
318
  * @param offset - Desplazamiento / Offset
329
319
  * @param limit - Tamaño de página / Page size
330
320
  * @returns Página de contactos / Contact page
331
321
  */
332
- members(offset?: number, limit?: number): Promise<InstanceType<typeof wa.Contact>[]>;
322
+ members(offset?: number, limit?: number): Promise<Contact[]>;
333
323
  /**
334
- * Descripción del chat: el asunto del grupo o, en un 1:1, la bio del contacto.
335
- * Es asíncrono porque ninguno de los dos vive en el documento del chat.
336
- * Chat description: the group's subject or, on a 1:1, the contact's bio. It is async
337
- * because neither of them lives in the chat document.
324
+ * Descripción: el asunto del grupo o, en un 1:1, la bio del contacto. Es asíncrono
325
+ * porque ninguna de las dos vive en el documento del chat.
326
+ * Description: the group's subject or, on a 1:1, the contact's bio. It is async because
327
+ * neither of them lives in the chat document.
338
328
  *
339
- * @returns Descripción, o cadena vacía si no hay / Description, or an empty string when absent
329
+ * @returns Descripción, o cadena vacía / Description, or an empty string
340
330
  */
341
331
  content(): Promise<string>;
342
332
  /**
343
- * Mensajes del chat paginados desde el más reciente.
344
- * Chat messages paginated from the most recent one.
333
+ * Mensajes del chat, del más reciente al más antiguo.
334
+ * Chat messages, from the most recent to the oldest.
345
335
  *
346
336
  * @param offset - Desplazamiento / Offset
347
337
  * @param limit - Tamaño de página / Page size
@@ -349,68 +339,58 @@ export declare function chat(wa: WhatsApp): {
349
339
  */
350
340
  messages(offset?: number, limit?: number): Promise<Message[]>;
351
341
  /**
352
- * Activa o desactiva el indicador «escribiendo…».
353
- * Toggles the "typing…" indicator.
342
+ * Publica el indicador «escribiendo…».
343
+ * Publishes the "typing…" indicator.
354
344
  *
355
- * @param value - true activa, false vuelve a pausa / true enables, false returns to paused
356
- * @returns true si el socket estaba disponible / true when the socket was available
345
+ * @param value - true escribe, false vuelve a pausa / true types, false returns to paused
357
346
  */
358
347
  typing(value: boolean): Promise<boolean>;
359
348
  /**
360
- * Activa o desactiva el indicador «grabando audio…».
361
- * Toggles the "recording audio…" indicator.
349
+ * Publica el indicador «grabando audio…».
350
+ * Publishes the "recording audio…" indicator.
362
351
  *
363
- * @param value - true activa, false vuelve a pausa / true enables, false returns to paused
364
- * @returns true si el socket estaba disponible / true when the socket was available
352
+ * @param value - true graba, false vuelve a pausa / true records, false returns to paused
365
353
  */
366
354
  recording(value: boolean): Promise<boolean>;
367
355
  /**
368
- * Archiva o desarchiva el chat en la cuenta de WhatsApp.
369
- * Archives or unarchives the chat on the WhatsApp account.
356
+ * Archiva o desarchiva el chat en la cuenta.
357
+ * Archives or unarchives the chat on the account.
370
358
  *
371
359
  * @param value - true archiva, false desarchiva / true archives, false unarchives
372
- * @returns true si la acción se envió / true when the action was sent
373
360
  */
374
361
  archive(value: boolean): Promise<boolean>;
375
362
  /**
376
- * Fija o desfija el chat en la cuenta de WhatsApp. WhatsApp acepta hasta 3 chats
377
- * fijados y descarta el cuarto sin avisar, así que el límite se verifica antes.
378
- * Pins or unpins the chat on the WhatsApp account. WhatsApp accepts up to 3 pinned
379
- * chats and silently drops the fourth, so the limit is checked beforehand.
363
+ * Fija o desfija el chat. Al fijar comprueba el límite, porque WhatsApp descarta el
364
+ * cuarto chat fijado sin avisar.
365
+ * Pins or unpins the chat. When pinning it checks the limit, since WhatsApp silently
366
+ * drops the fourth pinned chat.
380
367
  *
381
368
  * @param value - true fija, false desfija / true pins, false unpins
382
- * @returns false si el socket está caído o ya hay 3 chats fijados / false when the socket is down or 3 chats are already pinned
369
+ * @returns false si ya hay 3 chats fijados / false when 3 chats are already pinned
383
370
  */
384
371
  pin(value: boolean): Promise<boolean>;
385
372
  /**
386
- * Silencia el chat hasta la fecha indicada. `false` o una fecha pasada lo des-silencian.
387
- * Mutes the chat until the given date. `false` or a past date unmutes it.
373
+ * Silencia el chat hasta la fecha indicada; `false` o una fecha pasada lo reactivan.
374
+ * Mutes the chat until the given date; `false` or a past date unmutes it.
388
375
  *
389
- * @param until - Fecha límite (ISO, epoch ms o Date) o false / Deadline (ISO, epoch ms or Date) or false
390
- * @returns true si la acción se envió / true when the action was sent
376
+ * @param until - Fecha límite (ISO, epoch ms o Date), o false / Deadline (ISO, epoch ms or Date), or false
391
377
  */
392
378
  mute(until: string | number | Date | false): Promise<boolean>;
393
379
  /**
394
- * Marca el chat completo como leído en la cuenta de WhatsApp.
395
- * Marks the whole chat as read on the WhatsApp account.
396
- *
397
- * @returns true si la acción se envió / true when the action was sent
380
+ * Marca el chat completo como leído en la cuenta.
381
+ * Marks the whole chat as read on the account.
398
382
  */
399
383
  seen(): Promise<boolean>;
400
384
  /**
401
- * Vacía los mensajes del chat en la cuenta de WhatsApp y en el engine, conservando el chat.
402
- * Clears the chat messages on the WhatsApp account and in the engine, keeping the chat.
403
- *
404
- * @returns true siempre; la limpieza local es idempotente / always true; local cleanup is idempotent
385
+ * Vacía los mensajes del chat en la cuenta y en el engine, conservando el chat.
386
+ * Clears the chat messages on the account and in the engine, keeping the chat.
405
387
  */
406
388
  clear(): Promise<boolean>;
407
389
  /**
408
- * Elimina el chat y sus mensajes en la cuenta de WhatsApp y en el engine; en grupos
409
- * abandona el grupo.
410
- * Deletes the chat and its messages on the WhatsApp account and in the engine; for
411
- * groups it leaves the group.
412
- *
413
- * @returns true siempre; la limpieza local es idempotente / always true; local cleanup is idempotent
390
+ * Elimina el chat y sus mensajes en la cuenta y en el engine; en grupos, además sale
391
+ * del grupo.
392
+ * Deletes the chat and its messages on the account and in the engine; for groups it
393
+ * also leaves the group.
414
394
  */
415
395
  delete(): Promise<boolean>;
416
396
  readonly _raw: {