UNPKG

@voxket-ai/voxket-live

Version:

A React widget for embedding Voxket-powered audio/video/chat experiences.

47 lines (46 loc) 1.35 kB
import { Room } from 'livekit-client'; import { VoxketEventEmitter } from '../core/event-emitter'; import { VoxketInteractiveView, ViewPresentationMode, InteractiveUIState, RpcEvents } from '../types/rpc'; /** * Manager for Frontend RPC functionality */ export declare class RpcManager extends VoxketEventEmitter<RpcEvents> { private room; private registeredMethods; private activeInteractions; private currentInteraction; constructor(room?: Room); /** * Set the LiveKit room instance */ setRoom(room: Room): void; /** * Register a frontend RPC method with a React component */ registerFrontendRPC(methodName: string, component: VoxketInteractiveView, presentationMode?: ViewPresentationMode): Promise<void>; private awaitUserInteraction; /** * Clear an active interaction */ private clearInteraction; /** * Get current interaction state */ getCurrentInteraction(): InteractiveUIState | null; /** * Dismiss current interaction */ dismissCurrentInteraction(): void; /** * Get all registered methods */ getRegisteredMethods(): string[]; /** * Unregister a method */ unregisterMethod(methodName: string): void; /** * Clear all registrations and active interactions */ clear(): void; }