export type Base64URLString = string; export enum VBModel { landscape = "landscape", multiClass = "multiclass", meet = "meet", } export type VirtualBackgroundConfig = { /** * Virtual background type, can be "image" or "blur". */ type: 'image' | 'blur'; /** * Image URL for background (required only if `type` is "image"). */ imageUrl?: string; /** * Image base64 for background (required only if `type` is "image"). */ imageBase64?: Base64URLString; }; export class VideoSDKVirtualBackgroundProcessor { /** * Indicates whether the processor is ready. */ ready: boolean; /** * Initializes the virtual background processor. * @param {'landscape' | 'multiclass' | 'meet'} [model] - Segmentation model to load. * @returns {Promise} */ init(model?: 'landscape' | 'multiclass' | 'meet'): Promise; /** * Starts the virtual background processor. * @param {MediaStream} stream - The local camera (or screen) media stream. * @param {VirtualBackgroundConfig} [options] - Configuration for virtual background. * @returns {MediaStream} - The transformed media stream with background applied. */ start(stream: MediaStream, options: VirtualBackgroundConfig): Promise; /** * Indicates whether the processor is currently running. */ processorRunning: boolean; /** * Updates the virtual background configuration. * @param {VirtualBackgroundConfig} config - New configuration for the virtual background. * @returns {Promise} */ updateProcessorConfig(config: VirtualBackgroundConfig): Promise; /** * Stops the virtual background processor. * @returns {Promise} */ stop(): Promise; /** * Full cleanup — releases the segmenter's GPU/WASM resources. * After dispose(), the instance cannot be reused. * Use stop() for pause/resume; use dispose() when done. */ dispose(): void; }