import { type Transport } from "./types.ts"; /** * The type of the LiveKit transport as defined in the stable version of * [MSC4195](https://github.com/matrix-org/matrix-spec-proposals/pull/4195). * * @experimental Part of [MSC4195](https://github.com/matrix-org/matrix-spec-proposals/pull/4195). */ export declare const LIVEKIT_TRANSPORT_TYPE = "m.livekit"; /** * The type of the LiveKit transport used by implementations of earlier versions of * [MSC4195](https://github.com/matrix-org/matrix-spec-proposals/pull/4195). * * @experimental Part of [MSC4195](https://github.com/matrix-org/matrix-spec-proposals/pull/4195). */ export declare const LEGACY_LIVEKIT_TRANSPORT_TYPE = "livekit"; type LivekitTransportType = typeof LIVEKIT_TRANSPORT_TYPE | typeof LEGACY_LIVEKIT_TRANSPORT_TYPE; /** * @deprecated Use {@link UnstableLivekitTransport} instead, which has multiple * variants to support the migration to newer versions of MSC4195. */ export interface LivekitTransport extends Transport { type: "livekit"; livekit_service_url: string; } /** * @deprecated Use {@link isUnstableLivekitTransport} instead. */ export declare const isLivekitTransport: (object: unknown) => object is LivekitTransport; /** * @experimental Part of [MSC4195](https://github.com/matrix-org/matrix-spec-proposals/pull/4195). */ type WebsocketUrl = { /** * WebSocket URL of the LiveKit server. */ url: string; /** * The server name of the homeserver that operates the SFU at `url`. * * When omitted, the SFU belongs to the homeserver of the member event's sender. */ server_name?: string; }; type ServiceUrl = { /** * Base URL of the LiveKit JWT service. */ livekit_service_url: string; }; /** * Any LiveKit transport that can be advertised by a homeserver or published by * a session member: `url` only, `livekit_service_url` only, or both during the * migration. * * It uses the `Unstable` prefix as it includes the `livekit` type and the * `livekit_service_url` case which are only here for compatibility reasons. * * @experimental Part of [MSC4195](https://github.com/matrix-org/matrix-spec-proposals/pull/4195). */ export type UnstableLivekitTransport = { type: LivekitTransportType; } & LivekitTransportUrls; type LivekitTransportUrls = WebsocketUrl | ServiceUrl | (WebsocketUrl & ServiceUrl); export declare const isUnstableLivekitTransport: (object: unknown) => object is UnstableLivekitTransport; /** * A LiveKit transport with an SFU WebSocket `url`. * * @experimental Part of [MSC4195](https://github.com/matrix-org/matrix-spec-proposals/pull/4195). */ export type UnstableLivekitTransportWithUrl = UnstableLivekitTransport & WebsocketUrl; /** * Checks whether an object represents a LiveKit transport with an SFU WebSocket `url`. * * @experimental Part of [MSC4195](https://github.com/matrix-org/matrix-spec-proposals/pull/4195). */ export declare const isUnstableLivekitTransportWithUrl: (object: unknown) => object is UnstableLivekitTransportWithUrl; /** * Selects the LiveKit transport to use from a list of advertised transports. Picks the first * `m.livekit` transport, otherwise the first `livekit` transport. * * @returns The selected transport. * * @experimental Part of [MSC4195](https://github.com/matrix-org/matrix-spec-proposals/pull/4195). */ export declare function selectLivekitTransport(transports: Transport[]): UnstableLivekitTransport | undefined; /** * @deprecated this is just needed for the old focus active / focus fields of a call membership. * Not needed for new implementations. */ export interface LivekitFocusSelection extends Transport { type: "livekit"; focus_selection: "multi_sfu"; } /** * @deprecated see LivekitFocusSelection */ export declare const isLivekitFocusSelection: (object: any) => object is LivekitFocusSelection; /** * The body of a request to the LiveKit `get_token` endpoint (MSC4195). * * Declared as a type alias rather than an interface so that it can be passed to the widget API * (MSC4533), which expects request data to be assignable to an index signature. */ export type LivekitGetTokenRequest = { /** * The WebSocket URL of the LiveKit SFU to obtain a token for. */ url: string; /** * The room ID of the Matrix room the `m.rtc.member` event is in. */ room_id: string; /** * The slot ID from the `m.rtc.member` event. */ slot_id: string; /** * The `member.id` value from the `m.rtc.member` event. */ member_id: string; /** * The server name of the `m.rtc.member` event's sender. If omitted, the homeserver uses its own * server name. This is what makes it possible to obtain a token for an SFU of a remote homeserver. */ server_name?: string; }; /** * The response of the LiveKit `get_token` endpoint (MSC4195). */ export interface LivekitGetTokenResponse { /** * The JWT to authenticate with when connecting to the SFU. */ jwt: string; } /** * The body of a request to the LiveKit `delegate_delayed_leave` endpoint (MSC4195). * * Declared as a type alias rather than an interface so that it can be passed to the widget API * (MSC4533), which expects request data to be assignable to an index signature. */ export type LivekitDelegateDelayedLeaveRequest = { /** * The WebSocket URL of the LiveKit SFU that we are connected to. */ url: string; /** * The room ID of the Matrix room the `m.rtc.member` event is in. */ room_id: string; /** * The slot ID from the `m.rtc.member` event. */ slot_id: string; /** * The `member.id` value from the `m.rtc.member` event. */ member_id: string; /** * The delay ID of the delayed leave event to hand over to the homeserver. */ delay_id: string; }; export {}; //# sourceMappingURL=LivekitTransport.d.ts.map