import type { NetworkQuality } from '../../core/types/events.types'; import type { ProviderAdapter, AdapterConnectOptions, Capability } from '../../core/ports/outbound/provider-adapter.port'; import type { ServiceAdapters, ServiceContext } from '../../core/types/service-adapters.types'; import { type SessionPermissions } from '../../core/types/token.types'; import type { Track } from '../../core/types/track.types'; import type { RoomInfo } from '../../core/types/room.types'; import type { SwitchDeviceOptions, DeviceKind } from '../../core/types/media.types'; import type { Participant } from '../../core/types/participant.types'; import { type SessionEventName, type EventHandlers } from '../../core/types/events.types'; import { type LiveKitAdapterConfig } from './livekit.types'; type EventHandler = NonNullable; export declare class LiveKitAdapter implements ProviderAdapter { /** LiveKit Room instance */ private room; /** Event handlers registry */ private eventHandlers; /** Cached participants */ private participants; /** Cached tracks */ private tracks; /** Local participant reference */ private localParticipant; /** Adapter configuration */ private config; /** Service context for backend API calls */ private serviceContext; /** Domain-scoped loggers (provider-neutral namespaces). */ private connectionLog; private trackLog; private deviceLog; /** Reconnect attempt counter */ private reconnectAttempt; /** Cached room info, populated after connect() resolves */ private roomInfo; /** Per-kind operation queues — serialize mute/unmute to avoid overlap. */ private audioOp; private videoOp; constructor(serviceContext: ServiceContext, config?: LiveKitAdapterConfig); connect(options: AdapterConnectOptions): Promise; disconnect(): Promise; /** * Publish a MediaStreamTrack to the room */ publishTrack(track: MediaStreamTrack): Promise; /** * Unpublish a track from the room */ unpublishTrack(trackId: string): Promise; muteTrack(kind: 'audio' | 'video'): Promise; unmuteTrack(kind: 'audio' | 'video'): Promise; /** * Chains a mute/unmute onto the per-kind queue so calls run strictly in * order. Without this, rapid toggles can overlap inside LiveKit and leak * a MediaStreamTrack (camera LED stays on). */ private enqueueTrackOp; private runTrackOp; private stopOrphanLocalTrack; switchDevice(options: SwitchDeviceOptions): Promise; getActiveDevice(kind: DeviceKind): string | undefined; on(event: E, handler: EventHandler): void; off(event: E, handler?: EventHandler): void; getStats(): Promise; getNetworkQuality(): NetworkQuality; getCapabilities(): Capability[]; getParticipants(): Participant[]; getTracks(): Track[]; getRoomInfo(): RoomInfo; createServiceAdapters(permissions: SessionPermissions): ServiceAdapters; /** * Get event mappings for LiveKit Room events. * Defined as a getter to ensure handlers are initialized before access. */ private get roomEventMappings(); /** * Sets up LiveKit event listeners and maps them to SDK events. */ private setupEventListeners; /** * Removes all LiveKit event listeners to prevent memory leaks. */ private removeEventListeners; private handleParticipantConnected; private handleParticipantDisconnected; private handleTrackSubscribed; private handleTrackUnsubscribed; private handleLocalTrackPublished; private handleLocalTrackUnpublished; private handleTrackMuted; private handleTrackUnmuted; /** * Get SDK Participant for a LiveKit participant (local or remote) */ private getParticipantForTrack; private handleDisconnected; private handleReconnecting; private handleReconnected; private handleActiveSpeakersChanged; private handleActiveDeviceChanged; private emit; private mapDisconnectReason; } export {}; //# sourceMappingURL=livekit.adapter.d.ts.map