@4players/odin-common 3.2.0 → 4.0.1

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 (97) hide show
  1. package/README.md +11 -5
  2. package/mod.d.ts +26 -0
  3. package/mod.js +1182 -0
  4. package/mod.mjs +1065 -0
  5. package/package.json +6 -30
  6. package/{lib/plugin → plugin}/api.d.ts +7 -7
  7. package/{lib/rpc → rpc}/commands.d.ts +99 -99
  8. package/rpc/notifications.d.ts +1626 -0
  9. package/{lib/schema → schema}/channels.d.ts +1 -1
  10. package/schema/media.d.ts +122 -0
  11. package/schema/message.d.ts +12 -0
  12. package/schema/peer.d.ts +226 -0
  13. package/schema/room.d.ts +1673 -0
  14. package/{lib/schema → schema}/serialization.d.ts +2 -2
  15. package/{lib/schema → schema}/token.d.ts +31 -31
  16. package/{lib/schema → schema}/webrtc.d.ts +21 -21
  17. package/{lib/utility → utility}/base64.d.ts +1 -1
  18. package/utility/bytearray.d.ts +4 -0
  19. package/{lib/utility → utility}/codec.d.ts +1 -1
  20. package/utility/json.d.ts +2 -0
  21. package/{lib/utility → utility}/log.d.ts +3 -3
  22. package/{lib/utility → utility}/result.d.ts +2 -2
  23. package/{lib/utility → utility}/selector.d.ts +2 -2
  24. package/{lib/utility → utility}/sleep.d.ts +1 -1
  25. package/{lib/utility → utility}/url.d.ts +1 -1
  26. package/utility/validation.d.ts +10 -0
  27. package/eslint.config.mjs +0 -30
  28. package/lib/cjs/index.js +0 -44
  29. package/lib/cjs/plugin/api.js +0 -19
  30. package/lib/cjs/rpc/commands.js +0 -96
  31. package/lib/cjs/rpc/notifications.js +0 -39
  32. package/lib/cjs/schema/channels.js +0 -44
  33. package/lib/cjs/schema/media.js +0 -25
  34. package/lib/cjs/schema/message.js +0 -10
  35. package/lib/cjs/schema/peer.js +0 -34
  36. package/lib/cjs/schema/room.js +0 -136
  37. package/lib/cjs/schema/serialization.js +0 -15
  38. package/lib/cjs/schema/token.js +0 -33
  39. package/lib/cjs/schema/webrtc.js +0 -23
  40. package/lib/cjs/tsconfig.cjs.tsbuildinfo +0 -1
  41. package/lib/cjs/utility/base64.js +0 -29
  42. package/lib/cjs/utility/bytearray.js +0 -28
  43. package/lib/cjs/utility/codec.js +0 -89
  44. package/lib/cjs/utility/environment.js +0 -32
  45. package/lib/cjs/utility/iterable.js +0 -10
  46. package/lib/cjs/utility/json.js +0 -6
  47. package/lib/cjs/utility/log.js +0 -224
  48. package/lib/cjs/utility/msgpack.js +0 -11
  49. package/lib/cjs/utility/result.js +0 -31
  50. package/lib/cjs/utility/selector.js +0 -18
  51. package/lib/cjs/utility/sleep.js +0 -27
  52. package/lib/cjs/utility/strand.js +0 -38
  53. package/lib/cjs/utility/url.js +0 -27
  54. package/lib/cjs/utility/uuid.js +0 -11
  55. package/lib/cjs/utility/validation.js +0 -38
  56. package/lib/esm/index.js +0 -27
  57. package/lib/esm/plugin/api.js +0 -16
  58. package/lib/esm/rpc/commands.js +0 -93
  59. package/lib/esm/rpc/notifications.js +0 -36
  60. package/lib/esm/schema/channels.js +0 -40
  61. package/lib/esm/schema/media.js +0 -22
  62. package/lib/esm/schema/message.js +0 -7
  63. package/lib/esm/schema/peer.js +0 -31
  64. package/lib/esm/schema/room.js +0 -133
  65. package/lib/esm/schema/serialization.js +0 -12
  66. package/lib/esm/schema/token.js +0 -29
  67. package/lib/esm/schema/webrtc.js +0 -20
  68. package/lib/esm/tsconfig.esm.tsbuildinfo +0 -1
  69. package/lib/esm/utility/base64.js +0 -25
  70. package/lib/esm/utility/bytearray.js +0 -24
  71. package/lib/esm/utility/codec.js +0 -85
  72. package/lib/esm/utility/environment.js +0 -24
  73. package/lib/esm/utility/iterable.js +0 -7
  74. package/lib/esm/utility/json.js +0 -3
  75. package/lib/esm/utility/log.js +0 -210
  76. package/lib/esm/utility/msgpack.js +0 -7
  77. package/lib/esm/utility/result.js +0 -23
  78. package/lib/esm/utility/selector.js +0 -14
  79. package/lib/esm/utility/sleep.js +0 -22
  80. package/lib/esm/utility/strand.js +0 -34
  81. package/lib/esm/utility/url.js +0 -23
  82. package/lib/esm/utility/uuid.js +0 -7
  83. package/lib/esm/utility/validation.js +0 -27
  84. package/lib/index.d.ts +0 -27
  85. package/lib/rpc/notifications.d.ts +0 -1626
  86. package/lib/schema/media.d.ts +0 -122
  87. package/lib/schema/message.d.ts +0 -12
  88. package/lib/schema/peer.d.ts +0 -226
  89. package/lib/schema/room.d.ts +0 -1673
  90. package/lib/utility/bytearray.d.ts +0 -4
  91. package/lib/utility/json.d.ts +0 -4
  92. package/lib/utility/msgpack.d.ts +0 -2
  93. package/lib/utility/validation.d.ts +0 -10
  94. /package/{lib/utility → utility}/environment.d.ts +0 -0
  95. /package/{lib/utility → utility}/iterable.d.ts +0 -0
  96. /package/{lib/utility → utility}/strand.d.ts +0 -0
  97. /package/{lib/utility → utility}/uuid.d.ts +0 -0
