@livekit/rtc-node 0.12.2 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (217) hide show
  1. package/dist/audio_frame.cjs +2 -2
  2. package/dist/audio_frame.cjs.map +1 -1
  3. package/dist/audio_frame.d.cts +2 -3
  4. package/dist/audio_frame.d.ts +2 -3
  5. package/dist/audio_frame.d.ts.map +1 -1
  6. package/dist/audio_frame.js +3 -3
  7. package/dist/audio_frame.js.map +1 -1
  8. package/dist/audio_resampler.cjs +10 -7
  9. package/dist/audio_resampler.cjs.map +1 -1
  10. package/dist/audio_resampler.d.cts +2 -3
  11. package/dist/audio_resampler.d.ts +2 -3
  12. package/dist/audio_resampler.d.ts.map +1 -1
  13. package/dist/audio_resampler.js +13 -10
  14. package/dist/audio_resampler.js.map +1 -1
  15. package/dist/audio_source.cjs +6 -4
  16. package/dist/audio_source.cjs.map +1 -1
  17. package/dist/audio_source.d.cts +3 -3
  18. package/dist/audio_source.d.ts +3 -3
  19. package/dist/audio_source.d.ts.map +1 -1
  20. package/dist/audio_source.js +9 -7
  21. package/dist/audio_source.js.map +1 -1
  22. package/dist/audio_stream.cjs +1 -2
  23. package/dist/audio_stream.cjs.map +1 -1
  24. package/dist/audio_stream.d.cts +2 -3
  25. package/dist/audio_stream.d.ts +2 -3
  26. package/dist/audio_stream.d.ts.map +1 -1
  27. package/dist/audio_stream.js +2 -3
  28. package/dist/audio_stream.js.map +1 -1
  29. package/dist/e2ee.cjs +19 -20
  30. package/dist/e2ee.cjs.map +1 -1
  31. package/dist/e2ee.d.cts +0 -1
  32. package/dist/e2ee.d.ts +0 -1
  33. package/dist/e2ee.d.ts.map +1 -1
  34. package/dist/e2ee.js +29 -30
  35. package/dist/e2ee.js.map +1 -1
  36. package/dist/ffi_client.cjs +6 -5
  37. package/dist/ffi_client.cjs.map +1 -1
  38. package/dist/ffi_client.d.cts +10 -10
  39. package/dist/ffi_client.d.ts +10 -10
  40. package/dist/ffi_client.d.ts.map +1 -1
  41. package/dist/ffi_client.js +6 -10
  42. package/dist/ffi_client.js.map +1 -1
  43. package/dist/index.cjs +16 -49
  44. package/dist/index.cjs.map +1 -1
  45. package/dist/index.d.cts +6 -35
  46. package/dist/index.d.ts +6 -35
  47. package/dist/index.d.ts.map +1 -1
  48. package/dist/index.js +7 -46
  49. package/dist/index.js.map +1 -1
  50. package/dist/napi/native.d.cjs.map +1 -1
  51. package/dist/napi/native.d.ts +5 -5
  52. package/dist/native.d.ts +5 -5
  53. package/dist/participant.cjs +57 -34
  54. package/dist/participant.cjs.map +1 -1
  55. package/dist/participant.d.cts +10 -10
  56. package/dist/participant.d.ts +10 -10
  57. package/dist/participant.d.ts.map +1 -1
  58. package/dist/participant.js +75 -50
  59. package/dist/participant.js.map +1 -1
  60. package/dist/proto/audio_frame_pb.cjs +977 -125
  61. package/dist/proto/audio_frame_pb.cjs.map +1 -1
  62. package/dist/proto/audio_frame_pb.d.cts +502 -417
  63. package/dist/proto/audio_frame_pb.d.ts +502 -417
  64. package/dist/proto/audio_frame_pb.d.ts.map +1 -1
  65. package/dist/proto/audio_frame_pb.js +943 -85
  66. package/dist/proto/audio_frame_pb.js.map +1 -1
  67. package/dist/proto/e2ee_pb.cjs +700 -85
  68. package/dist/proto/e2ee_pb.cjs.map +1 -1
  69. package/dist/proto/e2ee_pb.d.cts +331 -263
  70. package/dist/proto/e2ee_pb.d.ts +331 -263
  71. package/dist/proto/e2ee_pb.d.ts.map +1 -1
  72. package/dist/proto/e2ee_pb.js +675 -57
  73. package/dist/proto/e2ee_pb.js.map +1 -1
  74. package/dist/proto/ffi_pb.cjs +369 -36
  75. package/dist/proto/ffi_pb.cjs.map +1 -1
  76. package/dist/proto/ffi_pb.d.cts +156 -109
  77. package/dist/proto/ffi_pb.d.ts +156 -109
  78. package/dist/proto/ffi_pb.d.ts.map +1 -1
  79. package/dist/proto/ffi_pb.js +364 -29
  80. package/dist/proto/ffi_pb.js.map +1 -1
  81. package/dist/proto/handle_pb.cjs +27 -7
  82. package/dist/proto/handle_pb.cjs.map +1 -1
  83. package/dist/proto/handle_pb.d.cts +13 -15
  84. package/dist/proto/handle_pb.d.ts +13 -15
  85. package/dist/proto/handle_pb.d.ts.map +1 -1
  86. package/dist/proto/handle_pb.js +26 -5
  87. package/dist/proto/handle_pb.js.map +1 -1
  88. package/dist/proto/participant_pb.cjs +112 -15
  89. package/dist/proto/participant_pb.cjs.map +1 -1
  90. package/dist/proto/participant_pb.d.cts +140 -52
  91. package/dist/proto/participant_pb.d.ts +140 -52
  92. package/dist/proto/participant_pb.d.ts.map +1 -1
  93. package/dist/proto/participant_pb.js +109 -11
  94. package/dist/proto/participant_pb.js.map +1 -1
  95. package/dist/proto/room_pb.cjs +2693 -302
  96. package/dist/proto/room_pb.cjs.map +1 -1
  97. package/dist/proto/room_pb.d.cts +1265 -862
  98. package/dist/proto/room_pb.d.ts +1265 -862
  99. package/dist/proto/room_pb.d.ts.map +1 -1
  100. package/dist/proto/room_pb.js +2603 -210
  101. package/dist/proto/room_pb.js.map +1 -1
  102. package/dist/proto/rpc_pb.cjs +302 -37
  103. package/dist/proto/rpc_pb.cjs.map +1 -1
  104. package/dist/proto/rpc_pb.d.cts +138 -108
  105. package/dist/proto/rpc_pb.d.ts +138 -108
  106. package/dist/proto/rpc_pb.d.ts.map +1 -1
  107. package/dist/proto/rpc_pb.js +291 -25
  108. package/dist/proto/rpc_pb.js.map +1 -1
  109. package/dist/proto/stats_pb.cjs +1253 -139
  110. package/dist/proto/stats_pb.cjs.map +1 -1
  111. package/dist/proto/stats_pb.d.cts +803 -692
  112. package/dist/proto/stats_pb.d.ts +803 -692
  113. package/dist/proto/stats_pb.d.ts.map +1 -1
  114. package/dist/proto/stats_pb.js +1216 -93
  115. package/dist/proto/stats_pb.js.map +1 -1
  116. package/dist/proto/track_pb.cjs +462 -64
  117. package/dist/proto/track_pb.cjs.map +1 -1
  118. package/dist/proto/track_pb.d.cts +250 -218
  119. package/dist/proto/track_pb.d.ts +250 -218
  120. package/dist/proto/track_pb.d.ts.map +1 -1
  121. package/dist/proto/track_pb.js +447 -45
  122. package/dist/proto/track_pb.js.map +1 -1
  123. package/dist/proto/track_publication_pb.cjs +130 -0
  124. package/dist/proto/track_publication_pb.cjs.map +1 -0
  125. package/dist/proto/track_publication_pb.d.cts +80 -0
  126. package/dist/proto/track_publication_pb.d.ts +80 -0
  127. package/dist/proto/track_publication_pb.d.ts.map +1 -0
  128. package/dist/proto/track_publication_pb.js +103 -0
  129. package/dist/proto/track_publication_pb.js.map +1 -0
  130. package/dist/proto/video_frame_pb.cjs +648 -88
  131. package/dist/proto/video_frame_pb.cjs.map +1 -1
  132. package/dist/proto/video_frame_pb.d.cts +371 -328
  133. package/dist/proto/video_frame_pb.d.ts +371 -328
  134. package/dist/proto/video_frame_pb.d.ts.map +1 -1
  135. package/dist/proto/video_frame_pb.js +626 -60
  136. package/dist/proto/video_frame_pb.js.map +1 -1
  137. package/dist/room.cjs +93 -125
  138. package/dist/room.cjs.map +1 -1
  139. package/dist/room.d.cts +6 -17
  140. package/dist/room.d.ts +6 -17
  141. package/dist/room.d.ts.map +1 -1
  142. package/dist/room.js +92 -122
  143. package/dist/room.js.map +1 -1
  144. package/dist/rpc.cjs.map +1 -1
  145. package/dist/rpc.d.cts +0 -1
  146. package/dist/rpc.d.ts +0 -1
  147. package/dist/rpc.js.map +1 -1
  148. package/dist/track.cjs +12 -8
  149. package/dist/track.cjs.map +1 -1
  150. package/dist/track.d.cts +8 -9
  151. package/dist/track.d.ts +8 -9
  152. package/dist/track.d.ts.map +1 -1
  153. package/dist/track.js +13 -9
  154. package/dist/track.js.map +1 -1
  155. package/dist/track_publication.cjs +21 -12
  156. package/dist/track_publication.cjs.map +1 -1
  157. package/dist/track_publication.d.cts +12 -13
  158. package/dist/track_publication.d.ts +12 -13
  159. package/dist/track_publication.d.ts.map +1 -1
  160. package/dist/track_publication.js +22 -13
  161. package/dist/track_publication.js.map +1 -1
  162. package/dist/version.cjs +1 -1
  163. package/dist/version.cjs.map +1 -1
  164. package/dist/version.d.cts +1 -1
  165. package/dist/version.d.ts +1 -1
  166. package/dist/version.js +1 -1
  167. package/dist/version.js.map +1 -1
  168. package/dist/video_frame.cjs +26 -45
  169. package/dist/video_frame.cjs.map +1 -1
  170. package/dist/video_frame.d.cts +2 -3
  171. package/dist/video_frame.d.ts +2 -3
  172. package/dist/video_frame.d.ts.map +1 -1
  173. package/dist/video_frame.js +29 -48
  174. package/dist/video_frame.js.map +1 -1
  175. package/dist/video_source.cjs +7 -4
  176. package/dist/video_source.cjs.map +1 -1
  177. package/dist/video_source.d.cts +4 -4
  178. package/dist/video_source.d.ts +4 -4
  179. package/dist/video_source.d.ts.map +1 -1
  180. package/dist/video_source.js +9 -6
  181. package/dist/video_source.js.map +1 -1
  182. package/dist/video_stream.cjs +16 -5
  183. package/dist/video_stream.cjs.map +1 -1
  184. package/dist/video_stream.d.cts +3 -4
  185. package/dist/video_stream.d.ts +3 -4
  186. package/dist/video_stream.d.ts.map +1 -1
  187. package/dist/video_stream.js +17 -6
  188. package/dist/video_stream.js.map +1 -1
  189. package/package.json +9 -9
  190. package/src/audio_frame.ts +10 -10
  191. package/src/audio_resampler.ts +15 -13
  192. package/src/audio_source.ts +11 -8
  193. package/src/audio_stream.ts +3 -4
  194. package/src/e2ee.ts +36 -37
  195. package/src/ffi_client.ts +8 -16
  196. package/src/index.ts +5 -68
  197. package/src/napi/native.d.ts +5 -5
  198. package/src/participant.ts +100 -72
  199. package/src/proto/audio_frame_pb.ts +1220 -496
  200. package/src/proto/e2ee_pb.ts +858 -337
  201. package/src/proto/ffi_pb.ts +442 -135
  202. package/src/proto/handle_pb.ts +33 -19
  203. package/src/proto/participant_pb.ts +225 -60
  204. package/src/proto/room_pb.ts +3149 -1013
  205. package/src/proto/rpc_pb.ts +358 -129
  206. package/src/proto/stats_pb.ts +1891 -877
  207. package/src/proto/track_pb.ts +587 -253
  208. package/src/proto/track_publication_pb.ts +180 -0
  209. package/src/proto/video_frame_pb.ts +861 -394
  210. package/src/room.ts +143 -188
  211. package/src/rpc.ts +1 -1
  212. package/src/track.ts +16 -17
  213. package/src/track_publication.ts +25 -26
  214. package/src/version.ts +1 -1
  215. package/src/video_frame.ts +48 -72
  216. package/src/video_source.ts +11 -8
  217. package/src/video_stream.ts +18 -8
