UNPKG

@webrtc2/utils

Version:

WebRTC2 Utils - Cross-platform WebRTC utility functions for device detection, media management, error handling, and performance optimization

28 lines (26 loc) 1.39 kB
/** * @webrtc2/utils * * Utility functions for WebRTC2 ecosystem */ declare function isMobile(): boolean; declare function isIOS(): boolean; declare function isAndroid(): boolean; declare function getMediaDevices(): Promise<MediaDeviceInfo[]>; declare function getVideoDevices(): Promise<MediaDeviceInfo[]>; declare function getAudioDevices(): Promise<MediaDeviceInfo[]>; declare function stopMediaStream(stream: MediaStream | null): void; declare function muteStream(stream: MediaStream, muted: boolean): void; declare function toggleVideo(stream: MediaStream, enabled: boolean): void; declare function generateRoomId(): string; declare function isValidRoomId(roomId: string): boolean; declare class WebRTCError extends Error { code: string; details?: any | undefined; constructor(message: string, code: string, details?: any | undefined); } declare function createError(code: string, message: string, details?: any): WebRTCError; declare function measureLatency(startTime: number): number; declare function debounce<T extends (...args: any[]) => any>(func: T, wait: number): (...args: Parameters<T>) => void; declare const VERSION = "1.0.0"; export { VERSION, WebRTCError, createError, debounce, generateRoomId, getAudioDevices, getMediaDevices, getVideoDevices, isAndroid, isIOS, isMobile, isValidRoomId, measureLatency, muteStream, stopMediaStream, toggleVideo };