@jkt48connect-corp/baileys 7.2.7 → 7.2.8

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 (102) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +838 -94
  3. package/WAProto/WAProto.proto +969 -88
  4. package/WAProto/index.d.ts +13199 -1260
  5. package/WAProto/index.js +124901 -74525
  6. package/lib/Defaults/baileys-version.json +1 -1
  7. package/lib/Defaults/index.d.ts +7 -8
  8. package/lib/Defaults/index.js +5 -3
  9. package/lib/Defaults/phonenumber-mcc.json +221 -221
  10. package/lib/Signal/libsignal.js +18 -9
  11. package/lib/Socket/Client/abstract-socket-client.d.ts +0 -2
  12. package/lib/Socket/Client/mobile-socket-client.d.ts +0 -1
  13. package/lib/Socket/business.d.ts +40 -40
  14. package/lib/Socket/chats.d.ts +13 -14
  15. package/lib/Socket/groups.d.ts +20 -21
  16. package/lib/Socket/groups.js +1 -1
  17. package/lib/Socket/index.d.ts +49 -49
  18. package/lib/Socket/messages-recv.d.ts +39 -39
  19. package/lib/Socket/messages-recv.js +310 -151
  20. package/lib/Socket/messages-send.d.ts +33 -31
  21. package/lib/Socket/messages-send.js +269 -36
  22. package/lib/Socket/newsletter.d.ts +24 -25
  23. package/lib/Socket/newsletter.js +3 -3
  24. package/lib/Socket/registration.d.ts +49 -52
  25. package/lib/Socket/registration.js +7 -7
  26. package/lib/Socket/socket.d.ts +6 -7
  27. package/lib/Socket/socket.js +7 -3
  28. package/lib/Store/make-cache-manager-store.d.ts +1 -0
  29. package/lib/Store/make-in-memory-store.d.ts +3 -4
  30. package/lib/Store/make-in-memory-store.js +13 -11
  31. package/lib/Store/make-ordered-dictionary.d.ts +1 -1
  32. package/lib/Types/Auth.d.ts +0 -1
  33. package/lib/Types/Call.d.ts +1 -1
  34. package/lib/Types/Chat.d.ts +12 -7
  35. package/lib/Types/Events.d.ts +17 -2
  36. package/lib/Types/GroupMetadata.d.ts +3 -1
  37. package/lib/Types/Label.d.ts +11 -0
  38. package/lib/Types/Label.js +1 -1
  39. package/lib/Types/LabelAssociation.js +1 -1
  40. package/lib/Types/Message.d.ts +164 -13
  41. package/lib/Types/Newsletter.js +3 -3
  42. package/lib/Types/Socket.d.ts +7 -2
  43. package/lib/Types/index.d.ts +9 -0
  44. package/lib/Types/index.js +1 -1
  45. package/lib/Utils/auth-utils.js +3 -3
  46. package/lib/Utils/business.d.ts +1 -1
  47. package/lib/Utils/business.js +2 -2
  48. package/lib/Utils/chat-utils.d.ts +11 -12
  49. package/lib/Utils/chat-utils.js +41 -20
  50. package/lib/Utils/crypto.d.ts +15 -16
  51. package/lib/Utils/crypto.js +35 -23
  52. package/lib/Utils/decode-wa-message.d.ts +17 -0
  53. package/lib/Utils/decode-wa-message.js +43 -15
  54. package/lib/Utils/generics.d.ts +10 -19
  55. package/lib/Utils/generics.js +32 -16
  56. package/lib/Utils/history.d.ts +6 -2
  57. package/lib/Utils/history.js +3 -0
  58. package/lib/Utils/index.d.ts +0 -1
  59. package/lib/Utils/index.js +0 -1
  60. package/lib/Utils/logger.d.ts +1 -3
  61. package/lib/Utils/make-mutex.d.ts +2 -2
  62. package/lib/Utils/messages-media.d.ts +25 -28
  63. package/lib/Utils/messages-media.js +38 -47
  64. package/lib/Utils/messages.d.ts +5 -8
  65. package/lib/Utils/messages.js +430 -12
  66. package/lib/Utils/noise-handler.d.ts +4 -5
  67. package/lib/Utils/process-message.js +2 -2
  68. package/lib/Utils/use-multi-file-auth-state.js +17 -3
  69. package/lib/Utils/validate-connection.d.ts +2 -2
  70. package/lib/Utils/validate-connection.js +12 -23
  71. package/lib/WABinary/decode.d.ts +1 -2
  72. package/lib/WABinary/decode.js +17 -7
  73. package/lib/WABinary/encode.d.ts +1 -2
  74. package/lib/WABinary/encode.js +33 -17
  75. package/lib/WABinary/generic-utils.d.ts +2 -3
  76. package/lib/WABinary/generic-utils.js +2 -2
  77. package/lib/WABinary/jid-utils.d.ts +1 -1
  78. package/lib/WAM/BinaryInfo.d.ts +2 -11
  79. package/lib/WAM/encode.d.ts +1 -2
  80. package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +9 -0
  81. package/lib/WAUSync/Protocols/USyncContactProtocol.js +32 -0
  82. package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +22 -0
  83. package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +57 -0
  84. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +12 -0
  85. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +30 -0
  86. package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +12 -0
  87. package/lib/WAUSync/Protocols/USyncStatusProtocol.js +42 -0
  88. package/lib/WAUSync/Protocols/index.d.ts +4 -0
  89. package/lib/WAUSync/Protocols/index.js +20 -0
  90. package/lib/WAUSync/USyncQuery.d.ts +26 -0
  91. package/lib/WAUSync/USyncQuery.js +79 -0
  92. package/lib/WAUSync/USyncUser.d.ts +10 -0
  93. package/lib/WAUSync/USyncUser.js +22 -0
  94. package/lib/WAUSync/index.d.ts +3 -0
  95. package/lib/WAUSync/index.js +19 -0
  96. package/lib/index.js +4 -1
  97. package/package.json +15 -10
  98. package/lib/Socket/community.d.ts +0 -219
  99. package/lib/Socket/community.js +0 -354
  100. package/lib/Utils/use-single-file-auth-statev2.d.ts +0 -12
  101. package/lib/Utils/use-single-file-auth-statev2.js +0 -75
  102. package/lib/index.d.ts +0 -11
