import { BaseProvider } from '../base/BaseProvider'; import { RTCConnectionConfig, RTCPrepareConnectionConfig } from '../../types'; import { LiveKitRoom } from './types'; /** * LiveKit Provider options. */ export interface LiveKitProviderOptions { /** * Exact LiveKit publication track name to treat as the animation track. */ animationTrackName?: string; /** * Pattern for LiveKit publication track names to treat as animation tracks. */ animationTrackNamePattern?: RegExp; } /** * LiveKit Provider. * * Implements RTCProvider interface for LiveKit platform. * Requires a browser with RTCRtpScriptTransform support for animation data. * * @example * ```typescript * import { AvatarPlayer, LiveKitProvider } from '@spatius/avatarkit-rtc'; * * const provider = new LiveKitProvider(); * const player = new AvatarPlayer(provider, renderer); * * await player.connect({ * url: 'wss://your-livekit-server.com', * token: 'your-token', * }); * ``` */ export declare class LiveKitProvider extends BaseProvider { private readonly options; /** Provider name identifier */ readonly name = "livekit"; constructor(options?: LiveKitProviderOptions); private createRoom; prepareConnection(config: RTCPrepareConnectionConfig): Promise; connect(config: RTCConnectionConfig): Promise; disconnect(): Promise; /** * Attach to a host-owned LiveKit Room instead of creating one. * * The provider borrows the Room only: the host remains responsible for * constructing it, calling `connect()` / `disconnect()`, and managing remote * audio playback. The provider adds only the listeners and hidden video * element needed for avatar animation extraction. * * This must be called before the host calls `room.connect()`. The Room must * be constructed with `{ singlePeerConnection: false }`, which gives each * subscribed track a fresh receiver early enough for the animation transform * to be installed reliably on current Chromium browsers. * * @example * ```typescript * const room = new Room({ singlePeerConnection: false }); * await player.attach(room); * await room.connect(url, token); * ``` * * @param room - The host-owned LiveKit Room to borrow. * @throws Error if another room is already set or the room has started * connecting. */ attachExternalClient(room: LiveKitRoom): Promise; /** * Detach from a host-owned LiveKit Room without disconnecting it or removing * any listeners/media elements owned by the host. */ detachExternalClient(): void; getConnectionState(): string; publishAudioTrack(track?: MediaStreamTrack): Promise; unpublishAudioTrack(): Promise; /** * Get the native LiveKit Room instance. * * Allows advanced users to access LiveKit-specific features * not exposed through the unified API. * * @returns The LiveKit Room instance, or null if not connected * * @example * ```typescript * const room = provider.getNativeClient(); * if (room) { * // Access LiveKit-specific features * console.log('Participants:', room.remoteParticipants.size); * } * ``` */ getNativeClient(): LiveKitRoom | null; } //# sourceMappingURL=LiveKitProvider.d.ts.map