import { LiveOptions } from '../typings/live/LiveOptions'; import { Live } from './live'; /** * 创建 Live 带看实例 * * 这是一个工厂函数,用于创建 Live 实例。在创建新实例前,会先清理全局的旧实例(如果存在)。 * * @template KeyframesSnapshot 帧数据快照类型,必须是一个对象类型 * @param opts 带看配置选项,详见 {@link LiveOptions} * @returns Live 实例 * @example * ```typescript * // 定义帧数据类型 * interface MyKeyframes { * camera: { position: [number, number, number] } * annotation: { text: string; position: [number, number] } * } * * // 创建 Live 实例 * const live = createLive({ * url: 'wss://example.com/live', * getTicket: async () => { * const response = await fetch('/api/get-ticket') * return response.json().ticket * }, * getVoiceSign: async (params) => { * const response = await fetch('/api/get-voice-sign', { * method: 'POST', * body: JSON.stringify(params) * }) * return response.json() * }, * useBuiltInRTC: true * }) * * // 连接带看 * await live.connect() * ``` */ export declare const createLive: >(opts: LiveOptions) => Live;