use createSomething$ mathods instead of classes

Rename several classes/behaviors to factory-style creators and adapt
call wiring and tests accordingly:
- Replace ConnectionManager class with createConnectionManager$ which
  returns transports$, connectionManagerData$, connections$
- Convert MatrixLivekitMerger to createMatrixLivekitMembers$
  (matrixLivekitMerger$)
- Rename sessionBehaviors$, localMembership$, localTransport$ to
  createSessionMembershipsAndTransports$, createLocalMembership$,
  createLocalTransport$
- Adjust participant types and hook up connectOptions$; expose join via
  localMembership.requestConnect
- Update tests to use the new factory APIs
This commit is contained in:
Timo K
2025-11-05 18:57:24 +01:00
parent 4d0de2fb71
commit c19e2245c8
10 changed files with 167 additions and 163 deletions

View File

@@ -13,7 +13,8 @@ import {
ConnectionError,
type ConnectionState as LivekitConenctionState,
type Room as LivekitRoom,
type Participant,
type LocalParticipant,
type RemoteParticipant,
RoomEvent,
} from "livekit-client";
import { type LivekitTransport } from "matrix-js-sdk/lib/matrixrtc";
@@ -32,7 +33,7 @@ import {
SFURoomCreationRestrictedError,
} from "../../utils/errors.ts";
export type PublishingParticipant = Participant;
export type PublishingParticipant = LocalParticipant | RemoteParticipant;
export interface ConnectionOpts {
/** The media transport to connect to. */