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.
Files changed (506) hide show
  1. package/CustomCamera.podspec +20 -0
  2. package/LICENSE +20 -0
  3. package/README.md +833 -0
  4. package/android/build.gradle +135 -0
  5. package/android/consumer-rules.pro +47 -0
  6. package/android/src/main/AndroidManifest.xml +72 -0
  7. package/android/src/main/java/android/print/PdfPrint.java +51 -0
  8. package/android/src/main/java/com/customcamera/AnimatedImageViewManager.kt +199 -0
  9. package/android/src/main/java/com/customcamera/AudioPlayerView.kt +322 -0
  10. package/android/src/main/java/com/customcamera/AudioRecorder.kt +506 -0
  11. package/android/src/main/java/com/customcamera/BarcodeScannerActivity.kt +361 -0
  12. package/android/src/main/java/com/customcamera/BlurBackgroundView.kt +199 -0
  13. package/android/src/main/java/com/customcamera/CacheCleanupManager.kt +386 -0
  14. package/android/src/main/java/com/customcamera/CameraAspectRatioMode.kt +77 -0
  15. package/android/src/main/java/com/customcamera/CameraAsset.kt +211 -0
  16. package/android/src/main/java/com/customcamera/CameraTheme.kt +479 -0
  17. package/android/src/main/java/com/customcamera/CompressionCacheStore.kt +504 -0
  18. package/android/src/main/java/com/customcamera/CompressionFileNameUtils.kt +7 -0
  19. package/android/src/main/java/com/customcamera/CompressionProfile.kt +195 -0
  20. package/android/src/main/java/com/customcamera/CustomCameraActivity.kt +7291 -0
  21. package/android/src/main/java/com/customcamera/CustomCameraFileProvider.kt +9 -0
  22. package/android/src/main/java/com/customcamera/CustomCameraModule.kt +2479 -0
  23. package/android/src/main/java/com/customcamera/CustomCameraPackage.kt +53 -0
  24. package/android/src/main/java/com/customcamera/DisplayUtils.kt +9 -0
  25. package/android/src/main/java/com/customcamera/DocumentPreviewView.kt +846 -0
  26. package/android/src/main/java/com/customcamera/DrawingView.kt +214 -0
  27. package/android/src/main/java/com/customcamera/EmojiPickerData.kt +228 -0
  28. package/android/src/main/java/com/customcamera/FilterStripAdapter.kt +158 -0
  29. package/android/src/main/java/com/customcamera/GifSupport.kt +215 -0
  30. package/android/src/main/java/com/customcamera/GlobalAudioPlayer.kt +320 -0
  31. package/android/src/main/java/com/customcamera/ImageExporter.kt +1394 -0
  32. package/android/src/main/java/com/customcamera/ImageFormatSupport.kt +163 -0
  33. package/android/src/main/java/com/customcamera/Localization.kt +206 -0
  34. package/android/src/main/java/com/customcamera/MediaAdapters.kt +758 -0
  35. package/android/src/main/java/com/customcamera/MediaCacheManager.kt +782 -0
  36. package/android/src/main/java/com/customcamera/MediaExportFormats.kt +201 -0
  37. package/android/src/main/java/com/customcamera/MediaFileIo.kt +310 -0
  38. package/android/src/main/java/com/customcamera/MediaMetadataStore.kt +494 -0
  39. package/android/src/main/java/com/customcamera/MediaPreviewEditor.kt +14865 -0
  40. package/android/src/main/java/com/customcamera/MediaPublisher.kt +423 -0
  41. package/android/src/main/java/com/customcamera/MediaStorageWorkflow.kt +722 -0
  42. package/android/src/main/java/com/customcamera/MediaStoreRepository.kt +378 -0
  43. package/android/src/main/java/com/customcamera/MediaThumbnailView.kt +286 -0
  44. package/android/src/main/java/com/customcamera/MediaUtils.kt +37 -0
  45. package/android/src/main/java/com/customcamera/NativeVideoViewManager.kt +845 -0
  46. package/android/src/main/java/com/customcamera/OfficeDocumentConverter.kt +2791 -0
  47. package/android/src/main/java/com/customcamera/PendingCaptureCrops.kt +88 -0
  48. package/android/src/main/java/com/customcamera/PowerPointPreview.kt +4077 -0
  49. package/android/src/main/java/com/customcamera/RecentPickerStore.kt +74 -0
  50. package/android/src/main/java/com/customcamera/SecureFileEraser.kt +411 -0
  51. package/android/src/main/java/com/customcamera/SecureKeyModule.kt +88 -0
  52. package/android/src/main/java/com/customcamera/SecureMediaDeleter.kt +493 -0
  53. package/android/src/main/java/com/customcamera/StickerPickerData.kt +107 -0
  54. package/android/src/main/java/com/customcamera/SvgDrawable.kt +175 -0
  55. package/android/src/main/java/com/customcamera/SvgIconViewManager.kt +77 -0
  56. package/android/src/main/java/com/customcamera/TextEntryController.kt +553 -0
  57. package/android/src/main/java/com/customcamera/ThumbnailLoader.kt +455 -0
  58. package/android/src/main/java/com/customcamera/UploadService.kt +909 -0
  59. package/android/src/main/java/com/customcamera/VideoEditUtils.kt +210 -0
  60. package/android/src/main/java/com/customcamera/VideoRotationTranscoder.kt +1992 -0
  61. package/android/src/main/java/com/customcamera/gif/AnimatedGifEncoder.kt +473 -0
  62. package/android/src/main/java/com/customcamera/gif/GifDecoder.kt +690 -0
  63. package/android/src/main/java/com/customcamera/gif/GifFramesDrawable.kt +160 -0
  64. package/android/src/main/java/com/customcamera/gif/GifHttp.kt +112 -0
  65. package/android/src/main/java/com/customcamera/gif/GifImageLoader.kt +186 -0
  66. package/android/src/main/java/com/customcamera/gif/GifModels.kt +74 -0
  67. package/android/src/main/java/com/customcamera/gif/GifProvider.kt +49 -0
  68. package/android/src/main/java/com/customcamera/gif/GifProviders.kt +27 -0
  69. package/android/src/main/java/com/customcamera/gif/GifRepository.kt +124 -0
  70. package/android/src/main/java/com/customcamera/gif/GifSafety.kt +33 -0
  71. package/android/src/main/java/com/customcamera/gif/GiphyGifProvider.kt +146 -0
  72. package/android/src/main/java/com/customcamera/gif/LZWEncoder.kt +258 -0
  73. package/android/src/main/java/com/customcamera/gif/NeuQuant.kt +435 -0
  74. package/android/src/main/java/com/customcamera/gif/TenorGifProvider.kt +147 -0
  75. package/android/src/main/res/drawable/bg_brush_selected.xml +5 -0
  76. package/android/src/main/res/drawable/bg_color_swatch.xml +5 -0
  77. package/android/src/main/res/drawable/bg_editor_toolbar.xml +6 -0
  78. package/android/src/main/res/drawable/bg_icon_circle.xml +5 -0
  79. package/android/src/main/res/drawable/bg_icon_circle_light.xml +5 -0
  80. package/android/src/main/res/drawable/bg_mode_tab_active.xml +6 -0
  81. package/android/src/main/res/drawable/bg_pill.xml +6 -0
  82. package/android/src/main/res/drawable/bg_recording_dot.xml +6 -0
  83. package/android/src/main/res/drawable/bg_selection_badge.xml +8 -0
  84. package/android/src/main/res/drawable/bg_send_button.xml +5 -0
  85. package/android/src/main/res/drawable/bg_shutter_inner.xml +5 -0
  86. package/android/src/main/res/drawable/bg_shutter_recording.xml +6 -0
  87. package/android/src/main/res/drawable/bg_shutter_ring.xml +8 -0
  88. package/android/src/main/res/drawable/bg_shutter_video_idle.xml +5 -0
  89. package/android/src/main/res/drawable/bg_thumbnail.xml +9 -0
  90. package/android/src/main/res/drawable/ic_aspect_ratio.xml +17 -0
  91. package/android/src/main/res/drawable/ic_audio.xml +10 -0
  92. package/android/src/main/res/drawable/ic_back.xml +10 -0
  93. package/android/src/main/res/drawable/ic_brush_medium.xml +12 -0
  94. package/android/src/main/res/drawable/ic_brush_thick.xml +12 -0
  95. package/android/src/main/res/drawable/ic_brush_thin.xml +12 -0
  96. package/android/src/main/res/drawable/ic_check.xml +17 -0
  97. package/android/src/main/res/drawable/ic_chevron_down.xml +10 -0
  98. package/android/src/main/res/drawable/ic_chevron_up.xml +13 -0
  99. package/android/src/main/res/drawable/ic_clear_drawing.xml +10 -0
  100. package/android/src/main/res/drawable/ic_close.xml +10 -0
  101. package/android/src/main/res/drawable/ic_cover.xml +9 -0
  102. package/android/src/main/res/drawable/ic_crop.xml +10 -0
  103. package/android/src/main/res/drawable/ic_delete.xml +9 -0
  104. package/android/src/main/res/drawable/ic_document.xml +10 -0
  105. package/android/src/main/res/drawable/ic_done.xml +10 -0
  106. package/android/src/main/res/drawable/ic_download.xml +10 -0
  107. package/android/src/main/res/drawable/ic_emoji.xml +10 -0
  108. package/android/src/main/res/drawable/ic_filter.xml +10 -0
  109. package/android/src/main/res/drawable/ic_flash_auto.xml +7 -0
  110. package/android/src/main/res/drawable/ic_flash_off.xml +23 -0
  111. package/android/src/main/res/drawable/ic_flash_on.xml +16 -0
  112. package/android/src/main/res/drawable/ic_flip.xml +15 -0
  113. package/android/src/main/res/drawable/ic_gallery.xml +10 -0
  114. package/android/src/main/res/drawable/ic_gif.xml +24 -0
  115. package/android/src/main/res/drawable/ic_lock.xml +19 -0
  116. package/android/src/main/res/drawable/ic_lock_open.xml +22 -0
  117. package/android/src/main/res/drawable/ic_marker.xml +10 -0
  118. package/android/src/main/res/drawable/ic_more_vert.xml +18 -0
  119. package/android/src/main/res/drawable/ic_overlay_close.xml +19 -0
  120. package/android/src/main/res/drawable/ic_overlay_resize.xml +18 -0
  121. package/android/src/main/res/drawable/ic_pause.xml +10 -0
  122. package/android/src/main/res/drawable/ic_photo_mode.xml +10 -0
  123. package/android/src/main/res/drawable/ic_play.xml +10 -0
  124. package/android/src/main/res/drawable/ic_redo.xml +10 -0
  125. package/android/src/main/res/drawable/ic_rotate.xml +9 -0
  126. package/android/src/main/res/drawable/ic_send.xml +10 -0
  127. package/android/src/main/res/drawable/ic_share.xml +10 -0
  128. package/android/src/main/res/drawable/ic_stat_upload.xml +10 -0
  129. package/android/src/main/res/drawable/ic_sticker.xml +24 -0
  130. package/android/src/main/res/drawable/ic_text.xml +10 -0
  131. package/android/src/main/res/drawable/ic_text_align_center.xml +11 -0
  132. package/android/src/main/res/drawable/ic_text_align_left.xml +11 -0
  133. package/android/src/main/res/drawable/ic_text_align_right.xml +11 -0
  134. package/android/src/main/res/drawable/ic_text_bg.xml +11 -0
  135. package/android/src/main/res/drawable/ic_trim.xml +23 -0
  136. package/android/src/main/res/drawable/ic_undo.xml +10 -0
  137. package/android/src/main/res/drawable/ic_video_mode.xml +10 -0
  138. package/android/src/main/res/drawable/ic_video_note.xml +13 -0
  139. package/android/src/main/res/drawable/ic_volume_off.xml +9 -0
  140. package/android/src/main/res/drawable/ic_volume_on.xml +9 -0
  141. package/android/src/main/res/drawable/sticker_heart.xml +9 -0
  142. package/android/src/main/res/drawable/sticker_smile.xml +9 -0
  143. package/android/src/main/res/drawable/sticker_star.xml +9 -0
  144. package/android/src/main/res/drawable/sticker_thumbsup.xml +9 -0
  145. package/android/src/main/res/values/colors.xml +34 -0
  146. package/android/src/main/res/values/ids.xml +15 -0
  147. package/android/src/main/res/values/strings.xml +15 -0
  148. package/android/src/main/res/values/styles.xml +20 -0
  149. package/android/src/main/res/xml/file_paths.xml +34 -0
  150. package/ios/CustomCamera.h +5 -0
  151. package/ios/CustomCamera.mm +214 -0
  152. package/lib/module/AudioPlayerContext.js +233 -0
  153. package/lib/module/AudioPlayerContext.js.map +1 -0
  154. package/lib/module/CameraPreview.js +304 -0
  155. package/lib/module/CameraPreview.js.map +1 -0
  156. package/lib/module/NativeAnimatedImageView.js +41 -0
  157. package/lib/module/NativeAnimatedImageView.js.map +1 -0
  158. package/lib/module/NativeAudioPlayerView.js +33 -0
  159. package/lib/module/NativeAudioPlayerView.js.map +1 -0
  160. package/lib/module/NativeBlurView.js +35 -0
  161. package/lib/module/NativeBlurView.js.map +1 -0
  162. package/lib/module/NativeCustomCamera.js +128 -0
  163. package/lib/module/NativeCustomCamera.js.map +1 -0
  164. package/lib/module/NativeCustomCamera.web.js +143 -0
  165. package/lib/module/NativeCustomCamera.web.js.map +1 -0
  166. package/lib/module/NativeCustomVideoView.js +5 -0
  167. package/lib/module/NativeCustomVideoView.js.map +1 -0
  168. package/lib/module/NativeDocumentPreviewView.js +156 -0
  169. package/lib/module/NativeDocumentPreviewView.js.map +1 -0
  170. package/lib/module/NativeMediaThumbnailView.js +110 -0
  171. package/lib/module/NativeMediaThumbnailView.js.map +1 -0
  172. package/lib/module/NativeSvgIcon.js +32 -0
  173. package/lib/module/NativeSvgIcon.js.map +1 -0
  174. package/lib/module/ResponsivePreviewContainer.js +171 -0
  175. package/lib/module/ResponsivePreviewContainer.js.map +1 -0
  176. package/lib/module/accessibility.js +61 -0
  177. package/lib/module/accessibility.js.map +1 -0
  178. package/lib/module/config.js +352 -0
  179. package/lib/module/config.js.map +1 -0
  180. package/lib/module/cpuOptimization.js +296 -0
  181. package/lib/module/cpuOptimization.js.map +1 -0
  182. package/lib/module/db/DatabaseManager.js +191 -0
  183. package/lib/module/db/DatabaseManager.js.map +1 -0
  184. package/lib/module/db/MediaMapper.js +284 -0
  185. package/lib/module/db/MediaMapper.js.map +1 -0
  186. package/lib/module/db/MediaRepository.js +242 -0
  187. package/lib/module/db/MediaRepository.js.map +1 -0
  188. package/lib/module/db/index.js +41 -0
  189. package/lib/module/db/index.js.map +1 -0
  190. package/lib/module/db/migrations.js +180 -0
  191. package/lib/module/db/migrations.js.map +1 -0
  192. package/lib/module/db/react-native-sqlcipher.d.js +2 -0
  193. package/lib/module/db/react-native-sqlcipher.d.js.map +1 -0
  194. package/lib/module/db/secureKey.js +87 -0
  195. package/lib/module/db/secureKey.js.map +1 -0
  196. package/lib/module/db/types.js +57 -0
  197. package/lib/module/db/types.js.map +1 -0
  198. package/lib/module/db/useMediaDatabase.js +123 -0
  199. package/lib/module/db/useMediaDatabase.js.map +1 -0
  200. package/lib/module/defaultIcons.js +2259 -0
  201. package/lib/module/defaultIcons.js.map +1 -0
  202. package/lib/module/deviceCapabilities.js +408 -0
  203. package/lib/module/deviceCapabilities.js.map +1 -0
  204. package/lib/module/errors.js +267 -0
  205. package/lib/module/errors.js.map +1 -0
  206. package/lib/module/iconConfig.js +796 -0
  207. package/lib/module/iconConfig.js.map +1 -0
  208. package/lib/module/icons.js +514 -0
  209. package/lib/module/icons.js.map +1 -0
  210. package/lib/module/index.js +251 -0
  211. package/lib/module/index.js.map +1 -0
  212. package/lib/module/jest-globals.d.js +2 -0
  213. package/lib/module/jest-globals.d.js.map +1 -0
  214. package/lib/module/library/MediaLibrary.js +107 -0
  215. package/lib/module/library/MediaLibrary.js.map +1 -0
  216. package/lib/module/library/MediaLibraryScreen.js +2597 -0
  217. package/lib/module/library/MediaLibraryScreen.js.map +1 -0
  218. package/lib/module/library/components/AudioPreview.js +74 -0
  219. package/lib/module/library/components/AudioPreview.js.map +1 -0
  220. package/lib/module/library/components/DocumentPreview.js +331 -0
  221. package/lib/module/library/components/DocumentPreview.js.map +1 -0
  222. package/lib/module/library/components/ExpandableFab.js +343 -0
  223. package/lib/module/library/components/ExpandableFab.js.map +1 -0
  224. package/lib/module/library/components/FileTiles.js +251 -0
  225. package/lib/module/library/components/FileTiles.js.map +1 -0
  226. package/lib/module/library/components/ImagePreview.js +70 -0
  227. package/lib/module/library/components/ImagePreview.js.map +1 -0
  228. package/lib/module/library/components/MediaMetadataHeader.js +175 -0
  229. package/lib/module/library/components/MediaMetadataHeader.js.map +1 -0
  230. package/lib/module/library/components/RecordAudioScreen.js +816 -0
  231. package/lib/module/library/components/RecordAudioScreen.js.map +1 -0
  232. package/lib/module/library/components/VideoPreview.js +453 -0
  233. package/lib/module/library/components/VideoPreview.js.map +1 -0
  234. package/lib/module/library/components/ViewerCounter.js +55 -0
  235. package/lib/module/library/components/ViewerCounter.js.map +1 -0
  236. package/lib/module/library/compressionEstimate.js +507 -0
  237. package/lib/module/library/compressionEstimate.js.map +1 -0
  238. package/lib/module/library/fileMetadata.js +196 -0
  239. package/lib/module/library/fileMetadata.js.map +1 -0
  240. package/lib/module/library/index.js +42 -0
  241. package/lib/module/library/index.js.map +1 -0
  242. package/lib/module/library/libraryIconRegistry.js +69 -0
  243. package/lib/module/library/libraryIconRegistry.js.map +1 -0
  244. package/lib/module/library/libraryIcons.js +858 -0
  245. package/lib/module/library/libraryIcons.js.map +1 -0
  246. package/lib/module/library/localizedFormat.js +181 -0
  247. package/lib/module/library/localizedFormat.js.map +1 -0
  248. package/lib/module/library/palette.js +225 -0
  249. package/lib/module/library/palette.js.map +1 -0
  250. package/lib/module/library/responsive.js +53 -0
  251. package/lib/module/library/responsive.js.map +1 -0
  252. package/lib/module/locales.js +416 -0
  253. package/lib/module/locales.js.map +1 -0
  254. package/lib/module/localization.js +1064 -0
  255. package/lib/module/localization.js.map +1 -0
  256. package/lib/module/logger.js +20 -0
  257. package/lib/module/logger.js.map +1 -0
  258. package/lib/module/lowMemoryCache.js +206 -0
  259. package/lib/module/lowMemoryCache.js.map +1 -0
  260. package/lib/module/mediaHistory.js +33 -0
  261. package/lib/module/mediaHistory.js.map +1 -0
  262. package/lib/module/mediaStorageService.js +402 -0
  263. package/lib/module/mediaStorageService.js.map +1 -0
  264. package/lib/module/memory.js +79 -0
  265. package/lib/module/memory.js.map +1 -0
  266. package/lib/module/nativeActions.js +307 -0
  267. package/lib/module/nativeActions.js.map +1 -0
  268. package/lib/module/nativeComponentSupport.js +61 -0
  269. package/lib/module/nativeComponentSupport.js.map +1 -0
  270. package/lib/module/networkPerformance.js +24 -0
  271. package/lib/module/networkPerformance.js.map +1 -0
  272. package/lib/module/package.json +1 -0
  273. package/lib/module/performance.js +104 -0
  274. package/lib/module/performance.js.map +1 -0
  275. package/lib/module/performanceMonitor.js +155 -0
  276. package/lib/module/performanceMonitor.js.map +1 -0
  277. package/lib/module/permissions.js +370 -0
  278. package/lib/module/permissions.js.map +1 -0
  279. package/lib/module/rendering.js +40 -0
  280. package/lib/module/rendering.js.map +1 -0
  281. package/lib/module/security.js +18 -0
  282. package/lib/module/security.js.map +1 -0
  283. package/lib/module/state.js +266 -0
  284. package/lib/module/state.js.map +1 -0
  285. package/lib/module/storage.js +400 -0
  286. package/lib/module/storage.js.map +1 -0
  287. package/lib/module/theme.js +390 -0
  288. package/lib/module/theme.js.map +1 -0
  289. package/lib/module/types.js +4 -0
  290. package/lib/module/types.js.map +1 -0
  291. package/lib/module/utils.js +115 -0
  292. package/lib/module/utils.js.map +1 -0
  293. package/lib/module/validation.js +288 -0
  294. package/lib/module/validation.js.map +1 -0
  295. package/lib/typescript/package.json +1 -0
  296. package/lib/typescript/src/AudioPlayerContext.d.ts +27 -0
  297. package/lib/typescript/src/AudioPlayerContext.d.ts.map +1 -0
  298. package/lib/typescript/src/CameraPreview.d.ts +13 -0
  299. package/lib/typescript/src/CameraPreview.d.ts.map +1 -0
  300. package/lib/typescript/src/NativeAnimatedImageView.d.ts +33 -0
  301. package/lib/typescript/src/NativeAnimatedImageView.d.ts.map +1 -0
  302. package/lib/typescript/src/NativeAudioPlayerView.d.ts +12 -0
  303. package/lib/typescript/src/NativeAudioPlayerView.d.ts.map +1 -0
  304. package/lib/typescript/src/NativeBlurView.d.ts +12 -0
  305. package/lib/typescript/src/NativeBlurView.d.ts.map +1 -0
  306. package/lib/typescript/src/NativeCustomCamera.d.ts +167 -0
  307. package/lib/typescript/src/NativeCustomCamera.d.ts.map +1 -0
  308. package/lib/typescript/src/NativeCustomCamera.web.d.ts +47 -0
  309. package/lib/typescript/src/NativeCustomCamera.web.d.ts.map +1 -0
  310. package/lib/typescript/src/NativeCustomVideoView.d.ts +30 -0
  311. package/lib/typescript/src/NativeCustomVideoView.d.ts.map +1 -0
  312. package/lib/typescript/src/NativeDocumentPreviewView.d.ts +48 -0
  313. package/lib/typescript/src/NativeDocumentPreviewView.d.ts.map +1 -0
  314. package/lib/typescript/src/NativeMediaThumbnailView.d.ts +54 -0
  315. package/lib/typescript/src/NativeMediaThumbnailView.d.ts.map +1 -0
  316. package/lib/typescript/src/NativeSvgIcon.d.ts +25 -0
  317. package/lib/typescript/src/NativeSvgIcon.d.ts.map +1 -0
  318. package/lib/typescript/src/ResponsivePreviewContainer.d.ts +92 -0
  319. package/lib/typescript/src/ResponsivePreviewContainer.d.ts.map +1 -0
  320. package/lib/typescript/src/accessibility.d.ts +20 -0
  321. package/lib/typescript/src/accessibility.d.ts.map +1 -0
  322. package/lib/typescript/src/config.d.ts +145 -0
  323. package/lib/typescript/src/config.d.ts.map +1 -0
  324. package/lib/typescript/src/cpuOptimization.d.ts +63 -0
  325. package/lib/typescript/src/cpuOptimization.d.ts.map +1 -0
  326. package/lib/typescript/src/db/DatabaseManager.d.ts +48 -0
  327. package/lib/typescript/src/db/DatabaseManager.d.ts.map +1 -0
  328. package/lib/typescript/src/db/MediaMapper.d.ts +77 -0
  329. package/lib/typescript/src/db/MediaMapper.d.ts.map +1 -0
  330. package/lib/typescript/src/db/MediaRepository.d.ts +66 -0
  331. package/lib/typescript/src/db/MediaRepository.d.ts.map +1 -0
  332. package/lib/typescript/src/db/index.d.ts +23 -0
  333. package/lib/typescript/src/db/index.d.ts.map +1 -0
  334. package/lib/typescript/src/db/migrations.d.ts +31 -0
  335. package/lib/typescript/src/db/migrations.d.ts.map +1 -0
  336. package/lib/typescript/src/db/secureKey.d.ts +10 -0
  337. package/lib/typescript/src/db/secureKey.d.ts.map +1 -0
  338. package/lib/typescript/src/db/types.d.ts +115 -0
  339. package/lib/typescript/src/db/types.d.ts.map +1 -0
  340. package/lib/typescript/src/db/useMediaDatabase.d.ts +41 -0
  341. package/lib/typescript/src/db/useMediaDatabase.d.ts.map +1 -0
  342. package/lib/typescript/src/defaultIcons.d.ts +139 -0
  343. package/lib/typescript/src/defaultIcons.d.ts.map +1 -0
  344. package/lib/typescript/src/deviceCapabilities.d.ts +92 -0
  345. package/lib/typescript/src/deviceCapabilities.d.ts.map +1 -0
  346. package/lib/typescript/src/errors.d.ts +95 -0
  347. package/lib/typescript/src/errors.d.ts.map +1 -0
  348. package/lib/typescript/src/iconConfig.d.ts +176 -0
  349. package/lib/typescript/src/iconConfig.d.ts.map +1 -0
  350. package/lib/typescript/src/icons.d.ts +217 -0
  351. package/lib/typescript/src/icons.d.ts.map +1 -0
  352. package/lib/typescript/src/index.d.ts +104 -0
  353. package/lib/typescript/src/index.d.ts.map +1 -0
  354. package/lib/typescript/src/library/MediaLibrary.d.ts +57 -0
  355. package/lib/typescript/src/library/MediaLibrary.d.ts.map +1 -0
  356. package/lib/typescript/src/library/MediaLibraryScreen.d.ts +51 -0
  357. package/lib/typescript/src/library/MediaLibraryScreen.d.ts.map +1 -0
  358. package/lib/typescript/src/library/components/AudioPreview.d.ts +6 -0
  359. package/lib/typescript/src/library/components/AudioPreview.d.ts.map +1 -0
  360. package/lib/typescript/src/library/components/DocumentPreview.d.ts +10 -0
  361. package/lib/typescript/src/library/components/DocumentPreview.d.ts.map +1 -0
  362. package/lib/typescript/src/library/components/ExpandableFab.d.ts +39 -0
  363. package/lib/typescript/src/library/components/ExpandableFab.d.ts.map +1 -0
  364. package/lib/typescript/src/library/components/FileTiles.d.ts +8 -0
  365. package/lib/typescript/src/library/components/FileTiles.d.ts.map +1 -0
  366. package/lib/typescript/src/library/components/ImagePreview.d.ts +5 -0
  367. package/lib/typescript/src/library/components/ImagePreview.d.ts.map +1 -0
  368. package/lib/typescript/src/library/components/MediaMetadataHeader.d.ts +16 -0
  369. package/lib/typescript/src/library/components/MediaMetadataHeader.d.ts.map +1 -0
  370. package/lib/typescript/src/library/components/RecordAudioScreen.d.ts +8 -0
  371. package/lib/typescript/src/library/components/RecordAudioScreen.d.ts.map +1 -0
  372. package/lib/typescript/src/library/components/VideoPreview.d.ts +20 -0
  373. package/lib/typescript/src/library/components/VideoPreview.d.ts.map +1 -0
  374. package/lib/typescript/src/library/components/ViewerCounter.d.ts +13 -0
  375. package/lib/typescript/src/library/components/ViewerCounter.d.ts.map +1 -0
  376. package/lib/typescript/src/library/compressionEstimate.d.ts +313 -0
  377. package/lib/typescript/src/library/compressionEstimate.d.ts.map +1 -0
  378. package/lib/typescript/src/library/fileMetadata.d.ts +33 -0
  379. package/lib/typescript/src/library/fileMetadata.d.ts.map +1 -0
  380. package/lib/typescript/src/library/index.d.ts +40 -0
  381. package/lib/typescript/src/library/index.d.ts.map +1 -0
  382. package/lib/typescript/src/library/libraryIconRegistry.d.ts +35 -0
  383. package/lib/typescript/src/library/libraryIconRegistry.d.ts.map +1 -0
  384. package/lib/typescript/src/library/libraryIcons.d.ts +85 -0
  385. package/lib/typescript/src/library/libraryIcons.d.ts.map +1 -0
  386. package/lib/typescript/src/library/localizedFormat.d.ts +49 -0
  387. package/lib/typescript/src/library/localizedFormat.d.ts.map +1 -0
  388. package/lib/typescript/src/library/palette.d.ts +104 -0
  389. package/lib/typescript/src/library/palette.d.ts.map +1 -0
  390. package/lib/typescript/src/library/responsive.d.ts +15 -0
  391. package/lib/typescript/src/library/responsive.d.ts.map +1 -0
  392. package/lib/typescript/src/locales.d.ts +103 -0
  393. package/lib/typescript/src/locales.d.ts.map +1 -0
  394. package/lib/typescript/src/localization.d.ts +1051 -0
  395. package/lib/typescript/src/localization.d.ts.map +1 -0
  396. package/lib/typescript/src/logger.d.ts +4 -0
  397. package/lib/typescript/src/logger.d.ts.map +1 -0
  398. package/lib/typescript/src/lowMemoryCache.d.ts +64 -0
  399. package/lib/typescript/src/lowMemoryCache.d.ts.map +1 -0
  400. package/lib/typescript/src/mediaHistory.d.ts +3 -0
  401. package/lib/typescript/src/mediaHistory.d.ts.map +1 -0
  402. package/lib/typescript/src/mediaStorageService.d.ts +155 -0
  403. package/lib/typescript/src/mediaStorageService.d.ts.map +1 -0
  404. package/lib/typescript/src/memory.d.ts +21 -0
  405. package/lib/typescript/src/memory.d.ts.map +1 -0
  406. package/lib/typescript/src/nativeActions.d.ts +174 -0
  407. package/lib/typescript/src/nativeActions.d.ts.map +1 -0
  408. package/lib/typescript/src/nativeComponentSupport.d.ts +30 -0
  409. package/lib/typescript/src/nativeComponentSupport.d.ts.map +1 -0
  410. package/lib/typescript/src/networkPerformance.d.ts +12 -0
  411. package/lib/typescript/src/networkPerformance.d.ts.map +1 -0
  412. package/lib/typescript/src/performance.d.ts +32 -0
  413. package/lib/typescript/src/performance.d.ts.map +1 -0
  414. package/lib/typescript/src/performanceMonitor.d.ts +45 -0
  415. package/lib/typescript/src/performanceMonitor.d.ts.map +1 -0
  416. package/lib/typescript/src/permissions.d.ts +132 -0
  417. package/lib/typescript/src/permissions.d.ts.map +1 -0
  418. package/lib/typescript/src/rendering.d.ts +9 -0
  419. package/lib/typescript/src/rendering.d.ts.map +1 -0
  420. package/lib/typescript/src/security.d.ts +6 -0
  421. package/lib/typescript/src/security.d.ts.map +1 -0
  422. package/lib/typescript/src/state.d.ts +102 -0
  423. package/lib/typescript/src/state.d.ts.map +1 -0
  424. package/lib/typescript/src/storage.d.ts +117 -0
  425. package/lib/typescript/src/storage.d.ts.map +1 -0
  426. package/lib/typescript/src/theme.d.ts +15 -0
  427. package/lib/typescript/src/theme.d.ts.map +1 -0
  428. package/lib/typescript/src/types.d.ts +802 -0
  429. package/lib/typescript/src/types.d.ts.map +1 -0
  430. package/lib/typescript/src/utils.d.ts +50 -0
  431. package/lib/typescript/src/utils.d.ts.map +1 -0
  432. package/lib/typescript/src/validation.d.ts +52 -0
  433. package/lib/typescript/src/validation.d.ts.map +1 -0
  434. package/package.json +204 -0
  435. package/react-native.config.js +17 -0
  436. package/src/AudioPlayerContext.tsx +220 -0
  437. package/src/CameraPreview.tsx +352 -0
  438. package/src/NativeAnimatedImageView.tsx +71 -0
  439. package/src/NativeAudioPlayerView.tsx +39 -0
  440. package/src/NativeBlurView.tsx +40 -0
  441. package/src/NativeCustomCamera.ts +305 -0
  442. package/src/NativeCustomCamera.web.ts +192 -0
  443. package/src/NativeCustomVideoView.ts +30 -0
  444. package/src/NativeDocumentPreviewView.tsx +196 -0
  445. package/src/NativeMediaThumbnailView.tsx +167 -0
  446. package/src/NativeSvgIcon.tsx +46 -0
  447. package/src/ResponsivePreviewContainer.tsx +227 -0
  448. package/src/accessibility.ts +80 -0
  449. package/src/config.ts +406 -0
  450. package/src/cpuOptimization.ts +365 -0
  451. package/src/db/DatabaseManager.ts +212 -0
  452. package/src/db/MediaMapper.ts +377 -0
  453. package/src/db/MediaRepository.ts +313 -0
  454. package/src/db/index.ts +73 -0
  455. package/src/db/migrations.ts +222 -0
  456. package/src/db/react-native-sqlcipher.d.ts +76 -0
  457. package/src/db/secureKey.ts +100 -0
  458. package/src/db/types.ts +123 -0
  459. package/src/db/useMediaDatabase.ts +191 -0
  460. package/src/defaultIcons.tsx +2390 -0
  461. package/src/deviceCapabilities.ts +438 -0
  462. package/src/errors.ts +350 -0
  463. package/src/iconConfig.tsx +962 -0
  464. package/src/icons.tsx +788 -0
  465. package/src/index.tsx +763 -0
  466. package/src/jest-globals.d.ts +9 -0
  467. package/src/library/MediaLibrary.tsx +141 -0
  468. package/src/library/MediaLibraryScreen.tsx +3003 -0
  469. package/src/library/components/AudioPreview.tsx +73 -0
  470. package/src/library/components/DocumentPreview.tsx +361 -0
  471. package/src/library/components/ExpandableFab.tsx +342 -0
  472. package/src/library/components/FileTiles.tsx +252 -0
  473. package/src/library/components/ImagePreview.tsx +72 -0
  474. package/src/library/components/MediaMetadataHeader.tsx +208 -0
  475. package/src/library/components/RecordAudioScreen.tsx +845 -0
  476. package/src/library/components/VideoPreview.tsx +478 -0
  477. package/src/library/components/ViewerCounter.tsx +71 -0
  478. package/src/library/compressionEstimate.ts +662 -0
  479. package/src/library/fileMetadata.ts +212 -0
  480. package/src/library/index.ts +66 -0
  481. package/src/library/libraryIconRegistry.tsx +86 -0
  482. package/src/library/libraryIcons.tsx +928 -0
  483. package/src/library/localizedFormat.ts +207 -0
  484. package/src/library/palette.ts +281 -0
  485. package/src/library/responsive.ts +49 -0
  486. package/src/locales.ts +381 -0
  487. package/src/localization.ts +1947 -0
  488. package/src/logger.ts +20 -0
  489. package/src/lowMemoryCache.ts +218 -0
  490. package/src/mediaHistory.ts +42 -0
  491. package/src/mediaStorageService.ts +546 -0
  492. package/src/memory.ts +102 -0
  493. package/src/nativeActions.ts +422 -0
  494. package/src/nativeComponentSupport.ts +60 -0
  495. package/src/networkPerformance.ts +30 -0
  496. package/src/performance.ts +137 -0
  497. package/src/performanceMonitor.ts +219 -0
  498. package/src/permissions.ts +403 -0
  499. package/src/rendering.ts +47 -0
  500. package/src/security.ts +19 -0
  501. package/src/state.ts +333 -0
  502. package/src/storage.ts +453 -0
  503. package/src/theme.tsx +467 -0
  504. package/src/types.ts +946 -0
  505. package/src/utils.ts +177 -0
  506. package/src/validation.ts +372 -0
