import type { ProviderAdapter } from './ports/outbound/provider-adapter.port'; import type { TrackAttachmentAdapter } from './ports/outbound/track-attachment-adapter.port'; import type { ConnectParams, SessionState } from './types/session.types'; import type { Participant } from './types/participant.types'; import type { Track } from './types/track.types'; import type { RoomInfo } from './types/room.types'; import type { SwitchDeviceOptions, ScreenShareOptions, DeviceKind } from './types/media.types'; import { type SessionEventName, type EventHandlers } from './types/events.types'; import { StatsService } from './services/stats.service'; import { RecordingService } from './services/recording.service'; import { ChatService } from './services/chat.service'; import type { Logger } from './utils/logger'; type EventHandler = NonNullable; /** * Session represents an active RTC connection. * * Created by `Vroom.connect()`, provides methods for: * - Media control (mic, camera, screen share) * - Participant management * - Event handling */ export declare class Session { private state; private adapter; private params; private services; private tokenService; private logger; private handleConnected; private handleDisconnected; private handleReconnecting; private handleReconnected; /** Stats service for network quality and RTC statistics. */ stats: StatsService; /** Recording service for session recording. */ recording: RecordingService; /** Chat service for real-time messaging (optional - requires "chat" feature). */ chat?: ChatService; /** * Track attachment adapter for attaching tracks to media elements. * Use this instead of setting srcObject directly for proper adaptive streaming behavior. */ trackAttachment: TrackAttachmentAdapter; constructor(adapter: ProviderAdapter, params: ConnectParams, sessionToken: string, logger: Logger); /** * Get current session state */ getState(): SessionState; /** * Disconnect from session and clean up resources. * Safe to call multiple times — subsequent calls are no-ops. */ disconnect(): Promise; /** * Disable microphone * @throws VroomError if operation fails */ disableMic(): Promise; /** * Enable microphone * @throws VroomError if operation fails */ enableMic(): Promise; /** * Disable camera * @throws VroomError if operation fails */ disableCamera(): Promise; /** * Enable camera * @throws VroomError if operation fails */ enableCamera(): Promise; /** * Switch audio/video input or output device. * * @param options - Device IDs to switch to * @throws VroomError with code `E_MEDIA` if device switch fails * @throws VroomError with code `E_UNSUPPORTED_FEATURE` if audioOutputId used on unsupported browser */ switchDevice(options: SwitchDeviceOptions): Promise; /** * Get currently active device ID for a given kind. * * @param kind - Device kind to query * @returns Device ID or undefined if not set */ getActiveDevice(kind: DeviceKind): string | undefined; /** * Start screen sharing */ startScreenShare(_options?: ScreenShareOptions): Promise; /** * Stop screen sharing */ stopScreenShare(): Promise; /** * Publish a custom track to the session * @param track - MediaStreamTrack to publish (audio or video) * @returns Published Track object */ publishTrack(track: MediaStreamTrack): Promise; /** * Unpublish a track from the session * @param trackId - ID of the track to unpublish */ unpublishTrack(trackId: string): Promise; /** * Get all participants in the session */ getParticipants(): Participant[]; /** * Get all tracks in the session */ getTracks(): Track[]; /** * Info for the currently connected room (name, id, createdAt). * * Immutable for the lifetime of the session. Available after * `Vroom.connect()` resolves. * * @throws VroomError if accessed before connect or after disconnect */ get room(): RoomInfo; /** * Register event listener */ on(event: E, handler: EventHandler): this; /** * Remove event listener */ off(event: E, handler?: EventHandler): this; /** @internal */ _connect(token: string, endpoint: string): Promise; private initializeServices; private setupEventHandlers; } export {}; //# sourceMappingURL=session.d.ts.map