@webrtc2/config
Version:
WebRTC2 Config - Configuration management for WebRTC applications with STUN/TURN servers, ICE settings, media constraints, and cross-platform defaults
67 lines (63 loc) • 1.79 kB
text/typescript
/**
* @webrtc2/types
*
* Core TypeScript type definitions for WebRTC2 ecosystem
*/
interface RTCConnectionConfig {
iceServers: RTCIceServer[];
iceTransportPolicy?: RTCIceTransportPolicy;
bundlePolicy?: RTCBundlePolicy;
}
/**
* @webrtc2/config
*
* Configuration management for WebRTC2 ecosystem
*/
interface WebRTC2Config {
rtc: RTCConnectionConfig;
signaling: {
url: string;
reconnectAttempts: number;
reconnectDelay: number;
};
media: {
video: {
width: number;
height: number;
frameRate: number;
facingMode?: 'user' | 'environment';
};
audio: {
echoCancellation: boolean;
noiseSuppression: boolean;
autoGainControl: boolean;
};
};
ui: {
theme: 'light' | 'dark' | 'auto';
language: string;
showStats: boolean;
};
debug: {
enabled: boolean;
level: 'debug' | 'info' | 'warn' | 'error';
logToConsole: boolean;
};
}
declare const defaultConfig: WebRTC2Config;
declare class ConfigManager {
private config;
constructor(initialConfig?: Partial<WebRTC2Config>);
private mergeConfig;
get(): WebRTC2Config;
update(updates: Partial<WebRTC2Config>): void;
reset(): void;
getRTCConfig(): RTCConnectionConfig;
getSignalingUrl(): string;
getMediaConstraints(): MediaStreamConstraints;
}
declare const config: ConfigManager;
declare function createConfig(overrides?: Partial<WebRTC2Config>): ConfigManager;
declare function validateConfig(config: Partial<WebRTC2Config>): boolean;
declare const VERSION = "1.0.0";
export { ConfigManager, VERSION, type WebRTC2Config, config, createConfig, defaultConfig, validateConfig };