livekit-client 2.22.2 → 2.22.4

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 (245) hide show
  1. package/README.md +35 -0
  2. package/dist/livekit-client.e2ee.worker.js +1 -1
  3. package/dist/livekit-client.e2ee.worker.js.map +1 -1
  4. package/dist/livekit-client.e2ee.worker.mjs +488 -438
  5. package/dist/livekit-client.e2ee.worker.mjs.map +1 -1
  6. package/dist/livekit-client.esm.mjs +954 -301
  7. package/dist/livekit-client.esm.mjs.map +1 -1
  8. package/dist/livekit-client.fm.worker.js +1 -1
  9. package/dist/livekit-client.fm.worker.js.map +1 -1
  10. package/dist/livekit-client.fm.worker.mjs +10 -2
  11. package/dist/livekit-client.fm.worker.mjs.map +1 -1
  12. package/dist/livekit-client.umd.js +1 -1
  13. package/dist/livekit-client.umd.js.map +1 -1
  14. package/dist/src/api/SignalClient.d.ts +4 -2
  15. package/dist/src/api/SignalClient.d.ts.map +1 -1
  16. package/dist/src/api/WebSocketStream.d.ts.map +1 -1
  17. package/dist/src/api/utils.d.ts +1 -0
  18. package/dist/src/api/utils.d.ts.map +1 -1
  19. package/dist/src/e2ee/E2eeManager.d.ts +26 -0
  20. package/dist/src/e2ee/E2eeManager.d.ts.map +1 -1
  21. package/dist/src/e2ee/types.d.ts +15 -1
  22. package/dist/src/e2ee/types.d.ts.map +1 -1
  23. package/dist/src/e2ee/worker/DataCryptor.d.ts.map +1 -1
  24. package/dist/src/e2ee/worker/ErrorRateLimiter.d.ts +21 -0
  25. package/dist/src/e2ee/worker/ErrorRateLimiter.d.ts.map +1 -0
  26. package/dist/src/e2ee/worker/FrameCryptor.d.ts +1 -18
  27. package/dist/src/e2ee/worker/FrameCryptor.d.ts.map +1 -1
  28. package/dist/src/logger.d.ts +4 -0
  29. package/dist/src/logger.d.ts.map +1 -1
  30. package/dist/src/options.d.ts +14 -0
  31. package/dist/src/options.d.ts.map +1 -1
  32. package/dist/src/room/PCTransport.d.ts +78 -7
  33. package/dist/src/room/PCTransport.d.ts.map +1 -1
  34. package/dist/src/room/PCTransportManager.d.ts.map +1 -1
  35. package/dist/src/room/RTCEngine.d.ts +9 -0
  36. package/dist/src/room/RTCEngine.d.ts.map +1 -1
  37. package/dist/src/room/Room.d.ts +1 -1
  38. package/dist/src/room/Room.d.ts.map +1 -1
  39. package/dist/src/room/defaults.d.ts.map +1 -1
  40. package/dist/src/room/errors.d.ts +18 -0
  41. package/dist/src/room/errors.d.ts.map +1 -1
  42. package/dist/src/room/events.d.ts +3 -2
  43. package/dist/src/room/events.d.ts.map +1 -1
  44. package/dist/src/room/participant/LocalParticipant.d.ts.map +1 -1
  45. package/dist/src/room/participant/publishUtils.d.ts +16 -0
  46. package/dist/src/room/participant/publishUtils.d.ts.map +1 -1
  47. package/dist/src/room/rpc/client/RpcClientManager.d.ts.map +1 -1
  48. package/dist/src/room/track/LocalTrack.d.ts.map +1 -1
  49. package/dist/src/room/track/LocalVideoTrack.d.ts +9 -0
  50. package/dist/src/room/track/LocalVideoTrack.d.ts.map +1 -1
  51. package/dist/src/room/track/options.d.ts +1 -1
  52. package/dist/src/room/track/utils.d.ts +13 -0
  53. package/dist/src/room/track/utils.d.ts.map +1 -1
  54. package/dist/src/room/utils.d.ts +66 -0
  55. package/dist/src/room/utils.d.ts.map +1 -1
  56. package/dist/src/test/compressionStreamStubs.d.ts +12 -0
  57. package/dist/src/test/compressionStreamStubs.d.ts.map +1 -0
  58. package/dist/ts4.2/api/SignalClient.d.ts +187 -185
  59. package/dist/ts4.2/api/SignalClientStateMachine.d.ts +85 -85
  60. package/dist/ts4.2/api/WebSocketStream.d.ts +33 -33
  61. package/dist/ts4.2/api/utils.d.ts +9 -8
  62. package/dist/ts4.2/connectionHelper/ConnectionCheck.d.ts +30 -30
  63. package/dist/ts4.2/connectionHelper/checks/Checker.d.ts +62 -62
  64. package/dist/ts4.2/connectionHelper/checks/cloudRegion.d.ts +18 -18
  65. package/dist/ts4.2/connectionHelper/checks/connectionProtocol.d.ts +20 -20
  66. package/dist/ts4.2/connectionHelper/checks/publishAudio.d.ts +6 -6
  67. package/dist/ts4.2/connectionHelper/checks/publishVideo.d.ts +7 -7
  68. package/dist/ts4.2/connectionHelper/checks/reconnect.d.ts +6 -6
  69. package/dist/ts4.2/connectionHelper/checks/turn.d.ts +6 -6
  70. package/dist/ts4.2/connectionHelper/checks/webrtc.d.ts +6 -6
  71. package/dist/ts4.2/connectionHelper/checks/websocket.d.ts +6 -6
  72. package/dist/ts4.2/e2ee/E2eeManager.d.ts +111 -85
  73. package/dist/ts4.2/e2ee/KeyProvider.d.ts +54 -54
  74. package/dist/ts4.2/e2ee/constants.d.ts +21 -21
  75. package/dist/ts4.2/e2ee/errors.d.ts +12 -12
  76. package/dist/ts4.2/e2ee/events.d.ts +39 -39
  77. package/dist/ts4.2/e2ee/index.d.ts +6 -6
  78. package/dist/ts4.2/e2ee/types.d.ts +231 -217
  79. package/dist/ts4.2/e2ee/utils.d.ts +32 -32
  80. package/dist/ts4.2/e2ee/worker/DataCryptor.d.ts +16 -16
  81. package/dist/ts4.2/e2ee/worker/ErrorRateLimiter.d.ts +21 -0
  82. package/dist/ts4.2/e2ee/worker/FrameCryptor.d.ts +209 -226
  83. package/dist/ts4.2/e2ee/worker/ParticipantKeyHandler.d.ts +81 -84
  84. package/dist/ts4.2/e2ee/worker/e2ee.worker.d.ts +2 -2
  85. package/dist/ts4.2/e2ee/worker/naluUtils.d.ts +28 -28
  86. package/dist/ts4.2/e2ee/worker/sifPayload.d.ts +23 -23
  87. package/dist/ts4.2/frameMetadata/FrameMetadataManager.d.ts +53 -53
  88. package/dist/ts4.2/frameMetadata/frameMetadata.d.ts +33 -33
  89. package/dist/ts4.2/frameMetadata/types.d.ts +62 -62
  90. package/dist/ts4.2/frameMetadata/utils.d.ts +9 -9
  91. package/dist/ts4.2/frameMetadata/worker/frameMetadata.worker.d.ts +2 -2
  92. package/dist/ts4.2/index.d.ts +76 -76
  93. package/dist/ts4.2/logger.d.ts +66 -62
  94. package/dist/ts4.2/options.d.ts +163 -149
  95. package/dist/ts4.2/room/BackOffStrategy.d.ts +27 -27
  96. package/dist/ts4.2/room/DefaultReconnectPolicy.d.ts +8 -8
  97. package/dist/ts4.2/room/DeviceManager.d.ts +12 -12
  98. package/dist/ts4.2/room/PCTransport.d.ts +246 -175
  99. package/dist/ts4.2/room/PCTransportManager.d.ts +77 -77
  100. package/dist/ts4.2/room/RTCEngine.d.ts +269 -261
  101. package/dist/ts4.2/room/ReconnectPolicy.d.ts +24 -24
  102. package/dist/ts4.2/room/RegionUrlProvider.d.ts +36 -36
  103. package/dist/ts4.2/room/Room.d.ts +354 -365
  104. package/dist/ts4.2/room/attribute-typings.d.ts +35 -35
  105. package/dist/ts4.2/room/data-channel/DataChannelManager.d.ts +62 -62
  106. package/dist/ts4.2/room/data-channel/FlowControlledDataChannel.d.ts +94 -95
  107. package/dist/ts4.2/room/data-channel/LossyDataChannel.d.ts +41 -41
  108. package/dist/ts4.2/room/data-channel/ReliableDataChannel.d.ts +57 -57
  109. package/dist/ts4.2/room/data-channel/types.d.ts +12 -12
  110. package/dist/ts4.2/room/data-stream/compression.d.ts +49 -49
  111. package/dist/ts4.2/room/data-stream/constants.d.ts +18 -18
  112. package/dist/ts4.2/room/data-stream/incoming/IncomingDataStreamManager.d.ts +29 -29
  113. package/dist/ts4.2/room/data-stream/incoming/StreamReader.d.ts +80 -80
  114. package/dist/ts4.2/room/data-stream/outgoing/OutgoingDataStreamManager.d.ts +73 -73
  115. package/dist/ts4.2/room/data-stream/outgoing/StreamWriter.d.ts +16 -16
  116. package/dist/ts4.2/room/data-stream/outgoing/header-utils.d.ts +18 -18
  117. package/dist/ts4.2/room/data-track/LocalDataTrack.d.ts +79 -80
  118. package/dist/ts4.2/room/data-track/RemoteDataTrack.d.ts +50 -50
  119. package/dist/ts4.2/room/data-track/depacketizer.d.ts +59 -59
  120. package/dist/ts4.2/room/data-track/frame.d.ts +22 -22
  121. package/dist/ts4.2/room/data-track/handle.d.ts +27 -27
  122. package/dist/ts4.2/room/data-track/incoming/IncomingDataTrackManager.d.ts +124 -124
  123. package/dist/ts4.2/room/data-track/incoming/errors.d.ts +24 -24
  124. package/dist/ts4.2/room/data-track/incoming/pipeline.d.ts +41 -41
  125. package/dist/ts4.2/room/data-track/incoming/types.d.ts +20 -20
  126. package/dist/ts4.2/room/data-track/outgoing/OutgoingDataTrackManager.d.ts +126 -126
  127. package/dist/ts4.2/room/data-track/outgoing/errors.d.ts +74 -74
  128. package/dist/ts4.2/room/data-track/outgoing/pipeline.d.ts +23 -23
  129. package/dist/ts4.2/room/data-track/outgoing/types.d.ts +48 -48
  130. package/dist/ts4.2/room/data-track/packet/constants.d.ts +20 -20
  131. package/dist/ts4.2/room/data-track/packet/errors.d.ts +40 -40
  132. package/dist/ts4.2/room/data-track/packet/extensions.d.ts +69 -69
  133. package/dist/ts4.2/room/data-track/packet/index.d.ts +98 -98
  134. package/dist/ts4.2/room/data-track/packet/serializable.d.ts +13 -13
  135. package/dist/ts4.2/room/data-track/packetizer.d.ts +43 -43
  136. package/dist/ts4.2/room/data-track/track-interfaces.d.ts +23 -23
  137. package/dist/ts4.2/room/data-track/types.d.ts +22 -22
  138. package/dist/ts4.2/room/data-track/utils.d.ts +60 -60
  139. package/dist/ts4.2/room/debounce.d.ts +11 -11
  140. package/dist/ts4.2/room/defaults.d.ts +9 -9
  141. package/dist/ts4.2/room/errors.d.ts +180 -162
  142. package/dist/ts4.2/room/events.d.ts +638 -637
  143. package/dist/ts4.2/room/participant/LocalParticipant.d.ts +287 -287
  144. package/dist/ts4.2/room/participant/Participant.d.ts +142 -144
  145. package/dist/ts4.2/room/participant/ParticipantTrackPermission.d.ts +26 -26
  146. package/dist/ts4.2/room/participant/RemoteParticipant.d.ts +85 -86
  147. package/dist/ts4.2/room/participant/publishUtils.d.ts +53 -37
  148. package/dist/ts4.2/room/rpc/client/RpcClientManager.d.ts +43 -43
  149. package/dist/ts4.2/room/rpc/client/events.d.ts +8 -8
  150. package/dist/ts4.2/room/rpc/index.d.ts +7 -7
  151. package/dist/ts4.2/room/rpc/server/RpcServerManager.d.ts +44 -44
  152. package/dist/ts4.2/room/rpc/server/events.d.ts +8 -8
  153. package/dist/ts4.2/room/rpc/utils.d.ts +131 -131
  154. package/dist/ts4.2/room/stats.d.ts +71 -71
  155. package/dist/ts4.2/room/statsSummary.d.ts +13 -13
  156. package/dist/ts4.2/room/timers.d.ts +12 -12
  157. package/dist/ts4.2/room/token-source/TokenSource.d.ts +82 -82
  158. package/dist/ts4.2/room/token-source/types.d.ts +70 -70
  159. package/dist/ts4.2/room/token-source/utils.d.ts +8 -8
  160. package/dist/ts4.2/room/track/FrameMetadataExtractor.d.ts +19 -19
  161. package/dist/ts4.2/room/track/LocalAudioTrack.d.ts +39 -42
  162. package/dist/ts4.2/room/track/LocalTrack.d.ts +125 -125
  163. package/dist/ts4.2/room/track/LocalTrackPublication.d.ts +42 -42
  164. package/dist/ts4.2/room/track/LocalVideoTrack.d.ts +102 -93
  165. package/dist/ts4.2/room/track/RemoteAudioTrack.d.ts +55 -55
  166. package/dist/ts4.2/room/track/RemoteTrack.d.ts +38 -38
  167. package/dist/ts4.2/room/track/RemoteTrackPublication.d.ts +72 -75
  168. package/dist/ts4.2/room/track/RemoteVideoTrack.d.ts +73 -76
  169. package/dist/ts4.2/room/track/Track.d.ts +156 -166
  170. package/dist/ts4.2/room/track/TrackPublication.d.ts +75 -81
  171. package/dist/ts4.2/room/track/create.d.ts +25 -25
  172. package/dist/ts4.2/room/track/facingMode.d.ts +41 -41
  173. package/dist/ts4.2/room/track/options.d.ts +403 -403
  174. package/dist/ts4.2/room/track/processor/types.d.ts +31 -31
  175. package/dist/ts4.2/room/track/record.d.ts +13 -13
  176. package/dist/ts4.2/room/track/types.d.ts +28 -28
  177. package/dist/ts4.2/room/track/utils.d.ts +60 -47
  178. package/dist/ts4.2/room/types.d.ts +127 -127
  179. package/dist/ts4.2/room/utils.d.ts +246 -180
  180. package/dist/ts4.2/test/MockMediaStreamTrack.d.ts +26 -26
  181. package/dist/ts4.2/test/compressionStreamStubs.d.ts +12 -0
  182. package/dist/ts4.2/test/mocks.d.ts +12 -12
  183. package/dist/ts4.2/test/promiseState.d.ts +12 -12
  184. package/dist/ts4.2/test/signalToken.d.ts +26 -26
  185. package/dist/ts4.2/type-polyfills/non-shared-typed-arrays.d.ts +2 -2
  186. package/dist/ts4.2/utils/AsyncQueue.d.ts +23 -23
  187. package/dist/ts4.2/utils/TypedPromise.d.ts +17 -17
  188. package/dist/ts4.2/utils/abort-signal-polyfill.d.ts +13 -13
  189. package/dist/ts4.2/utils/browserParser.d.ts +13 -13
  190. package/dist/ts4.2/utils/camelToSnakeCase.d.ts +8 -8
  191. package/dist/ts4.2/utils/cloneDeep.d.ts +2 -2
  192. package/dist/ts4.2/utils/dataPacketBuffer.d.ts +34 -34
  193. package/dist/ts4.2/utils/deferrable-map.d.ts +32 -32
  194. package/dist/ts4.2/utils/machineInspector.d.ts +54 -54
  195. package/dist/ts4.2/utils/serializer.d.ts +48 -48
  196. package/dist/ts4.2/utils/subscribeToEvents.d.ts +15 -15
  197. package/dist/ts4.2/utils/ttlmap.d.ts +20 -20
  198. package/dist/ts4.2/version.d.ts +15 -15
  199. package/package.json +5 -4
  200. package/src/api/SignalClient.e2e.test.ts +1 -3
  201. package/src/api/SignalClient.test.ts +160 -10
  202. package/src/api/SignalClient.ts +75 -54
  203. package/src/api/WebSocketStream.ts +3 -8
  204. package/src/api/utils.ts +10 -0
  205. package/src/e2ee/E2eeManager.test.ts +196 -0
  206. package/src/e2ee/E2eeManager.ts +114 -19
  207. package/src/e2ee/types.ts +19 -1
  208. package/src/e2ee/worker/DataCryptor.ts +2 -1
  209. package/src/e2ee/worker/ErrorRateLimiter.test.ts +53 -0
  210. package/src/e2ee/worker/ErrorRateLimiter.ts +52 -0
  211. package/src/e2ee/worker/FrameCryptor.ts +20 -70
  212. package/src/e2ee/worker/e2ee.worker.ts +34 -11
  213. package/src/logger.ts +22 -0
  214. package/src/options.ts +16 -0
  215. package/src/room/PCTransport.test.ts +183 -7
  216. package/src/room/PCTransport.ts +197 -36
  217. package/src/room/PCTransportManager.ts +3 -1
  218. package/src/room/RTCEngine.test.ts +84 -0
  219. package/src/room/RTCEngine.ts +52 -12
  220. package/src/room/Room.test.ts +32 -6
  221. package/src/room/Room.ts +27 -7
  222. package/src/room/data-stream/incoming/IncomingDataStreamManager.test.ts +16 -20
  223. package/src/room/data-stream/incoming/IncomingDataStreamManager.ts +5 -5
  224. package/src/room/data-stream/outgoing/OutgoingDataStreamManager.test.ts +60 -39
  225. package/src/room/data-stream/outgoing/OutgoingDataStreamManager.ts +4 -4
  226. package/src/room/defaults.ts +1 -0
  227. package/src/room/errors.test.ts +36 -0
  228. package/src/room/errors.ts +27 -0
  229. package/src/room/events.ts +2 -1
  230. package/src/room/participant/LocalParticipant.ts +30 -14
  231. package/src/room/participant/publishUtils.test.ts +133 -0
  232. package/src/room/participant/publishUtils.ts +54 -38
  233. package/src/room/rpc/client/RpcClientManager.test.ts +51 -0
  234. package/src/room/rpc/client/RpcClientManager.ts +32 -15
  235. package/src/room/track/LocalTrack.ts +18 -7
  236. package/src/room/track/LocalVideoTrack.ts +25 -8
  237. package/src/room/track/RemoteAudioTrack.ts +3 -3
  238. package/src/room/track/RemoteVideoTrack.test.ts +210 -0
  239. package/src/room/track/RemoteVideoTrack.ts +29 -3
  240. package/src/room/track/options.ts +1 -1
  241. package/src/room/track/utils.test.ts +201 -2
  242. package/src/room/track/utils.ts +88 -0
  243. package/src/room/utils.test.ts +211 -0
  244. package/src/room/utils.ts +129 -0
  245. package/src/test/compressionStreamStubs.ts +53 -0