@@ -0,0 +1,57 @@
1
+ /**
2
+ * CameraMediaLibrary — the batteries-included media library screen.
3
+ *
4
+ * This is the drop-in entry point: ONE element renders the whole shell the
5
+ * example app renders — the category pills, the swipeable category pager, the
6
+ * Plus/Cross FAB, the full-screen viewer with its scrubber and counter, the
7
+ * document/audio preview cards, the record-audio screen, the SQLCipher-backed
8
+ * library and upload progress:
9
+ *
10
+ * ```tsx
11
+ * export default function App() {
12
+ * return (
13
+ * <CameraMediaLibrary
14
+ * locale={myApp.language} // any BCP-47 tag the host already uses
15
+ * bundles={MY_TRANSLATIONS} // the host's existing translation data
16
+ * uploadUrl="https://api.example.com/upload"
17
+ * />
18
+ * );
19
+ * }
20
+ * ```
21
+ *
22
+ * It wraps {@link MediaLibraryScreen} in the plugin's three providers —
23
+ * `CameraThemeProvider`, `CameraIconProvider`, `CameraLocalizationProvider` —
24
+ * so a host needs no provider boilerplate of its own. Hosts that already mount
25
+ * those providers (because they use other plugin surfaces too) should render
26
+ * `<MediaLibraryScreen />` directly instead and skip the duplication.
27
+ *
28
+ * Defaults are the shipped design: omitting `theme` keeps the plugin's palette,
29
+ * omitting `icons` uses {@link libraryIconRegistry} (the shell's hand-authored
30
+ * outline set), and omitting `locale`/`bundles` renders English.
31
+ *
32
+ * The props are an alternative to `configureCameraPlugin`, not an addition to
33
+ * it. Configure language and icons through either one — a bare
34
+ * `<CameraMediaLibrary />` inherits whatever `configureCameraPlugin` set, and
35
+ * localization props passed here take over from it (they replace the plugin's
36
+ * localization config rather than merging into it).
37
+ */
38
+ import { type FC } from 'react';
39
+ import { type CameraLocalizationProviderProps } from '../localization';
40
+ import { type CameraIconRegistryConfig } from '../icons';
41
+ import type { CameraThemeInput } from '../types';
42
+ import { type MediaLibraryScreenProps } from './MediaLibraryScreen';
43
+ export interface CameraMediaLibraryProps extends MediaLibraryScreenProps, Omit<CameraLocalizationProviderProps, 'children'> {
44
+ /**
45
+ * Colors/sizing for the plugin — the native camera screens AND this shell's
46
+ * plugin-linked palette tokens. Omit to keep the shipped look.
47
+ */
48
+ theme?: CameraThemeInput;
49
+ /**
50
+ * Icon overrides. The shell's own outline set is the base registry, so
51
+ * `{ overrides: { camera: { component: MyCameraIcon } } }` replaces one icon
52
+ * and leaves the rest alone. Passing `{ registry }` replaces the set wholesale.
53
+ */
54
+ icons?: CameraIconRegistryConfig;
55
+ }
56
+ export declare const CameraMediaLibrary: FC<CameraMediaLibraryProps>;
57
+ //# sourceMappingURL=MediaLibrary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MediaLibrary.d.ts","sourceRoot":"","sources":["../../../../src/library/MediaLibrary.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,OAAO,EAAW,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAEL,KAAK,+BAA+B,EACrC,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAsB,KAAK,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAC7E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEjD,OAAO,EAEL,KAAK,uBAAuB,EAC7B,MAAM,sBAAsB,CAAC;AAE9B,MAAM,WAAW,uBACf,SAAQ,uBAAuB,EAC7B,IAAI,CAAC,+BAA+B,EAAE,UAAU,CAAC;IACnD;;;OAGG;IACH,KAAK,CAAC,EAAE,gBAAgB,CAAC;IACzB;;;;OAIG;IACH,KAAK,CAAC,EAAE,wBAAwB,CAAC;CAClC;AAED,eAAO,MAAM,kBAAkB,EAAE,EAAE,CAAC,uBAAuB,CAuE1D,CAAC"}
@@ -0,0 +1,51 @@
1
+ import { type StyleProp, type ViewStyle } from 'react-native';
2
+ import type { CameraAsset } from '../types';
3
+ declare const FILTER_KEYS: readonly ["all", "photos", "videos", "documents", "audio"];
4
+ /**
5
+ * One of the five library categories, in tab order. Exported from the package
6
+ * as `MediaLibraryFilterKey` — the type of the `initialFilter` prop.
7
+ */
8
+ export type FilterKey = (typeof FILTER_KEYS)[number];
9
+ /** Props for {@link MediaLibraryScreen}. */
10
+ export interface MediaLibraryScreenProps {
11
+ /**
12
+ * Where confirmed media is POSTed by the native foreground UploadService —
13
+ * this is what drives the upload progress / completed / failed notifications
14
+ * in the system notification bar.
15
+ *
16
+ * OMIT IT and nothing is uploaded: every other behaviour (capture, edit, send,
17
+ * SQLCipher persistence, the list refresh) is byte-for-byte identical. Set it
18
+ * to your own endpoint to switch uploads on.
19
+ */
20
+ uploadUrl?: string;
21
+ /** Category tab selected on first mount. Defaults to `'all'`. */
22
+ initialFilter?: FilterKey;
23
+ /**
24
+ * Called with the full asset list whenever the encrypted store changes
25
+ * (capture, gallery pick, delete). Useful for a badge count or an outer
26
+ * screen that mirrors the library.
27
+ */
28
+ onAssetsChange?: (assets: CameraAsset[]) => void;
29
+ /** Extra style for the screen's root container. */
30
+ style?: StyleProp<ViewStyle>;
31
+ }
32
+ /**
33
+ * The media library screen: the category tabs + swipeable category pager, the
34
+ * Plus/Cross FAB that opens the camera / gallery editor / document + audio
35
+ * pickers / audio recorder, the full-screen swipeable viewer (image, video with
36
+ * scrubber, document and audio preview cards) with its position counter and
37
+ * details sheet, and the mini audio player.
38
+ *
39
+ * It reads its entire dataset from the encrypted SQLCipher store, so it needs
40
+ * the `react-native-sqlcipher` peer dependency installed.
41
+ *
42
+ * Providers above it are optional: the theme, icon and localization hooks all
43
+ * fall back to the process-wide configuration (`configureCameraPlugin`,
44
+ * `setCameraIcons`, `setCameraLocalization`), so this renders correctly on its
45
+ * own. What it does NOT do by itself is install the shell's hand-authored
46
+ * outline icon set — {@link CameraMediaLibrary} adds that (plus the three
47
+ * providers) on top, which is why the drop-in is the recommended entry point.
48
+ */
49
+ export declare function MediaLibraryScreen({ uploadUrl, initialFilter, onAssetsChange, style, }?: MediaLibraryScreenProps): import("react").JSX.Element;
50
+ export {};
51
+ //# sourceMappingURL=MediaLibraryScreen.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MediaLibraryScreen.d.ts","sourceRoot":"","sources":["../../../../src/library/MediaLibraryScreen.tsx"],"names":[],"mappings":"AASA,OAAO,EAeL,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,WAAW,EAAiB,MAAM,UAAU,CAAC;AAwF3D,QAAA,MAAM,WAAW,4DAA6D,CAAC;AAC/E;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AA2frD,4CAA4C;AAC5C,MAAM,WAAW,uBAAuB;IACtC;;;;;;;;OAQG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iEAAiE;IACjE,aAAa,CAAC,EAAE,SAAS,CAAC;IAC1B;;;;OAIG;IACH,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,EAAE,KAAK,IAAI,CAAC;IACjD,mDAAmD;IACnD,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,SAAS,EACT,aAAqB,EACrB,cAAc,EACd,KAAK,GACN,GAAE,uBAA4B,+BAupD9B"}
@@ -0,0 +1,6 @@
1
+ import type { CameraAsset } from '../../types';
2
+ export declare const AudioPreview: ({ asset, active, }: {
3
+ asset: CameraAsset;
4
+ active: boolean;
5
+ }) => import("react").JSX.Element;
6
+ //# sourceMappingURL=AudioPreview.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AudioPreview.d.ts","sourceRoot":"","sources":["../../../../../src/library/components/AudioPreview.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAS/C,eAAO,MAAM,YAAY,GAAI,oBAG1B;IACD,KAAK,EAAE,WAAW,CAAC;IACnB,MAAM,EAAE,OAAO,CAAC;CACjB,gCAsBA,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { CameraAsset } from '../../types';
2
+ export declare const DocumentPreview: ({ asset, active, }: {
3
+ asset: CameraAsset;
4
+ /**
5
+ * False while this document's page is off-screen in the paging viewer — pauses expensive
6
+ * native work (PDF page rasterization), mirroring the audio/video cells' `active` gate.
7
+ */
8
+ active?: boolean;
9
+ }) => import("react").JSX.Element;
10
+ //# sourceMappingURL=DocumentPreview.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DocumentPreview.d.ts","sourceRoot":"","sources":["../../../../../src/library/components/DocumentPreview.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAkE/C,eAAO,MAAM,eAAe,GAAI,oBAG7B;IACD,KAAK,EAAE,WAAW,CAAC;IACnB;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,gCA4IA,CAAC"}
@@ -0,0 +1,39 @@
1
+ /**
2
+ * ExpandableFab — a bottom-right Floating Action Button that expands into a stack of labelled
3
+ * action rows (Camera / Document / Audio).
4
+ *
5
+ * Constraints honoured:
6
+ * • All icons are hand-authored from RN primitives (see ../icons/CustomIcons) — no icon library,
7
+ * no react-native-svg, no external assets.
8
+ * • All motion uses ONLY React Native's built-in Animated API (no reanimated / animatable / moti /
9
+ * lottie). A single Animated.Value drives everything, so there is one source of truth and the
10
+ * expand/collapse reverse is exact.
11
+ * • Transforms + opacity run on the native driver, so it stays smooth on low-end devices.
12
+ *
13
+ * State model: `open` (React state) is the source of truth; an effect animates `progress` toward
14
+ * it. Rapid taps just flip `open`; Animated.timing redirects from the current value, so there are
15
+ * no glitches or half-open states. The menu auto-collapses when an action is picked, when the
16
+ * backdrop is tapped, and whenever the FAB is disabled (e.g. a capture is in flight).
17
+ */
18
+ import { type FC } from 'react';
19
+ import { type ColorValue } from 'react-native';
20
+ export interface ExpandableFabProps {
21
+ onCamera: () => void;
22
+ /**
23
+ * Opens the device gallery for an existing image or video, then hands the pick to the same
24
+ * preview/editor screen a capture opens on (image editor for a photo, video editor for a clip).
25
+ */
26
+ onImageVideo: () => void;
27
+ onDocument: () => void;
28
+ onAudio: () => void;
29
+ onRecordAudio: () => void;
30
+ /** Shows a spinner on the FAB and disables interaction (e.g. while capturing). */
31
+ busy?: boolean;
32
+ disabled?: boolean;
33
+ /** Distance from the right/bottom screen edges — defaults match the app's original FAB. */
34
+ right?: number;
35
+ bottom?: number;
36
+ accentColor?: ColorValue;
37
+ }
38
+ export declare const ExpandableFab: FC<ExpandableFabProps>;
39
+ //# sourceMappingURL=ExpandableFab.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExpandableFab.d.ts","sourceRoot":"","sources":["../../../../../src/library/components/ExpandableFab.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAqD,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AACnF,OAAO,EASL,KAAK,UAAU,EAChB,MAAM,cAAc,CAAC;AAkBtB,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB;;;OAGG;IACH,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,kFAAkF;IAClF,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,2FAA2F;IAC3F,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,UAAU,CAAC;CAC1B;AAOD,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,CA2LhD,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { CameraAsset } from '../../types';
2
+ export declare const DocumentTile: ({ asset }: {
3
+ asset: CameraAsset;
4
+ }) => import("react").JSX.Element;
5
+ export declare const AudioTile: ({ asset }: {
6
+ asset: CameraAsset;
7
+ }) => import("react").JSX.Element;
8
+ //# sourceMappingURL=FileTiles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileTiles.d.ts","sourceRoot":"","sources":["../../../../../src/library/components/FileTiles.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAoI/C,eAAO,MAAM,YAAY,GAAI,WAAW;IAAE,KAAK,EAAE,WAAW,CAAA;CAAE,gCA6B7D,CAAC;AAEF,eAAO,MAAM,SAAS,GAAI,WAAW;IAAE,KAAK,EAAE,WAAW,CAAA;CAAE,gCA4B1D,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { CameraAsset } from '../../types';
2
+ export declare const ImagePreview: ({ asset, }: {
3
+ asset: CameraAsset;
4
+ }) => import("react").JSX.Element;
5
+ //# sourceMappingURL=ImagePreview.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ImagePreview.d.ts","sourceRoot":"","sources":["../../../../../src/library/components/ImagePreview.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAI/C,eAAO,MAAM,YAAY,GAAI,YAE1B;IACD,KAAK,EAAE,WAAW,CAAC;CACpB,gCA+BA,CAAC"}
@@ -0,0 +1,16 @@
1
+ import type { CameraAsset } from '../../types';
2
+ export interface MediaMetadataHeaderProps {
3
+ asset: CameraAsset;
4
+ /** Append `width × height` — images only, and only when both are known. */
5
+ showDimensions?: boolean;
6
+ /** Append the clip length — videos and audio. */
7
+ showDuration?: boolean;
8
+ /** Meta chunk rendered before the size (the document strip's page count). */
9
+ leadingMeta?: string | null;
10
+ /** Include the capture date and time chunks. @default true */
11
+ showDateTime?: boolean;
12
+ /** Shown when the asset carries no usable file name at all. @default 'Media' */
13
+ fallbackName?: string;
14
+ }
15
+ export declare const MediaMetadataHeader: ({ asset, showDimensions, showDuration, leadingMeta, showDateTime, fallbackName, }: MediaMetadataHeaderProps) => import("react").JSX.Element;
16
+ //# sourceMappingURL=MediaMetadataHeader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MediaMetadataHeader.d.ts","sourceRoot":"","sources":["../../../../../src/library/components/MediaMetadataHeader.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAc/C,MAAM,WAAW,wBAAwB;IACvC,KAAK,EAAE,WAAW,CAAC;IACnB,2EAA2E;IAC3E,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,iDAAiD;IACjD,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,6EAA6E;IAC7E,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,8DAA8D;IAC9D,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,gFAAgF;IAChF,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAqDD,eAAO,MAAM,mBAAmB,GAAI,mFAOjC,wBAAwB,gCA+D1B,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { CameraAsset } from '../../types';
2
+ export interface RecordAudioScreenProps {
3
+ visible: boolean;
4
+ onClose: () => void;
5
+ onRecorded: (asset: CameraAsset) => void;
6
+ }
7
+ export declare const RecordAudioScreen: ({ visible, onClose, onRecorded, }: RecordAudioScreenProps) => import("react").JSX.Element;
8
+ //# sourceMappingURL=RecordAudioScreen.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RecordAudioScreen.d.ts","sourceRoot":"","sources":["../../../../../src/library/components/RecordAudioScreen.tsx"],"names":[],"mappings":"AA6CA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAW/C,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,UAAU,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;CAC1C;AAeD,eAAO,MAAM,iBAAiB,GAAI,mCAI/B,sBAAsB,gCAojBxB,CAAC"}
@@ -0,0 +1,20 @@
1
+ import type { CameraAsset } from '../../types';
2
+ export interface VideoPreviewProps {
3
+ asset: CameraAsset;
4
+ paused: boolean;
5
+ onTogglePause: () => void;
6
+ onPlaybackEnded?: () => void;
7
+ active: boolean;
8
+ controlsVisible: boolean;
9
+ /**
10
+ * Fired ONLY when the video playback area itself is tapped. The host toggles the three transport
11
+ * controls: a tap reveals them, and a tap while they are showing hides them again. There is no
12
+ * auto-hide timer — once shown the controls stay until the video is tapped again. Deliberately
13
+ * scoped to the video surface: the X/close, counter, Share/Delete/Info and surrounding chrome are
14
+ * OUTSIDE this handler and never affect (or trigger) control visibility.
15
+ */
16
+ onVideoAreaPress: () => void;
17
+ onControlInteraction: () => void;
18
+ }
19
+ export declare const VideoPreview: ({ asset, paused, onTogglePause, onPlaybackEnded, active, controlsVisible, onVideoAreaPress, onControlInteraction, }: VideoPreviewProps) => import("react").JSX.Element;
20
+ //# sourceMappingURL=VideoPreview.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VideoPreview.d.ts","sourceRoot":"","sources":["../../../../../src/library/components/VideoPreview.tsx"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AA6B/C,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,WAAW,CAAC;IACnB,MAAM,EAAE,OAAO,CAAC;IAChB,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;IAC7B,MAAM,EAAE,OAAO,CAAC;IAChB,eAAe,EAAE,OAAO,CAAC;IACzB;;;;;;OAMG;IACH,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAC7B,oBAAoB,EAAE,MAAM,IAAI,CAAC;CAClC;AAED,eAAO,MAAM,YAAY,GAAI,qHAS1B,iBAAiB,gCAqRnB,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { type StyleProp, type TextStyle } from 'react-native';
2
+ export interface ViewerCounterHandle {
3
+ /** Show `index` (0-based) immediately. Ignored when it doesn't change the rendered text. */
4
+ setIndex: (index: number) => void;
5
+ }
6
+ export interface ViewerCounterProps {
7
+ /** Settled 0-based position — re-syncs the counter when the parent moves it. */
8
+ index: number;
9
+ total: number;
10
+ style?: StyleProp<TextStyle>;
11
+ }
12
+ export declare const ViewerCounter: import("react").ForwardRefExoticComponent<ViewerCounterProps & import("react").RefAttributes<ViewerCounterHandle>>;
13
+ //# sourceMappingURL=ViewerCounter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ViewerCounter.d.ts","sourceRoot":"","sources":["../../../../../src/library/components/ViewerCounter.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAQ,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAIpE,MAAM,WAAW,mBAAmB;IAClC,4FAA4F;IAC5F,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC;AAED,MAAM,WAAW,kBAAkB;IACjC,gFAAgF;IAChF,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED,eAAO,MAAM,aAAa,oHAsCzB,CAAC"}
@@ -0,0 +1,313 @@
1
+ import type { CameraTranslationFunction } from '../localization';
2
+ /** MB of SOURCE video demuxed + decoded + re-encoded per second. */
3
+ export declare const COMPRESSION_SOURCE_MB_PER_SECOND = 1;
4
+ /** Megapixels of decoded frame data processed per second (≈ 2 s per second of 1080p). */
5
+ export declare const COMPRESSION_MEGAPIXELS_PER_SECOND = 4;
6
+ /**
7
+ * Deprecated per-level discount, kept at 1 (no discount).
8
+ *
9
+ * They used to model the native transcoder downscaling the frame once the quality ratio dropped
10
+ * under 0.6, which made a heavy level a cheaper pass. That downscale is gone — every level now
11
+ * re-encodes at FULL resolution so quality is protected rather than traded away
12
+ * (`MediaPreviewEditor.estimateCompressionSeconds` dropped its matching discount for the same
13
+ * reason) — so the pass costs the same at 5% as at 95% and the factor must not shorten the seed.
14
+ * Left in place, and exported, because they are part of this module's public surface.
15
+ */
16
+ export declare const COMPRESSION_DOWNSCALE_QUALITY_CEILING = 60;
17
+ export declare const COMPRESSION_DOWNSCALED_LEVEL_FACTOR = 1;
18
+ /**
19
+ * Floor: below this there is no countdown worth showing, and it doubles as the allowance for the
20
+ * fixed codec + muxer setup that no amount of video changes.
21
+ */
22
+ export declare const MIN_COMPRESSION_COUNTDOWN_SECONDS = 2;
23
+ /** Ceiling: a very long clip shows a bounded number and finishes in "Finalizing..." if need be. */
24
+ export declare const MAX_COMPRESSION_COUNTDOWN_SECONDS = 180;
25
+ /**
26
+ * Megapixels of STILL image compressed per second, behind {@link estimateImageCompressionSeconds}.
27
+ *
28
+ * Much lower than a plain "encode one JPEG" rate because a still compression is not one encode:
29
+ * the native compressor decodes once and then re-encodes several times while it searches for the
30
+ * quality that hits the requested size.
31
+ */
32
+ export declare const IMAGE_COMPRESSION_MEGAPIXELS_PER_SECOND = 3;
33
+ /** Ceiling for a still: even a 100 MP source is bounded well below the video ceiling. */
34
+ export declare const MAX_IMAGE_COMPRESSION_COUNTDOWN_SECONDS = 30;
35
+ /** Caption shown once there is no measurable remaining time left to quote. */
36
+ export declare const COMPRESSION_FINALIZING_LABEL = "Finalizing...";
37
+ /** Caption shown when there is no countdown to display (estimate unavailable). */
38
+ export declare const COMPRESSION_FALLBACK_LABEL = "Compressing...";
39
+ /**
40
+ * The quality percentage a dropdown option asks to KEEP (5..99), or 0 for anything that is not a
41
+ * level (the "Original Video" / "Original Image" entries, which never start a compression).
42
+ */
43
+ export declare const parseCompressionPercent: (option: string) => number;
44
+ export interface VideoCompressionEstimateInput {
45
+ /** Size of the ORIGINAL file in bytes (never a previously compressed copy's). */
46
+ sizeBytes?: number;
47
+ /** Duration of the original, in milliseconds (seconds are accepted and normalised). */
48
+ duration?: number;
49
+ /** The original's own pixel dimensions. */
50
+ width?: number;
51
+ height?: number;
52
+ /** The selected level: the percentage of the original QUALITY to keep (5..99). Lower = stronger. */
53
+ percent: number;
54
+ }
55
+ /**
56
+ * How long compressing a clip is expected to take, in whole seconds — the value the countdown
57
+ * starts at, and only that: measured progress takes the figure over within the first second or so
58
+ * (see {@link foldCompressionProgress}).
59
+ *
60
+ * Two independent predictors are computed and the LARGER is taken, because either one alone is
61
+ * wrong for a whole class of clip:
62
+ *
63
+ * - **Bytes.** The whole file is demuxed, decoded and re-encoded, so throughput measured in MB of
64
+ * SOURCE per second is the most stable single predictor across devices. On its own it
65
+ * under-predicts a long, low-bitrate clip (lots of frames, few bytes).
66
+ * - **Pixels × frames.** Duration times megapixels per frame is what the codec actually has to
67
+ * work on. On its own it under-predicts a short, very high-bitrate clip (few frames, huge
68
+ * bytes).
69
+ *
70
+ * Every input must come from the ORIGINAL, so picking a second level after a first estimates
71
+ * against the untouched file rather than the shrunken copy. A clip with no readable metadata at
72
+ * all falls back to the floor rather than to zero.
73
+ */
74
+ export declare const estimateVideoCompressionSeconds: ({ sizeBytes, duration, width, height, percent, }: VideoCompressionEstimateInput) => number;
75
+ export interface ImageCompressionEstimateInput {
76
+ /** The ORIGINAL still's own pixel dimensions. */
77
+ width?: number;
78
+ height?: number;
79
+ }
80
+ /**
81
+ * How long compressing a still is expected to take, in whole seconds — the seed for its countdown.
82
+ *
83
+ * A single predictor, unlike the video estimate's two: a still has no duration and no bit rate, so
84
+ * the only thing that varies is how many pixels there are to decode and re-encode. The requested
85
+ * level does not enter into it either — the native compressor searches for the quality that hits
86
+ * the target, so a light level costs the same handful of encodes as a heavy one.
87
+ *
88
+ * A still with no readable dimensions falls back to the floor rather than to zero.
89
+ */
90
+ export declare const estimateImageCompressionSeconds: ({ width, height, }: ImageCompressionEstimateInput) => number;
91
+ /** The countdown's text for a given number of seconds remaining, e.g. `Compressing (5s left)`. */
92
+ export declare const formatCompressionCountdown: (secondsLeft: number, t?: CameraTranslationFunction) => string;
93
+ /**
94
+ * Below this fraction, `elapsed / fraction` is dominated by fixed setup cost (codec configuration,
95
+ * the first decode) and would predict a wildly pessimistic total. Under it the prediction is
96
+ * blended with the up-front estimate in proportion to how far along it is, so the number is steady
97
+ * at the start and fully measurement-driven from here on.
98
+ */
99
+ export declare const MIN_TRUSTED_COMPRESSION_PROGRESS = 0.08;
100
+ /**
101
+ * At or above this the encoder has finished its frames and the pass is in its tail — flushing,
102
+ * muxing, reading the output back — real work with no measurable length, which the line reports as
103
+ * "Finalizing..." rather than quoting seconds it cannot justify.
104
+ */
105
+ export declare const COMPRESSION_FINALIZING_PROGRESS = 0.985;
106
+ /**
107
+ * Weight given to a freshly derived total when smoothing. Low enough that a burst of
108
+ * cheap-to-encode frames cannot make the figure jump, high enough that a genuinely slower job has
109
+ * the number corrected within a few seconds.
110
+ */
111
+ export declare const COMPRESSION_PREDICTION_SMOOTHING = 0.4;
112
+ /** How often the screen should re-read the line. Twice a second; the read is one subtraction. */
113
+ export declare const COMPRESSION_COUNTDOWN_TICK_MS = 500;
114
+ /**
115
+ * One step of the opening ramp: how long each number stays on screen while the total is being
116
+ * worked out. About three numbers a second — slow enough to read every one of them, quick enough
117
+ * that the ramp is over in a moment.
118
+ */
119
+ export declare const COMPRESSION_CALCULATION_STEP_MS = 300;
120
+ /**
121
+ * The most steps the ramp may take, which is what bounds it in wall-clock time
122
+ * (`COMPRESSION_CALCULATION_STEP_MS` × this ≈ 3 s). A long job strides in larger increments rather
123
+ * than taking longer to count up — the ramp must never become the wait it is describing.
124
+ */
125
+ export declare const COMPRESSION_CALCULATION_MAX_STEPS = 10;
126
+ /**
127
+ * And it may never spend more than this share of the predicted job counting up either, so a job
128
+ * that is over in two seconds does not spend most of it ramping.
129
+ */
130
+ export declare const COMPRESSION_CALCULATION_MAX_ELAPSED_FRACTION = 0.4;
131
+ export interface CompressionProgressTracker {
132
+ /** `Date.now()` when the compression started. */
133
+ readonly startedAtMs: number;
134
+ /** The up-front estimate in seconds, which seeds — and early on partly carries — the total. */
135
+ readonly estimateSeconds: number;
136
+ /**
137
+ * The largest fraction the compressor has reported, or 0 while it has reported nothing at all.
138
+ * 0 is a real state, not just an initial one: a source with no readable duration reports nothing,
139
+ * and then the estimate is all there is.
140
+ */
141
+ readonly progress: number;
142
+ /** How long the whole compression is now expected to take, in seconds from its start. */
143
+ readonly predictedTotalSeconds: number;
144
+ /**
145
+ * Seconds the opening ramp adds per step. 1 for anything the ramp can count up to one second at
146
+ * a time within its step budget, larger for a job long enough that it has to stride.
147
+ */
148
+ readonly calculationStepSeconds: number;
149
+ /**
150
+ * Where the ramp stops climbing no matter what: the first multiple of
151
+ * [calculationStepSeconds] at or above the up-front estimate. Normally the ramp ends before this
152
+ * by meeting the real remaining time; this is the backstop for a prediction that runs away
153
+ * upward while the ramp is still climbing.
154
+ */
155
+ readonly calculationCeilingSeconds: number;
156
+ }
157
+ /** A tracker for a compression starting now, seeded by its up-front [estimateSeconds]. */
158
+ export declare const createCompressionProgressTracker: (estimateSeconds: number, nowMs: number) => CompressionProgressTracker;
159
+ /**
160
+ * Fold one measured progress report (0..1) into [tracker], re-deriving how long the whole
161
+ * compression will take from how long it has taken to get this far.
162
+ *
163
+ * `total = elapsed / fraction` is the entire idea: it is why the displayed figure can stretch as
164
+ * well as shrink, and therefore why it neither hits zero mid-compression nor lingers after the
165
+ * work is done. Out-of-order or repeated reports cannot walk the fraction backwards.
166
+ *
167
+ * Reports during the opening ramp are folded in exactly like any other: the ramp is a DISPLAY
168
+ * concern only, so nothing here has to be held back or paused for it. That is what makes the
169
+ * hand-over accurate — by the time the ramp meets the countdown, the figure it meets has already
170
+ * had every report so far folded into it.
171
+ */
172
+ export declare const foldCompressionProgress: (tracker: CompressionProgressTracker, progress: number, nowMs: number) => CompressionProgressTracker;
173
+ /**
174
+ * The figure the opening ramp is showing right now, or `null` once it is over and the countdown
175
+ * proper owns the line.
176
+ *
177
+ * The ramp ends the moment its climbing figure REACHES the real remaining time, which is what
178
+ * makes the hand-over seamless: the last number it shows and the first number the countdown shows
179
+ * are the same one, arrived at from below. (`remaining` is falling in real time while the ramp
180
+ * climbs, so the two always meet — the ceiling is only a backstop for a prediction re-derived
181
+ * upward faster than the ramp can climb.)
182
+ */
183
+ export declare const compressionCalculationSeconds: (tracker: CompressionProgressTracker, nowMs: number) => number | null;
184
+ /**
185
+ * How long the screen should wait before re-reading the line.
186
+ *
187
+ * While the ramp is climbing this is the time to its NEXT step, so every number it shows gets the
188
+ * same {@link COMPRESSION_CALCULATION_STEP_MS} on screen — an even cadence rather than one
189
+ * quantised to a tick that does not divide it. Afterwards it is the ordinary countdown tick.
190
+ */
191
+ export declare const compressionCountdownTickMs: (tracker: CompressionProgressTracker | null, nowMs: number) => number;
192
+ /**
193
+ * What the overlay's line should read right now.
194
+ *
195
+ * Four cases, in order:
196
+ *
197
+ * 1. **The encoder is done and the pass is in its tail** (progress at or above
198
+ * {@link COMPRESSION_FINALIZING_PROGRESS}) — "Finalizing...", because flushing and muxing are
199
+ * real work of unmeasurable length.
200
+ * 2. **The opening ramp is still climbing** — its figure, one readable step at a time, until it
201
+ * meets the real remaining time (see {@link compressionCalculationSeconds}).
202
+ * 3. **The prediction is spent and nothing was ever measured** — "Finalizing..." as well: a
203
+ * compressor that reports no progress leaves only the estimate, and counting through zero into
204
+ * negative numbers would misrepresent what is happening.
205
+ * 4. **Otherwise** — `predicted total - elapsed`, floored at one second. The floor is reached only
206
+ * within about a second of the end (it takes progress above `elapsed / (elapsed + 1)`), and
207
+ * case 1 takes over from there.
208
+ */
209
+ export declare const compressionCountdownLabel: (tracker: CompressionProgressTracker | null, nowMs: number, t?: CameraTranslationFunction) => string;
210
+ /**
211
+ * The QUALITY levels the sheet offers, highest quality first — the percentage of the original to
212
+ * KEEP, which is exactly what the bridge takes (`compressVideo(uri, '45%')`). So the number a row
213
+ * displays is the number handed to the encoder: no inversion anywhere between the two.
214
+ *
215
+ * The native editor's ladder is the same rungs expressed the other way round (percent to SHAVE), so
216
+ * `95%` quality here is its `5% smaller` row and `5%` quality here is its `95% smaller` row.
217
+ */
218
+ export declare const COMPRESSION_QUALITY_LEVELS: readonly number[];
219
+ /**
220
+ * How far under its ceiling a compression routinely lands, which is the bottom of every quoted band
221
+ * — for stills because the encoder's size search stops at the highest quality at or under the
222
+ * target (quality quantisation, a profile pre-cap, a fallback when the target is out of reach), and
223
+ * for clips because the same fraction is used so a video band and an image band open by the same
224
+ * amount. Shared verbatim with `ImageExporter.ESTIMATE_SIZE_UNDERSHOOT`.
225
+ */
226
+ export declare const ESTIMATE_SIZE_UNDERSHOOT = 0.85;
227
+ /**
228
+ * The quality floor, mirrored from `VideoRotationTranscoder.MIN_BITS_PER_PIXEL_AVC` — the fewest
229
+ * bits per pixel per frame the native encoder will spend on a full-size frame, however heavy the
230
+ * level asked for. Kotlin is the source of truth for the value; this copy exists so the sheet does
231
+ * not quote a size the pipeline deliberately refuses to produce.
232
+ *
233
+ * AVC's figure rather than HEVC's on purpose: it is the HIGHER of the two, and the shell cannot know
234
+ * which codec the device will pick, so assuming AVC keeps every quoted row at or above what will
235
+ * actually be written. A row that promises slightly less reduction than it delivers is a pleasant
236
+ * surprise; the other way round is a broken promise.
237
+ */
238
+ export declare const MIN_BITS_PER_PIXEL_AVC = 0.065;
239
+ /**
240
+ * How far the floor may push into the clip's own rate, mirroring
241
+ * `VideoRotationTranscoder.MAX_FLOOR_SOURCE_SHARE`. A clip that already sits below the floor is
242
+ * honestly cheap rather than under-encoded, so the floor gives way to half its own average rate:
243
+ * every clip can always be made about twice as small, and past that the picture is protected.
244
+ */
245
+ export declare const MAX_FLOOR_SOURCE_SHARE = 0.5;
246
+ /**
247
+ * Frames per second assumed when quoting the floor. The shell has no access to a clip's real frame
248
+ * rate (nothing on a `CameraAsset` carries it), and 30 is both the overwhelmingly common capture
249
+ * rate and native's own fallback (`VideoRotationTranscoder.DEFAULT_FRAME_RATE`).
250
+ */
251
+ export declare const ASSUMED_VIDEO_FRAME_RATE = 30;
252
+ /** The clip facts the quality floor is measured from. All optional: missing any of them drops it. */
253
+ export interface CompressedSizeFrame {
254
+ /** The clip's pixel dimensions. Orientation does not matter — only the pixel COUNT is used. */
255
+ readonly width?: number;
256
+ readonly height?: number;
257
+ /** Duration in milliseconds (seconds are accepted and normalised). */
258
+ readonly duration?: number;
259
+ }
260
+ /** A quoted output-size band: [low]..[high], the pair a level row shows as "1.8 – 2.1 MB". */
261
+ export interface CompressedSizeBand {
262
+ readonly low: number;
263
+ readonly high: number;
264
+ }
265
+ /**
266
+ * The CEILING a compression at [qualityPercent] is aiming at: [originalBytes] with the shaved share
267
+ * removed. The single figure a compressed clip is quoted at afterwards, and the top of the band a
268
+ * row promises beforehand.
269
+ *
270
+ * `shave = 100 - qualityPercent`, pinned to the same range the encoder pins it to — 1..99 for a
271
+ * clip, 1..95 for a still (`ImageExporter.compress`'s own clamp) — and the arithmetic is integer
272
+ * truncating, exactly as native's is, so the two agree to the byte.
273
+ *
274
+ * For a CLIP the result is then raised to the quality floor when [frame] describes the video well
275
+ * enough to measure one (see {@link qualityFloorBytes}): the native encoder will not take a
276
+ * full-size frame below that rate, so the heavy rungs all land on the same size and a row that went
277
+ * on quoting `1% of the original` would be promising a file that is never written. Omit [frame] and
278
+ * the figure stays purely proportional, as it was before the floor existed.
279
+ */
280
+ export declare const compressedCeilingBytes: (originalBytes: number, qualityPercent: number, kind: "video" | "image", frame?: CompressedSizeFrame) => number;
281
+ /**
282
+ * The band of output sizes a compression at [qualityPercent] is expected to land in, or null when
283
+ * [originalBytes] is unknown — which drops the size from the row rather than inventing one.
284
+ *
285
+ * The top is {@link compressedCeilingBytes}; the bottom is that ceiling scaled by
286
+ * {@link ESTIMATE_SIZE_UNDERSHOOT}. Both media kinds share the shape deliberately: a still's band is
287
+ * the encoder's own target arithmetic, and a clip's is the display convention the native menu uses
288
+ * so a video row and an image row read alike at every rung. [frame] is the clip's own geometry and
289
+ * duration, which is what lets a video band respect the encoder's quality floor.
290
+ */
291
+ export declare const compressedSizeBand: (originalBytes: number, qualityPercent: number, kind: "video" | "image", frame?: CompressedSizeFrame) => CompressedSizeBand | null;
292
+ /**
293
+ * The option string the bridge is called with for a quality level — the level itself, as a
294
+ * percentage. `compressVideo(uri, '45%')` keeps 45% of the quality.
295
+ */
296
+ export declare const compressionOptionForQuality: (qualityPercent: number) => string;
297
+ /**
298
+ * The sentinel option for "leave it alone". Native resolves any option starting with `Original`
299
+ * straight back to the input URI (quality ratio 1.0), and {@link parseCompressionPercent} reads it
300
+ * as 0, so it never starts a compression on either side. Never displayed — the row's label comes
301
+ * from the localized `originalVideo` / `originalImage` keys.
302
+ */
303
+ export declare const originalCompressionOption: (kind: "video" | "image") => string;
304
+ /** True for the {@link originalCompressionOption} sentinels — the rows that compress nothing. */
305
+ export declare const isOriginalCompressionOption: (option: string) => boolean;
306
+ /**
307
+ * How much smaller a finished compression came out, as a whole percentage of the original — the
308
+ * `{1}` of the `compressedToSize` line. Returns null when there is nothing honest to claim (either
309
+ * size unknown, or an output that did not actually shrink), and the caller falls back to
310
+ * `compressedToSizeOnly`.
311
+ */
312
+ export declare const compressionSavingPercent: (originalBytes: number, compressedBytes: number) => number | null;
313
+ //# sourceMappingURL=compressionEstimate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compressionEstimate.d.ts","sourceRoot":"","sources":["../../../../src/library/compressionEstimate.ts"],"names":[],"mappings":"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"}