@awangxcode/qiro-baileys 7.0.0-rc25.6 → 7.0.0-rc26.3

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 (193) hide show
  1. package/LICENSE +15 -0
  2. package/README.md +1445 -1041
  3. package/WAProto/WAProto.proto +4 -0
  4. package/WAProto/index.d.ts +4067 -243
  5. package/WAProto/index.js +74957 -43330
  6. package/assets/branding/qiro-logo.svg +24 -0
  7. package/assets/branding/qiro-mark.png +0 -0
  8. package/assets/branding/qiro-mark.svg +34 -0
  9. package/assets/branding/qiro-social-preview.png +0 -0
  10. package/lib/Defaults/index.d.ts +15 -0
  11. package/lib/Defaults/index.d.ts.map +1 -1
  12. package/lib/Defaults/index.js +40 -7
  13. package/lib/Defaults/index.js.map +1 -1
  14. package/lib/Extensions/experimental.d.ts +0 -2
  15. package/lib/Extensions/experimental.d.ts.map +1 -1
  16. package/lib/Extensions/experimental.js +0 -2
  17. package/lib/Extensions/experimental.js.map +1 -1
  18. package/lib/MessageBuilder/index.d.ts.map +1 -1
  19. package/lib/MessageBuilder/index.js +10 -1
  20. package/lib/MessageBuilder/index.js.map +1 -1
  21. package/lib/Signal/lid-mapping.js +3 -3
  22. package/lib/Signal/lid-mapping.js.map +1 -1
  23. package/lib/Socket/business.d.ts +283 -1
  24. package/lib/Socket/business.d.ts.map +1 -1
  25. package/lib/Socket/chats.d.ts +114 -1
  26. package/lib/Socket/chats.d.ts.map +1 -1
  27. package/lib/Socket/chats.js +285 -10
  28. package/lib/Socket/chats.js.map +1 -1
  29. package/lib/Socket/communities.d.ts +283 -1
  30. package/lib/Socket/communities.d.ts.map +1 -1
  31. package/lib/Socket/groups.d.ts +106 -0
  32. package/lib/Socket/groups.d.ts.map +1 -1
  33. package/lib/Socket/index.d.ts +283 -1
  34. package/lib/Socket/index.d.ts.map +1 -1
  35. package/lib/Socket/index.js +4 -1
  36. package/lib/Socket/index.js.map +1 -1
  37. package/lib/Socket/messages-recv.d.ts +284 -1
  38. package/lib/Socket/messages-recv.d.ts.map +1 -1
  39. package/lib/Socket/messages-recv.js +73 -22
  40. package/lib/Socket/messages-recv.js.map +1 -1
  41. package/lib/Socket/messages-send.d.ts +297 -1
  42. package/lib/Socket/messages-send.d.ts.map +1 -1
  43. package/lib/Socket/messages-send.js +164 -28
  44. package/lib/Socket/messages-send.js.map +1 -1
  45. package/lib/Socket/newsletter.d.ts +322 -37
  46. package/lib/Socket/newsletter.d.ts.map +1 -1
  47. package/lib/Socket/newsletter.js +341 -1
  48. package/lib/Socket/newsletter.js.map +1 -1
  49. package/lib/Socket/socket.d.ts +13 -0
  50. package/lib/Socket/socket.d.ts.map +1 -1
  51. package/lib/Socket/socket.js +84 -31
  52. package/lib/Socket/socket.js.map +1 -1
  53. package/lib/Store/index.d.ts +4 -0
  54. package/lib/Store/index.js +4 -0
  55. package/lib/Store/make-in-memory-store.d.ts +63 -0
  56. package/lib/Store/make-in-memory-store.js +397 -0
  57. package/lib/Store/make-ordered-dictionary.d.ts +13 -0
  58. package/lib/Store/make-ordered-dictionary.js +79 -0
  59. package/lib/Store/object-repository.d.ts +11 -0
  60. package/lib/Store/object-repository.js +24 -0
  61. package/lib/Types/Chat.d.ts +13 -0
  62. package/lib/Types/Chat.d.ts.map +1 -1
  63. package/lib/Types/Chat.js +7 -0
  64. package/lib/Types/Chat.js.map +1 -1
  65. package/lib/Types/Message.d.ts +65 -1
  66. package/lib/Types/Message.d.ts.map +1 -1
  67. package/lib/Types/Message.js +11 -0
  68. package/lib/Types/Message.js.map +1 -1
  69. package/lib/Types/Mex.d.ts +68 -39
  70. package/lib/Types/Mex.d.ts.map +1 -1
  71. package/lib/Types/Mex.js +66 -0
  72. package/lib/Types/Mex.js.map +1 -1
  73. package/lib/Types/Socket.d.ts +45 -0
  74. package/lib/Types/Socket.d.ts.map +1 -1
  75. package/lib/Utils/audio-sticker.d.ts +14 -0
  76. package/lib/Utils/audio-sticker.js +172 -0
  77. package/lib/Utils/auth-store.d.ts +30 -0
  78. package/lib/Utils/auth-store.js +77 -0
  79. package/lib/Utils/chat-theme.d.ts +34 -0
  80. package/lib/Utils/chat-theme.js +336 -0
  81. package/lib/Utils/chat-utils.js +2 -2
  82. package/lib/Utils/chat-utils.js.map +1 -1
  83. package/lib/Utils/decode-wa-message.d.ts +14 -0
  84. package/lib/Utils/decode-wa-message.d.ts.map +1 -1
  85. package/lib/Utils/decode-wa-message.js +55 -0
  86. package/lib/Utils/decode-wa-message.js.map +1 -1
  87. package/lib/Utils/event-buffer.d.ts +2 -1
  88. package/lib/Utils/event-buffer.d.ts.map +1 -1
  89. package/lib/Utils/event-buffer.js +3 -4
  90. package/lib/Utils/event-buffer.js.map +1 -1
  91. package/lib/Utils/generics.d.ts +3 -2
  92. package/lib/Utils/generics.d.ts.map +1 -1
  93. package/lib/Utils/generics.js +10 -19
  94. package/lib/Utils/generics.js.map +1 -1
  95. package/lib/Utils/group-metadata-cache.d.ts +4 -0
  96. package/lib/Utils/group-metadata-cache.js +25 -0
  97. package/lib/Utils/history.js +1 -1
  98. package/lib/Utils/history.js.map +1 -1
  99. package/lib/Utils/html-app.d.ts +19 -0
  100. package/lib/Utils/html-app.js +96 -0
  101. package/lib/Utils/html-multiplayer.d.ts +10 -0
  102. package/lib/Utils/html-multiplayer.js +94 -0
  103. package/lib/Utils/index.d.ts +25 -0
  104. package/lib/Utils/index.d.ts.map +1 -1
  105. package/lib/Utils/index.js +27 -0
  106. package/lib/Utils/index.js.map +1 -1
  107. package/lib/Utils/link-preview-metadata.d.ts +47 -0
  108. package/lib/Utils/link-preview-metadata.js +88 -0
  109. package/lib/Utils/messages-media.d.ts +31 -2
  110. package/lib/Utils/messages-media.d.ts.map +1 -1
  111. package/lib/Utils/messages-media.js +66 -19
  112. package/lib/Utils/messages-media.js.map +1 -1
  113. package/lib/Utils/messages.d.ts +42 -2
  114. package/lib/Utils/messages.d.ts.map +1 -1
  115. package/lib/Utils/messages.js +117 -26
  116. package/lib/Utils/messages.js.map +1 -1
  117. package/lib/Utils/modern-messages.d.ts +150 -0
  118. package/lib/Utils/modern-messages.js +496 -0
  119. package/lib/Utils/native-flow.d.ts +11 -0
  120. package/lib/Utils/native-flow.js +116 -0
  121. package/lib/Utils/newsletter-status.d.ts +158 -0
  122. package/lib/Utils/newsletter-status.js +651 -0
  123. package/lib/Utils/optional-media.d.ts +3 -0
  124. package/lib/Utils/optional-media.js +46 -0
  125. package/lib/Utils/payment-messages.d.ts +38 -0
  126. package/lib/Utils/payment-messages.js +160 -0
  127. package/lib/Utils/process-message.d.ts +11 -0
  128. package/lib/Utils/process-message.d.ts.map +1 -1
  129. package/lib/Utils/process-message.js +80 -0
  130. package/lib/Utils/process-message.js.map +1 -1
  131. package/lib/Utils/scheduled-message.d.ts +51 -0
  132. package/lib/Utils/scheduled-message.js +113 -0
  133. package/lib/Utils/sender-key-memory.d.ts +19 -0
  134. package/lib/Utils/sender-key-memory.js +51 -0
  135. package/lib/Utils/status-stickers.d.ts +127 -0
  136. package/lib/Utils/status-stickers.js +261 -0
  137. package/lib/Utils/ttl-cache.d.ts +29 -0
  138. package/lib/Utils/ttl-cache.js +121 -0
  139. package/lib/Utils/use-mongo-auth-state.d.ts +22 -0
  140. package/lib/Utils/use-mongo-auth-state.js +68 -0
  141. package/lib/Utils/use-multi-file-auth-state.d.ts +1 -0
  142. package/lib/Utils/use-multi-file-auth-state.d.ts.map +1 -1
  143. package/lib/Utils/use-multi-file-auth-state.js +26 -13
  144. package/lib/Utils/use-multi-file-auth-state.js.map +1 -1
  145. package/lib/Utils/use-mysql-auth-state.d.ts +20 -0
  146. package/lib/Utils/use-mysql-auth-state.js +80 -0
  147. package/lib/Utils/use-nekodb-auth.d.ts +19 -0
  148. package/lib/Utils/use-nekodb-auth.js +111 -0
  149. package/lib/Utils/use-postgres-auth-state.d.ts +20 -0
  150. package/lib/Utils/use-postgres-auth-state.js +80 -0
  151. package/lib/Utils/use-redis-auth-state.d.ts +20 -0
  152. package/lib/Utils/use-redis-auth-state.js +90 -0
  153. package/lib/Utils/use-single-file-auth-state.d.ts +11 -0
  154. package/lib/Utils/use-single-file-auth-state.js +109 -0
  155. package/lib/Utils/use-sqlite-auth-state.d.ts +13 -0
  156. package/lib/Utils/use-sqlite-auth-state.js +121 -0
  157. package/lib/Utils/username.d.ts +12 -0
  158. package/lib/Utils/username.js +59 -0
  159. package/lib/Utils/voice-recognition.d.ts +53 -0
  160. package/lib/Utils/voice-recognition.js +219 -0
  161. package/lib/VoIP/audio-feeder.d.ts +24 -0
  162. package/lib/VoIP/audio-feeder.js +276 -0
  163. package/lib/VoIP/index.d.ts +93 -0
  164. package/lib/VoIP/index.js +998 -0
  165. package/lib/VoIP/relay-transport.d.ts +5 -0
  166. package/lib/VoIP/relay-transport.js +824 -0
  167. package/lib/VoIP/signaling.d.ts +11 -0
  168. package/lib/VoIP/signaling.js +1099 -0
  169. package/lib/VoIP/types.d.ts +2 -0
  170. package/lib/VoIP/types.js +12 -0
  171. package/lib/VoIP/video-feeder.d.ts +24 -0
  172. package/lib/VoIP/video-feeder.js +276 -0
  173. package/lib/VoIP/wasm-engine.d.ts +26 -0
  174. package/lib/VoIP/wasm-engine.js +1318 -0
  175. package/lib/VoIP/worker-bootstrap.js +1022 -0
  176. package/lib/WABinary/generic-utils.d.ts +2 -0
  177. package/lib/WABinary/generic-utils.d.ts.map +1 -1
  178. package/lib/WABinary/generic-utils.js +2 -0
  179. package/lib/WABinary/generic-utils.js.map +1 -1
  180. package/lib/WABinary/jid-utils.d.ts +2 -0
  181. package/lib/WABinary/jid-utils.d.ts.map +1 -1
  182. package/lib/WABinary/jid-utils.js +3 -1
  183. package/lib/WABinary/jid-utils.js.map +1 -1
  184. package/lib/extensions/awang-MessageBuilder.js +1 -1
  185. package/lib/index.d.ts +4 -0
  186. package/lib/index.d.ts.map +1 -1
  187. package/lib/index.js +4 -0
  188. package/lib/index.js.map +1 -1
  189. package/package.json +78 -31
  190. package/MIGRASI-QIRO-BAILEYS-RC25.md +0 -102
  191. package/QIRO-BAILEYS-RC25.md +0 -168
  192. package/THIRD_PARTY_NOTICES.md +0 -49
  193. /package/{engine-requirements.js → config/engine-requirements.js} +0 -0
