@@ -16,7 +16,7 @@ import type { BaseKeyProvider } from './KeyProvider';
1616import { E2EE_FLAG } from './constants' ;
1717import { type E2EEManagerCallbacks , EncryptionEvent , KeyProviderEvent } from './events' ;
1818import type {
19- E2EEOptions ,
19+ E2EEManagerOptions ,
2020 E2EEWorkerMessage ,
2121 EnableMessage ,
2222 EncodeMessage ,
@@ -31,10 +31,21 @@ import type {
3131} from './types' ;
3232import { isE2EESupported , isScriptTransformSupported } from './utils' ;
3333
34+ export interface BaseE2EEManager {
35+ setup ( room : Room ) : void ;
36+ setupEngine ( engine : RTCEngine ) : void ;
37+ setParticipantCryptorEnabled ( enabled : boolean , participantIdentity : string ) : void ;
38+ setSifTrailer ( trailer : Uint8Array ) : void ;
39+ on < E extends keyof E2EEManagerCallbacks > ( event : E , listener : E2EEManagerCallbacks [ E ] ) : this;
40+ }
41+
3442/**
3543 * @experimental
3644 */
37- export class E2EEManager extends ( EventEmitter as new ( ) => TypedEventEmitter < E2EEManagerCallbacks > ) {
45+ export class E2EEManager
46+ extends ( EventEmitter as new ( ) => TypedEventEmitter < E2EEManagerCallbacks > )
47+ implements BaseE2EEManager
48+ {
3849 protected worker : Worker ;
3950
4051 protected room ?: Room ;
@@ -43,7 +54,7 @@ export class E2EEManager extends (EventEmitter as new () => TypedEventEmitter<E2
4354
4455 private keyProvider : BaseKeyProvider ;
4556
46- constructor ( options : E2EEOptions ) {
57+ constructor ( options : E2EEManagerOptions ) {
4758 super ( ) ;
4859 this . keyProvider = options . keyProvider ;
4960 this . worker = options . worker ;
0 commit comments