@@ -1,7 +1,7 @@
1
1
  export declare const makeMutex: () => {
2
- mutex<T>(code: () => T | Promise<T>): Promise<T>;
2
+ mutex<T>(code: () => Promise<T> | T): Promise<T>;
3
3
  };
4
4
  export type Mutex = ReturnType<typeof makeMutex>;
5
5
  export declare const makeKeyedMutex: () => {
6
- mutex<T>(key: string, task: () => T | Promise<T>): Promise<T>;
6
+ mutex<T>(key: string, task: () => Promise<T> | T): Promise<T>;
7
7
  };
@@ -1,10 +1,7 @@
1
- /// <reference types="node" />
2
- /// <reference types="node" />
3
- /// <reference types="node" />
4
1
  import { Boom } from '@hapi/boom';
5
2
  import { AxiosRequestConfig } from 'axios';
6
3
  import type { Logger } from 'pino';
7
- import { Readable, Transform } from 'stream';
4
+ import { Readable } from 'stream';
8
5
  import { URL } from 'url';
9
6
  import { proto } from '../../WAProto';
10
7
  import { DownloadableMessage, MediaConnInfo, MediaDecryptionKeyInfo, MediaType, SocketConfig, WAMediaUpload, WAMediaUploadFunction, WAMessageContent } from '../Types';
@@ -13,10 +10,10 @@ export declare const hkdfInfoKey: (type: MediaType) => string;
13
10
  /** generates all the keys required to encrypt/decrypt & sign a media message */
14
11
  export declare function getMediaKeys(buffer: Uint8Array | string | null | undefined, mediaType: MediaType): MediaDecryptionKeyInfo;
15
12
  export declare const extractImageThumb: (bufferOrFilePath: Readable | Buffer | string, width?: number) => Promise<{
16
- buffer: Buffer;
13
+ buffer: any;
17
14
  original: {
18
- width: number | undefined;
19
- height: number | undefined;
15
+ width: any;
16
+ height: any;
20
17
  };
21
18
  }>;
22
19
  export declare const encodeBase64EncodedStringForUpload: (b64: string) => string;
@@ -24,25 +21,25 @@ export declare const generateProfilePicture: (mediaUpload: WAMediaUpload) => Pro
24
21
  img: Buffer;
