/** * useWebRTCWithDetection Hook * * Combined hook that provides WebRTC video calling functionality * alongside face detection and eye tracking capabilities. * * This hook allows you to: * - Make video calls using WebRTC * - Detect faces in the local camera feed using VisionCamera * - Track eye status for blink detection */ import type { Frame } from 'react-native-vision-camera'; import type { Face, EyeStatusResult } from '../types'; import type { UseWebRTCResult, UseWebRTCWithDetectionOptions } from '../webrtc/types'; export type { UseWebRTCWithDetectionOptions } from '../webrtc/types'; /** * Result type for useWebRTCWithDetection hook */ export interface UseWebRTCWithDetectionResult extends UseWebRTCResult { /** Currently detected faces */ faces: Face[]; /** Detect faces in a frame (for use in VisionCamera frame processor) */ detectFaces: (frame: Frame) => Face[]; /** Current eye status */ eyeStatus: EyeStatusResult | null; /** Process faces for eye tracking */ processEyeStatus: (faces: Face[]) => void; /** Reset eye status */ resetEyeStatus: () => void; /** Process a frame for both face detection and eye tracking */ processFrame: (frame: Frame) => void; } /** * Hook combining WebRTC video calling with face detection and eye tracking * * @param options - Configuration options * @returns Combined WebRTC, face detection, and eye tracking controls * * @example * ```tsx * import { useWebRTCWithDetection } from '@arfuhad/react-native-smart-camera'; * import { Camera, useFrameProcessor } from 'react-native-vision-camera'; * import { RTCView } from 'react-native-webrtc'; * * function VideoCallWithDetection() { * const { * // WebRTC * localStream, * remoteStream, * callState, * startLocalStream, * createPeerConnection, * // Face detection * faces, * detectFaces, * // Eye tracking * eyeStatus, * // Combined handler * processFrame, * } = useWebRTCWithDetection({ * config: { iceServers: [{ urls: 'stun:stun.l.google.com:19302' }] }, * faceDetection: { enabled: true, classificationMode: 'all' }, * eyeTracking: { enabled: true, eyeClosedThreshold: 0.3 }, * }); * * // Use VisionCamera for local preview + detection * // Use RTCView for remote stream * const frameProcessor = useFrameProcessor((frame) => { * 'worklet'; * processFrame(frame); * }, [processFrame]); * * return ( * * * {remoteStream && } * Faces: {faces.length} * Left Eye: {eyeStatus?.leftEye.openProbability.toFixed(2)} * * ); * } * ``` */ export declare function useWebRTCWithDetection(options?: UseWebRTCWithDetectionOptions): UseWebRTCWithDetectionResult; //# sourceMappingURL=useWebRTCWithDetection.d.ts.map