package/src/e2ee.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  // SPDX-FileCopyrightText: 2024 LiveKit, Inc.
2
2
  //
3
3
  // SPDX-License-Identifier: Apache-2.0
4
- import { create } from '@bufbuild/protobuf';
5
4
  import { FfiClient } from './ffi_client.js';
6
5
  import type {
7
6
  E2eeManagerGetFrameCryptorsResponse,
@@ -12,17 +11,17 @@ import type {
12
11
  RatchetSharedKeyResponse,
13
12
  } from './proto/e2ee_pb.js';
14
13
  import {
15
- E2eeManagerSetEnabledRequestSchema,
16
- E2eeRequestSchema,
14
+ E2eeManagerSetEnabledRequest,
15
+ E2eeRequest,
17
16
  EncryptionType,
18
- FrameCryptorSetEnabledRequestSchema,
19
- FrameCryptorSetKeyIndexRequestSchema,
20
- GetKeyRequestSchema,
21
- GetSharedKeyRequestSchema,
22
- RatchetKeyRequestSchema,
23
- RatchetSharedKeyRequestSchema,
24
- SetKeyRequestSchema,
25
- SetSharedKeyRequestSchema,
17
+ FrameCryptorSetEnabledRequest,
18
+ FrameCryptorSetKeyIndexRequest,
19
+ GetKeyRequest,
20
+ GetSharedKeyRequest,
21
+ RatchetKeyRequest,
22
+ RatchetSharedKeyRequest,
23
+ SetKeyRequest,
24
+ SetSharedKeyRequest,
26
25
  } from './proto/e2ee_pb.js';
27
26
 
28
27
  const DEFAULT_RATCHET_SALT = new TextEncoder().encode('LKFrameEncryptionKey');
@@ -63,11 +62,11 @@ export class KeyProvider {
63
62
  }
64
63
 
65
64
  setSharedKey(sharedKey: Uint8Array, keyIndex: number) {
66
- const req = create(E2eeRequestSchema, {
65
+ const req = new E2eeRequest({
67
66
  roomHandle: this.roomHandle,
68
67
  message: {
69
68
  case: 'setSharedKey',
70
- value: create(SetSharedKeyRequestSchema, {
69
+ value: new SetSharedKeyRequest({
71
70
  keyIndex: keyIndex,
72
71
  sharedKey: sharedKey,
73
72
  }),
@@ -83,11 +82,11 @@ export class KeyProvider {
83
82
  }
84
83
 
85
84
  exportSharedKey(keyIndex: number): Uint8Array {
86
- const req = create(E2eeRequestSchema, {
85
+ const req = new E2eeRequest({
87
86
  roomHandle: this.roomHandle,
88
87
  message: {
89
88
  case: 'getSharedKey',
90
- value: create(GetSharedKeyRequestSchema, {
89
+ value: new GetSharedKeyRequest({
91
90
  keyIndex: keyIndex,
92
91
  }),
93
92
  },
@@ -100,15 +99,15 @@ export class KeyProvider {
100
99
  },
101
100
  });
102
101
 
103
- return (res.message.value as GetSharedKeyResponse).key;
102
+ return (res.message.value as GetSharedKeyResponse).key!;
104
103
  }
105
104
 
106
105
  ratchetSharedKey(keyIndex: number): Uint8Array {
107
- const req = create(E2eeRequestSchema, {
106
+ const req = new E2eeRequest({
108
107
  roomHandle: this.roomHandle,
109
108
  message: {
110
109
  case: 'ratchetSharedKey',
111
- value: create(RatchetSharedKeyRequestSchema, {
110
+ value: new RatchetSharedKeyRequest({
112
111
  keyIndex: keyIndex,
113
112
  }),
114
113
  },
@@ -121,15 +120,15 @@ export class KeyProvider {
121
120
  },
122
121
  });
123
122
 
124
- return (res.message.value as RatchetSharedKeyResponse).newKey;
123
+ return (res.message.value as RatchetSharedKeyResponse).newKey!;
125
124
  }
126
125
 
127
126
  setKey(participantIdentity: string, keyIndex: number) {
128
- const req = create(E2eeRequestSchema, {
127
+ const req = new E2eeRequest({
129
128
  roomHandle: this.roomHandle,
130
129
  message: {
131
130
  case: 'setKey',
132
- value: create(SetKeyRequestSchema, {
131
+ value: new SetKeyRequest({
133
132
  keyIndex: keyIndex,
134
133
  participantIdentity: participantIdentity,
135
134
  }),
@@ -145,11 +144,11 @@ export class KeyProvider {
145
144
  }
146
145
 
147
146
  exportKey(participantIdentity: string, keyIndex: number): Uint8Array {
148
- const req = create(E2eeRequestSchema, {
147
+ const req = new E2eeRequest({
149
148
  roomHandle: this.roomHandle,
150
149
  message: {
151
150
  case: 'getKey',
152
- value: create(GetKeyRequestSchema, {
151
+ value: new GetKeyRequest({
153
152
  keyIndex: keyIndex,
154
153
  participantIdentity: participantIdentity,
155
154
  }),
@@ -163,15 +162,15 @@ export class KeyProvider {
163
162
  },
164
163
  });
165
164
 
166
- return (res.message.value as GetKeyResponse).key;
165
+ return (res.message.value as GetKeyResponse).key!;
167
166
  }
168
167
 
169
168
  ratchetKey(participantIdentity: string, keyIndex: number): Uint8Array {
170
- const req = create(E2eeRequestSchema, {
169
+ const req = new E2eeRequest({
171
170
  roomHandle: this.roomHandle,
172
171
  message: {
173
172
  case: 'ratchetKey',
174
- value: create(RatchetKeyRequestSchema, {
173
+ value: new RatchetKeyRequest({
175
174
  keyIndex: keyIndex,
176
175
  participantIdentity: participantIdentity,
177
176
  }),
@@ -185,7 +184,7 @@ export class KeyProvider {
185
184
  },
186
185
  });
187
186
 
188
- return (res.message.value as RatchetKeyResponse).newKey;
187
+ return (res.message.value as RatchetKeyResponse).newKey!;
189
188
  }
190
189
  }
191
190
 
@@ -204,11 +203,11 @@ export class FrameCryptor {
204
203
 
205
204
  setEnabled(enabled: boolean) {
206
205
  this.enabled = enabled;
207
- const req = create(E2eeRequestSchema, {
206
+ const req = new E2eeRequest({
208
207
  roomHandle: this.roomHandle,
209
208
  message: {
210
209
  case: 'cryptorSetEnabled',
211
- value: create(FrameCryptorSetEnabledRequestSchema, {
210
+ value: new FrameCryptorSetEnabledRequest({
212
211
  participantIdentity: this.participantIdentity,
213
212
  enabled: this.enabled,
214
213
  }),
@@ -225,11 +224,11 @@ export class FrameCryptor {
225
224
 
226
225
  setKeyIndex(keyIndex: number) {
227
226
  this.keyIndex = keyIndex;
228
- const req = create(E2eeRequestSchema, {
227
+ const req = new E2eeRequest({
229
228
  roomHandle: this.roomHandle,
230
229
  message: {
231
230
  case: 'cryptorSetKeyIndex',
232
- value: create(FrameCryptorSetKeyIndexRequestSchema, {
231
+ value: new FrameCryptorSetKeyIndexRequest({
233
232
  participantIdentity: this.participantIdentity,
234
233
  keyIndex: this.keyIndex,
235
234
  }),
@@ -265,11 +264,11 @@ export class E2EEManager {
265
264
 
266
265
  setEnabled(enabled: boolean) {
267
266
  this.enabled = enabled;
268
- const req = create(E2eeRequestSchema, {
267
+ const req = new E2eeRequest({
269
268
  roomHandle: this.roomHandle,
270
269
  message: {
271
270
  case: 'managerSetEnabled',
272
- value: create(E2eeManagerSetEnabledRequestSchema, {
271
+ value: new E2eeManagerSetEnabledRequest({
273
272
  enabled: this.enabled,
274
273
  }),
275
274
  },
@@ -284,7 +283,7 @@ export class E2EEManager {
284
283
  }
285
284
 
286
285
  frameCryptors(): FrameCryptor[] {
287
- const req = create(E2eeRequestSchema, {
286
+ const req = new E2eeRequest({
288
287
  roomHandle: this.roomHandle,
289
288
  message: {
290
289
  case: 'managerGetFrameCryptors',
@@ -305,9 +304,9 @@ export class E2EEManager {
305
304
  (cryptor) =>
306
305
  new FrameCryptor(
307
306
  this.roomHandle,
308
- cryptor.participantIdentity,
309
- cryptor.keyIndex,
310
- cryptor.enabled,
307
+ cryptor.participantIdentity!,
308
+ cryptor.keyIndex!,
309
+ cryptor.enabled!,
311
310
  ),
312
311
  );
313
312
 
package/src/ffi_client.ts CHANGED
@@ -1,8 +1,7 @@
1
1
  // SPDX-FileCopyrightText: 2024 LiveKit, Inc.
2
2
  //
3
3
  // SPDX-License-Identifier: Apache-2.0
4
- import type { MessageInitShape } from '@bufbuild/protobuf';
5
- import { create, fromBinary, toBinary } from '@bufbuild/protobuf';
4
+ import type { PartialMessage } from '@bufbuild/protobuf';
6
5
  import type { TypedEventEmitter as TypedEmitter } from '@livekit/typed-emitter';
7
6
  import EventEmitter from 'events';
8
7
  import {
@@ -13,17 +12,10 @@ import {
13
12
  livekitInitialize,
14
13
  livekitRetrievePtr,
15
14
  } from './napi/native.js';
16
- import {
17
- type FfiEvent,
18
- FfiEventSchema,
19
- type FfiRequest,
20
- FfiRequestSchema,
21
- type FfiResponse,
22
- FfiResponseSchema,
23
- } from './proto/ffi_pb.js';
15
+ import { FfiEvent, FfiRequest, FfiResponse } from './proto/ffi_pb.js';
24
16
  import { SDK_VERSION } from './version.js';
25
17
 
26
- export { FfiHandle, type FfiEvent, type FfiResponse, type FfiRequest, livekitDispose as dispose };
18
+ export { FfiHandle, type FfiEvent, type FfiResponse, FfiRequest, livekitDispose as dispose };
27
19
 
28
20
  export type FfiClientCallbacks = {
29
21
  ffi_event: (event: FfiEvent) => void;
@@ -49,7 +41,7 @@ export class FfiClient extends (EventEmitter as new () => TypedEmitter<FfiClient
49
41
 
50
42
  livekitInitialize(
51
43
  (event_data: Uint8Array) => {
52
- const event = fromBinary(FfiEventSchema, event_data);
44
+ const event = FfiEvent.fromBinary(event_data);
53
45
  this.emit(FfiClientEvent.FfiEvent, event);
54
46
  },
55
47
  true,
@@ -57,11 +49,11 @@ export class FfiClient extends (EventEmitter as new () => TypedEmitter<FfiClient
57
49
  );
58
50
  }
59
51
 
60
- request<T>(req: MessageInitShape<typeof FfiRequestSchema>): T {
61
- const request = create(FfiRequestSchema, req);
62
- const req_data = toBinary(FfiRequestSchema, request);
52
+ request<T>(req: PartialMessage<FfiRequest>): T {
53
+ const request = new FfiRequest(req);
54
+ const req_data = request.toBinary();
63
55
  const res_data = livekitFfiRequest(req_data);
64
- return fromBinary(FfiResponseSchema, res_data).message.value as T;
56
+ return FfiResponse.fromBinary(res_data).message.value as T;
65
57
  }
66
58
 
67
59
  copyBuffer(ptr: bigint, len: number): Uint8Array {
package/src/index.ts CHANGED
@@ -1,18 +1,6 @@
1
1
  // SPDX-FileCopyrightText: 2024 LiveKit, Inc.
2
2
  //
3
3
  // SPDX-License-Identifier: Apache-2.0
4
- import type { MessageInitShape } from '@bufbuild/protobuf';
5
- import { create } from '@bufbuild/protobuf';
6
- import type { AudioEncoding, TrackPublishOptionsSchema, VideoEncoding } from './proto/room_pb.js';
7
- import {
8
- AudioEncodingSchema,
9
- IceServerSchema,
10
- type IceServer as IceServerType,
11
- type TrackPublishOptions as TrackPublishOptionsType,
12
- VideoEncodingSchema,
13
- } from './proto/room_pb.js';
14
- import { TrackSource } from './proto/track_pb.js';
15
- import { VideoCodec } from './proto/video_frame_pb.js';
16
4
 
17
5
  export { Room, RoomEvent, ConnectError, type RoomOptions, type RtcConfiguration } from './room.js';
18
6
  export { Participant, RemoteParticipant, LocalParticipant } from './participant.js';
@@ -39,20 +27,16 @@ export {
39
27
  RemoteTrackPublication,
40
28
  LocalTrackPublication,
41
29
  } from './track_publication.js';
42
- export { type Transcription, type TranscriptionSegment } from './transcription.js';
43
- export {
44
- E2EEManager,
45
- type E2EEOptions,
46
- type KeyProviderOptions,
47
- KeyProvider,
48
- FrameCryptor,
49
- } from './e2ee.js';
50
-
30
+ export type { Transcription, TranscriptionSegment } from './transcription.js';
31
+ export { E2EEManager, KeyProvider, FrameCryptor } from './e2ee.js';
32
+ export type { E2EEOptions, KeyProviderOptions } from './e2ee.js';
51
33
  export {
52
34
  ConnectionQuality,
35
+ IceServer,
53
36
  IceTransportType,
54
37
  DataPacketKind,
55
38
  ContinualGatheringPolicy,
39
+ TrackPublishOptions,
56
40
  ConnectionState,
57
41
  } from './proto/room_pb.js';
58
42
  export { RpcError, type RpcInvocationData, type PerformRpcParams } from './rpc.js';
@@ -62,50 +46,3 @@ export { VideoBufferType, VideoRotation, VideoCodec } from './proto/video_frame_
62
46
  export { ParticipantKind } from './proto/participant_pb.js';
63
47
  export { dispose } from './ffi_client.js';
64
48
  export type { ChatMessage } from './types.js';
65
-
66
- // exposing helpers for API compatibility with 1.x version of protobuf-es where these were class instances
67
-
68
- type IceServerInit = MessageInitShape<typeof IceServerSchema> & {
69
- urls: string[];
70
- };
71
- export class IceServer implements IceServerType {
72
- $typeName = 'livekit.proto.IceServer' as const;
73
- urls: string[];
74
- username: string;
75
- password: string;
76
- constructor(init: IceServerInit) {
77
- const { urls, username, password } = init;
78
- this.urls = urls;
79
- this.username = username ?? '';
80
- this.password = password ?? '';
81
- create(IceServerSchema, init);
82
- }
83
- }
84
-
85
- export class TrackPublishOptions implements TrackPublishOptionsType {
86
- $typeName = 'livekit.proto.TrackPublishOptions' as const;
87
- videoCodec: VideoCodec;
88
- videoEncoding?: VideoEncoding | undefined;
89
- audioEncoding?: AudioEncoding | undefined;
90
- dtx: boolean;
91
- simulcast: boolean;
92
- source: TrackSource;
93
- stream: string;
94
- red: boolean;
95
-
96
- constructor(init: MessageInitShape<typeof TrackPublishOptionsSchema> = {}) {
97
- const { videoCodec, videoEncoding, audioEncoding, dtx, simulcast, source, stream, red } = init;
98
- this.videoCodec = videoCodec ?? VideoCodec.VP8;
99
- if (videoEncoding) {
100
- this.videoEncoding = create(VideoEncodingSchema, videoEncoding);
101
- }
102
- if (audioEncoding) {
103
- this.audioEncoding = create(AudioEncodingSchema, audioEncoding);
104
- }
105
- this.dtx = dtx ?? false;
106
- this.simulcast = simulcast ?? false;
107
- this.source = source ?? TrackSource.SOURCE_UNKNOWN;
108
- this.stream = stream ?? '';
109
- this.red = red ?? false;
110
- }
111
- }
@@ -3,15 +3,15 @@
3
3
 
4
4
  /* auto-generated by NAPI-RS */
5
5
 
6
- export declare function livekitInitialize(
6
+ export function livekitInitialize(
7
7
  callback: (data: Uint8Array) => void,
8
8
  captureLogs: boolean,
9
9
  sdkVersion: string,
10
10
  ): void;
11
- export declare function livekitFfiRequest(data: Uint8Array): Uint8Array;
12
- export declare function livekitRetrievePtr(handle: Uint8Array): bigint;
13
- export declare function livekitCopyBuffer(ptr: bigint, len: number): Uint8Array;
14
- export declare function livekitDispose(): Promise<void>;
11
+ export function livekitFfiRequest(data: Uint8Array): Uint8Array;
12
+ export function livekitRetrievePtr(handle: Uint8Array): bigint;
13
+ export function livekitCopyBuffer(ptr: bigint, len: number): Uint8Array;
14
+ export function livekitDispose(): Promise<void>;
15
15
  export declare class FfiHandle {
16
16
  constructor(handle: bigint);
17
17
  dispose(): void;