UNPKG

@sawport/peers-caller

Version:

WebRTC multi-peer video call library with mesh architecture supporting up to 4 participants

50 lines 1.41 kB
/** * Utility functions for PeersCaller library */ import type { PeersCallerError } from "../types"; /** * Generate a unique ID for various purposes */ export declare function generateId(prefix?: string): string; /** * Generates a unique peer ID */ export declare const generatePeerId: () => string; /** * Validates a peer ID format */ export declare const isValidPeerId: (peerId: string) => boolean; /** * Formats media constraints for getUserMedia */ export declare const formatMediaConstraints: (options: { video?: boolean | MediaTrackConstraints; audio?: boolean | MediaTrackConstraints; }) => MediaStreamConstraints; /** * Format error messages consistently */ export declare function formatError(type: PeersCallerError, message: string, details?: any): Error; /** * Check if browser supports required WebRTC features */ export declare function checkWebRTCSupport(): { supported: boolean; features: { getUserMedia: boolean; getDisplayMedia: boolean; RTCPeerConnection: boolean; MediaRecorder: boolean; WebSocket: boolean; }; missingFeatures: string[]; }; /** * Checks if WebRTC is supported in the current browser */ export declare const isWebRTCSupported: () => boolean; /** * Get optimal ICE servers configuration */ export declare function getDefaultIceServers(): RTCIceServer[]; //# sourceMappingURL=index.d.ts.map