@@ -1,226 +1,209 @@
1
- import type TypedEventEmitter from 'typed-emitter';
2
- import type { FrameMetadataPublishOptions } from '../../frameMetadata/types';
3
- import type { VideoCodec } from '../../room/track/options';
4
- import type { NonSharedUint8Array } from '../../type-polyfills/non-shared-typed-arrays';
5
- import type { CryptorCallbacks } from '../events';
6
- import type { KeyProviderOptions } from '../types';
7
- import type { ParticipantKeyHandler } from './ParticipantKeyHandler';
8
- export declare const encryptionEnabledMap: Map<string, boolean>;
9
- export interface FrameCryptorConstructor {
10
- new (opts?: unknown): BaseFrameCryptor;
11
- }
12
- export interface TransformerInfo {
13
- readable: ReadableStream;
14
- writable: WritableStream;
15
- transformer: TransformStream;
16
- trackId: string;
17
- symbol: symbol;
18
- }
19
- declare const BaseFrameCryptor_base: new () => TypedEventEmitter<CryptorCallbacks>;
20
- export declare class BaseFrameCryptor extends BaseFrameCryptor_base {
21
- protected encodeFunction(encodedFrame: RTCEncodedVideoFrame | RTCEncodedAudioFrame, controller: TransformStreamDefaultController): Promise<any>;
22
- protected decodeFunction(encodedFrame: RTCEncodedVideoFrame | RTCEncodedAudioFrame, controller: TransformStreamDefaultController): Promise<any>;
23
- }
24
- /**
25
- * Cryptor is responsible for en-/decrypting media frames.
26
- * Each Cryptor instance is responsible for en-/decrypting a single mediaStreamTrack.
27
- */
28
- export declare class FrameCryptor extends BaseFrameCryptor {
29
- private sendCounts;
30
- private participantIdentity;
31
- private trackId;
32
- private keys;
33
- private videoCodec?;
34
- private rtpMap;
35
- private keyProviderOptions;
36
- /**
37
- * used for detecting server injected unencrypted frames
38
- */
39
- private sifTrailer;
40
- private detectedCodec?;
41
- private currentTransform?;
42
- /**
43
- * The encoded streams this cryptor was last set up with, retained beyond the
44
- * lifetime of {@link currentTransform}.
45
- *
46
- * The main thread transfers a receiver's encoded streams to the worker once and
47
- * cannot transfer them again (a transferred stream is locked), and
48
- * `createEncodedStreams()` may only be called once per receiver. So when a
49
- * transceiver is reused, or when a pipe dies underneath us, re-establishing the
50
- * transform is only possible from here. See {@link ensureTransform}.
51
- */
52
- private retainedStreams?;
53
- /**
54
- * Whether the subscribed track advertises packet trailer features.
55
- * When false, we skip the per-frame trailer extraction path entirely
56
- * on decode to avoid unnecessary work on tracks that don't use it.
57
- */
58
- private hasFrameMetadata;
59
- private frameMetadataOpts?;
60
- private frameMetadataFrameId;
61
- /**
62
- * Throttling mechanism for decryption errors to prevent memory leaks
63
- */
64
- private lastErrorTimestamp;
65
- private errorCounts;
66
- private readonly ERROR_THROTTLE_MS;
67
- private readonly MAX_ERRORS_PER_MINUTE;
68
- private readonly ERROR_WINDOW_MS;
69
- private undecryptedTrackTimeout?;
70
- /** grace period for a teardown or a resubscribe to land before we report a stalled track */
71
- private readonly UNDECRYPTED_TRACK_GRACE_MS;
72
- /**
73
- * Tracks (participant, trackId, payloadType) tuples for which we've already logged a NALU
74
- * fallback, so a persistent bad state doesn't flood the console (Firefox doesn't filter debug).
75
- */
76
- private loggedNALUFallbacks;
77
- constructor(opts: {
78
- keys: ParticipantKeyHandler;
79
- participantIdentity: string;
80
- keyProviderOptions: KeyProviderOptions;
81
- sifTrailer?: NonSharedUint8Array;
82
- });
83
- private get logContext();
84
- /**
85
- * Assign a different participant to the cryptor.
86
- * useful for transceiver re-use
87
- * @param id
88
- * @param keys
89
- */
90
- setParticipant(id: string, keys: ParticipantKeyHandler): void;
91
- unsetParticipant(): void;
92
- isEnabled(): boolean | undefined;
93
- getParticipantIdentity(): string | undefined;
94
- getTrackId(): string | undefined;
95
- /**
96
- * Re-point this cryptor at a new trackId, keeping its (already transferred)
97
- * encoded streams. Used when a transceiver is reused for a new track.
98
- */
99
- setTrackId(trackId: string): void;
100
- hasActiveTransform(): boolean;
101
- /**
102
- * A track that is subscribed and known to be encrypted, but has no transform to
103
- * decrypt it, will never produce a decodable frame again. That state used to be
104
- * completely silent (a black tile and endless PLIs), so report it.
105
- *
106
- * Deferred, because on teardown the encoded streams routinely close before the
107
- * 'removeTransform' message arrives -- checking immediately would cry wolf on
108
- * every unsubscribe.
109
- *
110
- * Only meaningful while decoding: a sender's pipe closing on unpublish is
111
- * routine and has no 'removeTransform' equivalent to quiet it down.
112
- */
113
- private scheduleUndecryptedTrackWatchdog;
114
- /**
115
- * Re-establish the transform if it is gone while we still own the encoded
116
- * streams, e.g. after a pipe died on its own (the swallowed
117
- * 'Destination stream closed') or when a reused transceiver never got a new
118
- * pipeline. Without this the frames pile up in a readable nobody reads and the
119
- * decoder starves, which shows up as a permanently black tile.
120
- */
121
- ensureTransform(): boolean;
122
- /**
123
- * Update the video codec used by the mediaStreamTrack
124
- * @param codec
125
- */
126
- setVideoCodec(codec: VideoCodec): void;
127
- /**
128
- * rtp payload type map used for figuring out codec of payload type when encoding
129
- * @param map
130
- */
131
- setRtpMap(map: Map<number, VideoCodec>): void;
132
- /**
133
- * Sets whether the track associated with this cryptor carries packet
134
- * trailer data. When false, {@link decodeFunction} skips the per-frame
135
- * trailer extraction branch entirely.
136
- */
137
- setHasFrameMetadata(hasFrameMetadata: boolean): void;
138
- setFrameMetadataOpts(frameMetadata?: FrameMetadataPublishOptions): void;
139
- setupTransform(operation: 'encode' | 'decode', readable: ReadableStream<RTCEncodedVideoFrame | RTCEncodedAudioFrame>, writable: WritableStream<RTCEncodedVideoFrame | RTCEncodedAudioFrame>, trackId: string, codec?: VideoCodec, frameMetadata?: FrameMetadataPublishOptions): boolean;
140
- setSifTrailer(trailer: NonSharedUint8Array): void;
141
- /**
142
- * Checks if we should emit an error based on throttling rules to prevent memory leaks
143
- * @param errorKey - unique key identifying the error context
144
- * @returns true if the error should be emitted, false otherwise
145
- */
146
- private shouldEmitError;
147
- /**
148
- * Emits a throttled error to prevent memory leaks from repeated decryption failures
149
- * @param error - the CryptorError to emit
150
- */
151
- private emitThrottledError;
152
- /**
153
- * Function that will be injected in a stream and will encrypt the given encoded frames.
154
- *
155
- * @param {RTCEncodedVideoFrame|RTCEncodedAudioFrame} encodedFrame - Encoded video frame.
156
- * @param {TransformStreamDefaultController} controller - TransportStreamController.
157
- *
158
- * The VP8 payload descriptor described in
159
- * https://tools.ietf.org/html/rfc7741#section-4.2
160
- * is part of the RTP packet and not part of the frame and is not controllable by us.
161
- * This is fine as the SFU keeps having access to it for routing.
162
- *
163
- * The encrypted frame is formed as follows:
164
- * 1) Find unencrypted byte length, depending on the codec, frame type and kind.
165
- * 2) Form the GCM IV for the frame as described above.
166
- * 3) Encrypt the rest of the frame using AES-GCM.
167
- * 4) Allocate space for the encrypted frame.
168
- * 5) Copy the unencrypted bytes to the start of the encrypted frame.
169
- * 6) Append the ciphertext to the encrypted frame.
170
- * 7) Append the IV.
171
- * 8) Append a single byte for the key identifier.
172
- * 9) Enqueue the encrypted frame for sending.
173
- */
174
- protected encodeFunction(encodedFrame: RTCEncodedVideoFrame | RTCEncodedAudioFrame, controller: TransformStreamDefaultController): Promise<void>;
175
- private appendFrameMetadata;
176
- /**
177
- * Function that will be injected in a stream and will decrypt the given encoded frames.
178
- *
179
- * @param {RTCEncodedVideoFrame|RTCEncodedAudioFrame} encodedFrame - Encoded video frame.
180
- * @param {TransformStreamDefaultController} controller - TransportStreamController.
181
- */
182
- protected decodeFunction(encodedFrame: RTCEncodedVideoFrame | RTCEncodedAudioFrame, controller: TransformStreamDefaultController): Promise<void>;
183
- /**
184
- * Function that will decrypt the given encoded frame. If the decryption fails, it will
185
- * ratchet the key for up to RATCHET_WINDOW_SIZE times.
186
- */
187
- private decryptFrame;
188
- /**
189
- * Construct the IV used for AES-GCM and sent (in plain) with the packet similar to
190
- * https://tools.ietf.org/html/rfc7714#section-8.1
191
- * It concatenates
192
- * - the 32 bit synchronization source (SSRC) given on the encoded frame,
193
- * - the 32 bit rtp timestamp given on the encoded frame,
194
- * - a send counter that is specific to the SSRC. Starts at a random number.
195
- * The send counter is essentially the pictureId but we currently have to implement this ourselves.
196
- * There is no XOR with a salt. Note that this IV leaks the SSRC to the receiver but since this is
197
- * randomly generated and SFUs may not rewrite this is considered acceptable.
198
- * The SSRC is used to allow demultiplexing multiple streams with the same key, as described in
199
- * https://tools.ietf.org/html/rfc3711#section-4.1.1
200
- * The RTP timestamp is 32 bits and advances by the codec clock rate (90khz for video, 48khz for
201
- * opus audio) every second. For video it rolls over roughly every 13 hours.
202
- * The send counter will advance at the frame rate (30fps for video, 50fps for 20ms opus audio)
203
- * every second. It will take a long time to roll over.
204
- *
205
- * See also https://developer.mozilla.org/en-US/docs/Web/API/AesGcmParams
206
- */
207
- private makeIV;
208
- private getUnencryptedBytes;
209
- /**
210
- * Logs a NALU processing fallback at most once per (participant, trackId, payloadType) tuple,
211
- * so a persistent bad state doesn't flood the console (Firefox doesn't filter debug).
212
- */
213
- private logNALUFallbackOnce;
214
- /**
215
- * inspects frame mimetype if available. falls back to payloadtype and maps it to the codec specified in rtpMap
216
- */
217
- private getVideoCodec;
218
- }
219
- /**
220
- * we use a magic frame trailer to detect whether a frame is injected
221
- * by the livekit server and thus to be treated as unencrypted
222
- * @internal
223
- */
224
- export declare function isFrameServerInjected(frameData: ArrayBuffer, trailerBytes: NonSharedUint8Array): boolean;
225
- export {};
226
- //# sourceMappingURL=FrameCryptor.d.ts.map
1
+ import type TypedEventEmitter from 'typed-emitter';
2
+ import type { FrameMetadataPublishOptions } from '../../frameMetadata/types';
3
+ import type { VideoCodec } from '../../room/track/options';
4
+ import type { NonSharedUint8Array } from '../../type-polyfills/non-shared-typed-arrays';
5
+ import type { CryptorCallbacks } from '../events';
6
+ import type { KeyProviderOptions } from '../types';
7
+ import type { ParticipantKeyHandler } from './ParticipantKeyHandler';
8
+ export declare const encryptionEnabledMap: Map<string, boolean>;
9
+ export interface FrameCryptorConstructor {
10
+ new (opts?: unknown): BaseFrameCryptor;
11
+ }
12
+ export interface TransformerInfo {
13
+ readable: ReadableStream;
14
+ writable: WritableStream;
15
+ transformer: TransformStream;
16
+ trackId: string;
17
+ symbol: symbol;
18
+ }
19
+ declare const BaseFrameCryptor_base: new () => TypedEventEmitter<CryptorCallbacks>;
20
+ export declare class BaseFrameCryptor extends BaseFrameCryptor_base {
21
+ protected encodeFunction(encodedFrame: RTCEncodedVideoFrame | RTCEncodedAudioFrame, controller: TransformStreamDefaultController): Promise<any>;
22
+ protected decodeFunction(encodedFrame: RTCEncodedVideoFrame | RTCEncodedAudioFrame, controller: TransformStreamDefaultController): Promise<any>;
23
+ }
24
+ /**
25
+ * Cryptor is responsible for en-/decrypting media frames.
26
+ * Each Cryptor instance is responsible for en-/decrypting a single mediaStreamTrack.
27
+ */
28
+ export declare class FrameCryptor extends BaseFrameCryptor {
29
+ private sendCounts;
30
+ private participantIdentity;
31
+ private trackId;
32
+ private keys;
33
+ private videoCodec?;
34
+ private rtpMap;
35
+ private keyProviderOptions;
36
+ /**
37
+ * used for detecting server injected unencrypted frames
38
+ */
39
+ private sifTrailer;
40
+ private detectedCodec?;
41
+ private currentTransform?;
42
+ /**
43
+ * The encoded streams this cryptor was last set up with, retained beyond the
44
+ * lifetime of {@link currentTransform}.
45
+ *
46
+ * The main thread transfers a receiver's encoded streams to the worker once and
47
+ * cannot transfer them again (a transferred stream is locked), and
48
+ * `createEncodedStreams()` may only be called once per receiver. So when a
49
+ * transceiver is reused, or when a pipe dies underneath us, re-establishing the
50
+ * transform is only possible from here. See {@link ensureTransform}.
51
+ */
52
+ private retainedStreams?;
53
+ /**
54
+ * Whether the subscribed track advertises packet trailer features.
55
+ * When false, we skip the per-frame trailer extraction path entirely
56
+ * on decode to avoid unnecessary work on tracks that don't use it.
57
+ */
58
+ private hasFrameMetadata;
59
+ private frameMetadataOpts?;
60
+ private frameMetadataFrameId;
61
+ private errorLimiter;
62
+ private undecryptedTrackTimeout?;
63
+ /** grace period for a teardown or a resubscribe to land before we report a stalled track */
64
+ private readonly UNDECRYPTED_TRACK_GRACE_MS;
65
+ /**
66
+ * Tracks (participant, trackId, payloadType) tuples for which we've already logged a NALU
67
+ * fallback, so a persistent bad state doesn't flood the console (Firefox doesn't filter debug).
68
+ */
69
+ private loggedNALUFallbacks;
70
+ constructor(opts: {
71
+ keys: ParticipantKeyHandler;
72
+ participantIdentity: string;
73
+ keyProviderOptions: KeyProviderOptions;
74
+ sifTrailer?: NonSharedUint8Array;
75
+ });
76
+ private get logContext();
77
+ /**
78
+ * Assign a different participant to the cryptor.
79
+ * useful for transceiver re-use
80
+ * @param id
81
+ * @param keys
82
+ */
83
+ setParticipant(id: string, keys: ParticipantKeyHandler): void;
84
+ unsetParticipant(): void;
85
+ isEnabled(): boolean | undefined;
86
+ getParticipantIdentity(): string | undefined;
87
+ getTrackId(): string | undefined;
88
+ /**
89
+ * Re-point this cryptor at a new trackId, keeping its (already transferred)
90
+ * encoded streams. Used when a transceiver is reused for a new track.
91
+ */
92
+ setTrackId(trackId: string): void;
93
+ hasActiveTransform(): boolean;
94
+ /**
95
+ * A track that is subscribed and known to be encrypted, but has no transform to
96
+ * decrypt it, will never produce a decodable frame again. That state used to be
97
+ * completely silent (a black tile and endless PLIs), so report it.
98
+ *
99
+ * Deferred, because on teardown the encoded streams routinely close before the
100
+ * 'removeTransform' message arrives -- checking immediately would cry wolf on
101
+ * every unsubscribe.
102
+ *
103
+ * Only meaningful while decoding: a sender's pipe closing on unpublish is
104
+ * routine and has no 'removeTransform' equivalent to quiet it down.
105
+ */
106
+ private scheduleUndecryptedTrackWatchdog;
107
+ /**
108
+ * Re-establish the transform if it is gone while we still own the encoded
109
+ * streams, e.g. after a pipe died on its own (the swallowed
110
+ * 'Destination stream closed') or when a reused transceiver never got a new
111
+ * pipeline. Without this the frames pile up in a readable nobody reads and the
112
+ * decoder starves, which shows up as a permanently black tile.
113
+ */
114
+ ensureTransform(): boolean;
115
+ /**
116
+ * Update the video codec used by the mediaStreamTrack
117
+ * @param codec
118
+ */
119
+ setVideoCodec(codec: VideoCodec): void;
120
+ /**
121
+ * rtp payload type map used for figuring out codec of payload type when encoding
122
+ * @param map
123
+ */
124
+ setRtpMap(map: Map<number, VideoCodec>): void;
125
+ /**
126
+ * Sets whether the track associated with this cryptor carries packet
127
+ * trailer data. When false, {@link decodeFunction} skips the per-frame
128
+ * trailer extraction branch entirely.
129
+ */
130
+ setHasFrameMetadata(hasFrameMetadata: boolean): void;
131
+ setFrameMetadataOpts(frameMetadata?: FrameMetadataPublishOptions): void;
132
+ setupTransform(operation: 'encode' | 'decode', readable: ReadableStream<RTCEncodedVideoFrame | RTCEncodedAudioFrame>, writable: WritableStream<RTCEncodedVideoFrame | RTCEncodedAudioFrame>, trackId: string, codec?: VideoCodec, frameMetadata?: FrameMetadataPublishOptions): boolean;
133
+ setSifTrailer(trailer: NonSharedUint8Array): void;
134
+ private emitThrottledError;
135
+ /**
136
+ * Function that will be injected in a stream and will encrypt the given encoded frames.
137
+ *
138
+ * @param {RTCEncodedVideoFrame|RTCEncodedAudioFrame} encodedFrame - Encoded video frame.
139
+ * @param {TransformStreamDefaultController} controller - TransportStreamController.
140
+ *
141
+ * The VP8 payload descriptor described in
142
+ * https://tools.ietf.org/html/rfc7741#section-4.2
143
+ * is part of the RTP packet and not part of the frame and is not controllable by us.
144
+ * This is fine as the SFU keeps having access to it for routing.
145
+ *
146
+ * The encrypted frame is formed as follows:
147
+ * 1) Find unencrypted byte length, depending on the codec, frame type and kind.
148
+ * 2) Form the GCM IV for the frame as described above.
149
+ * 3) Encrypt the rest of the frame using AES-GCM.
150
+ * 4) Allocate space for the encrypted frame.
151
+ * 5) Copy the unencrypted bytes to the start of the encrypted frame.
152
+ * 6) Append the ciphertext to the encrypted frame.
153
+ * 7) Append the IV.
154
+ * 8) Append a single byte for the key identifier.
155
+ * 9) Enqueue the encrypted frame for sending.
156
+ */
157
+ protected encodeFunction(encodedFrame: RTCEncodedVideoFrame | RTCEncodedAudioFrame, controller: TransformStreamDefaultController): Promise<void>;
158
+ private appendFrameMetadata;
159
+ /**
160
+ * Function that will be injected in a stream and will decrypt the given encoded frames.
161
+ *
162
+ * @param {RTCEncodedVideoFrame|RTCEncodedAudioFrame} encodedFrame - Encoded video frame.
163
+ * @param {TransformStreamDefaultController} controller - TransportStreamController.
164
+ */
165
+ protected decodeFunction(encodedFrame: RTCEncodedVideoFrame | RTCEncodedAudioFrame, controller: TransformStreamDefaultController): Promise<void>;
166
+ /**
167
+ * Function that will decrypt the given encoded frame. If the decryption fails, it will
168
+ * ratchet the key for up to RATCHET_WINDOW_SIZE times.
169
+ */
170
+ private decryptFrame;
171
+ /**
172
+ * Construct the IV used for AES-GCM and sent (in plain) with the packet similar to
173
+ * https://tools.ietf.org/html/rfc7714#section-8.1
174
+ * It concatenates
175
+ * - the 32 bit synchronization source (SSRC) given on the encoded frame,
176
+ * - the 32 bit rtp timestamp given on the encoded frame,
177
+ * - a send counter that is specific to the SSRC. Starts at a random number.
178
+ * The send counter is essentially the pictureId but we currently have to implement this ourselves.
179
+ * There is no XOR with a salt. Note that this IV leaks the SSRC to the receiver but since this is
180
+ * randomly generated and SFUs may not rewrite this is considered acceptable.
181
+ * The SSRC is used to allow demultiplexing multiple streams with the same key, as described in
182
+ * https://tools.ietf.org/html/rfc3711#section-4.1.1
183
+ * The RTP timestamp is 32 bits and advances by the codec clock rate (90khz for video, 48khz for
184
+ * opus audio) every second. For video it rolls over roughly every 13 hours.
185
+ * The send counter will advance at the frame rate (30fps for video, 50fps for 20ms opus audio)
186
+ * every second. It will take a long time to roll over.
187
+ *
188
+ * See also https://developer.mozilla.org/en-US/docs/Web/API/AesGcmParams
189
+ */
190
+ private makeIV;
191
+ private getUnencryptedBytes;
192
+ /**
193
+ * Logs a NALU processing fallback at most once per (participant, trackId, payloadType) tuple,
194
+ * so a persistent bad state doesn't flood the console (Firefox doesn't filter debug).
195
+ */
196
+ private logNALUFallbackOnce;
197
+ /**
198
+ * inspects frame mimetype if available. falls back to payloadtype and maps it to the codec specified in rtpMap
199
+ */
200
+ private getVideoCodec;
201
+ }
202
+ /**
203
+ * we use a magic frame trailer to detect whether a frame is injected
204
+ * by the livekit server and thus to be treated as unencrypted
205
+ * @internal
206
+ */
207
+ export declare function isFrameServerInjected(frameData: ArrayBuffer, trailerBytes: NonSharedUint8Array): boolean;
208
+ export {};
209
+ //# sourceMappingURL=FrameCryptor.d.ts.map
@@ -1,84 +1,81 @@
1
- import type TypedEventEmitter from 'typed-emitter';
2
- import type { ParticipantKeyHandlerCallbacks } from '../events';
3
- import type { KeyProviderOptions, KeySet, RatchetResult } from '../types';
4
- declare const ParticipantKeyHandler_base: new () => TypedEventEmitter<ParticipantKeyHandlerCallbacks>;
5
- /**
6
- * ParticipantKeyHandler is responsible for providing a cryptor instance with the
7
- * en-/decryption key of a participant. It assumes that all tracks of a specific participant
8
- * are encrypted with the same key.
9
- * Additionally it exposes a method to ratchet a key which can be used by the cryptor either automatically
10
- * if decryption fails or can be triggered manually on both sender and receiver side.
11
- *
12
- */
13
- export declare class ParticipantKeyHandler extends ParticipantKeyHandler_base {
14
- private currentKeyIndex;
15
- private cryptoKeyRing;
16
- private decryptionFailureCounts;
17
- private ratchetPromiseMap;
18
- readonly participantIdentity: string;
19
- /** @internal */
20
- readonly keyProviderOptions: KeyProviderOptions;
21
- /**
22
- * true if the current key has not been marked as invalid
23
- */
24
- get hasValidKey(): boolean;
25
- constructor(participantIdentity: string, keyProviderOptions: KeyProviderOptions);
26
- /**
27
- * Returns true if the key at the given index is marked as invalid.
28
- *
29
- * @param keyIndex the index of the key
30
- */
31
- hasInvalidKeyAtIndex(keyIndex: number): boolean;
32
- /**
33
- * Informs the key handler that a decryption failure occurred for an encryption key.
34
- * @internal
35
- * @param keyIndex the key index for which the failure occurred. Defaults to the current key index.
36
- */
37
- decryptionFailure(keyIndex?: number): void;
38
- /**
39
- * Informs the key handler that a frame was successfully decrypted using an encryption key.
40
- * @internal
41
- * @param keyIndex the key index for which the success occurred. Defaults to the current key index.
42
- */
43
- decryptionSuccess(keyIndex?: number): void;
44
- /**
45
- * Call this after user initiated ratchet or a new key has been set in order to make sure to mark potentially
46
- * invalid keys as valid again
47
- *
48
- * @param keyIndex the index of the key. Defaults to the current key index.
49
- */
50
- resetKeyStatus(keyIndex?: number): void;
51
- /**
52
- * Ratchets the current key (or the one at keyIndex if provided) and
53
- * returns the ratcheted material
54
- * if `setKey` is true (default), it will also set the ratcheted key directly on the crypto key ring
55
- * @param keyIndex
56
- * @param setKey
57
- */
58
- ratchetKey(keyIndex?: number, setKey?: boolean): Promise<RatchetResult>;
59
- /**
60
- * takes in a key material with `deriveBits` and `deriveKey` set as key usages
61
- * and derives encryption keys from the material and sets it on the key ring buffer
62
- * together with the material
63
- * also resets the valid key property and updates the currentKeyIndex
64
- */
65
- setKey(material: CryptoKey, keyIndex?: number, updateCurrentKeyIndex?: boolean): Promise<void>;
66
- /**
67
- * takes in a key material with `deriveBits` and `deriveKey` set as key usages
68
- * and derives encryption keys from the material and sets it on the key ring buffers
69
- * together with the material
70
- * also updates the currentKeyIndex
71
- */
72
- setKeyFromMaterial(material: CryptoKey, keyIndex: number, ratchetedResult?: RatchetResult | null, updateCurrentKeyIndex?: boolean): Promise<void>;
73
- setKeySet(keySet: KeySet, keyIndex: number, ratchetedResult?: RatchetResult | null): void;
74
- setCurrentKeyIndex(index: number): Promise<void>;
75
- getCurrentKeyIndex(): number;
76
- /**
77
- * returns currently used KeySet or the one at `keyIndex` if provided
78
- * @param keyIndex
79
- * @returns
80
- */
81
- getKeySet(keyIndex?: number): KeySet | undefined;
82
- }
83
- export {};
84
- //# sourceMappingURL=ParticipantKeyHandler.d.ts.map
1
+ import type TypedEventEmitter from 'typed-emitter';
2
+ import type { ParticipantKeyHandlerCallbacks } from '../events';
3
+ import type { KeyProviderOptions, KeySet, RatchetResult } from '../types';
4
+ declare const ParticipantKeyHandler_base: new () => TypedEventEmitter<ParticipantKeyHandlerCallbacks>;
5
+ /**
6
+ * ParticipantKeyHandler is responsible for providing a cryptor instance with the
7
+ * en-/decryption key of a participant. It assumes that all tracks of a specific participant
8
+ * are encrypted with the same key.
9
+ * Additionally it exposes a method to ratchet a key which can be used by the cryptor either automatically
10
+ * if decryption fails or can be triggered manually on both sender and receiver side.
11
+ *
12
+ */
13
+ export declare class ParticipantKeyHandler extends ParticipantKeyHandler_base {
14
+ private currentKeyIndex;
15
+ private cryptoKeyRing;
16
+ private decryptionFailureCounts;
17
+ private ratchetPromiseMap;
18
+ readonly participantIdentity: string;
19
+ /** @internal */
20
+ readonly keyProviderOptions: KeyProviderOptions;
21
+ get hasValidKey(): boolean;
22
+ constructor(participantIdentity: string, keyProviderOptions: KeyProviderOptions);
23
+ /**
24
+ * Returns true if the key at the given index is marked as invalid.
25
+ *
26
+ * @param keyIndex the index of the key
27
+ */
28
+ hasInvalidKeyAtIndex(keyIndex: number): boolean;
29
+ /**
30
+ * Informs the key handler that a decryption failure occurred for an encryption key.
31
+ * @internal
32
+ * @param keyIndex the key index for which the failure occurred. Defaults to the current key index.
33
+ */
34
+ decryptionFailure(keyIndex?: number): void;
35
+ /**
36
+ * Informs the key handler that a frame was successfully decrypted using an encryption key.
37
+ * @internal
38
+ * @param keyIndex the key index for which the success occurred. Defaults to the current key index.
39
+ */
40
+ decryptionSuccess(keyIndex?: number): void;
41
+ /**
42
+ * Call this after user initiated ratchet or a new key has been set in order to make sure to mark potentially
43
+ * invalid keys as valid again
44
+ *
45
+ * @param keyIndex the index of the key. Defaults to the current key index.
46
+ */
47
+ resetKeyStatus(keyIndex?: number): void;
48
+ /**
49
+ * Ratchets the current key (or the one at keyIndex if provided) and
50
+ * returns the ratcheted material
51
+ * if `setKey` is true (default), it will also set the ratcheted key directly on the crypto key ring
52
+ * @param keyIndex
53
+ * @param setKey
54
+ */
55
+ ratchetKey(keyIndex?: number, setKey?: boolean): Promise<RatchetResult>;
56
+ /**
57
+ * takes in a key material with `deriveBits` and `deriveKey` set as key usages
58
+ * and derives encryption keys from the material and sets it on the key ring buffer
59
+ * together with the material
60
+ * also resets the valid key property and updates the currentKeyIndex
61
+ */
62
+ setKey(material: CryptoKey, keyIndex?: number, updateCurrentKeyIndex?: boolean): Promise<void>;
63
+ /**
64
+ * takes in a key material with `deriveBits` and `deriveKey` set as key usages
65
+ * and derives encryption keys from the material and sets it on the key ring buffers
66
+ * together with the material
67
+ * also updates the currentKeyIndex
68
+ */
69
+ setKeyFromMaterial(material: CryptoKey, keyIndex: number, ratchetedResult?: RatchetResult | null, updateCurrentKeyIndex?: boolean): Promise<void>;
70
+ setKeySet(keySet: KeySet, keyIndex: number, ratchetedResult?: RatchetResult | null): void;
71
+ setCurrentKeyIndex(index: number): Promise<void>;
72
+ getCurrentKeyIndex(): number;
73
+ /**
74
+ * returns currently used KeySet or the one at `keyIndex` if provided
75
+ * @param keyIndex
76
+ * @returns
77
+ */
78
+ getKeySet(keyIndex?: number): KeySet | undefined;
79
+ }
80
+ export {};
81
+ //# sourceMappingURL=ParticipantKeyHandler.d.ts.map
@@ -1,2 +1,2 @@
1
- export {};
2
- //# sourceMappingURL=e2ee.worker.d.ts.map
1
+ export {};
2
+ //# sourceMappingURL=e2ee.worker.d.ts.map