25
22
  }>;
26
23
  /** gets the SHA256 of the given media message */
27
- export declare const mediaMessageSHA256B64: (message: WAMessageContent) => string | null | undefined;
28
- export declare function getAudioDuration(buffer: Buffer | string | Readable): Promise<number | undefined>;
24
+ export declare const mediaMessageSHA256B64: (message: WAMessageContent) => any;
25
+ export declare function getAudioDuration(buffer: Buffer | string | Readable): Promise<any>;
29
26
  /**
30
27
  referenced from and modifying https://github.com/wppconnect-team/wa-js/blob/main/src/chat/functions/prepareAudioWaveform.ts
31
28
  */
32
- export declare function getAudioWaveform(buffer: Buffer | string | Readable, logger?: Logger): Promise<Uint8Array | undefined>;
33
- export declare const toReadable: (buffer: Buffer) => Readable;
34
- export declare const toBuffer: (stream: Readable) => Promise<Buffer>;
29
+ export declare function getAudioWaveform(buffer: Buffer | string | Readable, logger?: Logger): Promise<Uint8Array<ArrayBuffer> | undefined>;
30
+ export declare const toReadable: (buffer: Buffer) => any;
31
+ export declare const toBuffer: (stream: Readable) => Promise<any>;
35
32
  export declare const getStream: (item: WAMediaUpload, opts?: AxiosRequestConfig) => Promise<{
36
- readonly stream: Readable;
33
+ readonly stream: any;
37
34
  readonly type: "buffer";
38
35
  } | {
39
- readonly stream: Readable;
36
+ readonly stream: any;
40
37
  readonly type: "readable";
41
38
  } | {
42
39
  readonly stream: Readable;
43
40
  readonly type: "remote";
44
41
  } | {
45
- readonly stream: import("fs").ReadStream;
42
+ readonly stream: any;
46
43
  readonly type: "file";
47
44
  }>;
48
45
  /** generates a thumbnail for a given media, if required */
@@ -65,20 +62,20 @@ type EncryptedStreamOptions = {
65
62
  };
66
63
  export declare const prepareStream: (media: WAMediaUpload, mediaType: MediaType, { logger, saveOriginalFileIfRequired, opts }?: EncryptedStreamOptions) => Promise<{
67
64
  mediaKey: undefined;
68
- encWriteStream: Buffer;
69
- fileLength: number;
70
- fileSha256: Buffer;
65
+ encWriteStream: any;
66
+ fileLength: any;
67
+ fileSha256: any;
71
68
  fileEncSha256: undefined;
72
69
  bodyPath: string | undefined;
73
70
  didSaveToTmpPath: boolean;
74
71
  }>;
75
72
  export declare const encryptedStream: (media: WAMediaUpload, mediaType: MediaType, { logger, saveOriginalFileIfRequired, opts }?: EncryptedStreamOptions) => Promise<{
76
- mediaKey: Buffer;
77
- encWriteStream: Readable;
73
+ mediaKey: any;
74
+ encWriteStream: any;
78
75
  bodyPath: string | undefined;
79
- mac: Buffer;
80
- fileEncSha256: Buffer;
81
- fileSha256: Buffer;
76
+ mac: any;
77
+ fileEncSha256: any;
78
+ fileSha256: any;
82
79
  fileLength: number;
83
80
  didSaveToTmpPath: boolean;
84
81
  }>;
@@ -88,12 +85,12 @@ export type MediaDownloadOptions = {
88
85
  options?: AxiosRequestConfig<any>;
89
86
  };
90
87
  export declare const getUrlFromDirectPath: (directPath: string) => string;
91
- export declare const downloadContentFromMessage: ({ mediaKey, directPath, url }: DownloadableMessage, type: MediaType, opts?: MediaDownloadOptions) => Promise<Transform>;
88
+ export declare const downloadContentFromMessage: ({ mediaKey, directPath, url }: DownloadableMessage, type: MediaType, opts?: MediaDownloadOptions) => Promise<any>;
92
89
  /**
93
90
  * Decrypts and downloads an AES256-CBC encrypted file given the keys.
94
91
  * Assumes the SHA256 of the plaintext is appended to the end of the ciphertext
95
92
  * */