@@ -0,0 +1,276 @@
1
+ import { spawn } from 'node:child_process';
2
+ const PREBUFFER_CHUNKS = 12;
3
+ const REBUFFER_CHUNKS = 6;
4
+ const MAX_QUEUED_CHUNKS = 1024;
5
+ const RESUME_QUEUE_CHUNKS = 256;
6
+ const RESYNC_AFTER_MS = 250;
7
+ export class AudioFeeder {
8
+ constructor(sampleRate, channels, framesPerChunk, onChunk, source = 'silence', hooks = {}) {
9
+ this.sampleRate = sampleRate;
10
+ this.channels = channels;
11
+ this.framesPerChunk = framesPerChunk;
12
+ this.onChunk = onChunk;
13
+ this.source = source;
14
+ this.onTrackStart = hooks.onTrackStart ?? (() => {});
15
+ this.onTrackEnd = hooks.onTrackEnd ?? (() => {});
16
+ this.onIdle = hooks.onIdle ?? (() => {});
17
+ this.ffmpegPath = hooks.ffmpegPath || process.env.FFMPEG_PATH || 'ffmpeg';
18
+ this.droppedChunks = 0;
19
+ this.underflowChunks = 0;
20
+ this.bytesProduced = 0;
21
+ this.chunksEmitted = 0;
22
+ this.rebuffers = 0;
23
+ this.tracksPlayed = 0;
24
+ this._proc = null;
25
+ this._playlist = [];
26
+ this._current = null;
27
+ this._sourceEnded = false;
28
+ this._idle = false;
29
+ this._pendingParts = [];
30
+ this._pendingBytes = 0;
31
+ this._queue = [];
32
+ this._emitTimer = null;
33
+ this._startedAtMs = 0;
34
+ this._emitIndex = 0;
35
+ this._buffering = true;
36
+ this._running = false;
37
+ this._chunkSamples = this.framesPerChunk * this.channels;
38
+ this._chunkBytes = this._chunkSamples * Float32Array.BYTES_PER_ELEMENT;
39
+ this._chunkIntervalMs = (this.framesPerChunk / this.sampleRate) * 1000;
40
+ }
41
+ get queuedChunks() {
42
+ return this._queue.length;
43
+ }
44
+ get playlistLength() {
45
+ return this._playlist.length;
46
+ }
47
+ get currentTrack() {
48
+ return this._current;
49
+ }
50
+ get idle() {
51
+ return this._idle;
52
+ }
53
+ enqueue(source) {
54
+ const tracks = Array.isArray(source) ? source : [source];
55
+ for (const track of tracks) {
56
+ if (track) {
57
+ this._playlist.push(track);
58
+ }
59
+ }
60
+ if (this._running && !this._proc) {
61
+ this._advance();
62
+ }
63
+ return this._playlist.length;
64
+ }
65
+ clearPlaylist() {
66
+ this._playlist = [];
67
+ }
68
+ skip() {
69
+ if (!this._proc) {
70
+ return false;
71
+ }
72
+ this._stopSource();
73
+ this._advance();
74
+ return true;
75
+ }
76
+ start(playlist) {
77
+ if (this._running) {
78
+ return;
79
+ }
80
+ this._running = true;
81
+ this._idle = false;
82
+ this._buffering = true;
83
+ this._emitIndex = 0;
84
+ this._startedAtMs = 0;
85
+ const initial = playlist ?? (this.source ? [this.source] : []);
86
+ this._playlist = Array.isArray(initial) ? [...initial] : [initial];
87
+ this._advance();
88
+ this._schedule();
89
+ }
90
+ stop() {
91
+ this._running = false;
92
+ if (this._emitTimer) {
93
+ clearTimeout(this._emitTimer);
94
+ this._emitTimer = null;
95
+ }
96
+ this._stopSource();
97
+ this._playlist = [];
98
+ this._current = null;
99
+ this._pendingParts = [];
100
+ this._pendingBytes = 0;
101
+ this._queue = [];
102
+ this._buffering = true;
103
+ }
104
+ _stopSource() {
105
+ const proc = this._proc;
106
+ this._proc = null;
107
+ if (proc) {
108
+ proc.stdout?.removeAllListeners('data');
109
+ proc.removeAllListeners('exit');
110
+ try {
111
+ proc.kill?.('SIGTERM');
112
+ }
113
+ catch {}
114
+ }
115
+ }
116
+ _advance() {
117
+ const next = this._playlist.shift();
118
+ if (!next) {
119
+ this._current = null;
120
+ if (!this._idle) {
121
+ this._idle = true;
122
+ this.onIdle();
123
+ }
124
+ return;
125
+ }
126
+ this._idle = false;
127
+ this._current = next;
128
+ this._sourceEnded = false;
129
+ this._buffering = true;
130
+ this._spawn(next);
131
+ this.tracksPlayed += 1;
132
+ this.onTrackStart(next);
133
+ }
134
+ _spawn(source) {
135
+ const proc = spawn(this.ffmpegPath, [
136
+ '-hide_banner',
137
+ '-loglevel', 'error',
138
+ '-thread_queue_size', '512',
139
+ ...this._resolveInputArgs(source),
140
+ '-f', 'f32le',
141
+ '-ac', String(this.channels),
142
+ '-ar', String(this.sampleRate),
143
+ 'pipe:1'
144
+ ]);
145
+ this._proc = proc;
146
+ proc.stdout.on('data', chunk => this._absorb(chunk));
147
+ proc.stderr.on('data', chunk => {
148
+ process.stderr.write(`[AudioFeeder] ${chunk.toString().trim()}\n`);
149
+ });
150
+ proc.on('error', err => {
151
+ if (this._proc !== proc) {
152
+ return;
153
+ }
154
+ process.stderr.write(`[AudioFeeder] ffmpeg error: ${err?.message || err}\n`);
155
+ this._proc = null;
156
+ this._sourceEnded = true;
157
+ });
158
+ proc.on('exit', code => {
159
+ if (this._proc !== proc) {
160
+ return;
161
+ }
162
+ if (code !== 0 && code !== null) {
163
+ process.stderr.write(`[AudioFeeder] ffmpeg exited with code=${code}\n`);
164
+ }
165
+ this._proc = null;
166
+ this._sourceEnded = true;
167
+ });
168
+ }
169
+ _resolveInputArgs(source = this.source) {
170
+ if (!source || source === 'silence') {
171
+ return ['-re', '-f', 'lavfi', '-i', `aevalsrc=0:d=3600:s=${this.sampleRate}`];
172
+ }
173
+ if (source.startsWith('lavfi:')) {
174
+ return ['-re', '-f', 'lavfi', '-i', source.slice('lavfi:'.length)];
175
+ }
176
+ return ['-re', '-i', source];
177
+ }
178
+ _absorb(chunk) {
179
+ this._pendingParts.push(chunk);
180
+ this._pendingBytes += chunk.length;
181
+ while (this._pendingBytes >= this._chunkBytes) {
182
+ if (this._queue.length >= MAX_QUEUED_CHUNKS) {
183
+ this._proc?.stdout.pause();
184
+ return;
185
+ }
186
+ this._queue.push(this._takeChunk());
187
+ }
188
+ }
189
+ _takeChunk() {
190
+ const frame = this._pendingParts.length === 1 && this._pendingParts[0].length === this._chunkBytes
191
+ ? this._pendingParts.shift()
192
+ : this._takeFromParts();
193
+ this._pendingBytes -= this._chunkBytes;
194
+ this.bytesProduced += this._chunkBytes;
195
+ const out = new Float32Array(this._chunkSamples);
196
+ out.set(new Float32Array(frame.buffer, frame.byteOffset, this._chunkSamples));
197
+ return out;
198
+ }
199
+ _takeFromParts() {
200
+ const frame = Buffer.allocUnsafe(this._chunkBytes);
201
+ let filled = 0;
202
+ while (filled < this._chunkBytes) {
203
+ const part = this._pendingParts[0];
204
+ const take = Math.min(part.length, this._chunkBytes - filled);
205
+ part.copy(frame, filled, 0, take);
206
+ filled += take;
207
+ if (take === part.length) {
208
+ this._pendingParts.shift();
209
+ }
210
+ else {
211
+ this._pendingParts[0] = part.subarray(take);
212
+ }
213
+ }
214
+ return frame;
215
+ }
216
+ _schedule() {
217
+ if (!this._running) {
218
+ return;
219
+ }
220
+ if (this._startedAtMs === 0) {
221
+ this._startedAtMs = Date.now();
222
+ }
223
+ const target = this._startedAtMs + this._emitIndex * this._chunkIntervalMs;
224
+ const now = Date.now();
225
+ if (now - target > RESYNC_AFTER_MS) {
226
+ this._startedAtMs = now - this._emitIndex * this._chunkIntervalMs;
227
+ }
228
+ this._emitTimer = setTimeout(() => {
229
+ this._emitTimer = null;
230
+ this._tick();
231
+ }, Math.max(0, target - now));
232
+ }
233
+ _tick() {
234
+ if (!this._running && !this._proc) {
235
+ return;
236
+ }
237
+ if (this._sourceEnded && !this._queue.length && !this._pendingBytes) {
238
+ this._sourceEnded = false;
239
+ const finished = this._current;
240
+ this._current = null;
241
+ this.onTrackEnd(finished);
242
+ this._advance();
243
+ }
244
+ if (this._buffering) {
245
+ if (this._queue.length < PREBUFFER_CHUNKS && this._proc) {
246
+ this._startedAtMs = 0;
247
+ this._emitIndex = 0;
248
+ this._schedule();
249
+ return;
250
+ }
251
+ this._buffering = false;
252
+ }
253
+ const chunk = this._queue.shift();
254
+ if (chunk) {
255
+ this.onChunk(chunk);
256
+ }
257
+ else {
258
+ this.underflowChunks += 1;
259
+ this.onChunk(new Float32Array(this._chunkSamples));
260
+ if (this._proc) {
261
+ this.rebuffers += 1;
262
+ this._buffering = true;
263
+ }
264
+ }
265
+ this.chunksEmitted += 1;
266
+ this._emitIndex += 1;
267
+ if (this._buffering && this._queue.length >= REBUFFER_CHUNKS) {
268
+ this._buffering = false;
269
+ }
270
+ if (this._proc?.stdout.isPaused() && this._queue.length <= RESUME_QUEUE_CHUNKS) {
271
+ this._proc.stdout.resume();
272
+ }
273
+ this._schedule();
274
+ }
275
+ }
276
+ export default AudioFeeder;
@@ -0,0 +1,93 @@
1
+ import { EventEmitter } from 'node:events';
2
+ export declare const CallState: Readonly<{
3
+ Idle: 0;
4
+ Calling: 1;
5
+ PreacceptReceived: 2;
6
+ ReceivedCall: 3;
7
+ AcceptSent: 4;
8
+ AcceptReceived: 5;
9
+ Active: 6;
10
+ ActiveElsewhere: 7;
11
+ Ending: 13;
12
+ }>;
13
+ export declare class ActiveCall extends EventEmitter {
14
+ readonly callId: string;
15
+ readonly state: number;
16
+ groupJid?: string;
17
+ end(): void;
18
+ mute(muted: boolean): void;
19
+ waitForEnd(): Promise<string>;
20
+ play(source: string): boolean;
21
+ playVideo(source: string): boolean;
22
+ enqueueVideo(source: string | string[]): number;
23
+ skipVideo(): boolean;
24
+ queuedVideo(): number;
25
+ nowPlayingVideo(): string | null;
26
+ isVideo(): boolean;
27
+ startScreenShare(): unknown;
28
+ stopScreenShare(): unknown;
29
+ isScreenShare(): boolean;
30
+ enqueue(source: string | string[]): number;
31
+ skip(): boolean;
32
+ queued(): number;
33
+ nowPlaying(): string | null;
34
+ }
35
+ export interface VoipClientOptions {
36
+ socket?: any;
37
+ sock?: any;
38
+ conn?: any;
39
+ logger?: (...args: any[]) => void;
40
+ debug?: boolean;
41
+ wasmPath?: string;
42
+ wasmBinary?: Uint8Array | Buffer;
43
+ resourcesPath?: string;
44
+ storageDir?: string;
45
+ ffmpegPath?: string;
46
+ loaderCode?: string;
47
+ workerModulesCode?: string;
48
+ loaderModuleName?: string;
49
+ enableLogs?: boolean;
50
+ options?: Record<string, unknown>;
51
+ }
52
+ export interface VoipCallOptions {
53
+ durationMs?: number;
54
+ audioSource?: string;
55
+ playlist?: string[];
56
+ endWhenQueueEmpty?: boolean;
57
+ idleGraceMs?: number;
58
+ audioStartDelayMs?: number;
59
+ video?: boolean;
60
+ isVideo?: boolean;
61
+ videoSource?: string;
62
+ videoPlaylist?: string[];
63
+ screenShare?: boolean;
64
+ }
65
+ export interface VoipGroupCallOptions extends VoipCallOptions {
66
+ participants?: string[];
67
+ metadata?: any;
68
+ }
69
+ export interface VoipCallInvite {
70
+ callId: string;
71
+ callCreatorJid: string;
72
+ groupJid?: string;
73
+ initialPeerJid?: string;
74
+ pnUserJids?: string[];
75
+ lidUserJids?: string[];
76
+ deviceJidsCsv?: string[];
77
+ chatName?: string;
78
+ }
79
+ export declare class VoipClient {
80
+ constructor(options?: VoipClientOptions);
81
+ connect(): Promise<void>;
82
+ attach(socket: any): Promise<void>;
83
+ call(phoneNumber: string, options?: VoipCallOptions): Promise<ActiveCall>;
84
+ callGroup(groupJid: string, options?: VoipGroupCallOptions): Promise<ActiveCall>;
85
+ joinGroupCall(invite: VoipCallInvite, options?: VoipCallOptions): Promise<ActiveCall>;
86
+ acceptCall(isMicEnabled?: boolean): void;
87
+ disconnect(): void;
88
+ resetCallState(): void;
89
+ }
90
+ export { VideoFeeder, VIDEO_FORMAT_I420 } from './video-feeder.js';
91
+ export { AudioFeeder } from './audio-feeder.js';
92
+ export declare function makeVoipClient(socket: any, options?: VoipClientOptions): Promise<VoipClient>;
93
+ export default VoipClient;