/** * Core type definitions for RTC adapter * @packageDocumentation */ /** * Connection state for RTC providers. * Represents the current state of the RTC connection. */ export declare enum ConnectionState { /** Not connected to any RTC server */ Disconnected = "disconnected", /** Currently connecting to RTC server */ Connecting = "connecting", /** Successfully connected to RTC server */ Connected = "connected", /** Reconnecting after connection loss */ Reconnecting = "reconnecting", /** Connection failed permanently */ Failed = "failed" } /** * LiveKit connection configuration. * Used when connecting via LiveKitProvider. */ export interface LiveKitConnectionConfig { /** LiveKit server URL (e.g., wss://your-server.livekit.cloud) */ url: string; /** Authentication token */ token: string; /** Room name to join */ roomName: string; } /** * LiveKit connection prewarm configuration. * Used for URL-only or token-assisted connection preparation. */ export interface LiveKitPrepareConnectionConfig { /** LiveKit server URL (e.g., wss://your-server.livekit.cloud) */ url: string; /** Authentication token, if available */ token?: string; /** Optional room name for callers that already have the full config */ roomName?: string; } /** * Agora connection configuration. * Used when connecting via AgoraProvider. */ export interface AgoraConnectionConfig { /** Agora Application ID (from Agora Console) */ appId: string; /** Channel name to join */ channel: string; /** Authentication token (optional for testing, required for production) */ token?: string; /** User ID (optional, 0 or undefined = auto-assign) */ uid?: number; } /** * RTC connection configuration. * Union type supporting both LiveKit and Agora providers. * * @example * ```typescript * // LiveKit * await player.connect({ * url: 'wss://your-server.livekit.cloud', * token: 'your-token', * roomName: 'my-room', * }); * * // Agora * await player.connect({ * appId: 'your-agora-app-id', * channel: 'my-channel', * token: 'your-agora-token', // optional * }); * ``` */ export type RTCConnectionConfig = LiveKitConnectionConfig | AgoraConnectionConfig; /** * Connection preparation configuration. * Currently only LiveKit supports explicit prewarming. */ export type RTCPrepareConnectionConfig = LiveKitPrepareConnectionConfig; /** * Type guard to check if config is for LiveKit. */ export declare function isLiveKitConfig(config: RTCConnectionConfig): config is LiveKitConnectionConfig; /** * Type guard to check if config can be used to prewarm a LiveKit connection. */ export declare function isLiveKitPrepareConfig(config: RTCPrepareConnectionConfig): config is LiveKitPrepareConnectionConfig; /** * Type guard to check if config is for Agora. */ export declare function isAgoraConfig(config: RTCConnectionConfig): config is AgoraConnectionConfig; //# sourceMappingURL=index.d.ts.map