96
- export declare const downloadEncryptedContent: (downloadUrl: string, { cipherKey, iv }: MediaDecryptionKeyInfo, { startByte, endByte, options }?: MediaDownloadOptions) => Promise<Transform>;
93
+ export declare const downloadEncryptedContent: (downloadUrl: string, { cipherKey, iv }: MediaDecryptionKeyInfo, { startByte, endByte, options }?: MediaDownloadOptions) => Promise<any>;
97
94
  export declare function extensionForMediaMessage(message: WAMessageContent): string;
98
95
  export declare const getWAUploadToServer: ({ customUploadHosts, fetchAgent, logger, options }: SocketConfig, refreshMediaConn: (force: boolean) => Promise<MediaConnInfo>) => WAMediaUploadFunction;
99
96
  /**
@@ -101,12 +98,12 @@ export declare const getWAUploadToServer: ({ customUploadHosts, fetchAgent, logg
101
98
  */
102
99
  export declare const encryptMediaRetryRequest: (key: proto.IMessageKey, mediaKey: Buffer | Uint8Array, meId: string) => BinaryNode;
103
100
  export declare const decodeMediaRetryNode: (node: BinaryNode) => {
104
- key: proto.IMessageKey;
101
+ key: import("../Types").WAMessageKey;
105
102
  media?: {
106
103
  ciphertext: Uint8Array;
107
104
  iv: Uint8Array;
108
- } | undefined;
109
- error?: Boom<any> | undefined;
105
+ };
106
+ error?: Boom;
110
107
  };
