@@ -18,13 +18,34 @@ import { MembershipConfig } from "./MatrixRTCSession.ts";
18
18
* @internal
19
19
*/
20
20
export interface IMembershipManager {
21
+ /**
22
+ * If we are trying to join the session.
23
+ * It does not reflect if the room state is already configures to represent us being joined.
24
+ * It only means that the Manager is running.
25
+ * @returns true if we intend to be participating in the MatrixRTC session
26
+ */
21
27
isJoined ( ) : boolean ;
28
+ /**
29
+ * Start sending all necessary events to make this user participant in the RTC session.
30
+ * @param fociPreferred the list of preferred foci to use in the joined RTC membership event.
31
+ * @param fociActive the active focus to use in the joined RTC membership event.
32
+ */
22
33
join ( fociPreferred : Focus [ ] , fociActive ?: Focus ) : void ;
34
+ /**
35
+ * Send all necessary events to make this user leave the RTC session.
36
+ * @param timeout the maximum duration in ms until the promise is forced to resolve.
37
+ * @returns It resolves with true in case the leave was sent successfully.
38
+ * It resolves with false in case we hit the timeout before sending successfully.
39
+ */
23
40
leave ( timeout : number | undefined ) : Promise < boolean > ;
24
41
/**
25
- * call this if the MatrixRTC session members have changed
42
+ * Call this if the MatrixRTC session members have changed.
26
43
*/
27
44
onRTCSessionMemberUpdate ( memberships : CallMembership [ ] ) : Promise < void > ;
45
+ /**
46
+ * The used active focus in the currently joined session.
47
+ * @returns the used active focus in the currently joined session or undefined if not joined.
48
+ */
28
49
getActiveFocus ( ) : Focus | undefined ;
29
50
}
30
51
@@ -102,10 +123,6 @@ export class LegacyMembershipManager implements IMembershipManager {
102
123
private getOldestMembership : ( ) => CallMembership | undefined ,
103
124
) { }
104
125
105
- /*
106
- * Returns true if we intend to be participating in the MatrixRTC session.
107
- * This is determined by checking if the relativeExpiry has been set.
108
- */
109
126
public isJoined ( ) : boolean {
110
127
return this . relativeExpiry !== undefined ;
111
128
}
0 commit comments