@arfuhad/react-native-smart-camera 0.1.2 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +75 -3
- package/README.md +259 -206
- package/android/build.gradle +14 -39
- package/android/src/main/java/com/smartcamera/FaceDetectorFrameProcessorPlugin.kt +324 -0
- package/android/src/main/java/com/smartcamera/SmartCameraPackage.kt +28 -0
- package/build/detection/blinkProcessor.js +2 -1
- package/build/detection/blinkProcessor.js.map +1 -1
- package/build/detection/faceDetector.d.ts +4 -4
- package/build/detection/faceDetector.d.ts.map +1 -1
- package/build/detection/faceDetector.js +31 -11
- package/build/detection/faceDetector.js.map +1 -1
- package/build/detection/index.d.ts +1 -1
- package/build/detection/index.d.ts.map +1 -1
- package/build/detection/index.js +1 -1
- package/build/detection/index.js.map +1 -1
- package/build/detection/staticImageDetector.d.ts +11 -11
- package/build/detection/staticImageDetector.d.ts.map +1 -1
- package/build/detection/staticImageDetector.js +19 -23
- package/build/detection/staticImageDetector.js.map +1 -1
- package/build/hooks/index.d.ts +6 -0
- package/build/hooks/index.d.ts.map +1 -1
- package/build/hooks/index.js +8 -0
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/useBlinkDetection.d.ts +27 -16
- package/build/hooks/useBlinkDetection.d.ts.map +1 -1
- package/build/hooks/useBlinkDetection.js +63 -37
- package/build/hooks/useBlinkDetection.js.map +1 -1
- package/build/hooks/useFaceDetection.js +3 -2
- package/build/hooks/useFaceDetection.js.map +1 -1
- package/build/hooks/useFaceDetector.d.ts +123 -0
- package/build/hooks/useFaceDetector.d.ts.map +1 -0
- package/build/hooks/useFaceDetector.js +133 -0
- package/build/hooks/useFaceDetector.js.map +1 -0
- package/build/hooks/useSmartCamera.js.map +1 -1
- package/build/hooks/useSmartCameraWebRTC.d.ts +3 -5
- package/build/hooks/useSmartCameraWebRTC.d.ts.map +1 -1
- package/build/hooks/useSmartCameraWebRTC.js +19 -87
- package/build/hooks/useSmartCameraWebRTC.js.map +1 -1
- package/build/hooks/useWebRTC.d.ts +88 -0
- package/build/hooks/useWebRTC.d.ts.map +1 -0
- package/build/hooks/useWebRTC.js +394 -0
- package/build/hooks/useWebRTC.js.map +1 -0
- package/build/hooks/useWebRTCWithDetection.d.ts +89 -0
- package/build/hooks/useWebRTCWithDetection.d.ts.map +1 -0
- package/build/hooks/useWebRTCWithDetection.js +131 -0
- package/build/hooks/useWebRTCWithDetection.js.map +1 -0
- package/build/index.d.ts +24 -10
- package/build/index.d.ts.map +1 -1
- package/build/index.js +38 -13
- package/build/index.js.map +1 -1
- package/build/types.d.ts +28 -12
- package/build/types.d.ts.map +1 -1
- package/build/types.js.map +1 -1
- package/build/utils/index.js.map +1 -1
- package/build/webrtc/WebRTCBridge.d.ts +3 -0
- package/build/webrtc/WebRTCBridge.d.ts.map +1 -1
- package/build/webrtc/WebRTCBridge.js +12 -15
- package/build/webrtc/WebRTCBridge.js.map +1 -1
- package/build/webrtc/WebRTCManager.d.ts +148 -0
- package/build/webrtc/WebRTCManager.d.ts.map +1 -0
- package/build/webrtc/WebRTCManager.js +383 -0
- package/build/webrtc/WebRTCManager.js.map +1 -0
- package/build/webrtc/index.d.ts +3 -1
- package/build/webrtc/index.d.ts.map +1 -1
- package/build/webrtc/index.js +5 -0
- package/build/webrtc/index.js.map +1 -1
- package/build/webrtc/types.d.ts +212 -4
- package/build/webrtc/types.d.ts.map +1 -1
- package/build/webrtc/types.js +34 -1
- package/build/webrtc/types.js.map +1 -1
- package/ios/FaceDetectorFrameProcessorPlugin.m +11 -0
- package/ios/FaceDetectorFrameProcessorPlugin.swift +304 -0
- package/package.json +11 -11
- package/react-native-smart-camera.podspec +32 -0
- package/src/detection/blinkProcessor.ts +127 -0
- package/src/detection/faceDetector.ts +78 -0
- package/src/detection/index.ts +3 -0
- package/src/detection/staticImageDetector.ts +53 -0
- package/src/hooks/index.ts +26 -0
- package/src/hooks/useBlinkDetection.ts +127 -0
- package/src/hooks/useFaceDetection.ts +105 -0
- package/src/hooks/useFaceDetector.ts +191 -0
- package/src/hooks/useSmartCamera.ts +83 -0
- package/src/hooks/useSmartCameraWebRTC.ts +120 -0
- package/src/hooks/useWebRTC.ts +453 -0
- package/src/hooks/useWebRTCWithDetection.ts +181 -0
- package/src/index.ts +170 -0
- package/src/types.ts +636 -0
- package/src/utils/index.ts +355 -0
- package/src/webrtc/WebRTCBridge.ts +127 -0
- package/src/webrtc/WebRTCManager.ts +453 -0
- package/src/webrtc/index.ts +50 -0
- package/src/webrtc/types.ts +361 -0
- package/android/build/.transforms/e0a0b120a9ccc3a8de4f5784bc36b161/results.bin +0 -1
- package/android/build/.transforms/e0a0b120a9ccc3a8de4f5784bc36b161/transformed/classes/classes_dex/classes.dex +0 -0
- package/android/build/generated/source/buildConfig/debug/expo/modules/smartcamera/BuildConfig.java +0 -10
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/AndroidManifest.xml +0 -7
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/output-metadata.json +0 -18
- package/android/build/intermediates/aar_metadata/debug/aar-metadata.properties +0 -6
- package/android/build/intermediates/annotation_processor_list/debug/annotationProcessors.json +0 -1
- package/android/build/intermediates/compile_library_classes_jar/debug/classes.jar +0 -0
- package/android/build/intermediates/compile_r_class_jar/debug/R.jar +0 -0
- package/android/build/intermediates/compile_symbol_list/debug/R.txt +0 -0
- package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +0 -1
- package/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +0 -2
- package/android/build/intermediates/java_res/debug/out/META-INF/arfuhad-react-native-smart-camera_debug.kotlin_module +0 -0
- package/android/build/intermediates/javac/debug/classes/expo/modules/smartcamera/BuildConfig.class +0 -0
- package/android/build/intermediates/local_only_symbol_list/debug/R-def.txt +0 -2
- package/android/build/intermediates/manifest_merge_blame_file/debug/manifest-merger-blame-debug-report.txt +0 -7
- package/android/build/intermediates/merged_manifest/debug/AndroidManifest.xml +0 -7
- package/android/build/intermediates/navigation_json/debug/navigation.json +0 -1
- package/android/build/intermediates/runtime_library_classes_jar/debug/classes.jar +0 -0
- package/android/build/intermediates/symbol_list_with_package_name/debug/package-aware-r.txt +0 -1
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/counters.tab +0 -2
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/last-build.bin +0 -0
- package/android/build/kotlin/compileDebugKotlin/classpath-snapshot/shrunk-classpath-snapshot.bin +0 -0
- package/android/build/kotlin/compileDebugKotlin/local-state/build-history.bin +0 -0
- package/android/build/outputs/logs/manifest-merger-debug-report.txt +0 -16
- package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
- package/android/build/tmp/kotlin-classes/debug/META-INF/arfuhad-react-native-smart-camera_debug.kotlin_module +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/DetectedFace.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/FaceBounds.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/FaceContoursData.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/FaceDetectionOptions.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/FaceLandmarksData.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/ImageLoader$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/ImageLoader$loadImage$2.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/ImageLoader.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/MLKitFaceDetector$detectFaces$2$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/MLKitFaceDetector$detectFaces$2$2.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/MLKitFaceDetector.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/MLKitFaceDetectorKt$sam$com_google_android_gms_tasks_OnSuccessListener$0.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/MLKitFaceDetectorKt.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/PointData.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/SmartCameraModule$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/SmartCameraModule$definition$1$1$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/SmartCameraModule$definition$1$3$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/SmartCameraModule$definition$1$4$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/SmartCameraModule$definition$lambda$10$$inlined$AsyncFunction$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/SmartCameraModule$definition$lambda$10$$inlined$AsyncFunction$2.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/SmartCameraModule$definition$lambda$10$$inlined$AsyncFunction$3.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/SmartCameraModule$definition$lambda$10$$inlined$AsyncFunctionWithPromise$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/SmartCameraModule$definition$lambda$10$$inlined$AsyncFunctionWithPromise$2.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/SmartCameraModule$definition$lambda$10$$inlined$AsyncFunctionWithPromise$3.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/SmartCameraModule$definition$lambda$10$$inlined$AsyncFunctionWithPromise$4.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/SmartCameraModule$definition$lambda$10$$inlined$Function$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/SmartCameraModule$definition$lambda$10$$inlined$Function$2.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/SmartCameraModule$definition$lambda$10$$inlined$Function$3.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/SmartCameraModule$definition$lambda$10$$inlined$Function$4.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/SmartCameraModule$definition$lambda$10$$inlined$FunctionWithoutArgs$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/SmartCameraModule$definition$lambda$10$$inlined$FunctionWithoutArgs$2.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/SmartCameraModule$definition$lambda$10$$inlined$OnActivityEntersBackground$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/SmartCameraModule$definition$lambda$10$$inlined$OnActivityEntersForeground$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/SmartCameraModule$definition$lambda$10$$inlined$OnDestroy$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/SmartCameraModule.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/SmartCameraView.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/WebRTCFrameBridge$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/expo/modules/smartcamera/WebRTCFrameBridge.class +0 -0
- package/android/src/main/java/expo/modules/smartcamera/ImageLoader.kt +0 -106
- package/android/src/main/java/expo/modules/smartcamera/MLKitFaceDetector.kt +0 -273
- package/android/src/main/java/expo/modules/smartcamera/SmartCameraModule.kt +0 -205
- package/android/src/main/java/expo/modules/smartcamera/SmartCameraView.kt +0 -153
- package/android/src/main/java/expo/modules/smartcamera/WebRTCFrameBridge.kt +0 -184
- package/build/SmartCamera.d.ts +0 -17
- package/build/SmartCamera.d.ts.map +0 -1
- package/build/SmartCamera.js +0 -270
- package/build/SmartCamera.js.map +0 -1
- package/build/SmartCameraModule.d.ts +0 -112
- package/build/SmartCameraModule.d.ts.map +0 -1
- package/build/SmartCameraModule.js +0 -121
- package/build/SmartCameraModule.js.map +0 -1
- package/build/SmartCameraView.d.ts +0 -8
- package/build/SmartCameraView.d.ts.map +0 -1
- package/build/SmartCameraView.js +0 -7
- package/build/SmartCameraView.js.map +0 -1
- package/expo-module.config.json +0 -9
- package/ios/MLKitFaceDetector.swift +0 -310
- package/ios/SmartCamera.podspec +0 -33
- package/ios/SmartCameraModule.swift +0 -225
- package/ios/SmartCameraView.swift +0 -146
- package/ios/WebRTCFrameBridge.swift +0 -150
package/src/types.ts
ADDED
|
@@ -0,0 +1,636 @@
|
|
|
1
|
+
import type { ViewStyle } from 'react-native';
|
|
2
|
+
|
|
3
|
+
// ============================================================================
|
|
4
|
+
// Face Detection Options
|
|
5
|
+
// ============================================================================
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Performance mode for face detection
|
|
9
|
+
* - 'fast': Favor speed over accuracy
|
|
10
|
+
* - 'accurate': Favor accuracy over speed
|
|
11
|
+
*/
|
|
12
|
+
export type PerformanceMode = 'fast' | 'accurate';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Mode for detecting facial landmarks
|
|
16
|
+
* - 'none': Don't detect landmarks
|
|
17
|
+
* - 'all': Detect all landmarks (eyes, ears, nose, cheeks, mouth)
|
|
18
|
+
*/
|
|
19
|
+
export type LandmarkMode = 'none' | 'all';
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Mode for detecting facial contours
|
|
23
|
+
* - 'none': Don't detect contours
|
|
24
|
+
* - 'all': Detect contours (only for most prominent face)
|
|
25
|
+
*/
|
|
26
|
+
export type ContourMode = 'none' | 'all';
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Mode for face classification
|
|
30
|
+
* - 'none': Don't classify faces
|
|
31
|
+
* - 'all': Classify faces (smiling, eyes open)
|
|
32
|
+
*/
|
|
33
|
+
export type ClassificationMode = 'none' | 'all';
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Camera facing direction
|
|
37
|
+
*/
|
|
38
|
+
export type CameraFacing = 'front' | 'back';
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Common face detection options shared between frame processor and static images
|
|
42
|
+
*/
|
|
43
|
+
export interface FaceDetectionOptions {
|
|
44
|
+
/**
|
|
45
|
+
* Favor speed or accuracy when detecting faces
|
|
46
|
+
* @default 'fast'
|
|
47
|
+
*/
|
|
48
|
+
performanceMode?: PerformanceMode;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Whether to identify facial landmarks: eyes, ears, nose, cheeks, mouth
|
|
52
|
+
* @default 'none'
|
|
53
|
+
*/
|
|
54
|
+
landmarkMode?: LandmarkMode;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Whether to detect contours of facial features.
|
|
58
|
+
* Contours are detected for only the most prominent face in an image.
|
|
59
|
+
* @default 'none'
|
|
60
|
+
*/
|
|
61
|
+
contourMode?: ContourMode;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Whether to classify faces into categories such as 'smiling' and 'eyes open'
|
|
65
|
+
* @default 'none'
|
|
66
|
+
*/
|
|
67
|
+
classificationMode?: ClassificationMode;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Sets the smallest desired face size, expressed as the ratio
|
|
71
|
+
* of the width of the head to width of the image.
|
|
72
|
+
* @default 0.15
|
|
73
|
+
*/
|
|
74
|
+
minFaceSize?: number;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Whether to assign faces an ID to track faces across images.
|
|
78
|
+
* Note: When contour detection is enabled, only one face is detected,
|
|
79
|
+
* so face tracking doesn't produce useful results. Don't enable both
|
|
80
|
+
* contour detection and face tracking for best performance.
|
|
81
|
+
* @default false
|
|
82
|
+
*/
|
|
83
|
+
trackingEnabled?: boolean;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Frame processor specific options
|
|
88
|
+
*/
|
|
89
|
+
export interface FrameProcessorOptions extends FaceDetectionOptions {
|
|
90
|
+
/**
|
|
91
|
+
* Current active camera
|
|
92
|
+
* @default 'front'
|
|
93
|
+
*/
|
|
94
|
+
cameraFacing?: CameraFacing;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Should handle auto scale (face bounds, contour and landmarks) and rotation
|
|
98
|
+
* on native side? If disabled, all detection results will be relative to frame
|
|
99
|
+
* coordinates, not to screen/preview.
|
|
100
|
+
* You shouldn't use this option if you want to draw on screen using Skia Frame Processor.
|
|
101
|
+
* @default false
|
|
102
|
+
*/
|
|
103
|
+
autoMode?: boolean;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Required if you want to use autoMode. Screen width for coordinate scaling.
|
|
107
|
+
* You must handle your own logic to get screen sizes, with or without statusbar size, etc.
|
|
108
|
+
* @default 1.0
|
|
109
|
+
*/
|
|
110
|
+
windowWidth?: number;
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Required if you want to use autoMode. Screen height for coordinate scaling.
|
|
114
|
+
* You must handle your own logic to get screen sizes, with or without statusbar size, etc.
|
|
115
|
+
* @default 1.0
|
|
116
|
+
*/
|
|
117
|
+
windowHeight?: number;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Static image face detection options
|
|
122
|
+
*/
|
|
123
|
+
export interface StaticImageOptions extends FaceDetectionOptions {
|
|
124
|
+
/**
|
|
125
|
+
* Image source for static face detection.
|
|
126
|
+
* Can be a require() result (number), a URI string, or an object with uri.
|
|
127
|
+
*/
|
|
128
|
+
image: number | string | { uri: string };
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
// ============================================================================
|
|
132
|
+
// Face Detection Results
|
|
133
|
+
// ============================================================================
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* 2D point coordinates
|
|
137
|
+
*/
|
|
138
|
+
export interface Point {
|
|
139
|
+
x: number;
|
|
140
|
+
y: number;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Bounding rectangle
|
|
145
|
+
*/
|
|
146
|
+
export interface Bounds {
|
|
147
|
+
x: number;
|
|
148
|
+
y: number;
|
|
149
|
+
width: number;
|
|
150
|
+
height: number;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Facial landmarks detected by ML Kit
|
|
155
|
+
*/
|
|
156
|
+
export interface FaceLandmarks {
|
|
157
|
+
leftEye?: Point;
|
|
158
|
+
rightEye?: Point;
|
|
159
|
+
leftEar?: Point;
|
|
160
|
+
rightEar?: Point;
|
|
161
|
+
leftCheek?: Point;
|
|
162
|
+
rightCheek?: Point;
|
|
163
|
+
noseBase?: Point;
|
|
164
|
+
leftMouth?: Point;
|
|
165
|
+
rightMouth?: Point;
|
|
166
|
+
bottomMouth?: Point;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Face contour types
|
|
171
|
+
*/
|
|
172
|
+
export type ContourType =
|
|
173
|
+
| 'face'
|
|
174
|
+
| 'leftEyebrowTop'
|
|
175
|
+
| 'leftEyebrowBottom'
|
|
176
|
+
| 'rightEyebrowTop'
|
|
177
|
+
| 'rightEyebrowBottom'
|
|
178
|
+
| 'leftEye'
|
|
179
|
+
| 'rightEye'
|
|
180
|
+
| 'upperLipTop'
|
|
181
|
+
| 'upperLipBottom'
|
|
182
|
+
| 'lowerLipTop'
|
|
183
|
+
| 'lowerLipBottom'
|
|
184
|
+
| 'noseBridge'
|
|
185
|
+
| 'noseBottom'
|
|
186
|
+
| 'leftCheek'
|
|
187
|
+
| 'rightCheek';
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Facial contours detected by ML Kit
|
|
191
|
+
*/
|
|
192
|
+
export interface FaceContours {
|
|
193
|
+
[key: string]: Point[];
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Detected face data
|
|
198
|
+
*/
|
|
199
|
+
export interface Face {
|
|
200
|
+
/**
|
|
201
|
+
* Bounding box of the detected face
|
|
202
|
+
*/
|
|
203
|
+
bounds: Bounds;
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* Roll angle of the face (rotation around front-to-back axis)
|
|
207
|
+
*/
|
|
208
|
+
rollAngle?: number;
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Pitch angle of the face (rotation around left-to-right axis)
|
|
212
|
+
*/
|
|
213
|
+
pitchAngle?: number;
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* Yaw angle of the face (rotation around top-to-bottom axis)
|
|
217
|
+
*/
|
|
218
|
+
yawAngle?: number;
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* Facial landmarks (when landmarkMode is 'all')
|
|
222
|
+
*/
|
|
223
|
+
landmarks?: FaceLandmarks;
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* Facial contours (when contourMode is 'all')
|
|
227
|
+
*/
|
|
228
|
+
contours?: FaceContours;
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* Probability that the face is smiling (0.0 - 1.0)
|
|
232
|
+
* Only available when classificationMode is 'all'
|
|
233
|
+
*/
|
|
234
|
+
smilingProbability?: number;
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* Probability that the left eye is open (0.0 - 1.0)
|
|
238
|
+
* Only available when classificationMode is 'all'
|
|
239
|
+
*/
|
|
240
|
+
leftEyeOpenProbability?: number;
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* Probability that the right eye is open (0.0 - 1.0)
|
|
244
|
+
* Only available when classificationMode is 'all'
|
|
245
|
+
*/
|
|
246
|
+
rightEyeOpenProbability?: number;
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* Tracking ID for this face (when trackingEnabled is true)
|
|
250
|
+
*/
|
|
251
|
+
trackingId?: number;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
// ============================================================================
|
|
255
|
+
// Blink Detection
|
|
256
|
+
// ============================================================================
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* Blink detection event
|
|
260
|
+
*/
|
|
261
|
+
export interface BlinkEvent {
|
|
262
|
+
/**
|
|
263
|
+
* Timestamp when the blink was detected
|
|
264
|
+
*/
|
|
265
|
+
timestamp: number;
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* Left eye open probability (0.0 - 1.0)
|
|
269
|
+
*/
|
|
270
|
+
leftEyeOpen: number;
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* Right eye open probability (0.0 - 1.0)
|
|
274
|
+
*/
|
|
275
|
+
rightEyeOpen: number;
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* Whether a blink was detected
|
|
279
|
+
*/
|
|
280
|
+
isBlink: boolean;
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* Face tracking ID (when trackingEnabled is true)
|
|
284
|
+
*/
|
|
285
|
+
faceId?: number;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
// ============================================================================
|
|
289
|
+
// WebRTC Configuration
|
|
290
|
+
// ============================================================================
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* WebRTC mode
|
|
294
|
+
* - 'call': Video calling (1:1 or group)
|
|
295
|
+
* - 'stream': Live streaming to a server
|
|
296
|
+
*/
|
|
297
|
+
export type WebRTCMode = 'call' | 'stream';
|
|
298
|
+
|
|
299
|
+
/**
|
|
300
|
+
* WebRTC video constraints
|
|
301
|
+
*/
|
|
302
|
+
export interface VideoConstraints {
|
|
303
|
+
width?: number;
|
|
304
|
+
height?: number;
|
|
305
|
+
frameRate?: number;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
/**
|
|
309
|
+
* WebRTC configuration
|
|
310
|
+
*/
|
|
311
|
+
export interface WebRTCConfig {
|
|
312
|
+
/**
|
|
313
|
+
* Whether WebRTC is enabled
|
|
314
|
+
*/
|
|
315
|
+
enabled: boolean;
|
|
316
|
+
|
|
317
|
+
/**
|
|
318
|
+
* RTCPeerConnection instance
|
|
319
|
+
*/
|
|
320
|
+
peerConnection?: RTCPeerConnection;
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
* WebRTC mode (call or stream)
|
|
324
|
+
* @default 'call'
|
|
325
|
+
*/
|
|
326
|
+
mode?: WebRTCMode;
|
|
327
|
+
|
|
328
|
+
/**
|
|
329
|
+
* Video constraints for the stream
|
|
330
|
+
*/
|
|
331
|
+
videoConstraints?: VideoConstraints;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
// ============================================================================
|
|
335
|
+
// Face Detection Configuration (for SmartCamera component)
|
|
336
|
+
// ============================================================================
|
|
337
|
+
|
|
338
|
+
/**
|
|
339
|
+
* Face detection configuration for SmartCamera component
|
|
340
|
+
*/
|
|
341
|
+
export interface FaceDetectionConfig extends FaceDetectionOptions {
|
|
342
|
+
/**
|
|
343
|
+
* Whether face detection is enabled
|
|
344
|
+
* @default false
|
|
345
|
+
*/
|
|
346
|
+
enabled?: boolean;
|
|
347
|
+
|
|
348
|
+
/**
|
|
349
|
+
* Handle auto scale on native side
|
|
350
|
+
* @default false
|
|
351
|
+
*/
|
|
352
|
+
autoMode?: boolean;
|
|
353
|
+
|
|
354
|
+
/**
|
|
355
|
+
* Screen width for coordinate scaling (required when autoMode is true)
|
|
356
|
+
* @default 1.0
|
|
357
|
+
*/
|
|
358
|
+
windowWidth?: number;
|
|
359
|
+
|
|
360
|
+
/**
|
|
361
|
+
* Screen height for coordinate scaling (required when autoMode is true)
|
|
362
|
+
* @default 1.0
|
|
363
|
+
*/
|
|
364
|
+
windowHeight?: number;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
// ============================================================================
|
|
368
|
+
// SmartCamera Component Props
|
|
369
|
+
// ============================================================================
|
|
370
|
+
|
|
371
|
+
/**
|
|
372
|
+
* SmartCamera component props
|
|
373
|
+
*/
|
|
374
|
+
export interface SmartCameraProps {
|
|
375
|
+
/**
|
|
376
|
+
* Camera facing direction
|
|
377
|
+
* @default 'front'
|
|
378
|
+
*/
|
|
379
|
+
camera?: CameraFacing;
|
|
380
|
+
|
|
381
|
+
/**
|
|
382
|
+
* Target frame rate for the camera
|
|
383
|
+
* @default 30
|
|
384
|
+
*/
|
|
385
|
+
fps?: number;
|
|
386
|
+
|
|
387
|
+
/**
|
|
388
|
+
* Style for the camera view
|
|
389
|
+
*/
|
|
390
|
+
style?: ViewStyle;
|
|
391
|
+
|
|
392
|
+
/**
|
|
393
|
+
* Face detection configuration
|
|
394
|
+
*/
|
|
395
|
+
faceDetection?: FaceDetectionConfig;
|
|
396
|
+
|
|
397
|
+
/**
|
|
398
|
+
* Whether blink detection is enabled
|
|
399
|
+
* @default false
|
|
400
|
+
*/
|
|
401
|
+
blinkDetection?: boolean;
|
|
402
|
+
|
|
403
|
+
/**
|
|
404
|
+
* Callback when a blink is detected
|
|
405
|
+
*/
|
|
406
|
+
onBlinkDetected?: (event: BlinkEvent) => void;
|
|
407
|
+
|
|
408
|
+
/**
|
|
409
|
+
* Callback when faces are detected
|
|
410
|
+
*/
|
|
411
|
+
onFaceDetected?: (faces: Face[]) => void;
|
|
412
|
+
|
|
413
|
+
/**
|
|
414
|
+
* WebRTC configuration for streaming
|
|
415
|
+
*/
|
|
416
|
+
webrtc?: WebRTCConfig;
|
|
417
|
+
|
|
418
|
+
/**
|
|
419
|
+
* Whether the camera is active
|
|
420
|
+
* @default true
|
|
421
|
+
*/
|
|
422
|
+
isActive?: boolean;
|
|
423
|
+
|
|
424
|
+
/**
|
|
425
|
+
* Callback when camera is ready
|
|
426
|
+
*/
|
|
427
|
+
onReady?: () => void;
|
|
428
|
+
|
|
429
|
+
/**
|
|
430
|
+
* Callback when an error occurs
|
|
431
|
+
*/
|
|
432
|
+
onError?: (error: SmartCameraError) => void;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
// ============================================================================
|
|
436
|
+
// Error Handling
|
|
437
|
+
// ============================================================================
|
|
438
|
+
|
|
439
|
+
/**
|
|
440
|
+
* Error codes for SmartCamera
|
|
441
|
+
*/
|
|
442
|
+
export type SmartCameraErrorCode =
|
|
443
|
+
| 'CAMERA_UNAVAILABLE'
|
|
444
|
+
| 'PERMISSION_DENIED'
|
|
445
|
+
| 'WEBRTC_ERROR'
|
|
446
|
+
| 'ML_KIT_ERROR'
|
|
447
|
+
| 'FRAME_PROCESSOR_ERROR'
|
|
448
|
+
| 'UNKNOWN_ERROR';
|
|
449
|
+
|
|
450
|
+
/**
|
|
451
|
+
* SmartCamera error
|
|
452
|
+
*/
|
|
453
|
+
export interface SmartCameraError {
|
|
454
|
+
/**
|
|
455
|
+
* Error code
|
|
456
|
+
*/
|
|
457
|
+
code: SmartCameraErrorCode;
|
|
458
|
+
|
|
459
|
+
/**
|
|
460
|
+
* Human-readable error message
|
|
461
|
+
*/
|
|
462
|
+
message: string;
|
|
463
|
+
|
|
464
|
+
/**
|
|
465
|
+
* Original native error (if available)
|
|
466
|
+
*/
|
|
467
|
+
nativeError?: Error;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
// ============================================================================
|
|
471
|
+
// Hook Return Types
|
|
472
|
+
// ============================================================================
|
|
473
|
+
|
|
474
|
+
/**
|
|
475
|
+
* Return type for useSmartCameraWebRTC hook
|
|
476
|
+
*/
|
|
477
|
+
export interface UseSmartCameraWebRTCResult {
|
|
478
|
+
/**
|
|
479
|
+
* The video track for WebRTC
|
|
480
|
+
*/
|
|
481
|
+
videoTrack: MediaStreamTrack | null;
|
|
482
|
+
|
|
483
|
+
/**
|
|
484
|
+
* Start streaming to the peer connection
|
|
485
|
+
*/
|
|
486
|
+
startStreaming: () => void;
|
|
487
|
+
|
|
488
|
+
/**
|
|
489
|
+
* Stop streaming
|
|
490
|
+
*/
|
|
491
|
+
stopStreaming: () => void;
|
|
492
|
+
|
|
493
|
+
/**
|
|
494
|
+
* Switch between front and back camera
|
|
495
|
+
*/
|
|
496
|
+
switchCamera: () => void;
|
|
497
|
+
|
|
498
|
+
/**
|
|
499
|
+
* Whether streaming is active
|
|
500
|
+
*/
|
|
501
|
+
isStreaming: boolean;
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
/**
|
|
505
|
+
* Return type for useFaceDetection hook
|
|
506
|
+
*/
|
|
507
|
+
export interface UseFaceDetectionResult {
|
|
508
|
+
/**
|
|
509
|
+
* Currently detected faces
|
|
510
|
+
*/
|
|
511
|
+
faces: Face[];
|
|
512
|
+
|
|
513
|
+
/**
|
|
514
|
+
* Whether face detection is active/detecting
|
|
515
|
+
*/
|
|
516
|
+
isDetecting: boolean;
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
/**
|
|
520
|
+
* Eye status for a single eye
|
|
521
|
+
*/
|
|
522
|
+
export interface EyeStatus {
|
|
523
|
+
/** Eye open probability (0-1, where 0 = closed, 1 = fully open) */
|
|
524
|
+
openProbability: number;
|
|
525
|
+
/** Whether the eye is considered closed based on the threshold */
|
|
526
|
+
isClosed: boolean;
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
/**
|
|
530
|
+
* Current eye status for both eyes
|
|
531
|
+
*/
|
|
532
|
+
export interface EyeStatusResult {
|
|
533
|
+
/** Left eye status */
|
|
534
|
+
leftEye: EyeStatus;
|
|
535
|
+
/** Right eye status */
|
|
536
|
+
rightEye: EyeStatus;
|
|
537
|
+
/** Face tracking ID */
|
|
538
|
+
faceId?: number;
|
|
539
|
+
/** Timestamp when this status was captured */
|
|
540
|
+
timestamp: number;
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
/**
|
|
544
|
+
* Return type for useBlinkDetection hook
|
|
545
|
+
*/
|
|
546
|
+
export interface UseBlinkDetectionResult {
|
|
547
|
+
/** Current eye status (null if no face detected) */
|
|
548
|
+
eyeStatus: EyeStatusResult | null;
|
|
549
|
+
/** Process faces to get eye status - call this with detected faces */
|
|
550
|
+
processEyeStatus: (faces: Face[]) => void;
|
|
551
|
+
/** Reset eye status */
|
|
552
|
+
reset: () => void;
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
// ============================================================================
|
|
556
|
+
// Camera Device Types
|
|
557
|
+
// ============================================================================
|
|
558
|
+
|
|
559
|
+
/**
|
|
560
|
+
* Camera device information
|
|
561
|
+
*/
|
|
562
|
+
export interface CameraDevice {
|
|
563
|
+
/**
|
|
564
|
+
* Unique identifier for the camera device
|
|
565
|
+
*/
|
|
566
|
+
id: string;
|
|
567
|
+
|
|
568
|
+
/**
|
|
569
|
+
* Human-readable name of the camera
|
|
570
|
+
*/
|
|
571
|
+
name: string;
|
|
572
|
+
|
|
573
|
+
/**
|
|
574
|
+
* Camera position (front or back)
|
|
575
|
+
*/
|
|
576
|
+
position: CameraFacing;
|
|
577
|
+
|
|
578
|
+
/**
|
|
579
|
+
* Whether the camera has a flash
|
|
580
|
+
*/
|
|
581
|
+
hasFlash: boolean;
|
|
582
|
+
|
|
583
|
+
/**
|
|
584
|
+
* Whether the camera has a torch (flashlight)
|
|
585
|
+
*/
|
|
586
|
+
hasTorch: boolean;
|
|
587
|
+
|
|
588
|
+
/**
|
|
589
|
+
* Whether the camera supports low-light boost
|
|
590
|
+
*/
|
|
591
|
+
supportsLowLightBoost: boolean;
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
/**
|
|
595
|
+
* Return type for useSmartCamera hook
|
|
596
|
+
*/
|
|
597
|
+
export interface UseSmartCameraResult {
|
|
598
|
+
/**
|
|
599
|
+
* Whether camera permission has been granted
|
|
600
|
+
*/
|
|
601
|
+
hasPermission: boolean;
|
|
602
|
+
|
|
603
|
+
/**
|
|
604
|
+
* Request camera permission
|
|
605
|
+
*/
|
|
606
|
+
requestPermission: () => Promise<boolean>;
|
|
607
|
+
|
|
608
|
+
/**
|
|
609
|
+
* Current camera device
|
|
610
|
+
*/
|
|
611
|
+
device: CameraDevice | undefined;
|
|
612
|
+
|
|
613
|
+
/**
|
|
614
|
+
* Switch between front and back camera
|
|
615
|
+
*/
|
|
616
|
+
switchCamera: () => void;
|
|
617
|
+
|
|
618
|
+
/**
|
|
619
|
+
* Current camera facing direction
|
|
620
|
+
*/
|
|
621
|
+
currentCamera: CameraFacing;
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
// ============================================================================
|
|
625
|
+
// Orientation Types
|
|
626
|
+
// ============================================================================
|
|
627
|
+
|
|
628
|
+
/**
|
|
629
|
+
* Device orientation
|
|
630
|
+
*/
|
|
631
|
+
export type Orientation = 'portrait' | 'portrait-upside-down' | 'landscape-left' | 'landscape-right';
|
|
632
|
+
|
|
633
|
+
/**
|
|
634
|
+
* Camera output orientation
|
|
635
|
+
*/
|
|
636
|
+
export type OutputOrientation = Orientation | 'device';
|