111
108
  export declare const decryptMediaRetryData: ({ ciphertext, iv }: {
112
109
  ciphertext: Uint8Array;
@@ -15,15 +15,30 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.getStatusCodeForMediaRetry = exports.decryptMediaRetryData = exports.decodeMediaRetryNode = exports.encryptMediaRetryRequest = exports.getWAUploadToServer = exports.extensionForMediaMessage = exports.downloadEncryptedContent = exports.downloadContentFromMessage = exports.getUrlFromDirectPath = exports.encryptedStream = exports.prepareStream = exports.getHttpStream = exports.generateThumbnail = exports.getStream = exports.toBuffer = exports.toReadable = exports.getAudioWaveform = exports.getAudioDuration = exports.mediaMessageSHA256B64 = exports.generateProfilePicture = exports.encodeBase64EncodedStringForUpload = exports.extractImageThumb = exports.getMediaKeys = exports.hkdfInfoKey = void 0;
36
+ exports.getStatusCodeForMediaRetry = exports.decryptMediaRetryData = exports.decodeMediaRetryNode = exports.encryptMediaRetryRequest = exports.getWAUploadToServer = exports.downloadEncryptedContent = exports.downloadContentFromMessage = exports.getUrlFromDirectPath = exports.encryptedStream = exports.prepareStream = exports.getHttpStream = exports.getStream = exports.toBuffer = exports.toReadable = exports.mediaMessageSHA256B64 = exports.generateProfilePicture = exports.encodeBase64EncodedStringForUpload = exports.extractImageThumb = exports.hkdfInfoKey = void 0;
37
+ exports.getMediaKeys = getMediaKeys;
38
+ exports.getAudioDuration = getAudioDuration;
39
+ exports.getAudioWaveform = getAudioWaveform;
40
+ exports.generateThumbnail = generateThumbnail;
41
+ exports.extensionForMediaMessage = extensionForMediaMessage;
27
42
  const boom_1 = require("@hapi/boom");
28
43
  const child_process_1 = require("child_process");
29
44
  const Crypto = __importStar(require("crypto"));
@@ -81,7 +96,6 @@ function getMediaKeys(buffer, mediaType) {
81
96
  macKey: expandedMediaKey.slice(48, 80),
82
97
  };
83
98
  }
84
- exports.getMediaKeys = getMediaKeys;
85
99
  /** Extracts video thumb using FFMPEG */
86
100
  const extractVideoThumb = async (path, destPath, time, size) => new Promise((resolve, reject) => {
87
101
  const cmd = `ffmpeg -ss ${time} -i ${path} -y -vf scale=${size.width}:-1 -vframes 1 -f image2 ${destPath}`;
@@ -142,42 +156,23 @@ const encodeBase64EncodedStringForUpload = (b64) => (encodeURIComponent(b64
142
156
  .replace(/\=+$/, '')));
143
157
  exports.encodeBase64EncodedStringForUpload = encodeBase64EncodedStringForUpload;
144
158
  const generateProfilePicture = async (mediaUpload) => {
145
- var _a, _b;
146
- let bufferOrFilePath;
147
- if (Buffer.isBuffer(mediaUpload)) {
148
- bufferOrFilePath = mediaUpload;
149
- }
150
- else if ('url' in mediaUpload) {
151
- bufferOrFilePath = mediaUpload.url.toString();
152
- }
153
- else {
154
- bufferOrFilePath = await (0, exports.toBuffer)(mediaUpload.stream);
155
- }
156
- const lib = await getImageProcessingLibrary();
159
+ const bufferOrFilePath = Buffer.isBuffer(mediaUpload)
160
+ ? mediaUpload
161
+ : typeof mediaUpload === 'object' && 'url' in mediaUpload
162
+ ? mediaUpload.url.toString()
163
+ : await (0, exports.toBuffer)(mediaUpload.stream);
157
164
  let img;
158
- if ('sharp' in lib && typeof ((_a = lib.sharp) === null || _a === void 0 ? void 0 : _a.default) === 'function') {
159
- img = lib.sharp.default(bufferOrFilePath)
160
- .resize(640, 640)
161
- .jpeg({
162
- quality: 50,
163
- })
164
- .toBuffer();
165
- }
166
- else if ('jimp' in lib && typeof ((_b = lib.jimp) === null || _b === void 0 ? void 0 : _b.read) === 'function') {
167
- const { read, MIME_JPEG, RESIZE_BILINEAR } = lib.jimp;
168
- const jimp = await read(bufferOrFilePath);
169
- const min = Math.min(jimp.getWidth(), jimp.getHeight());
170
- const cropped = jimp.crop(0, 0, min, min);
171
- img = cropped
172
- .quality(50)
173
- .resize(640, 640, RESIZE_BILINEAR)
174
- .getBufferAsync(MIME_JPEG);
175
- }
176
- else {
177
- throw new boom_1.Boom('No image processing library available');
178
- }
165
+ const { read, MIME_JPEG, AUTO } = require('jimp');
166
+ const jimp = await read(bufferOrFilePath);
167
+ const min = jimp.getWidth();
168
+ const max = jimp.getHeight();
169
+ const cropped = jimp.crop(0, 0, min, max);
170
+ img = cropped
171
+ .quality(100)
172
+ .scaleToFit(720, 720, AUTO)
173
+ .getBufferAsync(MIME_JPEG);
179
174
  return {
180
- img: await img,
175
+ img: await img
181
176
  };
182
177
  };
183
178
  exports.generateProfilePicture = generateProfilePicture;
@@ -207,7 +202,6 @@ async function getAudioDuration(buffer) {
207
202
  }
208
203
  return metadata.format.duration;
209
204
  }
210
- exports.getAudioDuration = getAudioDuration;
211
205
  /**
212
206
  referenced from and modifying https://github.com/wppconnect-team/wa-js/blob/main/src/chat/functions/prepareAudioWaveform.ts
213
207
  */
@@ -249,7 +243,6 @@ async function getAudioWaveform(buffer, logger) {
249
243
  logger === null || logger === void 0 ? void 0 : logger.debug('Failed to generate waveform: ' + e);
250
244
  }
251
245
  }
252
- exports.getAudioWaveform = getAudioWaveform;
253
246
  const toReadable = (buffer) => {
254
247
  const readable = new stream_1.Readable({ read: () => { } });
255
248
  readable.push(buffer);
@@ -311,7 +304,6 @@ async function generateThumbnail(file, mediaType, options) {
311
304
  originalImageDimensions
312
305
  };
313
306
  }
314
- exports.generateThumbnail = generateThumbnail;
315
307
  const getHttpStream = async (url, options = {}) => {
316
308
  const { default: axios } = await import('axios');
317
309
  const fetched = await axios.get(url.toString(), { ...options, responseType: 'stream' });
@@ -565,7 +557,6 @@ function extensionForMediaMessage(message) {
565
557
  }
566
558
  return extension;
567
559
  }
568
- exports.extensionForMediaMessage = extensionForMediaMessage;
569
560
  const getWAUploadToServer = ({ customUploadHosts, fetchAgent, logger, options }, refreshMediaConn) => {
570
561
  return async (stream, { mediaType, fileEncSha256B64, newsletter, timeoutMs }) => {
571
562
  var _a, _b;
@@ -1,7 +1,4 @@
1
- /// <reference types="node" />
2
- /// <reference types="node" />
3
1
  import { Logger } from 'pino';
4
- import { type Transform } from 'stream';
5
2
  import { proto } from '../../WAProto';
6
3
  import { AnyMediaMessageContent, AnyMessageContent, MediaGenerationOptions, MessageContentGenerationOptions, MessageGenerationOptions, MessageGenerationOptionsFromContent, MessageUserReceipt, WAMessage, WAMessageContent, WAProto } from '../Types';
7
4
  import { MediaDownloadOptions } from './messages-media';
@@ -11,7 +8,7 @@ import { MediaDownloadOptions } from './messages-media';
11
8
  * @returns the URL, eg. https://google.com
12
9
  */
13
10
  export declare const extractUrlFromText: (text: string) => string | undefined;
14
- export declare const generateLinkPreviewIfRequired: (text: string, getUrlInfo: MessageGenerationOptions['getUrlInfo'], logger: MessageGenerationOptions['logger']) => Promise<import("../Types").WAUrlInfo | undefined>;
11
+ export declare const generateLinkPreviewIfRequired: (text: string, getUrlInfo: MessageGenerationOptions["getUrlInfo"], logger: MessageGenerationOptions["logger"]) => Promise<import("../Types").WAUrlInfo | undefined>;
15
12
  export declare const prepareWAMessageMedia: (message: AnyMediaMessageContent, options: MediaGenerationOptions) => Promise<proto.Message>;
16
13
  export declare const prepareDisappearingMessageSettingContent: (ephemeralExpiration?: number) => proto.Message;
17
14
  /**
@@ -42,11 +39,11 @@ export declare const extractMessageContent: (content: WAMessageContent | undefin
42
39
  */
43
40
  export declare const getDevice: (id: string) => "android" | "unknown" | "web" | "ios" | "desktop";
44
41
  /** Upserts a receipt in the message */
45
- export declare const updateMessageWithReceipt: (msg: Pick<WAMessage, 'userReceipt'>, receipt: MessageUserReceipt) => void;
42
+ export declare const updateMessageWithReceipt: (msg: Pick<WAMessage, "userReceipt">, receipt: MessageUserReceipt) => void;
46
43
  /** Update the message with a new reaction */
47
- export declare const updateMessageWithReaction: (msg: Pick<WAMessage, 'reactions'>, reaction: proto.IReaction) => void;
44
+ export declare const updateMessageWithReaction: (msg: Pick<WAMessage, "reactions">, reaction: proto.IReaction) => void;
48
45
  /** Update the message with a new poll update */
49
- export declare const updateMessageWithPollUpdate: (msg: Pick<WAMessage, 'pollUpdates'>, update: proto.IPollUpdate) => void;
46
+ export declare const updateMessageWithPollUpdate: (msg: Pick<WAMessage, "pollUpdates">, update: proto.IPollUpdate) => void;
50
47
  type VoteAggregation = {
51
48
  name: string;
52
49
  voters: string[];
@@ -71,7 +68,7 @@ type DownloadMediaMessageContext = {
71
68
  /**
72
69
  * Downloads the given message. Throws an error if it's not a media message
73
70
  */
74
- export declare const downloadMediaMessage: <Type extends "stream" | "buffer">(message: WAMessage, type: Type, options: MediaDownloadOptions, ctx?: DownloadMediaMessageContext) => Promise<Type extends "buffer" ? Buffer : Transform>;
71
+ export declare const downloadMediaMessage: <Type extends "buffer" | "stream">(message: WAMessage, type: Type, options: MediaDownloadOptions, ctx?: DownloadMediaMessageContext) => Promise<Type extends "buffer" ? Buffer : Transform>;
75
72
  /** Checks whether the given message is a media message; if it is returns the inner content */
76
73
  export declare const assertMediaContent: (content: proto.IMessage | null | undefined) => proto.Message.IVideoMessage | proto.Message.IImageMessage | proto.Message.IAudioMessage | proto.Message.IDocumentMessage | proto.Message.IStickerMessage;
77
74
  export {};