import { NativeModules } from 'react-native'; const WebrtcModule = NativeModules.WebrtcP2P; class WebRTCService { switchCamera() { WebrtcModule.switchCamera(); } public rejectCall(): void { WebrtcModule.rejectCall(); } public takeCall(withVideo: boolean) { WebrtcModule.takeCall(withVideo); } public hangupCall(): void { WebrtcModule.hangupCall(); } public startCall(contactId: string, video: boolean, subject: string): void { WebrtcModule.startCall(contactId, video, subject); } public addLocalVideoToCall(): void { WebrtcModule.addLocalVideoToCall(); } public removeLocalVideoFromCall(): void { WebrtcModule.removeLocalVideoFromCall(); } } export const webRTCService = new WebRTCService();