@@ -0,0 +1,1673 @@
1
+ import * as z from "zod";
2
+ export declare namespace RoomV1 {
3
+ const RoomIdSchema: z.ZodString;
4
+ type RoomId = z.infer<typeof RoomIdSchema>;
5
+ const RoomSchema: z.ZodObject<{
6
+ id: z.ZodString;
7
+ customer: z.ZodString;
8
+ user_data: z.ZodType<Uint8Array<ArrayBufferLike>, z.ZodTypeDef, Uint8Array<ArrayBufferLike>>;
9
+ peers: z.ZodArray<z.ZodObject<{
10
+ id: z.ZodNumber;
11
+ user_id: z.ZodString;
12
+ user_data: z.ZodType<Uint8Array<ArrayBufferLike>, z.ZodTypeDef, Uint8Array<ArrayBufferLike>>;
13
+ medias: z.ZodArray<z.ZodObject<{
14
+ id: z.ZodNumber;
15
+ properties: z.ZodUnion<[z.ZodObject<{
16
+ kind: z.ZodOptional<z.ZodLiteral<"audio">>;
17
+ uid: z.ZodOptional<z.ZodString>;
18
+ customType: z.ZodOptional<z.ZodString>;
19
+ }, "strip", z.ZodTypeAny, {
20
+ uid?: string;
21
+ kind?: "audio";
22
+ customType?: string;
23
+ }, {
24
+ uid?: string;
25
+ kind?: "audio";
26
+ customType?: string;
27
+ }>, z.ZodObject<{
28
+ kind: z.ZodOptional<z.ZodLiteral<"video">>;
29
+ codec: z.ZodOptional<z.ZodString>;
30
+ uid: z.ZodOptional<z.ZodString>;
31
+ customType: z.ZodOptional<z.ZodString>;
32
+ }, "strip", z.ZodTypeAny, {
33
+ codec?: string;
34
+ uid?: string;
35
+ kind?: "video";
36
+ customType?: string;
37
+ }, {
38
+ codec?: string;
39
+ uid?: string;
40
+ kind?: "video";
41
+ customType?: string;
42
+ }>]>;
43
+ paused: z.ZodBoolean;
44
+ }, "strip", z.ZodTypeAny, {
45
+ id?: number;
46
+ paused?: boolean;
47
+ properties?: {
48
+ uid?: string;
49
+ kind?: "audio";
50
+ customType?: string;
51
+ } | {
52
+ codec?: string;
53
+ uid?: string;
54
+ kind?: "video";
55
+ customType?: string;
56
+ };
57
+ }, {
58
+ id?: number;
59
+ paused?: boolean;
60
+ properties?: {
61
+ uid?: string;
62
+ kind?: "audio";
63
+ customType?: string;
64
+ } | {
65
+ codec?: string;
66
+ uid?: string;
67
+ kind?: "video";
68
+ customType?: string;
69
+ };
70
+ }>, "many">;
71
+ }, "strip", z.ZodTypeAny, {
72
+ id?: number;
73
+ user_id?: string;
74
+ user_data?: Uint8Array<ArrayBufferLike>;
75
+ medias?: {
76
+ id?: number;
77
+ paused?: boolean;
78
+ properties?: {
79
+ uid?: string;
80
+ kind?: "audio";
81
+ customType?: string;
82
+ } | {
83
+ codec?: string;
84
+ uid?: string;
85
+ kind?: "video";
86
+ customType?: string;
87
+ };
88
+ }[];
89
+ }, {
90
+ id?: number;
91
+ user_id?: string;
92
+ user_data?: Uint8Array<ArrayBufferLike>;
93
+ medias?: {
94
+ id?: number;
95
+ paused?: boolean;
96
+ properties?: {
97
+ uid?: string;
98
+ kind?: "audio";
99
+ customType?: string;
100
+ } | {
101
+ codec?: string;
102
+ uid?: string;
103
+ kind?: "video";
104
+ customType?: string;
105
+ };
106
+ }[];
107
+ }>, "many">;
108
+ }, "strip", z.ZodTypeAny, {
109
+ id?: string;
110
+ user_data?: Uint8Array<ArrayBufferLike>;
111
+ customer?: string;
112
+ peers?: {
113
+ id?: number;
114
+ user_id?: string;
115
+ user_data?: Uint8Array<ArrayBufferLike>;
116
+ medias?: {
117
+ id?: number;
118
+ paused?: boolean;
119
+ properties?: {
120
+ uid?: string;
121
+ kind?: "audio";
122
+ customType?: string;
123
+ } | {
124
+ codec?: string;
125
+ uid?: string;
126
+ kind?: "video";
127
+ customType?: string;
128
+ };
129
+ }[];
130
+ }[];
131
+ }, {
132
+ id?: string;
133
+ user_data?: Uint8Array<ArrayBufferLike>;
134
+ customer?: string;
135
+ peers?: {
136
+ id?: number;
137
+ user_id?: string;
138
+ user_data?: Uint8Array<ArrayBufferLike>;
139
+ medias?: {
140
+ id?: number;
141
+ paused?: boolean;
142
+ properties?: {
143
+ uid?: string;
144
+ kind?: "audio";
145
+ customType?: string;
146
+ } | {
147
+ codec?: string;
148
+ uid?: string;
149
+ kind?: "video";
150
+ customType?: string;
151
+ };
152
+ }[];
153
+ }[];
154
+ }>;
155
+ type Room = z.infer<typeof RoomSchema>;
156
+ const RoomUpdateSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
157
+ kind: z.ZodLiteral<"Joined">;
158
+ room: z.ZodObject<{
159
+ id: z.ZodString;
160
+ customer: z.ZodString;
161
+ user_data: z.ZodType<Uint8Array<ArrayBufferLike>, z.ZodTypeDef, Uint8Array<ArrayBufferLike>>;
162
+ peers: z.ZodArray<z.ZodObject<{
163
+ id: z.ZodNumber;
164
+ user_id: z.ZodString;
165
+ user_data: z.ZodType<Uint8Array<ArrayBufferLike>, z.ZodTypeDef, Uint8Array<ArrayBufferLike>>;
166
+ medias: z.ZodArray<z.ZodObject<{
167
+ id: z.ZodNumber;
168
+ properties: z.ZodUnion<[z.ZodObject<{
169
+ kind: z.ZodOptional<z.ZodLiteral<"audio">>;
170
+ uid: z.ZodOptional<z.ZodString>;
171
+ customType: z.ZodOptional<z.ZodString>;
172
+ }, "strip", z.ZodTypeAny, {
173
+ uid?: string;
174
+ kind?: "audio";
175
+ customType?: string;
176
+ }, {
177
+ uid?: string;
178
+ kind?: "audio";
179
+ customType?: string;
180
+ }>, z.ZodObject<{
181
+ kind: z.ZodOptional<z.ZodLiteral<"video">>;
182
+ codec: z.ZodOptional<z.ZodString>;
183
+ uid: z.ZodOptional<z.ZodString>;
184
+ customType: z.ZodOptional<z.ZodString>;
185
+ }, "strip", z.ZodTypeAny, {
186
+ codec?: string;
187
+ uid?: string;
188
+ kind?: "video";
189
+ customType?: string;
190
+ }, {
191
+ codec?: string;
192
+ uid?: string;
193
+ kind?: "video";
194
+ customType?: string;
195
+ }>]>;
196
+ paused: z.ZodBoolean;
197
+ }, "strip", z.ZodTypeAny, {
198
+ id?: number;
199
+ paused?: boolean;
200
+ properties?: {
201
+ uid?: string;
202
+ kind?: "audio";
203
+ customType?: string;
204
+ } | {
205
+ codec?: string;
206
+ uid?: string;
207
+ kind?: "video";
208
+ customType?: string;
209
+ };
210
+ }, {
211
+ id?: number;
212
+ paused?: boolean;
213
+ properties?: {
214
+ uid?: string;
215
+ kind?: "audio";
216
+ customType?: string;
217
+ } | {
218
+ codec?: string;
219
+ uid?: string;
220
+ kind?: "video";
221
+ customType?: string;
222
+ };
223
+ }>, "many">;
224
+ }, "strip", z.ZodTypeAny, {
225
+ id?: number;
226
+ user_id?: string;
227
+ user_data?: Uint8Array<ArrayBufferLike>;
228
+ medias?: {
229
+ id?: number;
230
+ paused?: boolean;
231
+ properties?: {
232
+ uid?: string;
233
+ kind?: "audio";
234
+ customType?: string;
235
+ } | {
236
+ codec?: string;
237
+ uid?: string;
238
+ kind?: "video";
239
+ customType?: string;
240
+ };
241
+ }[];
242
+ }, {
243
+ id?: number;
244
+ user_id?: string;
245
+ user_data?: Uint8Array<ArrayBufferLike>;
246
+ medias?: {
247
+ id?: number;
248
+ paused?: boolean;
249
+ properties?: {
250
+ uid?: string;
251
+ kind?: "audio";
252
+ customType?: string;
253
+ } | {
254
+ codec?: string;
255
+ uid?: string;
256
+ kind?: "video";
257
+ customType?: string;
258
+ };
259
+ }[];
260
+ }>, "many">;
261
+ }, "strip", z.ZodTypeAny, {
262
+ id?: string;
263
+ user_data?: Uint8Array<ArrayBufferLike>;
264
+ customer?: string;
265
+ peers?: {
266
+ id?: number;
267
+ user_id?: string;
268
+ user_data?: Uint8Array<ArrayBufferLike>;
269
+ medias?: {
270
+ id?: number;
271
+ paused?: boolean;
272
+ properties?: {
273
+ uid?: string;
274
+ kind?: "audio";
275
+ customType?: string;
276
+ } | {
277
+ codec?: string;
278
+ uid?: string;
279
+ kind?: "video";
280
+ customType?: string;
281
+ };
282
+ }[];
283
+ }[];
284
+ }, {
285
+ id?: string;
286
+ user_data?: Uint8Array<ArrayBufferLike>;
287
+ customer?: string;
288
+ peers?: {
289
+ id?: number;
290
+ user_id?: string;
291
+ user_data?: Uint8Array<ArrayBufferLike>;
292
+ medias?: {
293
+ id?: number;
294
+ paused?: boolean;
295
+ properties?: {
296
+ uid?: string;
297
+ kind?: "audio";
298
+ customType?: string;
299
+ } | {
300
+ codec?: string;
301
+ uid?: string;
302
+ kind?: "video";
303
+ customType?: string;
304
+ };
305
+ }[];
306
+ }[];
307
+ }>;
308
+ media_ids: z.ZodArray<z.ZodNumber, "many">;
309
+ own_peer_id: z.ZodNumber;
310
+ }, "strip", z.ZodTypeAny, {
311
+ kind?: "Joined";
312
+ room?: {
313
+ id?: string;
314
+ user_data?: Uint8Array<ArrayBufferLike>;
315
+ customer?: string;
316
+ peers?: {
317
+ id?: number;
318
+ user_id?: string;
319
+ user_data?: Uint8Array<ArrayBufferLike>;
320
+ medias?: {
321
+ id?: number;
322
+ paused?: boolean;
323
+ properties?: {
324
+ uid?: string;
325
+ kind?: "audio";
326
+ customType?: string;
327
+ } | {
328
+ codec?: string;
329
+ uid?: string;
330
+ kind?: "video";
331
+ customType?: string;
332
+ };
333
+ }[];
334
+ }[];
335
+ };
336
+ media_ids?: number[];
337
+ own_peer_id?: number;
338
+ }, {
339
+ kind?: "Joined";
340
+ room?: {
341
+ id?: string;
342
+ user_data?: Uint8Array<ArrayBufferLike>;
343
+ customer?: string;
344
+ peers?: {
345
+ id?: number;
346
+ user_id?: string;
347
+ user_data?: Uint8Array<ArrayBufferLike>;
348
+ medias?: {
349
+ id?: number;
350
+ paused?: boolean;
351
+ properties?: {
352
+ uid?: string;
353
+ kind?: "audio";
354
+ customType?: string;
355
+ } | {
356
+ codec?: string;
357
+ uid?: string;
358
+ kind?: "video";
359
+ customType?: string;
360
+ };
361
+ }[];
362
+ }[];
363
+ };
364
+ media_ids?: number[];
365
+ own_peer_id?: number;
366
+ }>, z.ZodObject<{
367
+ kind: z.ZodLiteral<"Left">;
368
+ reason: z.ZodEnum<["RoomClosing", "ServerClosing", "PeerKicked"]>;
369
+ }, "strip", z.ZodTypeAny, {
370
+ reason?: "RoomClosing" | "ServerClosing" | "PeerKicked";
371
+ kind?: "Left";
372
+ }, {
373
+ reason?: "RoomClosing" | "ServerClosing" | "PeerKicked";
374
+ kind?: "Left";
375
+ }>, z.ZodObject<{
376
+ kind: z.ZodLiteral<"UserDataChanged">;
377
+ user_data: z.ZodOptional<z.ZodType<Uint8Array<ArrayBufferLike>, z.ZodTypeDef, Uint8Array<ArrayBufferLike>>>;
378
+ }, "strip", z.ZodTypeAny, {
379
+ kind?: "UserDataChanged";
380
+ user_data?: Uint8Array<ArrayBufferLike>;
381
+ }, {
382
+ kind?: "UserDataChanged";
383
+ user_data?: Uint8Array<ArrayBufferLike>;
384
+ }>, z.ZodObject<{
385
+ kind: z.ZodLiteral<"PeerJoined">;
386
+ peer: z.ZodObject<{
387
+ id: z.ZodNumber;
388
+ user_id: z.ZodString;
389
+ user_data: z.ZodType<Uint8Array<ArrayBufferLike>, z.ZodTypeDef, Uint8Array<ArrayBufferLike>>;
390
+ medias: z.ZodArray<z.ZodObject<{
391
+ id: z.ZodNumber;
392
+ properties: z.ZodUnion<[z.ZodObject<{
393
+ kind: z.ZodOptional<z.ZodLiteral<"audio">>;
394
+ uid: z.ZodOptional<z.ZodString>;
395
+ customType: z.ZodOptional<z.ZodString>;
396
+ }, "strip", z.ZodTypeAny, {
397
+ uid?: string;
398
+ kind?: "audio";
399
+ customType?: string;
400
+ }, {
401
+ uid?: string;
402
+ kind?: "audio";
403
+ customType?: string;
404
+ }>, z.ZodObject<{
405
+ kind: z.ZodOptional<z.ZodLiteral<"video">>;
406
+ codec: z.ZodOptional<z.ZodString>;
407
+ uid: z.ZodOptional<z.ZodString>;
408
+ customType: z.ZodOptional<z.ZodString>;
409
+ }, "strip", z.ZodTypeAny, {
410
+ codec?: string;
411
+ uid?: string;
412
+ kind?: "video";
413
+ customType?: string;
414
+ }, {
415
+ codec?: string;
416
+ uid?: string;
417
+ kind?: "video";
418
+ customType?: string;
419
+ }>]>;
420
+ paused: z.ZodBoolean;
421
+ }, "strip", z.ZodTypeAny, {
422
+ id?: number;
423
+ paused?: boolean;
424
+ properties?: {
425
+ uid?: string;
426
+ kind?: "audio";
427
+ customType?: string;
428
+ } | {
429
+ codec?: string;
430
+ uid?: string;
431
+ kind?: "video";
432
+ customType?: string;
433
+ };
434
+ }, {
435
+ id?: number;
436
+ paused?: boolean;
437
+ properties?: {
438
+ uid?: string;
439
+ kind?: "audio";
440
+ customType?: string;
441
+ } | {
442
+ codec?: string;
443
+ uid?: string;
444
+ kind?: "video";
445
+ customType?: string;
446
+ };
447
+ }>, "many">;
448
+ }, "strip", z.ZodTypeAny, {
449
+ id?: number;
450
+ user_id?: string;
451
+ user_data?: Uint8Array<ArrayBufferLike>;
452
+ medias?: {
453
+ id?: number;
454
+ paused?: boolean;
455
+ properties?: {
456
+ uid?: string;
457
+ kind?: "audio";
458
+ customType?: string;
459
+ } | {
460
+ codec?: string;
461
+ uid?: string;
462
+ kind?: "video";
463
+ customType?: string;
464
+ };
465
+ }[];
466
+ }, {
467
+ id?: number;
468
+ user_id?: string;
469
+ user_data?: Uint8Array<ArrayBufferLike>;
470
+ medias?: {
471
+ id?: number;
472
+ paused?: boolean;
473
+ properties?: {
474
+ uid?: string;
475
+ kind?: "audio";
476
+ customType?: string;
477
+ } | {
478
+ codec?: string;
479
+ uid?: string;
480
+ kind?: "video";
481
+ customType?: string;
482
+ };
483
+ }[];
484
+ }>;
485
+ }, "strip", z.ZodTypeAny, {
486
+ kind?: "PeerJoined";
487
+ peer?: {
488
+ id?: number;
489
+ user_id?: string;
490
+ user_data?: Uint8Array<ArrayBufferLike>;
491
+ medias?: {
492
+ id?: number;
493
+ paused?: boolean;
494
+ properties?: {
495
+ uid?: string;
496
+ kind?: "audio";
497
+ customType?: string;
498
+ } | {
499
+ codec?: string;
500
+ uid?: string;
501
+ kind?: "video";
502
+ customType?: string;
503
+ };
504
+ }[];
505
+ };
506
+ }, {
507
+ kind?: "PeerJoined";
508
+ peer?: {
509
+ id?: number;
510
+ user_id?: string;
511
+ user_data?: Uint8Array<ArrayBufferLike>;
512
+ medias?: {
513
+ id?: number;
514
+ paused?: boolean;
515
+ properties?: {
516
+ uid?: string;
517
+ kind?: "audio";
518
+ customType?: string;
519
+ } | {
520
+ codec?: string;
521
+ uid?: string;
522
+ kind?: "video";
523
+ customType?: string;
524
+ };
525
+ }[];
526
+ };
527
+ }>, z.ZodObject<{
528
+ kind: z.ZodLiteral<"PeerLeft">;
529
+ peer_id: z.ZodNumber;
530
+ }, "strip", z.ZodTypeAny, {
531
+ kind?: "PeerLeft";
532
+ peer_id?: number;
533
+ }, {
534
+ kind?: "PeerLeft";
535
+ peer_id?: number;
536
+ }>]>;
537
+ type RoomUpdate = z.infer<typeof RoomUpdateSchema>;
538
+ const RoomUpdatesSchema: z.ZodObject<{
539
+ updates: z.ZodArray<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
540
+ kind: z.ZodLiteral<"Joined">;
541
+ room: z.ZodObject<{
542
+ id: z.ZodString;
543
+ customer: z.ZodString;
544
+ user_data: z.ZodType<Uint8Array<ArrayBufferLike>, z.ZodTypeDef, Uint8Array<ArrayBufferLike>>;
545
+ peers: z.ZodArray<z.ZodObject<{
546
+ id: z.ZodNumber;
547
+ user_id: z.ZodString;
548
+ user_data: z.ZodType<Uint8Array<ArrayBufferLike>, z.ZodTypeDef, Uint8Array<ArrayBufferLike>>;
549
+ medias: z.ZodArray<z.ZodObject<{
550
+ id: z.ZodNumber;
551
+ properties: z.ZodUnion<[z.ZodObject<{
552
+ kind: z.ZodOptional<z.ZodLiteral<"audio">>;
553
+ uid: z.ZodOptional<z.ZodString>;
554
+ customType: z.ZodOptional<z.ZodString>;
555
+ }, "strip", z.ZodTypeAny, {
556
+ uid?: string;
557
+ kind?: "audio";
558
+ customType?: string;
559
+ }, {
560
+ uid?: string;
561
+ kind?: "audio";
562
+ customType?: string;
563
+ }>, z.ZodObject<{
564
+ kind: z.ZodOptional<z.ZodLiteral<"video">>;
565
+ codec: z.ZodOptional<z.ZodString>;
566
+ uid: z.ZodOptional<z.ZodString>;
567
+ customType: z.ZodOptional<z.ZodString>;
568
+ }, "strip", z.ZodTypeAny, {
569
+ codec?: string;
570
+ uid?: string;
571
+ kind?: "video";
572
+ customType?: string;
573
+ }, {
574
+ codec?: string;
575
+ uid?: string;
576
+ kind?: "video";
577
+ customType?: string;
578
+ }>]>;
579
+ paused: z.ZodBoolean;
580
+ }, "strip", z.ZodTypeAny, {
581
+ id?: number;
582
+ paused?: boolean;
583
+ properties?: {
584
+ uid?: string;
585
+ kind?: "audio";
586
+ customType?: string;
587
+ } | {
588
+ codec?: string;
589
+ uid?: string;
590
+ kind?: "video";
591
+ customType?: string;
592
+ };
593
+ }, {
594
+ id?: number;
595
+ paused?: boolean;
596
+ properties?: {
597
+ uid?: string;
598
+ kind?: "audio";
599
+ customType?: string;
600
+ } | {
601
+ codec?: string;
602
+ uid?: string;
603
+ kind?: "video";
604
+ customType?: string;
605
+ };
606
+ }>, "many">;
607
+ }, "strip", z.ZodTypeAny, {
608
+ id?: number;
609
+ user_id?: string;
610
+ user_data?: Uint8Array<ArrayBufferLike>;
611
+ medias?: {
612
+ id?: number;
613
+ paused?: boolean;
614
+ properties?: {
615
+ uid?: string;
616
+ kind?: "audio";
617
+ customType?: string;
618
+ } | {
619
+ codec?: string;
620
+ uid?: string;
621
+ kind?: "video";
622
+ customType?: string;
623
+ };
624
+ }[];
625
+ }, {
626
+ id?: number;
627
+ user_id?: string;
628
+ user_data?: Uint8Array<ArrayBufferLike>;
629
+ medias?: {
630
+ id?: number;
631
+ paused?: boolean;
632
+ properties?: {
633
+ uid?: string;
634
+ kind?: "audio";
635
+ customType?: string;
636
+ } | {
637
+ codec?: string;
638
+ uid?: string;
639
+ kind?: "video";
640
+ customType?: string;
641
+ };
642
+ }[];
643
+ }>, "many">;
644
+ }, "strip", z.ZodTypeAny, {
645
+ id?: string;
646
+ user_data?: Uint8Array<ArrayBufferLike>;
647
+ customer?: string;
648
+ peers?: {
649
+ id?: number;
650
+ user_id?: string;
651
+ user_data?: Uint8Array<ArrayBufferLike>;
652
+ medias?: {
653
+ id?: number;
654
+ paused?: boolean;
655
+ properties?: {
656
+ uid?: string;
657
+ kind?: "audio";
658
+ customType?: string;
659
+ } | {
660
+ codec?: string;
661
+ uid?: string;
662
+ kind?: "video";
663
+ customType?: string;
664
+ };
665
+ }[];
666
+ }[];
667
+ }, {
668
+ id?: string;
669
+ user_data?: Uint8Array<ArrayBufferLike>;
670
+ customer?: string;
671
+ peers?: {
672
+ id?: number;
673
+ user_id?: string;
674
+ user_data?: Uint8Array<ArrayBufferLike>;
675
+ medias?: {
676
+ id?: number;
677
+ paused?: boolean;
678
+ properties?: {
679
+ uid?: string;
680
+ kind?: "audio";
681
+ customType?: string;
682
+ } | {
683
+ codec?: string;
684
+ uid?: string;
685
+ kind?: "video";
686
+ customType?: string;
687
+ };
688
+ }[];
689
+ }[];
690
+ }>;
691
+ media_ids: z.ZodArray<z.ZodNumber, "many">;
692
+ own_peer_id: z.ZodNumber;
693
+ }, "strip", z.ZodTypeAny, {
694
+ kind?: "Joined";
695
+ room?: {
696
+ id?: string;
697
+ user_data?: Uint8Array<ArrayBufferLike>;
698
+ customer?: string;
699
+ peers?: {
700
+ id?: number;
701
+ user_id?: string;
702
+ user_data?: Uint8Array<ArrayBufferLike>;
703
+ medias?: {
704
+ id?: number;
705
+ paused?: boolean;
706
+ properties?: {
707
+ uid?: string;
708
+ kind?: "audio";
709
+ customType?: string;
710
+ } | {
711
+ codec?: string;
712
+ uid?: string;
713
+ kind?: "video";
714
+ customType?: string;
715
+ };
716
+ }[];
717
+ }[];
718
+ };
719
+ media_ids?: number[];
720
+ own_peer_id?: number;
721
+ }, {
722
+ kind?: "Joined";
723
+ room?: {
724
+ id?: string;
725
+ user_data?: Uint8Array<ArrayBufferLike>;
726
+ customer?: string;
727
+ peers?: {
728
+ id?: number;
729
+ user_id?: string;
730
+ user_data?: Uint8Array<ArrayBufferLike>;
731
+ medias?: {
732
+ id?: number;
733
+ paused?: boolean;
734
+ properties?: {
735
+ uid?: string;
736
+ kind?: "audio";
737
+ customType?: string;
738
+ } | {
739
+ codec?: string;
740
+ uid?: string;
741
+ kind?: "video";
742
+ customType?: string;
743
+ };
744
+ }[];
745
+ }[];
746
+ };
747
+ media_ids?: number[];
748
+ own_peer_id?: number;
749
+ }>, z.ZodObject<{
750
+ kind: z.ZodLiteral<"Left">;
751
+ reason: z.ZodEnum<["RoomClosing", "ServerClosing", "PeerKicked"]>;
752
+ }, "strip", z.ZodTypeAny, {
753
+ reason?: "RoomClosing" | "ServerClosing" | "PeerKicked";
754
+ kind?: "Left";
755
+ }, {
756
+ reason?: "RoomClosing" | "ServerClosing" | "PeerKicked";
757
+ kind?: "Left";
758
+ }>, z.ZodObject<{
759
+ kind: z.ZodLiteral<"UserDataChanged">;
760
+ user_data: z.ZodOptional<z.ZodType<Uint8Array<ArrayBufferLike>, z.ZodTypeDef, Uint8Array<ArrayBufferLike>>>;
761
+ }, "strip", z.ZodTypeAny, {
762
+ kind?: "UserDataChanged";
763
+ user_data?: Uint8Array<ArrayBufferLike>;
764
+ }, {
765
+ kind?: "UserDataChanged";
766
+ user_data?: Uint8Array<ArrayBufferLike>;
767
+ }>, z.ZodObject<{
768
+ kind: z.ZodLiteral<"PeerJoined">;
769
+ peer: z.ZodObject<{
770
+ id: z.ZodNumber;
771
+ user_id: z.ZodString;
772
+ user_data: z.ZodType<Uint8Array<ArrayBufferLike>, z.ZodTypeDef, Uint8Array<ArrayBufferLike>>;
773
+ medias: z.ZodArray<z.ZodObject<{
774
+ id: z.ZodNumber;
775
+ properties: z.ZodUnion<[z.ZodObject<{
776
+ kind: z.ZodOptional<z.ZodLiteral<"audio">>;
777
+ uid: z.ZodOptional<z.ZodString>;
778
+ customType: z.ZodOptional<z.ZodString>;
779
+ }, "strip", z.ZodTypeAny, {
780
+ uid?: string;
781
+ kind?: "audio";
782
+ customType?: string;
783
+ }, {
784
+ uid?: string;
785
+ kind?: "audio";
786
+ customType?: string;
787
+ }>, z.ZodObject<{
788
+ kind: z.ZodOptional<z.ZodLiteral<"video">>;
789
+ codec: z.ZodOptional<z.ZodString>;
790
+ uid: z.ZodOptional<z.ZodString>;
791
+ customType: z.ZodOptional<z.ZodString>;
792
+ }, "strip", z.ZodTypeAny, {
793
+ codec?: string;
794
+ uid?: string;
795
+ kind?: "video";
796
+ customType?: string;
797
+ }, {
798
+ codec?: string;
799
+ uid?: string;
800
+ kind?: "video";
801
+ customType?: string;
802
+ }>]>;
803
+ paused: z.ZodBoolean;
804
+ }, "strip", z.ZodTypeAny, {
805
+ id?: number;
806
+ paused?: boolean;
807
+ properties?: {
808
+ uid?: string;
809
+ kind?: "audio";
810
+ customType?: string;
811
+ } | {
812
+ codec?: string;
813
+ uid?: string;
814
+ kind?: "video";
815
+ customType?: string;
816
+ };
817
+ }, {
818
+ id?: number;
819
+ paused?: boolean;
820
+ properties?: {
821
+ uid?: string;
822
+ kind?: "audio";
823
+ customType?: string;
824
+ } | {
825
+ codec?: string;
826
+ uid?: string;
827
+ kind?: "video";
828
+ customType?: string;
829
+ };
830
+ }>, "many">;
831
+ }, "strip", z.ZodTypeAny, {
832
+ id?: number;
833
+ user_id?: string;
834
+ user_data?: Uint8Array<ArrayBufferLike>;
835
+ medias?: {
836
+ id?: number;
837
+ paused?: boolean;
838
+ properties?: {
839
+ uid?: string;
840
+ kind?: "audio";
841
+ customType?: string;
842
+ } | {
843
+ codec?: string;
844
+ uid?: string;
845
+ kind?: "video";
846
+ customType?: string;
847
+ };
848
+ }[];
849
+ }, {
850
+ id?: number;
851
+ user_id?: string;
852
+ user_data?: Uint8Array<ArrayBufferLike>;
853
+ medias?: {
854
+ id?: number;
855
+ paused?: boolean;
856
+ properties?: {
857
+ uid?: string;
858
+ kind?: "audio";
859
+ customType?: string;
860
+ } | {
861
+ codec?: string;
862
+ uid?: string;
863
+ kind?: "video";
864
+ customType?: string;
865
+ };
866
+ }[];
867
+ }>;
868
+ }, "strip", z.ZodTypeAny, {
869
+ kind?: "PeerJoined";
870
+ peer?: {
871
+ id?: number;
872
+ user_id?: string;
873
+ user_data?: Uint8Array<ArrayBufferLike>;
874
+ medias?: {
875
+ id?: number;
876
+ paused?: boolean;
877
+ properties?: {
878
+ uid?: string;
879
+ kind?: "audio";
880
+ customType?: string;
881
+ } | {
882
+ codec?: string;
883
+ uid?: string;
884
+ kind?: "video";
885
+ customType?: string;
886
+ };
887
+ }[];
888
+ };
889
+ }, {
890
+ kind?: "PeerJoined";
891
+ peer?: {
892
+ id?: number;
893
+ user_id?: string;
894
+ user_data?: Uint8Array<ArrayBufferLike>;
895
+ medias?: {
896
+ id?: number;
897
+ paused?: boolean;
898
+ properties?: {
899
+ uid?: string;
900
+ kind?: "audio";
901
+ customType?: string;
902
+ } | {
903
+ codec?: string;
904
+ uid?: string;
905
+ kind?: "video";
906
+ customType?: string;
907
+ };
908
+ }[];
909
+ };
910
+ }>, z.ZodObject<{
911
+ kind: z.ZodLiteral<"PeerLeft">;
912
+ peer_id: z.ZodNumber;
913
+ }, "strip", z.ZodTypeAny, {
914
+ kind?: "PeerLeft";
915
+ peer_id?: number;
916
+ }, {
917
+ kind?: "PeerLeft";
918
+ peer_id?: number;
919
+ }>]>, "many">;
920
+ }, "strip", z.ZodTypeAny, {
921
+ updates?: ({
922
+ kind?: "Joined";
923
+ room?: {
924
+ id?: string;
925
+ user_data?: Uint8Array<ArrayBufferLike>;
926
+ customer?: string;
927
+ peers?: {
928
+ id?: number;
929
+ user_id?: string;
930
+ user_data?: Uint8Array<ArrayBufferLike>;
931
+ medias?: {
932
+ id?: number;
933
+ paused?: boolean;
934
+ properties?: {
935
+ uid?: string;
936
+ kind?: "audio";
937
+ customType?: string;
938
+ } | {
939
+ codec?: string;
940
+ uid?: string;
941
+ kind?: "video";
942
+ customType?: string;
943
+ };
944
+ }[];
945
+ }[];
946
+ };
947
+ media_ids?: number[];
948
+ own_peer_id?: number;
949
+ } | {
950
+ reason?: "RoomClosing" | "ServerClosing" | "PeerKicked";
951
+ kind?: "Left";
952
+ } | {
953
+ kind?: "UserDataChanged";
954
+ user_data?: Uint8Array<ArrayBufferLike>;
955
+ } | {
956
+ kind?: "PeerJoined";
957
+ peer?: {
958
+ id?: number;
959
+ user_id?: string;
960
+ user_data?: Uint8Array<ArrayBufferLike>;
961
+ medias?: {
962
+ id?: number;
963
+ paused?: boolean;
964
+ properties?: {
965
+ uid?: string;
966
+ kind?: "audio";
967
+ customType?: string;
968
+ } | {
969
+ codec?: string;
970
+ uid?: string;
971
+ kind?: "video";
972
+ customType?: string;
973
+ };
974
+ }[];
975
+ };
976
+ } | {
977
+ kind?: "PeerLeft";
978
+ peer_id?: number;
979
+ })[];
980
+ }, {
981
+ updates?: ({
982
+ kind?: "Joined";
983
+ room?: {
984
+ id?: string;
985
+ user_data?: Uint8Array<ArrayBufferLike>;
986
+ customer?: string;
987
+ peers?: {
988
+ id?: number;
989
+ user_id?: string;
990
+ user_data?: Uint8Array<ArrayBufferLike>;
991
+ medias?: {
992
+ id?: number;
993
+ paused?: boolean;
994
+ properties?: {
995
+ uid?: string;
996
+ kind?: "audio";
997
+ customType?: string;
998
+ } | {
999
+ codec?: string;
1000
+ uid?: string;
1001
+ kind?: "video";
1002
+ customType?: string;
1003
+ };
1004
+ }[];
1005
+ }[];
1006
+ };
1007
+ media_ids?: number[];
1008
+ own_peer_id?: number;
1009
+ } | {
1010
+ reason?: "RoomClosing" | "ServerClosing" | "PeerKicked";
1011
+ kind?: "Left";
1012
+ } | {
1013
+ kind?: "UserDataChanged";
1014
+ user_data?: Uint8Array<ArrayBufferLike>;
1015
+ } | {
1016
+ kind?: "PeerJoined";
1017
+ peer?: {
1018
+ id?: number;
1019
+ user_id?: string;
1020
+ user_data?: Uint8Array<ArrayBufferLike>;
1021
+ medias?: {
1022
+ id?: number;
1023
+ paused?: boolean;
1024
+ properties?: {
1025
+ uid?: string;
1026
+ kind?: "audio";
1027
+ customType?: string;
1028
+ } | {
1029
+ codec?: string;
1030
+ uid?: string;
1031
+ kind?: "video";
1032
+ customType?: string;
1033
+ };
1034
+ }[];
1035
+ };
1036
+ } | {
1037
+ kind?: "PeerLeft";
1038
+ peer_id?: number;
1039
+ })[];
1040
+ }>;
1041
+ type RoomUpdates = z.infer<typeof RoomUpdatesSchema>;
1042
+ const RoomStatusSchema: z.ZodEnum<["Joining", "Joined", "Closed"]>;
1043
+ type RoomStatus = z.infer<typeof RoomStatusSchema>;
1044
+ const RoomStatusChangedSchema: z.ZodObject<{
1045
+ status: z.ZodEnum<["Joining", "Joined", "Closed"]>;
1046
+ message: z.ZodOptional<z.ZodString>;
1047
+ }, "strip", z.ZodTypeAny, {
1048
+ message?: string;
1049
+ status?: "Joined" | "Joining" | "Closed";
1050
+ }, {
1051
+ message?: string;
1052
+ status?: "Joined" | "Joining" | "Closed";
1053
+ }>;
1054
+ type RoomStatusChanged = z.infer<typeof RoomStatusChangedSchema>;
1055
+ }
1056
+ export declare namespace RoomV2 {
1057
+ const ParametersSchema: z.ZodRecord<z.ZodString, z.ZodType<import("./serialization.ts").Json, z.ZodTypeDef, import("./serialization.ts").Json>>;
1058
+ const PeerProperties: z.ZodObject<{
1059
+ user_data: z.ZodOptional<z.ZodType<Uint8Array<ArrayBufferLike>, z.ZodTypeDef, Uint8Array<ArrayBufferLike>>>;
1060
+ tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1061
+ audio_parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./serialization.ts").Json, z.ZodTypeDef, import("./serialization.ts").Json>>>;
1062
+ video_parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./serialization.ts").Json, z.ZodTypeDef, import("./serialization.ts").Json>>>;
1063
+ }, "strip", z.ZodTypeAny, {
1064
+ user_data?: Uint8Array<ArrayBufferLike>;
1065
+ tags?: string[];
1066
+ audio_parameters?: Record<string, import("./serialization.ts").Json>;
1067
+ video_parameters?: Record<string, import("./serialization.ts").Json>;
1068
+ }, {
1069
+ user_data?: Uint8Array<ArrayBufferLike>;
1070
+ tags?: string[];
1071
+ audio_parameters?: Record<string, import("./serialization.ts").Json>;
1072
+ video_parameters?: Record<string, import("./serialization.ts").Json>;
1073
+ }>;
1074
+ const PingSchema: z.ZodObject<{
1075
+ Ping: z.ZodObject<{
1076
+ id: z.ZodNumber;
1077
+ }, "strip", z.ZodTypeAny, {
1078
+ id?: number;
1079
+ }, {
1080
+ id?: number;
1081
+ }>;
1082
+ }, "strip", z.ZodTypeAny, {
1083
+ Ping?: {
1084
+ id?: number;
1085
+ };
1086
+ }, {
1087
+ Ping?: {
1088
+ id?: number;
1089
+ };
1090
+ }>;
1091
+ const ChangeSelfSchema: z.ZodObject<{
1092
+ ChangeSelf: z.ZodObject<Omit<{
1093
+ user_data: z.ZodOptional<z.ZodType<Uint8Array<ArrayBufferLike>, z.ZodTypeDef, Uint8Array<ArrayBufferLike>>>;
1094
+ tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1095
+ audio_parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./serialization.ts").Json, z.ZodTypeDef, import("./serialization.ts").Json>>>;
1096
+ video_parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./serialization.ts").Json, z.ZodTypeDef, import("./serialization.ts").Json>>>;
1097
+ }, "tags">, "strip", z.ZodTypeAny, {
1098
+ user_data?: Uint8Array<ArrayBufferLike>;
1099
+ audio_parameters?: Record<string, import("./serialization.ts").Json>;
1100
+ video_parameters?: Record<string, import("./serialization.ts").Json>;
1101
+ }, {
1102
+ user_data?: Uint8Array<ArrayBufferLike>;
1103
+ audio_parameters?: Record<string, import("./serialization.ts").Json>;
1104
+ video_parameters?: Record<string, import("./serialization.ts").Json>;
1105
+ }>;
1106
+ }, "strip", z.ZodTypeAny, {
1107
+ ChangeSelf?: {
1108
+ user_data?: Uint8Array<ArrayBufferLike>;
1109
+ audio_parameters?: Record<string, import("./serialization.ts").Json>;
1110
+ video_parameters?: Record<string, import("./serialization.ts").Json>;
1111
+ };
1112
+ }, {
1113
+ ChangeSelf?: {
1114
+ user_data?: Uint8Array<ArrayBufferLike>;
1115
+ audio_parameters?: Record<string, import("./serialization.ts").Json>;
1116
+ video_parameters?: Record<string, import("./serialization.ts").Json>;
1117
+ };
1118
+ }>;
1119
+ const SetAudioMaskSchema: z.ZodObject<{
1120
+ SetAudioMask: z.ZodObject<{
1121
+ peer_id: z.ZodNumber;
1122
+ mask: z.ZodEffects<z.ZodBigInt, import("./channels.ts").ChannelSet, bigint>;
1123
+ }, "strip", z.ZodTypeAny, {
1124
+ mask?: import("./channels.ts").ChannelSet;
1125
+ peer_id?: number;
1126
+ }, {
1127
+ mask?: bigint;
1128
+ peer_id?: number;
1129
+ }>;
1130
+ }, "strip", z.ZodTypeAny, {
1131
+ SetAudioMask?: {
1132
+ mask?: import("./channels.ts").ChannelSet;
1133
+ peer_id?: number;
1134
+ };
1135
+ }, {
1136
+ SetAudioMask?: {
1137
+ mask?: bigint;
1138
+ peer_id?: number;
1139
+ };
1140
+ }>;
1141
+ const SendMessageSchema: z.ZodObject<{
1142
+ SendMessage: z.ZodObject<{
1143
+ peer_ids: z.ZodDefault<z.ZodArray<z.ZodNumber, "many">>;
1144
+ message: z.ZodType<Uint8Array<ArrayBufferLike>, z.ZodTypeDef, Uint8Array<ArrayBufferLike>>;
1145
+ }, "strip", z.ZodTypeAny, {
1146
+ message?: Uint8Array<ArrayBufferLike>;
1147
+ peer_ids?: number[];
1148
+ }, {
1149
+ message?: Uint8Array<ArrayBufferLike>;
1150
+ peer_ids?: number[];
1151
+ }>;
1152
+ }, "strip", z.ZodTypeAny, {
1153
+ SendMessage?: {
1154
+ message?: Uint8Array<ArrayBufferLike>;
1155
+ peer_ids?: number[];
1156
+ };
1157
+ }, {
1158
+ SendMessage?: {
1159
+ message?: Uint8Array<ArrayBufferLike>;
1160
+ peer_ids?: number[];
1161
+ };
1162
+ }>;
1163
+ const CallSchema: z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
1164
+ Ping: z.ZodObject<{
1165
+ id: z.ZodNumber;
1166
+ }, "strip", z.ZodTypeAny, {
1167
+ id?: number;
1168
+ }, {
1169
+ id?: number;
1170
+ }>;
1171
+ }, "strip", z.ZodTypeAny, {
1172
+ Ping?: {
1173
+ id?: number;
1174
+ };
1175
+ }, {
1176
+ Ping?: {
1177
+ id?: number;
1178
+ };
1179
+ }>, z.ZodObject<{
1180
+ ChangeSelf: z.ZodObject<Omit<{
1181
+ user_data: z.ZodOptional<z.ZodType<Uint8Array<ArrayBufferLike>, z.ZodTypeDef, Uint8Array<ArrayBufferLike>>>;
1182
+ tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1183
+ audio_parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./serialization.ts").Json, z.ZodTypeDef, import("./serialization.ts").Json>>>;
1184
+ video_parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./serialization.ts").Json, z.ZodTypeDef, import("./serialization.ts").Json>>>;
1185
+ }, "tags">, "strip", z.ZodTypeAny, {
1186
+ user_data?: Uint8Array<ArrayBufferLike>;
1187
+ audio_parameters?: Record<string, import("./serialization.ts").Json>;
1188
+ video_parameters?: Record<string, import("./serialization.ts").Json>;
1189
+ }, {
1190
+ user_data?: Uint8Array<ArrayBufferLike>;
1191
+ audio_parameters?: Record<string, import("./serialization.ts").Json>;
1192
+ video_parameters?: Record<string, import("./serialization.ts").Json>;
1193
+ }>;
1194
+ }, "strip", z.ZodTypeAny, {
1195
+ ChangeSelf?: {
1196
+ user_data?: Uint8Array<ArrayBufferLike>;
1197
+ audio_parameters?: Record<string, import("./serialization.ts").Json>;
1198
+ video_parameters?: Record<string, import("./serialization.ts").Json>;
1199
+ };
1200
+ }, {
1201
+ ChangeSelf?: {
1202
+ user_data?: Uint8Array<ArrayBufferLike>;
1203
+ audio_parameters?: Record<string, import("./serialization.ts").Json>;
1204
+ video_parameters?: Record<string, import("./serialization.ts").Json>;
1205
+ };
1206
+ }>]>, z.ZodObject<{
1207
+ SetAudioMask: z.ZodObject<{
1208
+ peer_id: z.ZodNumber;
1209
+ mask: z.ZodEffects<z.ZodBigInt, import("./channels.ts").ChannelSet, bigint>;
1210
+ }, "strip", z.ZodTypeAny, {
1211
+ mask?: import("./channels.ts").ChannelSet;
1212
+ peer_id?: number;
1213
+ }, {
1214
+ mask?: bigint;
1215
+ peer_id?: number;
1216
+ }>;
1217
+ }, "strip", z.ZodTypeAny, {
1218
+ SetAudioMask?: {
1219
+ mask?: import("./channels.ts").ChannelSet;
1220
+ peer_id?: number;
1221
+ };
1222
+ }, {
1223
+ SetAudioMask?: {
1224
+ mask?: bigint;
1225
+ peer_id?: number;
1226
+ };
1227
+ }>]>, z.ZodObject<{
1228
+ SendMessage: z.ZodObject<{
1229
+ peer_ids: z.ZodDefault<z.ZodArray<z.ZodNumber, "many">>;
1230
+ message: z.ZodType<Uint8Array<ArrayBufferLike>, z.ZodTypeDef, Uint8Array<ArrayBufferLike>>;
1231
+ }, "strip", z.ZodTypeAny, {
1232
+ message?: Uint8Array<ArrayBufferLike>;
1233
+ peer_ids?: number[];
1234
+ }, {
1235
+ message?: Uint8Array<ArrayBufferLike>;
1236
+ peer_ids?: number[];
1237
+ }>;
1238
+ }, "strip", z.ZodTypeAny, {
1239
+ SendMessage?: {
1240
+ message?: Uint8Array<ArrayBufferLike>;
1241
+ peer_ids?: number[];
1242
+ };
1243
+ }, {
1244
+ SendMessage?: {
1245
+ message?: Uint8Array<ArrayBufferLike>;
1246
+ peer_ids?: number[];
1247
+ };
1248
+ }>]>;
1249
+ type Call = z.infer<typeof CallSchema>;
1250
+ const PongSchema: z.ZodObject<{
1251
+ Pong: z.ZodObject<{
1252
+ id: z.ZodNumber;
1253
+ }, "strip", z.ZodTypeAny, {
1254
+ id?: number;
1255
+ }, {
1256
+ id?: number;
1257
+ }>;
1258
+ }, "strip", z.ZodTypeAny, {
1259
+ Pong?: {
1260
+ id?: number;
1261
+ };
1262
+ }, {
1263
+ Pong?: {
1264
+ id?: number;
1265
+ };
1266
+ }>;
1267
+ const JoinedSchema: z.ZodObject<{
1268
+ Joined: z.ZodObject<{
1269
+ own_peer_id: z.ZodNumber;
1270
+ room_id: z.ZodString;
1271
+ customer: z.ZodString;
1272
+ }, "strip", z.ZodTypeAny, {
1273
+ customer?: string;
1274
+ own_peer_id?: number;
1275
+ room_id?: string;
1276
+ }, {
1277
+ customer?: string;
1278
+ own_peer_id?: number;
1279
+ room_id?: string;
1280
+ }>;
1281
+ }, "strip", z.ZodTypeAny, {
1282
+ Joined?: {
1283
+ customer?: string;
1284
+ own_peer_id?: number;
1285
+ room_id?: string;
1286
+ };
1287
+ }, {
1288
+ Joined?: {
1289
+ customer?: string;
1290
+ own_peer_id?: number;
1291
+ room_id?: string;
1292
+ };
1293
+ }>;
1294
+ const LeftSchema: z.ZodObject<{
1295
+ Left: z.ZodObject<{
1296
+ reason: z.ZodEnum<["room_closing", "server_closing", "peer_kicked"]>;
1297
+ }, "strip", z.ZodTypeAny, {
1298
+ reason?: "room_closing" | "server_closing" | "peer_kicked";
1299
+ }, {
1300
+ reason?: "room_closing" | "server_closing" | "peer_kicked";
1301
+ }>;
1302
+ }, "strip", z.ZodTypeAny, {
1303
+ Left?: {
1304
+ reason?: "room_closing" | "server_closing" | "peer_kicked";
1305
+ };
1306
+ }, {
1307
+ Left?: {
1308
+ reason?: "room_closing" | "server_closing" | "peer_kicked";
1309
+ };
1310
+ }>;
1311
+ const PeerJoinedSchema: z.ZodObject<{
1312
+ PeerJoined: z.ZodObject<{
1313
+ user_data: z.ZodOptional<z.ZodType<Uint8Array<ArrayBufferLike>, z.ZodTypeDef, Uint8Array<ArrayBufferLike>>>;
1314
+ tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1315
+ audio_parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./serialization.ts").Json, z.ZodTypeDef, import("./serialization.ts").Json>>>;
1316
+ video_parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./serialization.ts").Json, z.ZodTypeDef, import("./serialization.ts").Json>>>;
1317
+ } & {
1318
+ peer_id: z.ZodNumber;
1319
+ user_id: z.ZodString;
1320
+ }, "strip", z.ZodTypeAny, {
1321
+ user_id?: string;
1322
+ user_data?: Uint8Array<ArrayBufferLike>;
1323
+ peer_id?: number;
1324
+ tags?: string[];
1325
+ audio_parameters?: Record<string, import("./serialization.ts").Json>;
1326
+ video_parameters?: Record<string, import("./serialization.ts").Json>;
1327
+ }, {
1328
+ user_id?: string;
1329
+ user_data?: Uint8Array<ArrayBufferLike>;
1330
+ peer_id?: number;
1331
+ tags?: string[];
1332
+ audio_parameters?: Record<string, import("./serialization.ts").Json>;
1333
+ video_parameters?: Record<string, import("./serialization.ts").Json>;
1334
+ }>;
1335
+ }, "strip", z.ZodTypeAny, {
1336
+ PeerJoined?: {
1337
+ user_id?: string;
1338
+ user_data?: Uint8Array<ArrayBufferLike>;
1339
+ peer_id?: number;
1340
+ tags?: string[];
1341
+ audio_parameters?: Record<string, import("./serialization.ts").Json>;
1342
+ video_parameters?: Record<string, import("./serialization.ts").Json>;
1343
+ };
1344
+ }, {
1345
+ PeerJoined?: {
1346
+ user_id?: string;
1347
+ user_data?: Uint8Array<ArrayBufferLike>;
1348
+ peer_id?: number;
1349
+ tags?: string[];
1350
+ audio_parameters?: Record<string, import("./serialization.ts").Json>;
1351
+ video_parameters?: Record<string, import("./serialization.ts").Json>;
1352
+ };
1353
+ }>;
1354
+ const PeerLeftSchema: z.ZodObject<{
1355
+ PeerLeft: z.ZodObject<{
1356
+ peer_id: z.ZodNumber;
1357
+ }, "strip", z.ZodTypeAny, {
1358
+ peer_id?: number;
1359
+ }, {
1360
+ peer_id?: number;
1361
+ }>;
1362
+ }, "strip", z.ZodTypeAny, {
1363
+ PeerLeft?: {
1364
+ peer_id?: number;
1365
+ };
1366
+ }, {
1367
+ PeerLeft?: {
1368
+ peer_id?: number;
1369
+ };
1370
+ }>;
1371
+ const PeerChangedSchema: z.ZodObject<{
1372
+ PeerChanged: z.ZodObject<{
1373
+ user_data: z.ZodOptional<z.ZodType<Uint8Array<ArrayBufferLike>, z.ZodTypeDef, Uint8Array<ArrayBufferLike>>>;
1374
+ tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1375
+ audio_parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./serialization.ts").Json, z.ZodTypeDef, import("./serialization.ts").Json>>>;
1376
+ video_parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./serialization.ts").Json, z.ZodTypeDef, import("./serialization.ts").Json>>>;
1377
+ } & {
1378
+ peer_id: z.ZodNumber;
1379
+ }, "strip", z.ZodTypeAny, {
1380
+ user_data?: Uint8Array<ArrayBufferLike>;
1381
+ peer_id?: number;
1382
+ tags?: string[];
1383
+ audio_parameters?: Record<string, import("./serialization.ts").Json>;
1384
+ video_parameters?: Record<string, import("./serialization.ts").Json>;
1385
+ }, {
1386
+ user_data?: Uint8Array<ArrayBufferLike>;
1387
+ peer_id?: number;
1388
+ tags?: string[];
1389
+ audio_parameters?: Record<string, import("./serialization.ts").Json>;
1390
+ video_parameters?: Record<string, import("./serialization.ts").Json>;
1391
+ }>;
1392
+ }, "strip", z.ZodTypeAny, {
1393
+ PeerChanged?: {
1394
+ user_data?: Uint8Array<ArrayBufferLike>;
1395
+ peer_id?: number;
1396
+ tags?: string[];
1397
+ audio_parameters?: Record<string, import("./serialization.ts").Json>;
1398
+ video_parameters?: Record<string, import("./serialization.ts").Json>;
1399
+ };
1400
+ }, {
1401
+ PeerChanged?: {
1402
+ user_data?: Uint8Array<ArrayBufferLike>;
1403
+ peer_id?: number;
1404
+ tags?: string[];
1405
+ audio_parameters?: Record<string, import("./serialization.ts").Json>;
1406
+ video_parameters?: Record<string, import("./serialization.ts").Json>;
1407
+ };
1408
+ }>;
1409
+ const NewReconnectTokenSchema: z.ZodObject<{
1410
+ NewReconnectToken: z.ZodObject<{
1411
+ token: z.ZodString;
1412
+ }, "strip", z.ZodTypeAny, {
1413
+ token?: string;
1414
+ }, {
1415
+ token?: string;
1416
+ }>;
1417
+ }, "strip", z.ZodTypeAny, {
1418
+ NewReconnectToken?: {
1419
+ token?: string;
1420
+ };
1421
+ }, {
1422
+ NewReconnectToken?: {
1423
+ token?: string;
1424
+ };
1425
+ }>;
1426
+ const MessageReceivedSchema: z.ZodObject<{
1427
+ MessageReceived: z.ZodObject<{
1428
+ sender_peer_id: z.ZodNumber;
1429
+ message: z.ZodType<Uint8Array<ArrayBufferLike>, z.ZodTypeDef, Uint8Array<ArrayBufferLike>>;
1430
+ }, "strip", z.ZodTypeAny, {
1431
+ message?: Uint8Array<ArrayBufferLike>;
1432
+ sender_peer_id?: number;
1433
+ }, {
1434
+ message?: Uint8Array<ArrayBufferLike>;
1435
+ sender_peer_id?: number;
1436
+ }>;
1437
+ }, "strip", z.ZodTypeAny, {
1438
+ MessageReceived?: {
1439
+ message?: Uint8Array<ArrayBufferLike>;
1440
+ sender_peer_id?: number;
1441
+ };
1442
+ }, {
1443
+ MessageReceived?: {
1444
+ message?: Uint8Array<ArrayBufferLike>;
1445
+ sender_peer_id?: number;
1446
+ };
1447
+ }>;
1448
+ const ErrorSchema: z.ZodObject<{
1449
+ Error: z.ZodObject<{
1450
+ message: z.ZodType<Uint8Array<ArrayBufferLike>, z.ZodTypeDef, Uint8Array<ArrayBufferLike>>;
1451
+ }, "strip", z.ZodTypeAny, {
1452
+ message?: Uint8Array<ArrayBufferLike>;
1453
+ }, {
1454
+ message?: Uint8Array<ArrayBufferLike>;
1455
+ }>;
1456
+ }, "strip", z.ZodTypeAny, {
1457
+ Error?: {
1458
+ message?: Uint8Array<ArrayBufferLike>;
1459
+ };
1460
+ }, {
1461
+ Error?: {
1462
+ message?: Uint8Array<ArrayBufferLike>;
1463
+ };
1464
+ }>;
1465
+ const EventSchema: z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
1466
+ Pong: z.ZodObject<{
1467
+ id: z.ZodNumber;
1468
+ }, "strip", z.ZodTypeAny, {
1469
+ id?: number;
1470
+ }, {
1471
+ id?: number;
1472
+ }>;
1473
+ }, "strip", z.ZodTypeAny, {
1474
+ Pong?: {
1475
+ id?: number;
1476
+ };
1477
+ }, {
1478
+ Pong?: {
1479
+ id?: number;
1480
+ };
1481
+ }>, z.ZodObject<{
1482
+ Joined: z.ZodObject<{
1483
+ own_peer_id: z.ZodNumber;
1484
+ room_id: z.ZodString;
1485
+ customer: z.ZodString;
1486
+ }, "strip", z.ZodTypeAny, {
1487
+ customer?: string;
1488
+ own_peer_id?: number;
1489
+ room_id?: string;
1490
+ }, {
1491
+ customer?: string;
1492
+ own_peer_id?: number;
1493
+ room_id?: string;
1494
+ }>;
1495
+ }, "strip", z.ZodTypeAny, {
1496
+ Joined?: {
1497
+ customer?: string;
1498
+ own_peer_id?: number;
1499
+ room_id?: string;
1500
+ };
1501
+ }, {
1502
+ Joined?: {
1503
+ customer?: string;
1504
+ own_peer_id?: number;
1505
+ room_id?: string;
1506
+ };
1507
+ }>]>, z.ZodObject<{
1508
+ Left: z.ZodObject<{
1509
+ reason: z.ZodEnum<["room_closing", "server_closing", "peer_kicked"]>;
1510
+ }, "strip", z.ZodTypeAny, {
1511
+ reason?: "room_closing" | "server_closing" | "peer_kicked";
1512
+ }, {
1513
+ reason?: "room_closing" | "server_closing" | "peer_kicked";
1514
+ }>;
1515
+ }, "strip", z.ZodTypeAny, {
1516
+ Left?: {
1517
+ reason?: "room_closing" | "server_closing" | "peer_kicked";
1518
+ };
1519
+ }, {
1520
+ Left?: {
1521
+ reason?: "room_closing" | "server_closing" | "peer_kicked";
1522
+ };
1523
+ }>]>, z.ZodObject<{
1524
+ PeerJoined: z.ZodObject<{
1525
+ user_data: z.ZodOptional<z.ZodType<Uint8Array<ArrayBufferLike>, z.ZodTypeDef, Uint8Array<ArrayBufferLike>>>;
1526
+ tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1527
+ audio_parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./serialization.ts").Json, z.ZodTypeDef, import("./serialization.ts").Json>>>;
1528
+ video_parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./serialization.ts").Json, z.ZodTypeDef, import("./serialization.ts").Json>>>;
1529
+ } & {
1530
+ peer_id: z.ZodNumber;
1531
+ user_id: z.ZodString;
1532
+ }, "strip", z.ZodTypeAny, {
1533
+ user_id?: string;
1534
+ user_data?: Uint8Array<ArrayBufferLike>;
1535
+ peer_id?: number;
1536
+ tags?: string[];
1537
+ audio_parameters?: Record<string, import("./serialization.ts").Json>;
1538
+ video_parameters?: Record<string, import("./serialization.ts").Json>;
1539
+ }, {
1540
+ user_id?: string;
1541
+ user_data?: Uint8Array<ArrayBufferLike>;
1542
+ peer_id?: number;
1543
+ tags?: string[];
1544
+ audio_parameters?: Record<string, import("./serialization.ts").Json>;
1545
+ video_parameters?: Record<string, import("./serialization.ts").Json>;
1546
+ }>;
1547
+ }, "strip", z.ZodTypeAny, {
1548
+ PeerJoined?: {
1549
+ user_id?: string;
1550
+ user_data?: Uint8Array<ArrayBufferLike>;
1551
+ peer_id?: number;
1552
+ tags?: string[];
1553
+ audio_parameters?: Record<string, import("./serialization.ts").Json>;
1554
+ video_parameters?: Record<string, import("./serialization.ts").Json>;
1555
+ };
1556
+ }, {
1557
+ PeerJoined?: {
1558
+ user_id?: string;
1559
+ user_data?: Uint8Array<ArrayBufferLike>;
1560
+ peer_id?: number;
1561
+ tags?: string[];
1562
+ audio_parameters?: Record<string, import("./serialization.ts").Json>;
1563
+ video_parameters?: Record<string, import("./serialization.ts").Json>;
1564
+ };
1565
+ }>]>, z.ZodObject<{
1566
+ PeerLeft: z.ZodObject<{
1567
+ peer_id: z.ZodNumber;
1568
+ }, "strip", z.ZodTypeAny, {
1569
+ peer_id?: number;
1570
+ }, {
1571
+ peer_id?: number;
1572
+ }>;
1573
+ }, "strip", z.ZodTypeAny, {
1574
+ PeerLeft?: {
1575
+ peer_id?: number;
1576
+ };
1577
+ }, {
1578
+ PeerLeft?: {
1579
+ peer_id?: number;
1580
+ };
1581
+ }>]>, z.ZodObject<{
1582
+ PeerChanged: z.ZodObject<{
1583
+ user_data: z.ZodOptional<z.ZodType<Uint8Array<ArrayBufferLike>, z.ZodTypeDef, Uint8Array<ArrayBufferLike>>>;
1584
+ tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1585
+ audio_parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./serialization.ts").Json, z.ZodTypeDef, import("./serialization.ts").Json>>>;
1586
+ video_parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./serialization.ts").Json, z.ZodTypeDef, import("./serialization.ts").Json>>>;
1587
+ } & {
1588
+ peer_id: z.ZodNumber;
1589
+ }, "strip", z.ZodTypeAny, {
1590
+ user_data?: Uint8Array<ArrayBufferLike>;
1591
+ peer_id?: number;
1592
+ tags?: string[];
1593
+ audio_parameters?: Record<string, import("./serialization.ts").Json>;
1594
+ video_parameters?: Record<string, import("./serialization.ts").Json>;
1595
+ }, {
1596
+ user_data?: Uint8Array<ArrayBufferLike>;
1597
+ peer_id?: number;
1598
+ tags?: string[];
1599
+ audio_parameters?: Record<string, import("./serialization.ts").Json>;
1600
+ video_parameters?: Record<string, import("./serialization.ts").Json>;
1601
+ }>;
1602
+ }, "strip", z.ZodTypeAny, {
1603
+ PeerChanged?: {
1604
+ user_data?: Uint8Array<ArrayBufferLike>;
1605
+ peer_id?: number;
1606
+ tags?: string[];
1607
+ audio_parameters?: Record<string, import("./serialization.ts").Json>;
1608
+ video_parameters?: Record<string, import("./serialization.ts").Json>;
1609
+ };
1610
+ }, {
1611
+ PeerChanged?: {
1612
+ user_data?: Uint8Array<ArrayBufferLike>;
1613
+ peer_id?: number;
1614
+ tags?: string[];
1615
+ audio_parameters?: Record<string, import("./serialization.ts").Json>;
1616
+ video_parameters?: Record<string, import("./serialization.ts").Json>;
1617
+ };
1618
+ }>]>, z.ZodObject<{
1619
+ NewReconnectToken: z.ZodObject<{
1620
+ token: z.ZodString;
1621
+ }, "strip", z.ZodTypeAny, {
1622
+ token?: string;
1623
+ }, {
1624
+ token?: string;
1625
+ }>;
1626
+ }, "strip", z.ZodTypeAny, {
1627
+ NewReconnectToken?: {
1628
+ token?: string;
1629
+ };
1630
+ }, {
1631
+ NewReconnectToken?: {
1632
+ token?: string;
1633
+ };
1634
+ }>]>, z.ZodObject<{
1635
+ MessageReceived: z.ZodObject<{
1636
+ sender_peer_id: z.ZodNumber;
1637
+ message: z.ZodType<Uint8Array<ArrayBufferLike>, z.ZodTypeDef, Uint8Array<ArrayBufferLike>>;
1638
+ }, "strip", z.ZodTypeAny, {
1639
+ message?: Uint8Array<ArrayBufferLike>;
1640
+ sender_peer_id?: number;
1641
+ }, {
1642
+ message?: Uint8Array<ArrayBufferLike>;
1643
+ sender_peer_id?: number;
1644
+ }>;
1645
+ }, "strip", z.ZodTypeAny, {
1646
+ MessageReceived?: {
1647
+ message?: Uint8Array<ArrayBufferLike>;
1648
+ sender_peer_id?: number;
1649
+ };
1650
+ }, {
1651
+ MessageReceived?: {
1652
+ message?: Uint8Array<ArrayBufferLike>;
1653
+ sender_peer_id?: number;
1654
+ };
1655
+ }>]>, z.ZodObject<{
1656
+ Error: z.ZodObject<{
1657
+ message: z.ZodType<Uint8Array<ArrayBufferLike>, z.ZodTypeDef, Uint8Array<ArrayBufferLike>>;
1658
+ }, "strip", z.ZodTypeAny, {
1659
+ message?: Uint8Array<ArrayBufferLike>;
1660
+ }, {
1661
+ message?: Uint8Array<ArrayBufferLike>;
1662
+ }>;
1663
+ }, "strip", z.ZodTypeAny, {
1664
+ Error?: {
1665
+ message?: Uint8Array<ArrayBufferLike>;
1666
+ };
1667
+ }, {
1668
+ Error?: {
1669
+ message?: Uint8Array<ArrayBufferLike>;
1670
+ };
1671
+ }>]>;
1672
+ type Event = z.infer<typeof EventSchema>;
1673
+ }