Skip to content

Commit f22d5e9

Browse files
authored
MatrixRTC: additional TS docs for IMembershipManager interface (#4613)
* docstrings for IMembershipManager interface * more details and cleanup * timeout docs
1 parent ffb228b commit f22d5e9

File tree

1 file changed

+22
-5
lines changed

1 file changed

+22
-5
lines changed

src/matrixrtc/MembershipManager.ts

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,34 @@ import { MembershipConfig } from "./MatrixRTCSession.ts";
1818
* @internal
1919
*/
2020
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+
*/
2127
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+
*/
2233
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+
*/
2340
leave(timeout: number | undefined): Promise<boolean>;
2441
/**
25-
* call this if the MatrixRTC session members have changed
42+
* Call this if the MatrixRTC session members have changed.
2643
*/
2744
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+
*/
2849
getActiveFocus(): Focus | undefined;
2950
}
3051

@@ -102,10 +123,6 @@ export class LegacyMembershipManager implements IMembershipManager {
102123
private getOldestMembership: () => CallMembership | undefined,
103124
) {}
104125

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-
*/
109126
public isJoined(): boolean {
110127
return this.relativeExpiry !== undefined;
111128
}

0 commit comments

Comments
 (0)