react-native-ensys-camera-x 1.0.7
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/CustomCamera.podspec +20 -0
- package/LICENSE +20 -0
- package/README.md +833 -0
- package/android/build.gradle +135 -0
- package/android/consumer-rules.pro +47 -0
- package/android/src/main/AndroidManifest.xml +72 -0
- package/android/src/main/java/android/print/PdfPrint.java +51 -0
- package/android/src/main/java/com/customcamera/AnimatedImageViewManager.kt +199 -0
- package/android/src/main/java/com/customcamera/AudioPlayerView.kt +322 -0
- package/android/src/main/java/com/customcamera/AudioRecorder.kt +506 -0
- package/android/src/main/java/com/customcamera/BarcodeScannerActivity.kt +361 -0
- package/android/src/main/java/com/customcamera/BlurBackgroundView.kt +199 -0
- package/android/src/main/java/com/customcamera/CacheCleanupManager.kt +386 -0
- package/android/src/main/java/com/customcamera/CameraAspectRatioMode.kt +77 -0
- package/android/src/main/java/com/customcamera/CameraAsset.kt +211 -0
- package/android/src/main/java/com/customcamera/CameraTheme.kt +479 -0
- package/android/src/main/java/com/customcamera/CompressionCacheStore.kt +504 -0
- package/android/src/main/java/com/customcamera/CompressionFileNameUtils.kt +7 -0
- package/android/src/main/java/com/customcamera/CompressionProfile.kt +195 -0
- package/android/src/main/java/com/customcamera/CustomCameraActivity.kt +7291 -0
- package/android/src/main/java/com/customcamera/CustomCameraFileProvider.kt +9 -0
- package/android/src/main/java/com/customcamera/CustomCameraModule.kt +2479 -0
- package/android/src/main/java/com/customcamera/CustomCameraPackage.kt +53 -0
- package/android/src/main/java/com/customcamera/DisplayUtils.kt +9 -0
- package/android/src/main/java/com/customcamera/DocumentPreviewView.kt +846 -0
- package/android/src/main/java/com/customcamera/DrawingView.kt +214 -0
- package/android/src/main/java/com/customcamera/EmojiPickerData.kt +228 -0
- package/android/src/main/java/com/customcamera/FilterStripAdapter.kt +158 -0
- package/android/src/main/java/com/customcamera/GifSupport.kt +215 -0
- package/android/src/main/java/com/customcamera/GlobalAudioPlayer.kt +320 -0
- package/android/src/main/java/com/customcamera/ImageExporter.kt +1394 -0
- package/android/src/main/java/com/customcamera/ImageFormatSupport.kt +163 -0
- package/android/src/main/java/com/customcamera/Localization.kt +206 -0
- package/android/src/main/java/com/customcamera/MediaAdapters.kt +758 -0
- package/android/src/main/java/com/customcamera/MediaCacheManager.kt +782 -0
- package/android/src/main/java/com/customcamera/MediaExportFormats.kt +201 -0
- package/android/src/main/java/com/customcamera/MediaFileIo.kt +310 -0
- package/android/src/main/java/com/customcamera/MediaMetadataStore.kt +494 -0
- package/android/src/main/java/com/customcamera/MediaPreviewEditor.kt +14865 -0
- package/android/src/main/java/com/customcamera/MediaPublisher.kt +423 -0
- package/android/src/main/java/com/customcamera/MediaStorageWorkflow.kt +722 -0
- package/android/src/main/java/com/customcamera/MediaStoreRepository.kt +378 -0
- package/android/src/main/java/com/customcamera/MediaThumbnailView.kt +286 -0
- package/android/src/main/java/com/customcamera/MediaUtils.kt +37 -0
- package/android/src/main/java/com/customcamera/NativeVideoViewManager.kt +845 -0
- package/android/src/main/java/com/customcamera/OfficeDocumentConverter.kt +2791 -0
- package/android/src/main/java/com/customcamera/PendingCaptureCrops.kt +88 -0
- package/android/src/main/java/com/customcamera/PowerPointPreview.kt +4077 -0
- package/android/src/main/java/com/customcamera/RecentPickerStore.kt +74 -0
- package/android/src/main/java/com/customcamera/SecureFileEraser.kt +411 -0
- package/android/src/main/java/com/customcamera/SecureKeyModule.kt +88 -0
- package/android/src/main/java/com/customcamera/SecureMediaDeleter.kt +493 -0
- package/android/src/main/java/com/customcamera/StickerPickerData.kt +107 -0
- package/android/src/main/java/com/customcamera/SvgDrawable.kt +175 -0
- package/android/src/main/java/com/customcamera/SvgIconViewManager.kt +77 -0
- package/android/src/main/java/com/customcamera/TextEntryController.kt +553 -0
- package/android/src/main/java/com/customcamera/ThumbnailLoader.kt +455 -0
- package/android/src/main/java/com/customcamera/UploadService.kt +909 -0
- package/android/src/main/java/com/customcamera/VideoEditUtils.kt +210 -0
- package/android/src/main/java/com/customcamera/VideoRotationTranscoder.kt +1992 -0
- package/android/src/main/java/com/customcamera/gif/AnimatedGifEncoder.kt +473 -0
- package/android/src/main/java/com/customcamera/gif/GifDecoder.kt +690 -0
- package/android/src/main/java/com/customcamera/gif/GifFramesDrawable.kt +160 -0
- package/android/src/main/java/com/customcamera/gif/GifHttp.kt +112 -0
- package/android/src/main/java/com/customcamera/gif/GifImageLoader.kt +186 -0
- package/android/src/main/java/com/customcamera/gif/GifModels.kt +74 -0
- package/android/src/main/java/com/customcamera/gif/GifProvider.kt +49 -0
- package/android/src/main/java/com/customcamera/gif/GifProviders.kt +27 -0
- package/android/src/main/java/com/customcamera/gif/GifRepository.kt +124 -0
- package/android/src/main/java/com/customcamera/gif/GifSafety.kt +33 -0
- package/android/src/main/java/com/customcamera/gif/GiphyGifProvider.kt +146 -0
- package/android/src/main/java/com/customcamera/gif/LZWEncoder.kt +258 -0
- package/android/src/main/java/com/customcamera/gif/NeuQuant.kt +435 -0
- package/android/src/main/java/com/customcamera/gif/TenorGifProvider.kt +147 -0
- package/android/src/main/res/drawable/bg_brush_selected.xml +5 -0
- package/android/src/main/res/drawable/bg_color_swatch.xml +5 -0
- package/android/src/main/res/drawable/bg_editor_toolbar.xml +6 -0
- package/android/src/main/res/drawable/bg_icon_circle.xml +5 -0
- package/android/src/main/res/drawable/bg_icon_circle_light.xml +5 -0
- package/android/src/main/res/drawable/bg_mode_tab_active.xml +6 -0
- package/android/src/main/res/drawable/bg_pill.xml +6 -0
- package/android/src/main/res/drawable/bg_recording_dot.xml +6 -0
- package/android/src/main/res/drawable/bg_selection_badge.xml +8 -0
- package/android/src/main/res/drawable/bg_send_button.xml +5 -0
- package/android/src/main/res/drawable/bg_shutter_inner.xml +5 -0
- package/android/src/main/res/drawable/bg_shutter_recording.xml +6 -0
- package/android/src/main/res/drawable/bg_shutter_ring.xml +8 -0
- package/android/src/main/res/drawable/bg_shutter_video_idle.xml +5 -0
- package/android/src/main/res/drawable/bg_thumbnail.xml +9 -0
- package/android/src/main/res/drawable/ic_aspect_ratio.xml +17 -0
- package/android/src/main/res/drawable/ic_audio.xml +10 -0
- package/android/src/main/res/drawable/ic_back.xml +10 -0
- package/android/src/main/res/drawable/ic_brush_medium.xml +12 -0
- package/android/src/main/res/drawable/ic_brush_thick.xml +12 -0
- package/android/src/main/res/drawable/ic_brush_thin.xml +12 -0
- package/android/src/main/res/drawable/ic_check.xml +17 -0
- package/android/src/main/res/drawable/ic_chevron_down.xml +10 -0
- package/android/src/main/res/drawable/ic_chevron_up.xml +13 -0
- package/android/src/main/res/drawable/ic_clear_drawing.xml +10 -0
- package/android/src/main/res/drawable/ic_close.xml +10 -0
- package/android/src/main/res/drawable/ic_cover.xml +9 -0
- package/android/src/main/res/drawable/ic_crop.xml +10 -0
- package/android/src/main/res/drawable/ic_delete.xml +9 -0
- package/android/src/main/res/drawable/ic_document.xml +10 -0
- package/android/src/main/res/drawable/ic_done.xml +10 -0
- package/android/src/main/res/drawable/ic_download.xml +10 -0
- package/android/src/main/res/drawable/ic_emoji.xml +10 -0
- package/android/src/main/res/drawable/ic_filter.xml +10 -0
- package/android/src/main/res/drawable/ic_flash_auto.xml +7 -0
- package/android/src/main/res/drawable/ic_flash_off.xml +23 -0
- package/android/src/main/res/drawable/ic_flash_on.xml +16 -0
- package/android/src/main/res/drawable/ic_flip.xml +15 -0
- package/android/src/main/res/drawable/ic_gallery.xml +10 -0
- package/android/src/main/res/drawable/ic_gif.xml +24 -0
- package/android/src/main/res/drawable/ic_lock.xml +19 -0
- package/android/src/main/res/drawable/ic_lock_open.xml +22 -0
- package/android/src/main/res/drawable/ic_marker.xml +10 -0
- package/android/src/main/res/drawable/ic_more_vert.xml +18 -0
- package/android/src/main/res/drawable/ic_overlay_close.xml +19 -0
- package/android/src/main/res/drawable/ic_overlay_resize.xml +18 -0
- package/android/src/main/res/drawable/ic_pause.xml +10 -0
- package/android/src/main/res/drawable/ic_photo_mode.xml +10 -0
- package/android/src/main/res/drawable/ic_play.xml +10 -0
- package/android/src/main/res/drawable/ic_redo.xml +10 -0
- package/android/src/main/res/drawable/ic_rotate.xml +9 -0
- package/android/src/main/res/drawable/ic_send.xml +10 -0
- package/android/src/main/res/drawable/ic_share.xml +10 -0
- package/android/src/main/res/drawable/ic_stat_upload.xml +10 -0
- package/android/src/main/res/drawable/ic_sticker.xml +24 -0
- package/android/src/main/res/drawable/ic_text.xml +10 -0
- package/android/src/main/res/drawable/ic_text_align_center.xml +11 -0
- package/android/src/main/res/drawable/ic_text_align_left.xml +11 -0
- package/android/src/main/res/drawable/ic_text_align_right.xml +11 -0
- package/android/src/main/res/drawable/ic_text_bg.xml +11 -0
- package/android/src/main/res/drawable/ic_trim.xml +23 -0
- package/android/src/main/res/drawable/ic_undo.xml +10 -0
- package/android/src/main/res/drawable/ic_video_mode.xml +10 -0
- package/android/src/main/res/drawable/ic_video_note.xml +13 -0
- package/android/src/main/res/drawable/ic_volume_off.xml +9 -0
- package/android/src/main/res/drawable/ic_volume_on.xml +9 -0
- package/android/src/main/res/drawable/sticker_heart.xml +9 -0
- package/android/src/main/res/drawable/sticker_smile.xml +9 -0
- package/android/src/main/res/drawable/sticker_star.xml +9 -0
- package/android/src/main/res/drawable/sticker_thumbsup.xml +9 -0
- package/android/src/main/res/values/colors.xml +34 -0
- package/android/src/main/res/values/ids.xml +15 -0
- package/android/src/main/res/values/strings.xml +15 -0
- package/android/src/main/res/values/styles.xml +20 -0
- package/android/src/main/res/xml/file_paths.xml +34 -0
- package/ios/CustomCamera.h +5 -0
- package/ios/CustomCamera.mm +214 -0
- package/lib/module/AudioPlayerContext.js +233 -0
- package/lib/module/AudioPlayerContext.js.map +1 -0
- package/lib/module/CameraPreview.js +304 -0
- package/lib/module/CameraPreview.js.map +1 -0
- package/lib/module/NativeAnimatedImageView.js +41 -0
- package/lib/module/NativeAnimatedImageView.js.map +1 -0
- package/lib/module/NativeAudioPlayerView.js +33 -0
- package/lib/module/NativeAudioPlayerView.js.map +1 -0
- package/lib/module/NativeBlurView.js +35 -0
- package/lib/module/NativeBlurView.js.map +1 -0
- package/lib/module/NativeCustomCamera.js +128 -0
- package/lib/module/NativeCustomCamera.js.map +1 -0
- package/lib/module/NativeCustomCamera.web.js +143 -0
- package/lib/module/NativeCustomCamera.web.js.map +1 -0
- package/lib/module/NativeCustomVideoView.js +5 -0
- package/lib/module/NativeCustomVideoView.js.map +1 -0
- package/lib/module/NativeDocumentPreviewView.js +156 -0
- package/lib/module/NativeDocumentPreviewView.js.map +1 -0
- package/lib/module/NativeMediaThumbnailView.js +110 -0
- package/lib/module/NativeMediaThumbnailView.js.map +1 -0
- package/lib/module/NativeSvgIcon.js +32 -0
- package/lib/module/NativeSvgIcon.js.map +1 -0
- package/lib/module/ResponsivePreviewContainer.js +171 -0
- package/lib/module/ResponsivePreviewContainer.js.map +1 -0
- package/lib/module/accessibility.js +61 -0
- package/lib/module/accessibility.js.map +1 -0
- package/lib/module/config.js +352 -0
- package/lib/module/config.js.map +1 -0
- package/lib/module/cpuOptimization.js +296 -0
- package/lib/module/cpuOptimization.js.map +1 -0
- package/lib/module/db/DatabaseManager.js +191 -0
- package/lib/module/db/DatabaseManager.js.map +1 -0
- package/lib/module/db/MediaMapper.js +284 -0
- package/lib/module/db/MediaMapper.js.map +1 -0
- package/lib/module/db/MediaRepository.js +242 -0
- package/lib/module/db/MediaRepository.js.map +1 -0
- package/lib/module/db/index.js +41 -0
- package/lib/module/db/index.js.map +1 -0
- package/lib/module/db/migrations.js +180 -0
- package/lib/module/db/migrations.js.map +1 -0
- package/lib/module/db/react-native-sqlcipher.d.js +2 -0
- package/lib/module/db/react-native-sqlcipher.d.js.map +1 -0
- package/lib/module/db/secureKey.js +87 -0
- package/lib/module/db/secureKey.js.map +1 -0
- package/lib/module/db/types.js +57 -0
- package/lib/module/db/types.js.map +1 -0
- package/lib/module/db/useMediaDatabase.js +123 -0
- package/lib/module/db/useMediaDatabase.js.map +1 -0
- package/lib/module/defaultIcons.js +2259 -0
- package/lib/module/defaultIcons.js.map +1 -0
- package/lib/module/deviceCapabilities.js +408 -0
- package/lib/module/deviceCapabilities.js.map +1 -0
- package/lib/module/errors.js +267 -0
- package/lib/module/errors.js.map +1 -0
- package/lib/module/iconConfig.js +796 -0
- package/lib/module/iconConfig.js.map +1 -0
- package/lib/module/icons.js +514 -0
- package/lib/module/icons.js.map +1 -0
- package/lib/module/index.js +251 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/jest-globals.d.js +2 -0
- package/lib/module/jest-globals.d.js.map +1 -0
- package/lib/module/library/MediaLibrary.js +107 -0
- package/lib/module/library/MediaLibrary.js.map +1 -0
- package/lib/module/library/MediaLibraryScreen.js +2597 -0
- package/lib/module/library/MediaLibraryScreen.js.map +1 -0
- package/lib/module/library/components/AudioPreview.js +74 -0
- package/lib/module/library/components/AudioPreview.js.map +1 -0
- package/lib/module/library/components/DocumentPreview.js +331 -0
- package/lib/module/library/components/DocumentPreview.js.map +1 -0
- package/lib/module/library/components/ExpandableFab.js +343 -0
- package/lib/module/library/components/ExpandableFab.js.map +1 -0
- package/lib/module/library/components/FileTiles.js +251 -0
- package/lib/module/library/components/FileTiles.js.map +1 -0
- package/lib/module/library/components/ImagePreview.js +70 -0
- package/lib/module/library/components/ImagePreview.js.map +1 -0
- package/lib/module/library/components/MediaMetadataHeader.js +175 -0
- package/lib/module/library/components/MediaMetadataHeader.js.map +1 -0
- package/lib/module/library/components/RecordAudioScreen.js +816 -0
- package/lib/module/library/components/RecordAudioScreen.js.map +1 -0
- package/lib/module/library/components/VideoPreview.js +453 -0
- package/lib/module/library/components/VideoPreview.js.map +1 -0
- package/lib/module/library/components/ViewerCounter.js +55 -0
- package/lib/module/library/components/ViewerCounter.js.map +1 -0
- package/lib/module/library/compressionEstimate.js +507 -0
- package/lib/module/library/compressionEstimate.js.map +1 -0
- package/lib/module/library/fileMetadata.js +196 -0
- package/lib/module/library/fileMetadata.js.map +1 -0
- package/lib/module/library/index.js +42 -0
- package/lib/module/library/index.js.map +1 -0
- package/lib/module/library/libraryIconRegistry.js +69 -0
- package/lib/module/library/libraryIconRegistry.js.map +1 -0
- package/lib/module/library/libraryIcons.js +858 -0
- package/lib/module/library/libraryIcons.js.map +1 -0
- package/lib/module/library/localizedFormat.js +181 -0
- package/lib/module/library/localizedFormat.js.map +1 -0
- package/lib/module/library/palette.js +225 -0
- package/lib/module/library/palette.js.map +1 -0
- package/lib/module/library/responsive.js +53 -0
- package/lib/module/library/responsive.js.map +1 -0
- package/lib/module/locales.js +416 -0
- package/lib/module/locales.js.map +1 -0
- package/lib/module/localization.js +1064 -0
- package/lib/module/localization.js.map +1 -0
- package/lib/module/logger.js +20 -0
- package/lib/module/logger.js.map +1 -0
- package/lib/module/lowMemoryCache.js +206 -0
- package/lib/module/lowMemoryCache.js.map +1 -0
- package/lib/module/mediaHistory.js +33 -0
- package/lib/module/mediaHistory.js.map +1 -0
- package/lib/module/mediaStorageService.js +402 -0
- package/lib/module/mediaStorageService.js.map +1 -0
- package/lib/module/memory.js +79 -0
- package/lib/module/memory.js.map +1 -0
- package/lib/module/nativeActions.js +307 -0
- package/lib/module/nativeActions.js.map +1 -0
- package/lib/module/nativeComponentSupport.js +61 -0
- package/lib/module/nativeComponentSupport.js.map +1 -0
- package/lib/module/networkPerformance.js +24 -0
- package/lib/module/networkPerformance.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/performance.js +104 -0
- package/lib/module/performance.js.map +1 -0
- package/lib/module/performanceMonitor.js +155 -0
- package/lib/module/performanceMonitor.js.map +1 -0
- package/lib/module/permissions.js +370 -0
- package/lib/module/permissions.js.map +1 -0
- package/lib/module/rendering.js +40 -0
- package/lib/module/rendering.js.map +1 -0
- package/lib/module/security.js +18 -0
- package/lib/module/security.js.map +1 -0
- package/lib/module/state.js +266 -0
- package/lib/module/state.js.map +1 -0
- package/lib/module/storage.js +400 -0
- package/lib/module/storage.js.map +1 -0
- package/lib/module/theme.js +390 -0
- package/lib/module/theme.js.map +1 -0
- package/lib/module/types.js +4 -0
- package/lib/module/types.js.map +1 -0
- package/lib/module/utils.js +115 -0
- package/lib/module/utils.js.map +1 -0
- package/lib/module/validation.js +288 -0
- package/lib/module/validation.js.map +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/AudioPlayerContext.d.ts +27 -0
- package/lib/typescript/src/AudioPlayerContext.d.ts.map +1 -0
- package/lib/typescript/src/CameraPreview.d.ts +13 -0
- package/lib/typescript/src/CameraPreview.d.ts.map +1 -0
- package/lib/typescript/src/NativeAnimatedImageView.d.ts +33 -0
- package/lib/typescript/src/NativeAnimatedImageView.d.ts.map +1 -0
- package/lib/typescript/src/NativeAudioPlayerView.d.ts +12 -0
- package/lib/typescript/src/NativeAudioPlayerView.d.ts.map +1 -0
- package/lib/typescript/src/NativeBlurView.d.ts +12 -0
- package/lib/typescript/src/NativeBlurView.d.ts.map +1 -0
- package/lib/typescript/src/NativeCustomCamera.d.ts +167 -0
- package/lib/typescript/src/NativeCustomCamera.d.ts.map +1 -0
- package/lib/typescript/src/NativeCustomCamera.web.d.ts +47 -0
- package/lib/typescript/src/NativeCustomCamera.web.d.ts.map +1 -0
- package/lib/typescript/src/NativeCustomVideoView.d.ts +30 -0
- package/lib/typescript/src/NativeCustomVideoView.d.ts.map +1 -0
- package/lib/typescript/src/NativeDocumentPreviewView.d.ts +48 -0
- package/lib/typescript/src/NativeDocumentPreviewView.d.ts.map +1 -0
- package/lib/typescript/src/NativeMediaThumbnailView.d.ts +54 -0
- package/lib/typescript/src/NativeMediaThumbnailView.d.ts.map +1 -0
- package/lib/typescript/src/NativeSvgIcon.d.ts +25 -0
- package/lib/typescript/src/NativeSvgIcon.d.ts.map +1 -0
- package/lib/typescript/src/ResponsivePreviewContainer.d.ts +92 -0
- package/lib/typescript/src/ResponsivePreviewContainer.d.ts.map +1 -0
- package/lib/typescript/src/accessibility.d.ts +20 -0
- package/lib/typescript/src/accessibility.d.ts.map +1 -0
- package/lib/typescript/src/config.d.ts +145 -0
- package/lib/typescript/src/config.d.ts.map +1 -0
- package/lib/typescript/src/cpuOptimization.d.ts +63 -0
- package/lib/typescript/src/cpuOptimization.d.ts.map +1 -0
- package/lib/typescript/src/db/DatabaseManager.d.ts +48 -0
- package/lib/typescript/src/db/DatabaseManager.d.ts.map +1 -0
- package/lib/typescript/src/db/MediaMapper.d.ts +77 -0
- package/lib/typescript/src/db/MediaMapper.d.ts.map +1 -0
- package/lib/typescript/src/db/MediaRepository.d.ts +66 -0
- package/lib/typescript/src/db/MediaRepository.d.ts.map +1 -0
- package/lib/typescript/src/db/index.d.ts +23 -0
- package/lib/typescript/src/db/index.d.ts.map +1 -0
- package/lib/typescript/src/db/migrations.d.ts +31 -0
- package/lib/typescript/src/db/migrations.d.ts.map +1 -0
- package/lib/typescript/src/db/secureKey.d.ts +10 -0
- package/lib/typescript/src/db/secureKey.d.ts.map +1 -0
- package/lib/typescript/src/db/types.d.ts +115 -0
- package/lib/typescript/src/db/types.d.ts.map +1 -0
- package/lib/typescript/src/db/useMediaDatabase.d.ts +41 -0
- package/lib/typescript/src/db/useMediaDatabase.d.ts.map +1 -0
- package/lib/typescript/src/defaultIcons.d.ts +139 -0
- package/lib/typescript/src/defaultIcons.d.ts.map +1 -0
- package/lib/typescript/src/deviceCapabilities.d.ts +92 -0
- package/lib/typescript/src/deviceCapabilities.d.ts.map +1 -0
- package/lib/typescript/src/errors.d.ts +95 -0
- package/lib/typescript/src/errors.d.ts.map +1 -0
- package/lib/typescript/src/iconConfig.d.ts +176 -0
- package/lib/typescript/src/iconConfig.d.ts.map +1 -0
- package/lib/typescript/src/icons.d.ts +217 -0
- package/lib/typescript/src/icons.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +104 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/library/MediaLibrary.d.ts +57 -0
- package/lib/typescript/src/library/MediaLibrary.d.ts.map +1 -0
- package/lib/typescript/src/library/MediaLibraryScreen.d.ts +51 -0
- package/lib/typescript/src/library/MediaLibraryScreen.d.ts.map +1 -0
- package/lib/typescript/src/library/components/AudioPreview.d.ts +6 -0
- package/lib/typescript/src/library/components/AudioPreview.d.ts.map +1 -0
- package/lib/typescript/src/library/components/DocumentPreview.d.ts +10 -0
- package/lib/typescript/src/library/components/DocumentPreview.d.ts.map +1 -0
- package/lib/typescript/src/library/components/ExpandableFab.d.ts +39 -0
- package/lib/typescript/src/library/components/ExpandableFab.d.ts.map +1 -0
- package/lib/typescript/src/library/components/FileTiles.d.ts +8 -0
- package/lib/typescript/src/library/components/FileTiles.d.ts.map +1 -0
- package/lib/typescript/src/library/components/ImagePreview.d.ts +5 -0
- package/lib/typescript/src/library/components/ImagePreview.d.ts.map +1 -0
- package/lib/typescript/src/library/components/MediaMetadataHeader.d.ts +16 -0
- package/lib/typescript/src/library/components/MediaMetadataHeader.d.ts.map +1 -0
- package/lib/typescript/src/library/components/RecordAudioScreen.d.ts +8 -0
- package/lib/typescript/src/library/components/RecordAudioScreen.d.ts.map +1 -0
- package/lib/typescript/src/library/components/VideoPreview.d.ts +20 -0
- package/lib/typescript/src/library/components/VideoPreview.d.ts.map +1 -0
- package/lib/typescript/src/library/components/ViewerCounter.d.ts +13 -0
- package/lib/typescript/src/library/components/ViewerCounter.d.ts.map +1 -0
- package/lib/typescript/src/library/compressionEstimate.d.ts +313 -0
- package/lib/typescript/src/library/compressionEstimate.d.ts.map +1 -0
- package/lib/typescript/src/library/fileMetadata.d.ts +33 -0
- package/lib/typescript/src/library/fileMetadata.d.ts.map +1 -0
- package/lib/typescript/src/library/index.d.ts +40 -0
- package/lib/typescript/src/library/index.d.ts.map +1 -0
- package/lib/typescript/src/library/libraryIconRegistry.d.ts +35 -0
- package/lib/typescript/src/library/libraryIconRegistry.d.ts.map +1 -0
- package/lib/typescript/src/library/libraryIcons.d.ts +85 -0
- package/lib/typescript/src/library/libraryIcons.d.ts.map +1 -0
- package/lib/typescript/src/library/localizedFormat.d.ts +49 -0
- package/lib/typescript/src/library/localizedFormat.d.ts.map +1 -0
- package/lib/typescript/src/library/palette.d.ts +104 -0
- package/lib/typescript/src/library/palette.d.ts.map +1 -0
- package/lib/typescript/src/library/responsive.d.ts +15 -0
- package/lib/typescript/src/library/responsive.d.ts.map +1 -0
- package/lib/typescript/src/locales.d.ts +103 -0
- package/lib/typescript/src/locales.d.ts.map +1 -0
- package/lib/typescript/src/localization.d.ts +1051 -0
- package/lib/typescript/src/localization.d.ts.map +1 -0
- package/lib/typescript/src/logger.d.ts +4 -0
- package/lib/typescript/src/logger.d.ts.map +1 -0
- package/lib/typescript/src/lowMemoryCache.d.ts +64 -0
- package/lib/typescript/src/lowMemoryCache.d.ts.map +1 -0
- package/lib/typescript/src/mediaHistory.d.ts +3 -0
- package/lib/typescript/src/mediaHistory.d.ts.map +1 -0
- package/lib/typescript/src/mediaStorageService.d.ts +155 -0
- package/lib/typescript/src/mediaStorageService.d.ts.map +1 -0
- package/lib/typescript/src/memory.d.ts +21 -0
- package/lib/typescript/src/memory.d.ts.map +1 -0
- package/lib/typescript/src/nativeActions.d.ts +174 -0
- package/lib/typescript/src/nativeActions.d.ts.map +1 -0
- package/lib/typescript/src/nativeComponentSupport.d.ts +30 -0
- package/lib/typescript/src/nativeComponentSupport.d.ts.map +1 -0
- package/lib/typescript/src/networkPerformance.d.ts +12 -0
- package/lib/typescript/src/networkPerformance.d.ts.map +1 -0
- package/lib/typescript/src/performance.d.ts +32 -0
- package/lib/typescript/src/performance.d.ts.map +1 -0
- package/lib/typescript/src/performanceMonitor.d.ts +45 -0
- package/lib/typescript/src/performanceMonitor.d.ts.map +1 -0
- package/lib/typescript/src/permissions.d.ts +132 -0
- package/lib/typescript/src/permissions.d.ts.map +1 -0
- package/lib/typescript/src/rendering.d.ts +9 -0
- package/lib/typescript/src/rendering.d.ts.map +1 -0
- package/lib/typescript/src/security.d.ts +6 -0
- package/lib/typescript/src/security.d.ts.map +1 -0
- package/lib/typescript/src/state.d.ts +102 -0
- package/lib/typescript/src/state.d.ts.map +1 -0
- package/lib/typescript/src/storage.d.ts +117 -0
- package/lib/typescript/src/storage.d.ts.map +1 -0
- package/lib/typescript/src/theme.d.ts +15 -0
- package/lib/typescript/src/theme.d.ts.map +1 -0
- package/lib/typescript/src/types.d.ts +802 -0
- package/lib/typescript/src/types.d.ts.map +1 -0
- package/lib/typescript/src/utils.d.ts +50 -0
- package/lib/typescript/src/utils.d.ts.map +1 -0
- package/lib/typescript/src/validation.d.ts +52 -0
- package/lib/typescript/src/validation.d.ts.map +1 -0
- package/package.json +204 -0
- package/react-native.config.js +17 -0
- package/src/AudioPlayerContext.tsx +220 -0
- package/src/CameraPreview.tsx +352 -0
- package/src/NativeAnimatedImageView.tsx +71 -0
- package/src/NativeAudioPlayerView.tsx +39 -0
- package/src/NativeBlurView.tsx +40 -0
- package/src/NativeCustomCamera.ts +305 -0
- package/src/NativeCustomCamera.web.ts +192 -0
- package/src/NativeCustomVideoView.ts +30 -0
- package/src/NativeDocumentPreviewView.tsx +196 -0
- package/src/NativeMediaThumbnailView.tsx +167 -0
- package/src/NativeSvgIcon.tsx +46 -0
- package/src/ResponsivePreviewContainer.tsx +227 -0
- package/src/accessibility.ts +80 -0
- package/src/config.ts +406 -0
- package/src/cpuOptimization.ts +365 -0
- package/src/db/DatabaseManager.ts +212 -0
- package/src/db/MediaMapper.ts +377 -0
- package/src/db/MediaRepository.ts +313 -0
- package/src/db/index.ts +73 -0
- package/src/db/migrations.ts +222 -0
- package/src/db/react-native-sqlcipher.d.ts +76 -0
- package/src/db/secureKey.ts +100 -0
- package/src/db/types.ts +123 -0
- package/src/db/useMediaDatabase.ts +191 -0
- package/src/defaultIcons.tsx +2390 -0
- package/src/deviceCapabilities.ts +438 -0
- package/src/errors.ts +350 -0
- package/src/iconConfig.tsx +962 -0
- package/src/icons.tsx +788 -0
- package/src/index.tsx +763 -0
- package/src/jest-globals.d.ts +9 -0
- package/src/library/MediaLibrary.tsx +141 -0
- package/src/library/MediaLibraryScreen.tsx +3003 -0
- package/src/library/components/AudioPreview.tsx +73 -0
- package/src/library/components/DocumentPreview.tsx +361 -0
- package/src/library/components/ExpandableFab.tsx +342 -0
- package/src/library/components/FileTiles.tsx +252 -0
- package/src/library/components/ImagePreview.tsx +72 -0
- package/src/library/components/MediaMetadataHeader.tsx +208 -0
- package/src/library/components/RecordAudioScreen.tsx +845 -0
- package/src/library/components/VideoPreview.tsx +478 -0
- package/src/library/components/ViewerCounter.tsx +71 -0
- package/src/library/compressionEstimate.ts +662 -0
- package/src/library/fileMetadata.ts +212 -0
- package/src/library/index.ts +66 -0
- package/src/library/libraryIconRegistry.tsx +86 -0
- package/src/library/libraryIcons.tsx +928 -0
- package/src/library/localizedFormat.ts +207 -0
- package/src/library/palette.ts +281 -0
- package/src/library/responsive.ts +49 -0
- package/src/locales.ts +381 -0
- package/src/localization.ts +1947 -0
- package/src/logger.ts +20 -0
- package/src/lowMemoryCache.ts +218 -0
- package/src/mediaHistory.ts +42 -0
- package/src/mediaStorageService.ts +546 -0
- package/src/memory.ts +102 -0
- package/src/nativeActions.ts +422 -0
- package/src/nativeComponentSupport.ts +60 -0
- package/src/networkPerformance.ts +30 -0
- package/src/performance.ts +137 -0
- package/src/performanceMonitor.ts +219 -0
- package/src/permissions.ts +403 -0
- package/src/rendering.ts +47 -0
- package/src/security.ts +19 -0
- package/src/state.ts +333 -0
- package/src/storage.ts +453 -0
- package/src/theme.tsx +467 -0
- package/src/types.ts +946 -0
- package/src/utils.ts +177 -0
- package/src/validation.ts +372 -0
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
import { TurboModuleRegistry, type TurboModule } from 'react-native';
|
|
2
|
+
|
|
3
|
+
const createStubModule = (): Spec => ({
|
|
4
|
+
openCamera: async () => '',
|
|
5
|
+
openCameraPicker: async () => ({ cancelled: true, assets: [] }),
|
|
6
|
+
openDocumentPicker: async () => ({ cancelled: true, assets: [] }),
|
|
7
|
+
openAudioPicker: async () => ({ cancelled: true, assets: [] }),
|
|
8
|
+
openImageVideoPicker: async () => ({ cancelled: true, assets: [] }),
|
|
9
|
+
openMediaEditor: async () => ({ cancelled: true, assets: [] }),
|
|
10
|
+
openDocument: async () => false,
|
|
11
|
+
startUpload: async () => undefined,
|
|
12
|
+
getUploadState: async () => '[]',
|
|
13
|
+
getNotificationHistory: async () => '[]',
|
|
14
|
+
clearNotificationHistory: async () => undefined,
|
|
15
|
+
getDeviceCapabilities: async () => ({}),
|
|
16
|
+
cropImage: async () => '',
|
|
17
|
+
rotateImage: async () => '',
|
|
18
|
+
applyFilter: async () => '',
|
|
19
|
+
createAlbum: async () => false,
|
|
20
|
+
moveMediaToAlbum: async () => false,
|
|
21
|
+
deleteMedia: async () => false,
|
|
22
|
+
secureDeleteMedia: async () => ({
|
|
23
|
+
deleted: false,
|
|
24
|
+
securelyOverwritten: false,
|
|
25
|
+
fullySecure: false,
|
|
26
|
+
originalBytes: 0,
|
|
27
|
+
overwrittenBytes: 0,
|
|
28
|
+
derivedFilesErased: 0,
|
|
29
|
+
derivedFilesFailed: 0,
|
|
30
|
+
}),
|
|
31
|
+
deleteStoredMedia: async () => false,
|
|
32
|
+
shareMedia: async () => false,
|
|
33
|
+
setCameraFlash: async () => undefined,
|
|
34
|
+
setCameraTimer: async () => undefined,
|
|
35
|
+
enableCameraGrid: async () => undefined,
|
|
36
|
+
setMediaCaption: async () => false,
|
|
37
|
+
getMediaMetadata: async () => ({}),
|
|
38
|
+
getRecordedOriginalSize: async () => 0,
|
|
39
|
+
trimVideo: async () => '',
|
|
40
|
+
compressVideo: async () => '',
|
|
41
|
+
compressImage: async () => '',
|
|
42
|
+
scanQRCode: async () => '',
|
|
43
|
+
enableFaceDetection: async () => undefined,
|
|
44
|
+
setFaceEffect: async () => undefined,
|
|
45
|
+
setCameraTheme: async () => undefined,
|
|
46
|
+
setCameraConfig: async () => undefined,
|
|
47
|
+
// Media Storage Features
|
|
48
|
+
initializeMediaStorage: async () => ({ success: true }),
|
|
49
|
+
publishMedia: async () => ({ success: false }),
|
|
50
|
+
publishBatch: async () => ({
|
|
51
|
+
totalCount: 0,
|
|
52
|
+
successCount: 0,
|
|
53
|
+
failureCount: 0,
|
|
54
|
+
}),
|
|
55
|
+
getCachedMedia: async () => [],
|
|
56
|
+
getPublishedMedia: async () => [],
|
|
57
|
+
getStorageStats: async () => ({}),
|
|
58
|
+
cleanupOldCache: async () => ({
|
|
59
|
+
success: false,
|
|
60
|
+
filesRemoved: 0,
|
|
61
|
+
spaceFreedMB: 0,
|
|
62
|
+
}),
|
|
63
|
+
getFailedTransfers: async () => [],
|
|
64
|
+
retryFailedTransfers: async () => [],
|
|
65
|
+
playAudio: async () => undefined,
|
|
66
|
+
pauseAudio: async () => undefined,
|
|
67
|
+
resumeAudio: async () => undefined,
|
|
68
|
+
seekAudio: async () => undefined,
|
|
69
|
+
stopAudio: async () => undefined,
|
|
70
|
+
setLocalization: () => undefined,
|
|
71
|
+
// Audio Recording Features
|
|
72
|
+
startAudioRecording: async () => ({ filePath: '', mimeType: '' }),
|
|
73
|
+
stopAudioRecording: async () => ({
|
|
74
|
+
filePath: '',
|
|
75
|
+
durationMs: 0,
|
|
76
|
+
fileSizeBytes: 0,
|
|
77
|
+
mimeType: '',
|
|
78
|
+
}),
|
|
79
|
+
cancelAudioRecording: async () => ({ deleted: false }),
|
|
80
|
+
stopAndPublishAudioRecording: async () => ({
|
|
81
|
+
id: '',
|
|
82
|
+
uri: '',
|
|
83
|
+
documentUri: '',
|
|
84
|
+
type: 'audio',
|
|
85
|
+
fileName: '',
|
|
86
|
+
mimeType: '',
|
|
87
|
+
size: 0,
|
|
88
|
+
duration: 0,
|
|
89
|
+
dateTaken: 0,
|
|
90
|
+
}),
|
|
91
|
+
pauseAudioRecording: async () => undefined,
|
|
92
|
+
resumeAudioRecording: async () => undefined,
|
|
93
|
+
getAudioRecordingState: async () => ({
|
|
94
|
+
state: 'idle',
|
|
95
|
+
filePath: '',
|
|
96
|
+
durationMs: 0,
|
|
97
|
+
isPauseSupported: false,
|
|
98
|
+
}),
|
|
99
|
+
getAudioAmplitude: async () => 0,
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
export interface Spec extends TurboModule {
|
|
103
|
+
openCamera(): Promise<string>;
|
|
104
|
+
openCameraPicker(options: Object): Promise<Object>;
|
|
105
|
+
openDocumentPicker(options: Object): Promise<Object>;
|
|
106
|
+
openAudioPicker(options: Object): Promise<Object>;
|
|
107
|
+
/** Opens the system image/video picker via SAF (ACTION_OPEN_DOCUMENT). */
|
|
108
|
+
openImageVideoPicker(options: Object): Promise<Object>;
|
|
109
|
+
/**
|
|
110
|
+
* Opens an existing photo/video (e.g. one just picked from the gallery) on the camera's own
|
|
111
|
+
* preview/editor screen — the same screen, controller and tools a capture lands on. Resolves
|
|
112
|
+
* with the same `{ cancelled, assets }` shape as {@link openCameraPicker}.
|
|
113
|
+
*/
|
|
114
|
+
openMediaEditor(options: Object): Promise<Object>;
|
|
115
|
+
/** Opens a document uri in an external viewer via ACTION_VIEW. Resolves true if launched. */
|
|
116
|
+
openDocument(uri: string, mimeType: string): Promise<boolean>;
|
|
117
|
+
startUpload(uris: string[], uploadUrl: string): Promise<void>;
|
|
118
|
+
getUploadState(): Promise<string>;
|
|
119
|
+
getNotificationHistory(): Promise<string>;
|
|
120
|
+
clearNotificationHistory(): Promise<void>;
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Real device-memory facts (ActivityManager on Android): isLowRamDevice,
|
|
124
|
+
* memoryClassMb, totalRamMb, availableRamMb, isCurrentlyLowMemory, cpuCores.
|
|
125
|
+
*/
|
|
126
|
+
getDeviceCapabilities(): Promise<Object>;
|
|
127
|
+
|
|
128
|
+
// Media Editing Features
|
|
129
|
+
cropImage(uri: string, options: Object): Promise<string>;
|
|
130
|
+
rotateImage(uri: string, degrees: number): Promise<string>;
|
|
131
|
+
applyFilter(uri: string, filterType: string): Promise<string>;
|
|
132
|
+
|
|
133
|
+
// Media Management Features
|
|
134
|
+
createAlbum(albumName: string): Promise<boolean>;
|
|
135
|
+
moveMediaToAlbum(uris: string[], albumId: string): Promise<boolean>;
|
|
136
|
+
/**
|
|
137
|
+
* Deletes media files. On Android each file's bytes are securely overwritten
|
|
138
|
+
* with encrypted cryptographically secure random data before the file is
|
|
139
|
+
* unlinked, and cached copies / derived variants are swept too.
|
|
140
|
+
*
|
|
141
|
+
* Resolves `true` when at least one file was removed. It CANNOT express
|
|
142
|
+
* whether the overwrite succeeded — use {@link secureDeleteMedia} when the
|
|
143
|
+
* security verdict matters (e.g. before telling a user the media is gone).
|
|
144
|
+
*/
|
|
145
|
+
deleteMedia(uris: string[]): Promise<boolean>;
|
|
146
|
+
/**
|
|
147
|
+
* Securely deletes ONE media item and reports exactly what was achieved.
|
|
148
|
+
*
|
|
149
|
+
* The file's exact size is measured, it is overwritten with encrypted CSPRNG
|
|
150
|
+
* garbage 2 MiB longer than that size (chunked, so nothing is held in RAM at
|
|
151
|
+
* file scale), the write is flushed to storage, and only then is the file
|
|
152
|
+
* unlinked — after which thumbnails, cached copies, derived variants and
|
|
153
|
+
* native metadata references are removed.
|
|
154
|
+
*
|
|
155
|
+
* `options` accepts `{ assetId, fileName, coverUri }`. Passing `assetId` is
|
|
156
|
+
* strongly preferred: compressed/exported/edited variants and video cover
|
|
157
|
+
* frames are named after it, and without it those copies of the same media
|
|
158
|
+
* are not found.
|
|
159
|
+
*
|
|
160
|
+
* Resolves `{ deleted, securelyOverwritten, fullySecure, originalBytes,
|
|
161
|
+
* overwrittenBytes, derivedFilesErased, derivedFilesFailed, error? }`. Only
|
|
162
|
+
* `fullySecure` justifies reporting a secure deletion to the user.
|
|
163
|
+
*/
|
|
164
|
+
secureDeleteMedia(uri: string, options: Object): Promise<Object>;
|
|
165
|
+
deleteStoredMedia(mediaId: string): Promise<boolean>;
|
|
166
|
+
/**
|
|
167
|
+
* Share one or more media uris through the native Android share sheet using
|
|
168
|
+
* Intent.ACTION_SEND (single item) or Intent.ACTION_SEND_MULTIPLE (multiple
|
|
169
|
+
* items), with the correct MIME type. `file://` paths are wrapped in a
|
|
170
|
+
* FileProvider content uri so no raw file path leaks to another process.
|
|
171
|
+
* Resolves `true` when the share chooser was launched, `false` otherwise.
|
|
172
|
+
*/
|
|
173
|
+
shareMedia(uris: string[], mimeType: string): Promise<boolean>;
|
|
174
|
+
|
|
175
|
+
// Advanced Camera Features
|
|
176
|
+
setCameraFlash(mode: string): Promise<void>;
|
|
177
|
+
setCameraTimer(delaySeconds: number): Promise<void>;
|
|
178
|
+
enableCameraGrid(enabled: boolean): Promise<void>;
|
|
179
|
+
|
|
180
|
+
// Metadata Features
|
|
181
|
+
setMediaCaption(uri: string, caption: string): Promise<boolean>;
|
|
182
|
+
getMediaMetadata(uri: string): Promise<Object>;
|
|
183
|
+
/**
|
|
184
|
+
* The byte length of the exact clip the recording process finalized under `mediaId`, or 0 when
|
|
185
|
+
* none is remembered. Lets a preview quote the recorded size (matching the recording counter and
|
|
186
|
+
* the native editor's "Original" row) instead of the smaller background-cropped file on disk.
|
|
187
|
+
*/
|
|
188
|
+
getRecordedOriginalSize(mediaId: string): Promise<number>;
|
|
189
|
+
|
|
190
|
+
// Video Features
|
|
191
|
+
trimVideo(uri: string, startTime: number, endTime: number): Promise<string>;
|
|
192
|
+
compressVideo(uri: string, qualityOrOption: string): Promise<string>;
|
|
193
|
+
|
|
194
|
+
// Image Features
|
|
195
|
+
compressImage(uri: string, qualityOrOption: string): Promise<string>;
|
|
196
|
+
|
|
197
|
+
// QR Code Features
|
|
198
|
+
scanQRCode(): Promise<string>;
|
|
199
|
+
|
|
200
|
+
// Face Detection Features
|
|
201
|
+
enableFaceDetection(enabled: boolean): Promise<void>;
|
|
202
|
+
setFaceEffect(effectType: string): Promise<void>;
|
|
203
|
+
|
|
204
|
+
// Theme Features
|
|
205
|
+
setCameraTheme(theme: string): Promise<void>;
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* Push the full serialized white-label config (theme + icons + animations +
|
|
209
|
+
* dimensions + notifications) to native. Stored in SharedPreferences and read
|
|
210
|
+
* by the camera Activity/editor on next launch.
|
|
211
|
+
*/
|
|
212
|
+
setCameraConfig(configJson: string): Promise<void>;
|
|
213
|
+
|
|
214
|
+
// Media Storage Features
|
|
215
|
+
initializeMediaStorage(): Promise<Object>;
|
|
216
|
+
publishMedia(mediaId: string, moveMode: boolean): Promise<Object>;
|
|
217
|
+
publishBatch(mediaIds: string[], moveMode: boolean): Promise<Object>;
|
|
218
|
+
getCachedMedia(): Promise<Object[]>;
|
|
219
|
+
getPublishedMedia(): Promise<Object[]>;
|
|
220
|
+
getStorageStats(): Promise<Object>;
|
|
221
|
+
cleanupOldCache(olderThanDays: number): Promise<Object>;
|
|
222
|
+
getFailedTransfers(): Promise<Object[]>;
|
|
223
|
+
retryFailedTransfers(): Promise<Object[]>;
|
|
224
|
+
|
|
225
|
+
// Audio Player Features
|
|
226
|
+
playAudio(uri: string, title: string): Promise<void>;
|
|
227
|
+
pauseAudio(): Promise<void>;
|
|
228
|
+
resumeAudio(): Promise<void>;
|
|
229
|
+
seekAudio(positionMs: number): Promise<void>;
|
|
230
|
+
stopAudio(): Promise<void>;
|
|
231
|
+
|
|
232
|
+
// ── Audio Recording Features ─────────────────────────────────────────
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* Start recording audio via native MediaRecorder.
|
|
236
|
+
* Resolves with `{ filePath, mimeType }`.
|
|
237
|
+
*
|
|
238
|
+
* Options (all optional):
|
|
239
|
+
* - `outputFormat`: 'mpeg4' | 'aac_adts' | 'amr_nb' | 'amr_wb' | 'three_gpp'
|
|
240
|
+
* - `audioEncoder`: 'aac' | 'amr_nb' | 'amr_wb' | 'he_aac'
|
|
241
|
+
* - `audioSource`: 'mic' | 'camcorder' | 'voice_recognition' | 'voice_communication'
|
|
242
|
+
* - `bitRate`: number (default 128000)
|
|
243
|
+
* - `sampleRate`: number (default 44100)
|
|
244
|
+
* - `meteringIntervalMs`: number (0 = disabled; >0 fires `onAudioAmplitude` events)
|
|
245
|
+
*/
|
|
246
|
+
startAudioRecording(options: Object): Promise<Object>;
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* Stop the active recording.
|
|
250
|
+
* Resolves with `{ filePath, durationMs, fileSizeBytes, mimeType }`.
|
|
251
|
+
*/
|
|
252
|
+
stopAudioRecording(): Promise<Object>;
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* Cancel the active recording and delete the temporary file.
|
|
256
|
+
* Resolves with `{ deleted: boolean }`.
|
|
257
|
+
*/
|
|
258
|
+
cancelAudioRecording(): Promise<Object>;
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* Stop the active recording, validate the file, move it to the Documents
|
|
262
|
+
* directory, and return the finalized audio asset.
|
|
263
|
+
*
|
|
264
|
+
* Resolves with an asset map: `{ id, uri, documentUri, type, fileName,
|
|
265
|
+
* mimeType, size, duration, dateTaken }`.
|
|
266
|
+
*/
|
|
267
|
+
stopAndPublishAudioRecording(): Promise<Object>;
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* Pause the current recording (requires API 24+).
|
|
271
|
+
*/
|
|
272
|
+
pauseAudioRecording(): Promise<void>;
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* Resume a paused recording (requires API 24+).
|
|
276
|
+
*/
|
|
277
|
+
resumeAudioRecording(): Promise<void>;
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* Get the current recording state.
|
|
281
|
+
* Resolves with `{ state, filePath, durationMs, isPauseSupported }`.
|
|
282
|
+
*/
|
|
283
|
+
getAudioRecordingState(): Promise<Object>;
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* Get the current max amplitude from the active MediaRecorder.
|
|
287
|
+
* Returns an integer (0 = silence, higher = louder).
|
|
288
|
+
*/
|
|
289
|
+
getAudioAmplitude(): Promise<number>;
|
|
290
|
+
|
|
291
|
+
// Localization bridge
|
|
292
|
+
/**
|
|
293
|
+
* Pushes the host app's strings, text direction and active language to the
|
|
294
|
+
* native camera. `locale` is a BCP-47 tag ('fr', 'zh-Hans', 'ar') or '' when
|
|
295
|
+
* the host has not set one, in which case native formatting uses the device
|
|
296
|
+
* locale. Prefer `setCameraLocalization` / `setCameraLanguage` over calling
|
|
297
|
+
* this directly.
|
|
298
|
+
*/
|
|
299
|
+
setLocalization(translations: Object, isRtl: boolean, locale: string): void;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
const nativeModule =
|
|
303
|
+
TurboModuleRegistry.get<Spec>('CustomCamera') ?? createStubModule();
|
|
304
|
+
|
|
305
|
+
export default nativeModule;
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
function createUnsupportedPlatformError(): Error {
|
|
2
|
+
return new Error('react-native-ensys-camera-x is not supported on web');
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
function rejectUnsupported<T>(): Promise<T> {
|
|
6
|
+
return Promise.reject(createUnsupportedPlatformError());
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const CustomCamera = {
|
|
10
|
+
openCamera(): Promise<string> {
|
|
11
|
+
return rejectUnsupported();
|
|
12
|
+
},
|
|
13
|
+
|
|
14
|
+
openCameraPicker(_options: Object): Promise<Object> {
|
|
15
|
+
return rejectUnsupported();
|
|
16
|
+
},
|
|
17
|
+
|
|
18
|
+
openDocumentPicker(_options: Object): Promise<Object> {
|
|
19
|
+
return rejectUnsupported();
|
|
20
|
+
},
|
|
21
|
+
|
|
22
|
+
openAudioPicker(_options: Object): Promise<Object> {
|
|
23
|
+
return rejectUnsupported();
|
|
24
|
+
},
|
|
25
|
+
|
|
26
|
+
openImageVideoPicker(_options: Object): Promise<Object> {
|
|
27
|
+
return rejectUnsupported();
|
|
28
|
+
},
|
|
29
|
+
|
|
30
|
+
openMediaEditor(_options: Object): Promise<Object> {
|
|
31
|
+
return rejectUnsupported();
|
|
32
|
+
},
|
|
33
|
+
|
|
34
|
+
openDocument(_uri: string, _mimeType: string): Promise<boolean> {
|
|
35
|
+
return rejectUnsupported();
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
startUpload(_uris: string[], _uploadUrl: string): Promise<void> {
|
|
39
|
+
return rejectUnsupported();
|
|
40
|
+
},
|
|
41
|
+
|
|
42
|
+
getUploadState(): Promise<string> {
|
|
43
|
+
return rejectUnsupported();
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
getNotificationHistory(): Promise<string> {
|
|
47
|
+
return rejectUnsupported();
|
|
48
|
+
},
|
|
49
|
+
|
|
50
|
+
clearNotificationHistory(): Promise<void> {
|
|
51
|
+
return rejectUnsupported();
|
|
52
|
+
},
|
|
53
|
+
|
|
54
|
+
getDeviceCapabilities(): Promise<Object> {
|
|
55
|
+
return rejectUnsupported();
|
|
56
|
+
},
|
|
57
|
+
|
|
58
|
+
cropImage(_uri: string, _options: Object): Promise<string> {
|
|
59
|
+
return rejectUnsupported();
|
|
60
|
+
},
|
|
61
|
+
|
|
62
|
+
rotateImage(_uri: string, _degrees: number): Promise<string> {
|
|
63
|
+
return rejectUnsupported();
|
|
64
|
+
},
|
|
65
|
+
|
|
66
|
+
applyFilter(_uri: string, _filterType: string): Promise<string> {
|
|
67
|
+
return rejectUnsupported();
|
|
68
|
+
},
|
|
69
|
+
|
|
70
|
+
createAlbum(_albumName: string): Promise<boolean> {
|
|
71
|
+
return rejectUnsupported();
|
|
72
|
+
},
|
|
73
|
+
|
|
74
|
+
moveMediaToAlbum(_uris: string[], _albumId: string): Promise<boolean> {
|
|
75
|
+
return rejectUnsupported();
|
|
76
|
+
},
|
|
77
|
+
|
|
78
|
+
deleteMedia(_uris: string[]): Promise<boolean> {
|
|
79
|
+
return rejectUnsupported();
|
|
80
|
+
},
|
|
81
|
+
|
|
82
|
+
secureDeleteMedia(_uri: string, _options: Object): Promise<Object> {
|
|
83
|
+
return rejectUnsupported();
|
|
84
|
+
},
|
|
85
|
+
|
|
86
|
+
shareMedia(_uris: string[], _mimeType: string): Promise<boolean> {
|
|
87
|
+
return rejectUnsupported();
|
|
88
|
+
},
|
|
89
|
+
|
|
90
|
+
setCameraFlash(_mode: string): Promise<void> {
|
|
91
|
+
return rejectUnsupported();
|
|
92
|
+
},
|
|
93
|
+
|
|
94
|
+
setCameraTimer(_delaySeconds: number): Promise<void> {
|
|
95
|
+
return rejectUnsupported();
|
|
96
|
+
},
|
|
97
|
+
|
|
98
|
+
enableCameraGrid(_enabled: boolean): Promise<void> {
|
|
99
|
+
return rejectUnsupported();
|
|
100
|
+
},
|
|
101
|
+
|
|
102
|
+
setMediaCaption(_uri: string, _caption: string): Promise<boolean> {
|
|
103
|
+
return rejectUnsupported();
|
|
104
|
+
},
|
|
105
|
+
|
|
106
|
+
getMediaMetadata(_uri: string): Promise<Object> {
|
|
107
|
+
return rejectUnsupported();
|
|
108
|
+
},
|
|
109
|
+
|
|
110
|
+
getRecordedOriginalSize(_mediaId: string): Promise<number> {
|
|
111
|
+
return rejectUnsupported();
|
|
112
|
+
},
|
|
113
|
+
|
|
114
|
+
trimVideo(
|
|
115
|
+
_uri: string,
|
|
116
|
+
_startTime: number,
|
|
117
|
+
_endTime: number
|
|
118
|
+
): Promise<string> {
|
|
119
|
+
return rejectUnsupported();
|
|
120
|
+
},
|
|
121
|
+
|
|
122
|
+
compressVideo(
|
|
123
|
+
uri: string,
|
|
124
|
+
_qualityOrOption: string
|
|
125
|
+
): Promise<string> {
|
|
126
|
+
// For web fallback, return the original URI without modification
|
|
127
|
+
return Promise.resolve(uri);
|
|
128
|
+
},
|
|
129
|
+
|
|
130
|
+
compressImage(uri: string, _qualityOrOption: string): Promise<string> {
|
|
131
|
+
// Same web fallback as compressVideo: hand the original URI back unmodified rather than
|
|
132
|
+
// rejecting, so a caller that only wants a smaller copy still gets a usable one.
|
|
133
|
+
return Promise.resolve(uri);
|
|
134
|
+
},
|
|
135
|
+
|
|
136
|
+
scanQRCode(): Promise<string> {
|
|
137
|
+
return rejectUnsupported();
|
|
138
|
+
},
|
|
139
|
+
|
|
140
|
+
enableFaceDetection(_enabled: boolean): Promise<void> {
|
|
141
|
+
return rejectUnsupported();
|
|
142
|
+
},
|
|
143
|
+
|
|
144
|
+
setFaceEffect(_effectType: string): Promise<void> {
|
|
145
|
+
return rejectUnsupported();
|
|
146
|
+
},
|
|
147
|
+
|
|
148
|
+
setCameraTheme(_theme: string): Promise<void> {
|
|
149
|
+
return rejectUnsupported();
|
|
150
|
+
},
|
|
151
|
+
|
|
152
|
+
setCameraConfig(_configJson: string): Promise<void> {
|
|
153
|
+
return rejectUnsupported();
|
|
154
|
+
},
|
|
155
|
+
|
|
156
|
+
setLocalization(_translations: Object, _isRtl: boolean, _locale: string): void {},
|
|
157
|
+
|
|
158
|
+
// Audio Recording Features (unsupported on web)
|
|
159
|
+
startAudioRecording(_options: Object): Promise<Object> {
|
|
160
|
+
return rejectUnsupported();
|
|
161
|
+
},
|
|
162
|
+
|
|
163
|
+
stopAudioRecording(): Promise<Object> {
|
|
164
|
+
return rejectUnsupported();
|
|
165
|
+
},
|
|
166
|
+
|
|
167
|
+
cancelAudioRecording(): Promise<Object> {
|
|
168
|
+
return rejectUnsupported();
|
|
169
|
+
},
|
|
170
|
+
|
|
171
|
+
stopAndPublishAudioRecording(): Promise<Object> {
|
|
172
|
+
return rejectUnsupported();
|
|
173
|
+
},
|
|
174
|
+
|
|
175
|
+
pauseAudioRecording(): Promise<void> {
|
|
176
|
+
return rejectUnsupported();
|
|
177
|
+
},
|
|
178
|
+
|
|
179
|
+
resumeAudioRecording(): Promise<void> {
|
|
180
|
+
return rejectUnsupported();
|
|
181
|
+
},
|
|
182
|
+
|
|
183
|
+
getAudioRecordingState(): Promise<Object> {
|
|
184
|
+
return rejectUnsupported();
|
|
185
|
+
},
|
|
186
|
+
|
|
187
|
+
getAudioAmplitude(): Promise<number> {
|
|
188
|
+
return rejectUnsupported();
|
|
189
|
+
},
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
export default CustomCamera;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type NativeSyntheticEvent, requireNativeComponent, type ViewProps } from 'react-native';
|
|
2
|
+
|
|
3
|
+
export interface VideoPlaybackProgressEventData {
|
|
4
|
+
currentTimeMs: number;
|
|
5
|
+
durationMs: number;
|
|
6
|
+
isPlaying: boolean;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface VideoPlaybackProgressEvent extends NativeSyntheticEvent<VideoPlaybackProgressEventData> {}
|
|
10
|
+
|
|
11
|
+
export interface NativeCustomVideoViewProps extends ViewProps {
|
|
12
|
+
src?: string;
|
|
13
|
+
paused?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Whether this view is the currently-visible page in a paging viewer. When a paging host
|
|
16
|
+
* (e.g. the full-screen preview viewer) sets this per cell, only the active clip keeps a
|
|
17
|
+
* live player: deactivating releases the decoder and resets to 00:00, so returning replays
|
|
18
|
+
* from the start rather than resuming, and at most one video plays at a time.
|
|
19
|
+
*
|
|
20
|
+
* Optional — defaults to true natively, so a single-video consumer that never sets it
|
|
21
|
+
* behaves exactly as before (driven purely by `paused`).
|
|
22
|
+
*/
|
|
23
|
+
active?: boolean;
|
|
24
|
+
/** Called when the native player advances or pauses at a position. */
|
|
25
|
+
onPlaybackProgress?: (event: VideoPlaybackProgressEvent) => void;
|
|
26
|
+
/** Called once the video reaches the end of playback. */
|
|
27
|
+
onPlaybackEnded?: (event: NativeSyntheticEvent<{ durationMs: number }>) => void;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export const NativeCustomVideoView = requireNativeComponent<NativeCustomVideoViewProps>('NativeCustomVideoView');
|