gravix-rtc-react-native 0.0.0-stage → 0.2.0

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 (378) hide show
  1. package/CHANGELOG.md +134 -0
  2. package/LICENSE +20 -0
  3. package/LICENSES/Apache-2.0.txt +175 -0
  4. package/NOTICE +68 -0
  5. package/README.md +313 -2
  6. package/android/build.gradle +137 -0
  7. package/android/consumer-rules.pro +29 -0
  8. package/android/src/main/AndroidManifest.xml +9 -0
  9. package/android/src/main/cpp/CMakeLists.txt +48 -0
  10. package/android/src/main/cpp/gx_dfn_engine.c +332 -0
  11. package/android/src/main/cpp/gx_fx_jni.cpp +34 -0
  12. package/android/src/main/cpp/gx_ns_jni.c +162 -0
  13. package/android/src/main/cpp/third_party/onnxruntime/LICENSE +21 -0
  14. package/android/src/main/cpp/third_party/onnxruntime/include/onnxruntime_c_api.h +9227 -0
  15. package/android/src/main/cpp/third_party/onnxruntime/include/onnxruntime_ep_c_api.h +3315 -0
  16. package/android/src/main/cpp/third_party/onnxruntime/include/onnxruntime_error_code.h +98 -0
  17. package/android/src/main/java/com/gravitycompile/gravixrtc/GravixAudioHooks.kt +144 -0
  18. package/android/src/main/java/com/gravitycompile/gravixrtc/GravixAudioModule.kt +105 -0
  19. package/android/src/main/java/com/gravitycompile/gravixrtc/GravixNativeAudio.kt +310 -0
  20. package/android/src/main/java/com/gravitycompile/gravixrtc/GravixRtc.kt +134 -0
  21. package/android/src/main/java/com/gravitycompile/gravixrtc/GravixRtcModule.kt +176 -0
  22. package/android/src/main/java/com/gravitycompile/gravixrtc/GravixRtcPackage.kt +39 -0
  23. package/android/src/main/java/com/gravitycompile/gravixrtc/audio/AudioDeviceKind.java +44 -0
  24. package/android/src/main/java/com/gravitycompile/gravixrtc/audio/AudioManagerUtils.kt +120 -0
  25. package/android/src/main/java/com/gravitycompile/gravixrtc/audio/AudioSwitchManager.java +270 -0
  26. package/android/src/main/java/com/gravitycompile/gravixrtc/audio/AudioType.kt +50 -0
  27. package/android/src/main/java/com/gravitycompile/gravixrtc/music/MusicCaptureRouter.kt +375 -0
  28. package/android/src/main/java/com/gravitycompile/gravixrtc/music/MusicDecoder.kt +339 -0
  29. package/android/src/main/java/com/gravitycompile/gravixrtc/music/MusicInterruptionWatcher.kt +82 -0
  30. package/android/src/main/java/com/gravitycompile/gravixrtc/music/MusicMicRelease.kt +117 -0
  31. package/android/src/main/java/com/gravitycompile/gravixrtc/music/MusicMixKernel.kt +191 -0
  32. package/android/src/main/java/com/gravitycompile/gravixrtc/music/MusicMixerEngine.kt +617 -0
  33. package/android/src/main/java/com/gravitycompile/gravixrtc/processing/AudioRoutePolicy.kt +137 -0
  34. package/android/src/main/java/com/gravitycompile/gravixrtc/processing/GravixCaptureProcessing.kt +67 -0
  35. package/android/src/main/java/com/gravitycompile/gravixrtc/processing/GxCaptureDump.kt +143 -0
  36. package/android/src/main/java/com/gravitycompile/gravixrtc/processing/GxCaptureSwitcher.kt +196 -0
  37. package/android/src/main/java/com/gravitycompile/gravixrtc/processing/GxNoiseProcessor.kt +795 -0
  38. package/android/src/main/java/com/gravitycompile/gravixrtc/processing/GxNsLogic.kt +180 -0
  39. package/android/src/main/java/com/gravitycompile/gravixrtc/processing/GxNsNative.kt +83 -0
  40. package/android/src/main/java/com/gravitycompile/gravixrtc/processing/GxNsStudio.kt +372 -0
  41. package/android/src/main/java/com/gravitycompile/gravixrtc/processing/GxRecordStartGuard.kt +76 -0
  42. package/android/src/main/java/com/gravitycompile/gravixrtc/processing/GxRecorderSeam.kt +434 -0
  43. package/android/src/main/java/com/gravitycompile/gravixrtc/processing/GxSingerSource.kt +37 -0
  44. package/android/src/main/java/com/gravitycompile/gravixrtc/processing/GxVoiceFx.kt +160 -0
  45. package/android/src/main/java/com/gravitycompile/gravixrtc/processing/OtherAppAudioPolicy.kt +143 -0
  46. package/android/src/main/java/org/webrtc/audio/WebRtcAudioTrackHelper.kt +43 -0
  47. package/docs/ANDROID_NATIVE_HOOKS.md +102 -0
  48. package/docs/FEATURE_MATRIX.md +192 -0
  49. package/docs/IOS_NATIVE_HOOKS.md +190 -0
  50. package/gravix-rtc-react-native.podspec +49 -0
  51. package/ios/GravixRtc.h +7 -0
  52. package/ios/GravixRtc.mm +273 -0
  53. package/ios/GravixRtcSetup.h +29 -0
  54. package/ios/GravixRtcSetup.m +52 -0
  55. package/ios/audio/GravixRtcIosAudio.m +157 -0
  56. package/ios/audio/GxAudioDevice.h +62 -0
  57. package/ios/audio/GxAudioDevice.m +857 -0
  58. package/ios/audio/GxAudioSetup.h +34 -0
  59. package/ios/audio/GxAudioSetup.m +70 -0
  60. package/ios/audio/GxCompat.swift +53 -0
  61. package/ios/audio/GxIosAudio.swift +99 -0
  62. package/ios/audio/GxMusicController.swift +150 -0
  63. package/ios/audio/GxMusicPost.swift +362 -0
  64. package/ios/audio/GxNoiseProcessor.swift +718 -0
  65. package/ios/audio/GxNsDfn3CoreML.swift +195 -0
  66. package/ios/audio/GxNsStudioEngine.swift +237 -0
  67. package/ios/audio/GxNsStudioPack.swift +212 -0
  68. package/ios/audio/GxVoiceFx.swift +161 -0
  69. package/ios/audio/gx_adm_state.h +153 -0
  70. package/ios/gxcore/apple/gx_music_post.c +312 -0
  71. package/ios/gxcore/apple/gx_pcm.c +30 -0
  72. package/ios/gxcore/apple/gxns_build.h +19 -0
  73. package/ios/gxcore/apple/gxns_ios.c +17 -0
  74. package/ios/gxcore/apple/include/gx_fx.h +3 -0
  75. package/ios/gxcore/apple/include/gx_music_post.h +88 -0
  76. package/ios/gxcore/apple/include/gx_ns.h +3 -0
  77. package/ios/gxcore/apple/include/gx_pcm.h +33 -0
  78. package/ios/gxcore/apple/include/gxns_ios.h +18 -0
  79. package/ios/gxcore/apple/include/module.modulemap +10 -0
  80. package/ios/gxcore/apple/shim/rnnoise.h +2 -0
  81. package/ios/gxcore/apple/shim/speex_resampler.h +2 -0
  82. package/ios/gxcore/apple/units/gx_fx_forward.cpp +3 -0
  83. package/ios/gxcore/apple/units/gx_ns.c +7 -0
  84. package/ios/gxcore/apple/units/gx_ns_timer.c +7 -0
  85. package/ios/gxcore/apple/units/rnnoise_celt_lpc.c +7 -0
  86. package/ios/gxcore/apple/units/rnnoise_denoise.c +7 -0
  87. package/ios/gxcore/apple/units/rnnoise_kiss_fft.c +7 -0
  88. package/ios/gxcore/apple/units/rnnoise_pitch.c +7 -0
  89. package/ios/gxcore/apple/units/rnnoise_rnn.c +7 -0
  90. package/ios/gxcore/apple/units/rnnoise_rnn_data.c +7 -0
  91. package/ios/gxcore/apple/units/speexdsp_resample.c +7 -0
  92. package/ios/resources/ns/DFN3-NOTICE.txt +10 -0
  93. package/ios/resources/ns/DeepFilterNet-LICENSE-APACHE +201 -0
  94. package/ios/resources/ns/DeepFilterNet-LICENSE-MIT +19 -0
  95. package/ios/resources/ns/gxns_dfn3.mlmodelc/analytics/coremldata.bin +0 -0
  96. package/ios/resources/ns/gxns_dfn3.mlmodelc/coremldata.bin +0 -0
  97. package/ios/resources/ns/gxns_dfn3.mlmodelc/metadata.json +338 -0
  98. package/ios/resources/ns/gxns_dfn3.mlmodelc/model.mil +927 -0
  99. package/ios/resources/ns/gxns_dfn3.mlmodelc/weights/weight.bin +0 -0
  100. package/lib/module/android/bindings.js +49 -0
  101. package/lib/module/android/bindings.js.map +1 -0
  102. package/lib/module/android/index.js +13 -0
  103. package/lib/module/android/index.js.map +1 -0
  104. package/lib/module/android/micMute.js +341 -0
  105. package/lib/module/android/micMute.js.map +1 -0
  106. package/lib/module/android/nativeAudio.js +47 -0
  107. package/lib/module/android/nativeAudio.js.map +1 -0
  108. package/lib/module/android/noiseSuppression.js +170 -0
  109. package/lib/module/android/noiseSuppression.js.map +1 -0
  110. package/lib/module/android/roomMusic.js +142 -0
  111. package/lib/module/android/roomMusic.js.map +1 -0
  112. package/lib/module/android/singerMode.js +31 -0
  113. package/lib/module/android/singerMode.js.map +1 -0
  114. package/lib/module/android/voiceEffects.js +65 -0
  115. package/lib/module/android/voiceEffects.js.map +1 -0
  116. package/lib/module/audio/AudioManager.js +79 -0
  117. package/lib/module/audio/AudioManager.js.map +1 -0
  118. package/lib/module/audio/AudioSession.js +90 -0
  119. package/lib/module/audio/AudioSession.js.map +1 -0
  120. package/lib/module/audio/remoteVolume.js +54 -0
  121. package/lib/module/audio/remoteVolume.js.map +1 -0
  122. package/lib/module/components/VideoView.js +109 -0
  123. package/lib/module/components/VideoView.js.map +1 -0
  124. package/lib/module/features/audioScenario.js +53 -0
  125. package/lib/module/features/audioScenario.js.map +1 -0
  126. package/lib/module/features/beauty.js +828 -0
  127. package/lib/module/features/beauty.js.map +1 -0
  128. package/lib/module/features/micRelease.js +89 -0
  129. package/lib/module/features/micRelease.js.map +1 -0
  130. package/lib/module/features/noiseSuppression.js +213 -0
  131. package/lib/module/features/noiseSuppression.js.map +1 -0
  132. package/lib/module/features/roomMusic.js +90 -0
  133. package/lib/module/features/roomMusic.js.map +1 -0
  134. package/lib/module/features/roomMusicAndroid.js +294 -0
  135. package/lib/module/features/roomMusicAndroid.js.map +1 -0
  136. package/lib/module/features/roomMusicIos.js +250 -0
  137. package/lib/module/features/roomMusicIos.js.map +1 -0
  138. package/lib/module/features/roomMusicTypes.js +53 -0
  139. package/lib/module/features/roomMusicTypes.js.map +1 -0
  140. package/lib/module/features/screenShare.js +22 -0
  141. package/lib/module/features/screenShare.js.map +1 -0
  142. package/lib/module/features/singerMode.js +73 -0
  143. package/lib/module/features/singerMode.js.map +1 -0
  144. package/lib/module/features/voiceEffects.js +148 -0
  145. package/lib/module/features/voiceEffects.js.map +1 -0
  146. package/lib/module/hooks/context.js +34 -0
  147. package/lib/module/hooks/context.js.map +1 -0
  148. package/lib/module/hooks/hooks.js +145 -0
  149. package/lib/module/hooks/hooks.js.map +1 -0
  150. package/lib/module/hooks/types.js +4 -0
  151. package/lib/module/hooks/types.js.map +1 -0
  152. package/lib/module/hooks/useRoomEvents.js +30 -0
  153. package/lib/module/hooks/useRoomEvents.js.map +1 -0
  154. package/lib/module/index.js +43 -0
  155. package/lib/module/index.js.map +1 -0
  156. package/lib/module/ios/autoAttach.js +14 -0
  157. package/lib/module/ios/autoAttach.js.map +1 -0
  158. package/lib/module/ios/iosAudio.js +149 -0
  159. package/lib/module/ios/iosAudio.js.map +1 -0
  160. package/lib/module/join/appStateLifecycle.js +54 -0
  161. package/lib/module/join/appStateLifecycle.js.map +1 -0
  162. package/lib/module/micPolicy.js +249 -0
  163. package/lib/module/micPolicy.js.map +1 -0
  164. package/lib/module/native/NativeGravixAudio.js +18 -0
  165. package/lib/module/native/NativeGravixAudio.js.map +1 -0
  166. package/lib/module/native/NativeGravixRtc.js +13 -0
  167. package/lib/module/native/NativeGravixRtc.js.map +1 -0
  168. package/lib/module/native/module.js +23 -0
  169. package/lib/module/native/module.js.map +1 -0
  170. package/lib/module/package.json +1 -0
  171. package/lib/module/polyfills/DOMException.js +22 -0
  172. package/lib/module/polyfills/DOMException.js.map +1 -0
  173. package/lib/module/polyfills/early.js +18 -0
  174. package/lib/module/polyfills/early.js.map +1 -0
  175. package/lib/module/polyfills/event.js +71 -0
  176. package/lib/module/polyfills/event.js.map +1 -0
  177. package/lib/module/polyfills/sha256.js +92 -0
  178. package/lib/module/polyfills/sha256.js.map +1 -0
  179. package/lib/module/polyfills/subtleHmac.js +91 -0
  180. package/lib/module/polyfills/subtleHmac.js.map +1 -0
  181. package/lib/module/polyfills/textCoding.js +164 -0
  182. package/lib/module/polyfills/textCoding.js.map +1 -0
  183. package/lib/module/registerGlobals.js +135 -0
  184. package/lib/module/registerGlobals.js.map +1 -0
  185. package/lib/module/unsupported.js +90 -0
  186. package/lib/module/unsupported.js.map +1 -0
  187. package/lib/module/version.js +7 -0
  188. package/lib/module/version.js.map +1 -0
  189. package/lib/typescript/package.json +1 -0
  190. package/lib/typescript/src/android/bindings.d.ts +14 -0
  191. package/lib/typescript/src/android/bindings.d.ts.map +1 -0
  192. package/lib/typescript/src/android/index.d.ts +9 -0
  193. package/lib/typescript/src/android/index.d.ts.map +1 -0
  194. package/lib/typescript/src/android/micMute.d.ts +124 -0
  195. package/lib/typescript/src/android/micMute.d.ts.map +1 -0
  196. package/lib/typescript/src/android/nativeAudio.d.ts +40 -0
  197. package/lib/typescript/src/android/nativeAudio.d.ts.map +1 -0
  198. package/lib/typescript/src/android/noiseSuppression.d.ts +48 -0
  199. package/lib/typescript/src/android/noiseSuppression.d.ts.map +1 -0
  200. package/lib/typescript/src/android/roomMusic.d.ts +80 -0
  201. package/lib/typescript/src/android/roomMusic.d.ts.map +1 -0
  202. package/lib/typescript/src/android/singerMode.d.ts +27 -0
  203. package/lib/typescript/src/android/singerMode.d.ts.map +1 -0
  204. package/lib/typescript/src/android/voiceEffects.d.ts +30 -0
  205. package/lib/typescript/src/android/voiceEffects.d.ts.map +1 -0
  206. package/lib/typescript/src/audio/AudioManager.d.ts +32 -0
  207. package/lib/typescript/src/audio/AudioManager.d.ts.map +1 -0
  208. package/lib/typescript/src/audio/AudioSession.d.ts +70 -0
  209. package/lib/typescript/src/audio/AudioSession.d.ts.map +1 -0
  210. package/lib/typescript/src/audio/remoteVolume.d.ts +8 -0
  211. package/lib/typescript/src/audio/remoteVolume.d.ts.map +1 -0
  212. package/lib/typescript/src/components/VideoView.d.ts +44 -0
  213. package/lib/typescript/src/components/VideoView.d.ts.map +1 -0
  214. package/lib/typescript/src/features/audioScenario.d.ts +24 -0
  215. package/lib/typescript/src/features/audioScenario.d.ts.map +1 -0
  216. package/lib/typescript/src/features/beauty.d.ts +377 -0
  217. package/lib/typescript/src/features/beauty.d.ts.map +1 -0
  218. package/lib/typescript/src/features/micRelease.d.ts +28 -0
  219. package/lib/typescript/src/features/micRelease.d.ts.map +1 -0
  220. package/lib/typescript/src/features/noiseSuppression.d.ts +64 -0
  221. package/lib/typescript/src/features/noiseSuppression.d.ts.map +1 -0
  222. package/lib/typescript/src/features/roomMusic.d.ts +41 -0
  223. package/lib/typescript/src/features/roomMusic.d.ts.map +1 -0
  224. package/lib/typescript/src/features/roomMusicAndroid.d.ts +60 -0
  225. package/lib/typescript/src/features/roomMusicAndroid.d.ts.map +1 -0
  226. package/lib/typescript/src/features/roomMusicIos.d.ts +56 -0
  227. package/lib/typescript/src/features/roomMusicIos.d.ts.map +1 -0
  228. package/lib/typescript/src/features/roomMusicTypes.d.ts +76 -0
  229. package/lib/typescript/src/features/roomMusicTypes.d.ts.map +1 -0
  230. package/lib/typescript/src/features/screenShare.d.ts +12 -0
  231. package/lib/typescript/src/features/screenShare.d.ts.map +1 -0
  232. package/lib/typescript/src/features/singerMode.d.ts +20 -0
  233. package/lib/typescript/src/features/singerMode.d.ts.map +1 -0
  234. package/lib/typescript/src/features/voiceEffects.d.ts +46 -0
  235. package/lib/typescript/src/features/voiceEffects.d.ts.map +1 -0
  236. package/lib/typescript/src/hooks/context.d.ts +12 -0
  237. package/lib/typescript/src/hooks/context.d.ts.map +1 -0
  238. package/lib/typescript/src/hooks/hooks.d.ts +54 -0
  239. package/lib/typescript/src/hooks/hooks.d.ts.map +1 -0
  240. package/lib/typescript/src/hooks/types.d.ts +8 -0
  241. package/lib/typescript/src/hooks/types.d.ts.map +1 -0
  242. package/lib/typescript/src/hooks/useRoomEvents.d.ts +13 -0
  243. package/lib/typescript/src/hooks/useRoomEvents.d.ts.map +1 -0
  244. package/lib/typescript/src/index.d.ts +37 -0
  245. package/lib/typescript/src/index.d.ts.map +1 -0
  246. package/lib/typescript/src/ios/autoAttach.d.ts +2 -0
  247. package/lib/typescript/src/ios/autoAttach.d.ts.map +1 -0
  248. package/lib/typescript/src/ios/iosAudio.d.ts +96 -0
  249. package/lib/typescript/src/ios/iosAudio.d.ts.map +1 -0
  250. package/lib/typescript/src/join/appStateLifecycle.d.ts +14 -0
  251. package/lib/typescript/src/join/appStateLifecycle.d.ts.map +1 -0
  252. package/lib/typescript/src/micPolicy.d.ts +104 -0
  253. package/lib/typescript/src/micPolicy.d.ts.map +1 -0
  254. package/lib/typescript/src/native/NativeGravixAudio.d.ts +21 -0
  255. package/lib/typescript/src/native/NativeGravixAudio.d.ts.map +1 -0
  256. package/lib/typescript/src/native/NativeGravixRtc.d.ts +31 -0
  257. package/lib/typescript/src/native/NativeGravixRtc.d.ts.map +1 -0
  258. package/lib/typescript/src/native/module.d.ts +7 -0
  259. package/lib/typescript/src/native/module.d.ts.map +1 -0
  260. package/lib/typescript/src/polyfills/DOMException.d.ts +3 -0
  261. package/lib/typescript/src/polyfills/DOMException.d.ts.map +1 -0
  262. package/lib/typescript/src/polyfills/early.d.ts +2 -0
  263. package/lib/typescript/src/polyfills/early.d.ts.map +1 -0
  264. package/lib/typescript/src/polyfills/event.d.ts +2 -0
  265. package/lib/typescript/src/polyfills/event.d.ts.map +1 -0
  266. package/lib/typescript/src/polyfills/sha256.d.ts +3 -0
  267. package/lib/typescript/src/polyfills/sha256.d.ts.map +1 -0
  268. package/lib/typescript/src/polyfills/subtleHmac.d.ts +37 -0
  269. package/lib/typescript/src/polyfills/subtleHmac.d.ts.map +1 -0
  270. package/lib/typescript/src/polyfills/textCoding.d.ts +36 -0
  271. package/lib/typescript/src/polyfills/textCoding.d.ts.map +1 -0
  272. package/lib/typescript/src/registerGlobals.d.ts +42 -0
  273. package/lib/typescript/src/registerGlobals.d.ts.map +1 -0
  274. package/lib/typescript/src/unsupported.d.ts +42 -0
  275. package/lib/typescript/src/unsupported.d.ts.map +1 -0
  276. package/lib/typescript/src/version.d.ts +3 -0
  277. package/lib/typescript/src/version.d.ts.map +1 -0
  278. package/metro/index.js +39 -0
  279. package/metro/noise-stub.js +10 -0
  280. package/native/gxfx/include/gx_fx.h +82 -0
  281. package/native/gxfx/src/gx_fx.cpp +527 -0
  282. package/native/gxfx/third_party/README.md +4 -0
  283. package/native/gxfx/third_party/signalsmith-linear/LICENSE.txt +21 -0
  284. package/native/gxfx/third_party/signalsmith-linear/approx.h +191 -0
  285. package/native/gxfx/third_party/signalsmith-linear/fft.h +1386 -0
  286. package/native/gxfx/third_party/signalsmith-linear/linear.h +1129 -0
  287. package/native/gxfx/third_party/signalsmith-linear/platform/approx-cmsisdsp.h +40 -0
  288. package/native/gxfx/third_party/signalsmith-linear/platform/basic-fill-warnings.h +61 -0
  289. package/native/gxfx/third_party/signalsmith-linear/platform/fft-accelerate.h +340 -0
  290. package/native/gxfx/third_party/signalsmith-linear/platform/fft-cmsisdsp.h +307 -0
  291. package/native/gxfx/third_party/signalsmith-linear/platform/fft-ipp.h +532 -0
  292. package/native/gxfx/third_party/signalsmith-linear/platform/fft-linear.h +213 -0
  293. package/native/gxfx/third_party/signalsmith-linear/platform/fft-pffft-double.h +221 -0
  294. package/native/gxfx/third_party/signalsmith-linear/platform/fft-pffft.h +221 -0
  295. package/native/gxfx/third_party/signalsmith-linear/platform/linear-accelerate.h +593 -0
  296. package/native/gxfx/third_party/signalsmith-linear/platform/linear-cmsisdsp.h +713 -0
  297. package/native/gxfx/third_party/signalsmith-linear/platform/linear-xsimd-dispatch.cpp +6 -0
  298. package/native/gxfx/third_party/signalsmith-linear/platform/linear-xsimd.h +818 -0
  299. package/native/gxfx/third_party/signalsmith-linear/stft.h +700 -0
  300. package/native/gxfx/third_party/signalsmith-stretch-LICENSE.txt +21 -0
  301. package/native/gxfx/third_party/signalsmith-stretch.h +1060 -0
  302. package/native/gxns/CMakeLists.txt +67 -0
  303. package/native/gxns/include/gx_ns.h +285 -0
  304. package/native/gxns/src/gx_ns.c +1518 -0
  305. package/native/gxns/src/gx_ns_timer.c +84 -0
  306. package/native/gxns/src/gx_ns_timer.h +29 -0
  307. package/native/gxns/third_party/VENDOR.md +43 -0
  308. package/native/gxns/third_party/rnnoise/AUTHORS +1 -0
  309. package/native/gxns/third_party/rnnoise/COPYING +31 -0
  310. package/native/gxns/third_party/rnnoise/include/rnnoise.h +117 -0
  311. package/native/gxns/third_party/rnnoise/src/_kiss_fft_guts.h +182 -0
  312. package/native/gxns/third_party/rnnoise/src/arch.h +261 -0
  313. package/native/gxns/third_party/rnnoise/src/celt_lpc.c +172 -0
  314. package/native/gxns/third_party/rnnoise/src/celt_lpc.h +45 -0
  315. package/native/gxns/third_party/rnnoise/src/common.h +48 -0
  316. package/native/gxns/third_party/rnnoise/src/denoise.c +664 -0
  317. package/native/gxns/third_party/rnnoise/src/kiss_fft.c +601 -0
  318. package/native/gxns/third_party/rnnoise/src/kiss_fft.h +203 -0
  319. package/native/gxns/third_party/rnnoise/src/opus_types.h +159 -0
  320. package/native/gxns/third_party/rnnoise/src/pitch.c +523 -0
  321. package/native/gxns/third_party/rnnoise/src/pitch.h +149 -0
  322. package/native/gxns/third_party/rnnoise/src/rnn.c +178 -0
  323. package/native/gxns/third_party/rnnoise/src/rnn.h +65 -0
  324. package/native/gxns/third_party/rnnoise/src/rnn_data.c +11051 -0
  325. package/native/gxns/third_party/rnnoise/src/rnn_data.h +34 -0
  326. package/native/gxns/third_party/rnnoise/src/tansig_table.h +45 -0
  327. package/native/gxns/third_party/speexdsp/AUTHORS +18 -0
  328. package/native/gxns/third_party/speexdsp/COPYING +35 -0
  329. package/native/gxns/third_party/speexdsp/arch.h +232 -0
  330. package/native/gxns/third_party/speexdsp/resample.c +1239 -0
  331. package/native/gxns/third_party/speexdsp/resample_neon.h +339 -0
  332. package/native/gxns/third_party/speexdsp/resample_sse.h +128 -0
  333. package/native/gxns/third_party/speexdsp/speex_resampler.h +343 -0
  334. package/package.json +186 -4
  335. package/src/android/bindings.ts +61 -0
  336. package/src/android/index.ts +10 -0
  337. package/src/android/micMute.ts +422 -0
  338. package/src/android/nativeAudio.ts +94 -0
  339. package/src/android/noiseSuppression.ts +209 -0
  340. package/src/android/roomMusic.ts +193 -0
  341. package/src/android/singerMode.ts +53 -0
  342. package/src/android/voiceEffects.ts +126 -0
  343. package/src/audio/AudioManager.ts +111 -0
  344. package/src/audio/AudioSession.ts +190 -0
  345. package/src/audio/remoteVolume.ts +58 -0
  346. package/src/components/VideoView.tsx +152 -0
  347. package/src/features/audioScenario.ts +58 -0
  348. package/src/features/beauty.ts +1057 -0
  349. package/src/features/micRelease.ts +108 -0
  350. package/src/features/noiseSuppression.ts +251 -0
  351. package/src/features/roomMusic.ts +106 -0
  352. package/src/features/roomMusicAndroid.ts +310 -0
  353. package/src/features/roomMusicIos.ts +300 -0
  354. package/src/features/roomMusicTypes.ts +97 -0
  355. package/src/features/screenShare.ts +19 -0
  356. package/src/features/singerMode.ts +70 -0
  357. package/src/features/voiceEffects.ts +245 -0
  358. package/src/hooks/context.tsx +38 -0
  359. package/src/hooks/hooks.ts +247 -0
  360. package/src/hooks/types.ts +10 -0
  361. package/src/hooks/useRoomEvents.ts +35 -0
  362. package/src/index.tsx +134 -0
  363. package/src/ios/autoAttach.ts +11 -0
  364. package/src/ios/iosAudio.ts +202 -0
  365. package/src/join/appStateLifecycle.ts +55 -0
  366. package/src/micPolicy.ts +312 -0
  367. package/src/native/NativeGravixAudio.ts +30 -0
  368. package/src/native/NativeGravixRtc.ts +38 -0
  369. package/src/native/module.ts +22 -0
  370. package/src/polyfills/DOMException.ts +20 -0
  371. package/src/polyfills/early.ts +16 -0
  372. package/src/polyfills/event.ts +88 -0
  373. package/src/polyfills/sha256.ts +112 -0
  374. package/src/polyfills/subtleHmac.ts +124 -0
  375. package/src/polyfills/textCoding.ts +197 -0
  376. package/src/registerGlobals.ts +201 -0
  377. package/src/unsupported.ts +139 -0
  378. package/src/version.ts +4 -0
@@ -0,0 +1,96 @@
1
+ import { type GravixNativeFeature } from '../unsupported.js';
2
+ /**
3
+ * Bridge to the iOS-only native module `GravixRtcIosAudio` (ios/audio): voice
4
+ * effects, noise suppression, room music and the recorder state. It is a
5
+ * plain interop module (not in the shared codegen spec, so Android is
6
+ * unaffected); the feature classes in src/features call it from their iOS
7
+ * branches only. One generic `call(method, args)` mirrors the Flutter method
8
+ * channels (`fxConfigure`, `nsConfigure`, `music.start`, ...).
9
+ */
10
+ interface IosAudioNative {
11
+ attach(): Promise<{
12
+ processingInstalled: boolean;
13
+ graphHooked: boolean;
14
+ }>;
15
+ getRecorderState(): Promise<GravixRecorderState>;
16
+ /** Mute releases the mic (Gravix audio device); older native sides lack it. */
17
+ setCaptureClosed?(closed: boolean): Promise<boolean>;
18
+ /** The muted mic's publication ended: the close ends once WebRTC stops recording. */
19
+ releaseCaptureClose?(): Promise<boolean>;
20
+ /** Info.plist `GravixMuteStopsMicTrack` (rollback), exported as a constant. */
21
+ muteStopsMicTrack?: boolean;
22
+ getConstants?(): {
23
+ muteStopsMicTrack?: boolean;
24
+ };
25
+ call(method: string, args: Record<string, unknown>): Promise<unknown>;
26
+ addListener(eventName: string): void;
27
+ removeListeners(count: number): void;
28
+ }
29
+ /** The microphone recorder as the Gravix iOS audio device sees it. */
30
+ export interface GravixRecorderState {
31
+ recording: boolean;
32
+ /** The mic input is closed for a mute (mute releases mic). */
33
+ captureClosed?: boolean;
34
+ /** The muted publication ended: the close lasts until WebRTC stops recording. */
35
+ captureReleasePending?: boolean;
36
+ recordingInitialized: boolean;
37
+ playing: boolean;
38
+ engineRunning: boolean;
39
+ microphoneMuted: boolean;
40
+ /** -1 unknown, 0 voiceProcessing, 1 restartEngine, 2 inputMixer. */
41
+ muteMode: number;
42
+ }
43
+ export declare const IOS_AUDIO_EVENT = "GravixIosAudioEvent";
44
+ export declare function isIos(): boolean;
45
+ export declare function iosAudioModule(): IosAudioNative | null;
46
+ /** Calls a native audio method; rejects with the native error code. */
47
+ export declare function iosCall<T = unknown>(method: string, args?: Record<string, unknown>): Promise<T>;
48
+ /**
49
+ * Installs the audio engine graph hook (music monitor, VPIO AGC) once. Called
50
+ * by every iOS feature before its first native call; cheap after the first.
51
+ */
52
+ export declare function iosAttach(): Promise<{
53
+ processingInstalled: boolean;
54
+ graphHooked: boolean;
55
+ }>;
56
+ export declare function iosRecorderState(): Promise<GravixRecorderState>;
57
+ /**
58
+ * Mute releases the mic on iOS: closes (true) or reopens the microphone input
59
+ * of the Gravix audio device (stock WebRTC keeps recording under a track
60
+ * mute). Resolves null without the native method, false when the Gravix audio
61
+ * device is not in use.
62
+ */
63
+ export declare function iosSetCaptureClosed(closed: boolean): Promise<boolean | null>;
64
+ /**
65
+ * The muted mic's publication ended (final unpublish, room left): the Gravix
66
+ * audio device keeps the mic closed while WebRTC still records and opens it
67
+ * once recording stops. A plain close survives a WebRTC recording stop / start,
68
+ * so a reconnect republish of a muted mic never opens the input. Resolves null
69
+ * without the native method.
70
+ */
71
+ export declare function iosReleaseCaptureClose(): Promise<boolean | null>;
72
+ /**
73
+ * Rollback for the single iOS mute path: Info.plist boolean
74
+ * `GravixMuteStopsMicTrack` = YES makes the room policy also stop the mic
75
+ * track on mute (`stopOnMute`; the core reacquires it with getUserMedia on
76
+ * unmute), as 0.2.0 betas did. Default false: the Gravix audio device's mic
77
+ * close is the only mute path.
78
+ */
79
+ export declare function iosMuteStopsMicTrack(): boolean;
80
+ type Listener = (body: Record<string, unknown>) => void;
81
+ /**
82
+ * Subscribes to a native audio event: `onVoiceEffects`, `onNsEvent`,
83
+ * `music.onCompleted`. Returns the unsubscribe function.
84
+ */
85
+ export declare function onIosAudioEvent(name: string, fn: Listener): () => void;
86
+ /** Test hook. @internal */
87
+ export declare function __resetIosAudioForTests(): void;
88
+ /**
89
+ * Whether an iOS branch may run: on iOS and the native side reports the
90
+ * feature (it is false when GravixRtcSetup.setup() did not install the audio
91
+ * chain, or with an older native module); otherwise the stub throws
92
+ * GravixUnsupportedError as on every platform without the feature.
93
+ */
94
+ export declare function iosFeature(feature: GravixNativeFeature): boolean;
95
+ export {};
96
+ //# sourceMappingURL=iosAudio.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"iosAudio.d.ts","sourceRoot":"","sources":["../../../../src/ios/iosAudio.ts"],"names":[],"mappings":"AAGA,OAAO,EAAsB,KAAK,mBAAmB,EAAE,MAAM,mBAAgB,CAAC;AAE9E;;;;;;;GAOG;AACH,UAAU,cAAc;IACtB,MAAM,IAAI,OAAO,CAAC;QAAE,mBAAmB,EAAE,OAAO,CAAC;QAAC,WAAW,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;IAC1E,gBAAgB,IAAI,OAAO,CAAC,mBAAmB,CAAC,CAAC;IACjD,+EAA+E;IAC/E,gBAAgB,CAAC,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACrD,qFAAqF;IACrF,mBAAmB,CAAC,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IACzC,+EAA+E;IAC/E,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,YAAY,CAAC,IAAI;QAAE,iBAAiB,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;IACjD,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACtE,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtC;AAED,sEAAsE;AACtE,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,OAAO,CAAC;IACnB,8DAA8D;IAC9D,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,iFAAiF;IACjF,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,oBAAoB,EAAE,OAAO,CAAC;IAC9B,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,EAAE,OAAO,CAAC;IACvB,eAAe,EAAE,OAAO,CAAC;IACzB,oEAAoE;IACpE,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,eAAe,wBAAwB,CAAC;AAErD,wBAAgB,KAAK,IAAI,OAAO,CAE/B;AAED,wBAAgB,cAAc,IAAI,cAAc,GAAG,IAAI,CAKtD;AAYD,uEAAuE;AACvE,wBAAsB,OAAO,CAAC,CAAC,GAAG,OAAO,EACvC,MAAM,EAAE,MAAM,EACd,IAAI,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,GACjC,OAAO,CAAC,CAAC,CAAC,CAEZ;AAOD;;;GAGG;AACH,wBAAgB,SAAS,IAAI,OAAO,CAAC;IACnC,mBAAmB,EAAE,OAAO,CAAC;IAC7B,WAAW,EAAE,OAAO,CAAC;CACtB,CAAC,CAUD;AAED,wBAAgB,gBAAgB,IAAI,OAAO,CAAC,mBAAmB,CAAC,CAE/D;AAED;;;;;GAKG;AACH,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,OAAO,GACd,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,CAIzB;AAED;;;;;;GAMG;AACH,wBAAsB,sBAAsB,IAAI,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,CAItE;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,IAAI,OAAO,CAU9C;AAED,KAAK,QAAQ,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;AAKxD;;;GAGG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,QAAQ,GAAG,MAAM,IAAI,CA0BtE;AAED,2BAA2B;AAC3B,wBAAgB,uBAAuB,IAAI,IAAI,CAK9C;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAEhE"}
@@ -0,0 +1,14 @@
1
+ import { GravixJoin, type GravixJoinOptions, type GravixPageLifecycle } from 'gravix-rtc';
2
+ /**
3
+ * The app lifecycle in the shape gravix-rtc's join guard expects
4
+ * (`GravixPageLifecycle`): "hidden" = the app went to the background
5
+ * (`AppState` 'background'; iOS 'inactive', e.g. Control Center, is not
6
+ * hidden), "visible frame" = the next frame drawn while the app is active.
7
+ *
8
+ * In a browser GravixJoin uses `document.visibilityState`; in React Native
9
+ * there is no document, so without this the join has no lifecycle guard.
10
+ */
11
+ export declare function gravixAppStateLifecycle(): GravixPageLifecycle;
12
+ /** `new GravixJoin(options)` with the React Native app lifecycle as the join guard. */
13
+ export declare function createGravixJoin(options: GravixJoinOptions): GravixJoin;
14
+ //# sourceMappingURL=appStateLifecycle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"appStateLifecycle.d.ts","sourceRoot":"","sources":["../../../../src/join/appStateLifecycle.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,UAAU,EACV,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACzB,MAAM,YAAY,CAAC;AAGpB;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,IAAI,mBAAmB,CA2B7D;AAED,uFAAuF;AACvF,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,iBAAiB,GAAG,UAAU,CAMvE"}
@@ -0,0 +1,104 @@
1
+ import { type GravixMicMute } from './android/micMute.js';
2
+ /**
3
+ * Mute releases the microphone, as the room default (Flutter 0.12.1+
4
+ * `GravixRoomService(muteReleasesMic: true)`), wired into EVERY gravix-rtc
5
+ * Room (also the ones GravixJoin creates) by {@link installRoomMicHooks}, which
6
+ * `registerGlobals()` runs. One-flag rollback:
7
+ * `registerGlobals({ muteReleasesMic: false })` (or
8
+ * `GravixMicRelease.setMuteReleasesMic(false)` at run time).
9
+ *
10
+ * - iOS (only with the Gravix audio device, Info.plist `GravixAudioDevice`;
11
+ * with WebRTC's built-in device `muteReleasesMic` is unsupported and the
12
+ * policy does nothing): every local mic mute closes the mic input of the
13
+ * Gravix audio device (`setCaptureClosed`), so the OS mic indicator goes
14
+ * off; an unmute reopens it at once. This is the ONLY mute path: the track
15
+ * is not also stopped (`stopOnMute`; react-native-webrtc 155's WebRTC keeps
16
+ * recording under a track stop, which only disables the track, and the
17
+ * unmute then paid a getUserMedia). Rollback: Info.plist
18
+ * `GravixMuteStopsMicTrack` = YES (`iosStopTrackOnMute` on the policy is an
19
+ * internal / test override). The close survives WebRTC's recording stop / start, so a muted
20
+ * mic republished after a reconnect never opens the input; it ends with an
21
+ * unmute, a fresh unmuted publish, or when the muted publication ends for
22
+ * good (final unpublish of a stopped track, room left: `releaseCaptureClose`,
23
+ * applied once WebRTC stops recording).
24
+ * - Android: every local mic mute closes the hardware recorder and every
25
+ * unmute reopens it (`GravixMicMute.setCaptureClosed`, the native capture
26
+ * seam; react-native-webrtc 155's WebRTC keeps recording under a plain
27
+ * mute). A mic published while already muted (also a reconnect republish)
28
+ * gets its recorder closed (`GravixMicMute.closeMutedCapture`). A core mute during a voice-only music mute
29
+ * hands the mute to the core; leaving the room gives the engine mute back.
30
+ */
31
+ export type MicPolicyPlatform = 'android' | 'ios' | null;
32
+ type PubLike = {
33
+ source?: string;
34
+ isMuted?: boolean;
35
+ track?: MicTrack;
36
+ };
37
+ type MicTrack = {
38
+ isMuted: boolean;
39
+ isUserProvided?: boolean;
40
+ stopOnMute?: boolean;
41
+ mediaStreamTrack: {
42
+ enabled: boolean;
43
+ readyState?: string;
44
+ stop?(): void;
45
+ };
46
+ mute(): Promise<unknown>;
47
+ unmute(): Promise<unknown>;
48
+ };
49
+ type RoomLike = {
50
+ /** gravix-rtc `ConnectionState` ('reconnecting' while a full reconnect republishes). */
51
+ state?: string;
52
+ localParticipant?: {
53
+ audioTrackPublications?: Map<string, PubLike>;
54
+ };
55
+ };
56
+ export declare class GravixRoomMicPolicy {
57
+ private readonly platform;
58
+ private readonly mic;
59
+ private readonly iosCapture;
60
+ private readonly iosRelease;
61
+ private readonly iosStopsTrackDefault;
62
+ constructor(platform?: () => MicPolicyPlatform, mic?: GravixMicMute, iosCapture?: (closed: boolean) => Promise<unknown>, iosRelease?: () => Promise<unknown>, iosStopsTrackDefault?: () => boolean);
63
+ /**
64
+ * iOS rollback: also stop the mic track on mute (`stopOnMute`, the 0.2.0
65
+ * beta double path). null (default) = Info.plist `GravixMuteStopsMicTrack`.
66
+ */
67
+ iosStopTrackOnMute: boolean | null;
68
+ /** Whether an iOS mic gets `stopOnMute` (releasesMic AND the rollback flag). */
69
+ iosStopsTrackOnMute(): boolean;
70
+ /** Rooms whose muted mic holds the iOS device mic close (one device per process). */
71
+ private readonly iosClosedBy;
72
+ /** Rooms that unpublished a muted mic and kept it (it may be published again), with the track. */
73
+ private readonly iosKeptMuted;
74
+ /** iOS mic close / reopen; never throws. */
75
+ private iosClose;
76
+ /**
77
+ * iOS: [room]'s muted publication ended for good. The device close ends once
78
+ * WebRTC stops recording (no input opens before), unless another room's
79
+ * muted mic still holds it. Never throws.
80
+ */
81
+ private iosReleaseFor;
82
+ /** Mute releases the mic (default true). Mirrors the Android engine flag. */
83
+ get releasesMic(): boolean;
84
+ set releasesMic(on: boolean);
85
+ /**
86
+ * True while the local mic is muted: the core mute (`track.isMuted`) OR a
87
+ * voice-only music mute (Android), which the core does not see.
88
+ */
89
+ isMicMuted(room: RoomLike): boolean;
90
+ /** Voice-only mute changes (the core's TrackMuted / TrackUnmuted cover the rest). */
91
+ onMicMuteChanged(fn: () => void): () => void;
92
+ /** Room event tap (installed on `Room.prototype.emit`). Never throws into the core. */
93
+ onRoomEvent(room: RoomLike, event: string, args: unknown[]): void;
94
+ private onMicPublished;
95
+ }
96
+ /** Process-wide policy (one audio device module per process). */
97
+ export declare const gravixRoomMicPolicy: GravixRoomMicPolicy;
98
+ /**
99
+ * Taps [RoomClass]'s `emit` so the policy sees every room's events, the Rooms
100
+ * GravixJoin builds included. Idempotent; the original emit always runs.
101
+ */
102
+ export declare function installRoomMicHooks(RoomClass: unknown, handler?: (room: RoomLike, event: string, args: unknown[]) => void): boolean;
103
+ export {};
104
+ //# sourceMappingURL=micPolicy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"micPolicy.d.ts","sourceRoot":"","sources":["../../../src/micPolicy.ts"],"names":[],"mappings":"AAGA,OAAO,EAAiB,KAAK,aAAa,EAAE,MAAM,sBAAmB,CAAC;AAQtE;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,KAAK,GAAG,IAAI,CAAC;AAEzD,KAAK,OAAO,GAAG;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,QAAQ,CAAC;CAClB,CAAC;AACF,KAAK,QAAQ,GAAG;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,gBAAgB,EAAE;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,IAAI,IAAI,CAAA;KAAE,CAAC;IAC3E,IAAI,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IACzB,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;CAC5B,CAAC;AACF,KAAK,QAAQ,GAAG;IACd,wFAAwF;IACxF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gBAAgB,CAAC,EAAE;QACjB,sBAAsB,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAC/C,CAAC;CACH,CAAC;AAWF,qBAAa,mBAAmB;IAE5B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,GAAG;IACpB,OAAO,CAAC,QAAQ,CAAC,UAAU;IAG3B,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,oBAAoB;gBANpB,QAAQ,GAAE,MAAM,iBAAmC,EACnD,GAAG,GAAE,aAA6B,EAClC,UAAU,GAAE,CAC3B,MAAM,EAAE,OAAO,KACZ,OAAO,CAAC,OAAO,CAAuB,EAC1B,UAAU,GAAE,MAAM,OAAO,CAAC,OAAO,CAA0B,EAC3D,oBAAoB,GAAE,MAAM,OAA8B;IAG7E;;;OAGG;IACH,kBAAkB,EAAE,OAAO,GAAG,IAAI,CAAQ;IAE1C,gFAAgF;IAChF,mBAAmB,IAAI,OAAO;IAU9B,qFAAqF;IACrF,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAuB;IACnD,kGAAkG;IAClG,OAAO,CAAC,QAAQ,CAAC,YAAY,CAA6C;IAE1E,4CAA4C;IAC5C,OAAO,CAAC,QAAQ;IAahB;;;;OAIG;IACH,OAAO,CAAC,aAAa;IASrB,6EAA6E;IAC7E,IAAI,WAAW,IAAI,OAAO,CAEzB;IACD,IAAI,WAAW,CAAC,EAAE,EAAE,OAAO,EAE1B;IAED;;;OAGG;IACH,UAAU,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO;IASnC,qFAAqF;IACrF,gBAAgB,CAAC,EAAE,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI;IAI5C,uFAAuF;IACvF,WAAW,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;IA6FjE,OAAO,CAAC,cAAc;CAsBvB;AAED,iEAAiE;AACjE,eAAO,MAAM,mBAAmB,qBAA4B,CAAC;AAI7D;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,SAAS,EAAE,OAAO,EAClB,OAAO,GAAE,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,IAIhB,GAC5C,OAAO,CAkBT"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Codegen spec of the Android-only `GravixAudio` TurboModule: the native audio
3
+ * features (voice effects, noise suppression, room music, singer capture,
4
+ * mute that releases the mic). One generic call keeps the spec stable while
5
+ * the method set follows the Flutter SDK's channel methods
6
+ * (`android/.../GravixNativeAudio.kt` lists them). Events go out as the
7
+ * device event `GravixAudioEvent` ({ name, payload }).
8
+ *
9
+ * iOS does not register this module (`TurboModuleRegistry.get` returns null).
10
+ * Keep this file free of imports other than `react-native`.
11
+ */
12
+ import { type CodegenTypes, type TurboModule } from 'react-native';
13
+ export interface Spec extends TurboModule {
14
+ /** Resolves with the method's result wrapped as `{ value }`. */
15
+ call(method: string, args: CodegenTypes.UnsafeObject): Promise<CodegenTypes.UnsafeObject>;
16
+ addListener(eventName: string): void;
17
+ removeListeners(count: number): void;
18
+ }
19
+ declare const _default: Spec | null | undefined;
20
+ export default _default;
21
+ //# sourceMappingURL=NativeGravixAudio.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NativeGravixAudio.d.ts","sourceRoot":"","sources":["../../../../src/native/NativeGravixAudio.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AACH,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,WAAW,EACjB,MAAM,cAAc,CAAC;AAEtB,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC,gEAAgE;IAChE,IAAI,CACF,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,YAAY,CAAC,YAAY,GAC9B,OAAO,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;IACtC,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtC;;AAED,wBAA4D"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Codegen spec of the `GravixRtc` TurboModule (Android: Kotlin, iOS: Obj-C++).
3
+ *
4
+ * Keep this file free of imports other than `react-native`: the codegen parser
5
+ * reads it statically.
6
+ */
7
+ import { type CodegenTypes, type TurboModule } from 'react-native';
8
+ export interface Spec extends TurboModule {
9
+ /**
10
+ * `{ platform, nativeVersion, features: { [feature]: boolean } }`.
11
+ * A feature flips to true once its native implementation lands; the JS stubs
12
+ * read this map (see `src/unsupported.ts`).
13
+ */
14
+ getCapabilities(): CodegenTypes.UnsafeObject;
15
+ configureAudio(config: CodegenTypes.UnsafeObject): Promise<void>;
16
+ startAudioSession(): Promise<void>;
17
+ stopAudioSession(): Promise<void>;
18
+ getAudioOutputs(): Promise<string[]>;
19
+ selectAudioOutput(deviceId: string): Promise<void>;
20
+ showAudioRoutePicker(): Promise<void>;
21
+ setAppleAudioConfiguration(config: CodegenTypes.UnsafeObject): Promise<void>;
22
+ /**
23
+ * iOS: the AVAudioSession configuration WebRTC's audio unit applies when
24
+ * audio starts (`RTCAudioSessionConfiguration.webRTCConfiguration`); null =
25
+ * the setup default. No-op on Android.
26
+ */
27
+ setWebRTCAudioConfiguration(config: CodegenTypes.UnsafeObject | null): void;
28
+ }
29
+ declare const _default: Spec | null | undefined;
30
+ export default _default;
31
+ //# sourceMappingURL=NativeGravixRtc.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NativeGravixRtc.d.ts","sourceRoot":"","sources":["../../../../src/native/NativeGravixRtc.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,WAAW,EACjB,MAAM,cAAc,CAAC;AAEtB,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC;;;;OAIG;IACH,eAAe,IAAI,YAAY,CAAC,YAAY,CAAC;IAE7C,cAAc,CAAC,MAAM,EAAE,YAAY,CAAC,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACjE,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACnC,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAClC,eAAe,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IACrC,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACnD,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACtC,0BAA0B,CAAC,MAAM,EAAE,YAAY,CAAC,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7E;;;;OAIG;IACH,2BAA2B,CAAC,MAAM,EAAE,YAAY,CAAC,YAAY,GAAG,IAAI,GAAG,IAAI,CAAC;CAC7E;;AAED,wBAA0D"}
@@ -0,0 +1,7 @@
1
+ import { type Spec } from './NativeGravixRtc.js';
2
+ export declare const LINKING_ERROR: string;
3
+ /** The native module, or null when it is not linked (tests, Expo Go, web). */
4
+ export declare function nativeModuleOrNull(): Spec | null;
5
+ /** The native module; throws a clear linking error when it is missing. */
6
+ export declare function nativeModule(): Spec;
7
+ //# sourceMappingURL=module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../src/native/module.ts"],"names":[],"mappings":"AAGA,OAAwB,EAAE,KAAK,IAAI,EAAE,MAAM,sBAAmB,CAAC;AAE/D,eAAO,MAAM,aAAa,QAImC,CAAC;AAE9D,8EAA8E;AAC9E,wBAAgB,kBAAkB,IAAI,IAAI,GAAG,IAAI,CAEhD;AAED,0EAA0E;AAC1E,wBAAgB,YAAY,IAAI,IAAI,CAInC"}
@@ -0,0 +1,3 @@
1
+ /** DOMException is missing in some React Native runtimes; gravix-rtc and fetch/AbortController use it. */
2
+ export declare function installDOMException(): void;
3
+ //# sourceMappingURL=DOMException.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DOMException.d.ts","sourceRoot":"","sources":["../../../../src/polyfills/DOMException.ts"],"names":[],"mappings":"AAIA,0GAA0G;AAC1G,wBAAgB,mBAAmB,IAAI,IAAI,CAc1C"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=early.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"early.d.ts","sourceRoot":"","sources":["../../../../src/polyfills/early.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export declare function installEvent(): void;
2
+ //# sourceMappingURL=event.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event.d.ts","sourceRoot":"","sources":["../../../../src/polyfills/event.ts"],"names":[],"mappings":"AAmFA,wBAAgB,YAAY,IAAI,IAAI,CAInC"}
@@ -0,0 +1,3 @@
1
+ export declare function sha256(data: Uint8Array): Uint8Array;
2
+ export declare function hmacSha256(key: Uint8Array, message: Uint8Array): Uint8Array;
3
+ //# sourceMappingURL=sha256.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sha256.d.ts","sourceRoot":"","sources":["../../../../src/polyfills/sha256.ts"],"names":[],"mappings":"AAyBA,wBAAgB,MAAM,CAAC,IAAI,EAAE,UAAU,GAAG,UAAU,CAoEnD;AAGD,wBAAgB,UAAU,CAAC,GAAG,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,GAAG,UAAU,CAe3E"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * A `crypto.subtle` stand-in for Hermes that supports exactly what
3
+ * gravix-rtc's `createToken` (local HS256 join tokens) needs:
4
+ * `importKey('raw', key, { name: 'HMAC', hash: 'SHA-256' }, ...)` and
5
+ * `sign('HMAC', key, data)`. Every other call rejects with NotSupportedError,
6
+ * so E2EE (which needs AES-GCM/HKDF) still reports itself unsupported.
7
+ *
8
+ * Installed by `registerGlobals()` only when `globalThis.crypto.subtle` is
9
+ * missing; a real WebCrypto (e.g. a native polyfill) always wins.
10
+ */
11
+ declare const KEY_BYTES: unique symbol;
12
+ type ShimKey = {
13
+ type: 'secret';
14
+ algorithm: {
15
+ name: 'HMAC';
16
+ };
17
+ [KEY_BYTES]: Uint8Array;
18
+ };
19
+ export declare const gravixSubtleHmac: {
20
+ __gravixShim: true;
21
+ importKey(format: string, keyData: unknown, algorithm: unknown, _extractable: boolean, _usages: string[]): Promise<ShimKey>;
22
+ sign(algorithm: unknown, key: ShimKey, data: unknown): Promise<ArrayBuffer>;
23
+ verify: () => Promise<never>;
24
+ digest: () => Promise<never>;
25
+ encrypt: () => Promise<never>;
26
+ decrypt: () => Promise<never>;
27
+ deriveKey: () => Promise<never>;
28
+ deriveBits: () => Promise<never>;
29
+ generateKey: () => Promise<never>;
30
+ exportKey: () => Promise<never>;
31
+ wrapKey: () => Promise<never>;
32
+ unwrapKey: () => Promise<never>;
33
+ };
34
+ /** Installs the shim when there is no `crypto.subtle`. Returns whether it did. */
35
+ export declare function installSubtleHmacShim(): boolean;
36
+ export {};
37
+ //# sourceMappingURL=subtleHmac.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subtleHmac.d.ts","sourceRoot":"","sources":["../../../../src/polyfills/subtleHmac.ts"],"names":[],"mappings":"AAIA;;;;;;;;;GASG;AAEH,QAAA,MAAM,SAAS,eAA0B,CAAC;AAE1C,KAAK,OAAO,GAAG;IACb,IAAI,EAAE,QAAQ,CAAC;IACf,SAAS,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IAC5B,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC;CACzB,CAAC;AAkCF,eAAO,MAAM,gBAAgB;;sBAGjB,MAAM,WACL,OAAO,aACL,OAAO,gBACJ,OAAO,WACZ,MAAM,EAAE,GAChB,OAAO,CAAC,OAAO,CAAC;oBAgBH,OAAO,OAAO,OAAO,QAAQ,OAAO,GAAG,OAAO,CAAC,WAAW,CAAC;;;;;;;;;;;CA0B5E,CAAC;AAEF,kFAAkF;AAClF,wBAAgB,qBAAqB,IAAI,OAAO,CAe/C"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * UTF-8 TextEncoder/TextDecoder for runtimes that lack them (older Hermes has
3
+ * TextEncoder only; @bufbuild/protobuf in gravix-rtc decodes signalling strings
4
+ * with TextDecoder). Installed only when missing.
5
+ */
6
+ declare function encodeUtf8(input: string): Uint8Array;
7
+ declare function decodeUtf8(bytes: Uint8Array, dropBom?: boolean, fatal?: boolean): string;
8
+ declare class GravixTextEncoder {
9
+ readonly encoding = "utf-8";
10
+ encode(input?: string): Uint8Array;
11
+ }
12
+ /** WHATWG TextDecoder, utf-8 only, with `fatal`, `ignoreBOM` and `{stream}`. */
13
+ declare class GravixTextDecoder {
14
+ readonly encoding = "utf-8";
15
+ readonly fatal: boolean;
16
+ readonly ignoreBOM: boolean;
17
+ private pending;
18
+ private started;
19
+ constructor(label?: string, options?: {
20
+ fatal?: boolean;
21
+ ignoreBOM?: boolean;
22
+ });
23
+ decode(input?: ArrayBuffer | ArrayBufferView, options?: {
24
+ stream?: boolean;
25
+ }): string;
26
+ private reset;
27
+ }
28
+ export declare function installTextCoding(): void;
29
+ export declare const __test: {
30
+ encodeUtf8: typeof encodeUtf8;
31
+ decodeUtf8: typeof decodeUtf8;
32
+ GravixTextDecoder: typeof GravixTextDecoder;
33
+ GravixTextEncoder: typeof GravixTextEncoder;
34
+ };
35
+ export {};
36
+ //# sourceMappingURL=textCoding.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"textCoding.d.ts","sourceRoot":"","sources":["../../../../src/polyfills/textCoding.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AAGH,iBAAS,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU,CA0B7C;AAQD,iBAAS,UAAU,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,UAAO,EAAE,KAAK,UAAQ,GAAG,MAAM,CA0D5E;AAGD,cAAM,iBAAiB;IACrB,QAAQ,CAAC,QAAQ,WAAW;IAC5B,MAAM,CAAC,KAAK,SAAK,GAAG,UAAU;CAG/B;AAgBD,gFAAgF;AAChF,cAAM,iBAAiB;IACrB,QAAQ,CAAC,QAAQ,WAAW;IAC5B,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,OAAO,CAAC,OAAO,CAAiC;IAChD,OAAO,CAAC,OAAO,CAAS;gBAEtB,KAAK,SAAU,EACf,OAAO,GAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAC;QAAC,SAAS,CAAC,EAAE,OAAO,CAAA;KAAO;IAWxD,MAAM,CACJ,KAAK,CAAC,EAAE,WAAW,GAAG,eAAe,EACrC,OAAO,GAAE;QAAE,MAAM,CAAC,EAAE,OAAO,CAAA;KAAO,GACjC,MAAM;IA+BT,OAAO,CAAC,KAAK;CAId;AAED,wBAAgB,iBAAiB,IAAI,IAAI,CAIxC;AAED,eAAO,MAAM,MAAM;;;;;CAKlB,CAAC"}
@@ -0,0 +1,42 @@
1
+ import 'well-known-symbols/Symbol.asyncIterator/auto';
2
+ import 'well-known-symbols/Symbol.iterator/auto';
3
+ import { type IOSAudioSessionPolicy } from './audio/AudioManager.js';
4
+ export interface RegisterGlobalsOptions {
5
+ /**
6
+ * iOS: let the audio engine configure and activate the AVAudioSession as
7
+ * playout/recording start and stop (see `setupIOSAudioManagement`).
8
+ * Default true. No effect on Android.
9
+ */
10
+ autoConfigureAudioSession?: boolean;
11
+ /** iOS: prefer the loudspeaker while publishing the mic. Default true. */
12
+ preferSpeakerOutput?: boolean;
13
+ /** iOS: a custom per-engine-state session policy. */
14
+ iosAudioSessionPolicy?: IOSAudioSessionPolicy;
15
+ /**
16
+ * Install the HMAC-SHA256-only `crypto.subtle` stand-in when the runtime has
17
+ * no WebCrypto, so local join tokens (`createToken`,
18
+ * `GravixTokenProvider.local`) work on Hermes. Default true.
19
+ */
20
+ cryptoHmacShim?: boolean;
21
+ /**
22
+ * Mute releases the microphone on every Room (Flutter 0.12.1+ default):
23
+ * iOS (Gravix audio device) closes the mic input on mute, Android mics published while muted get their
24
+ * recorder closed. Default true; `false` is the one-flag rollback (no room
25
+ * hook installed, the plain core mute).
26
+ */
27
+ muteReleasesMic?: boolean;
28
+ }
29
+ /** What the gravix-rtc core reads to tell it runs in React Native (`getReactNativeOs`). */
30
+ export type GravixReactNativeGlobal = {
31
+ platform: string;
32
+ devicePixelRatio: number;
33
+ };
34
+ /**
35
+ * Installs WebRTC and the web APIs gravix-rtc needs into the React Native
36
+ * runtime. Call once, at app start, before any `Room` is created.
37
+ * Safe to call more than once.
38
+ */
39
+ export declare function registerGlobals(options?: RegisterGlobalsOptions): void;
40
+ /** Test hook: lets a test call `registerGlobals` again. @internal */
41
+ export declare function __resetRegisterGlobalsForTests(): void;
42
+ //# sourceMappingURL=registerGlobals.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registerGlobals.d.ts","sourceRoot":"","sources":["../../../src/registerGlobals.ts"],"names":[],"mappings":"AAIA,OAAO,8CAA8C,CAAC;AACtD,OAAO,yCAAyC,CAAC;AAUjD,OAAO,EAEL,KAAK,qBAAqB,EAC3B,MAAM,yBAAsB,CAAC;AAQ9B,MAAM,WAAW,sBAAsB;IACrC;;;;OAIG;IACH,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,0EAA0E;IAC1E,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,qDAAqD;IACrD,qBAAqB,CAAC,EAAE,qBAAqB,CAAC;IAC9C;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;;;OAKG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,2FAA2F;AAC3F,MAAM,MAAM,uBAAuB,GAAG;IACpC,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,MAAM,CAAC;CAC1B,CAAC;AAIF;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,OAAO,GAAE,sBAA2B,GAAG,IAAI,CAsC1E;AAED,qEAAqE;AACrE,wBAAgB,8BAA8B,IAAI,IAAI,CAErD"}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Native-only Gravix features (Flutter gravix_rtc parity). Each one is gated
3
+ * on a per-platform capability the native module reports; while it is false,
4
+ * every call of that feature throws {@link GravixUnsupportedError}.
5
+ *
6
+ * Keep in sync with `NATIVE_FEATURES` in the Android `GravixRtcModule.kt` and
7
+ * `GravixNativeFeatures()` in the iOS `GravixRtc.mm`.
8
+ */
9
+ export declare const NATIVE_FEATURES: readonly ["voiceEffects", "roomMusic", "muteReleasesMic", "noiseSuppression", "singerMode", "audioScenario", "screenShareService"];
10
+ export type GravixNativeFeature = (typeof NATIVE_FEATURES)[number];
11
+ export interface GravixCapabilities {
12
+ /** 'android' | 'ios' | another `Platform.OS`. */
13
+ platform: string;
14
+ /** Version of the linked native module, or null when it is not linked. */
15
+ nativeVersion: string | null;
16
+ /** Whether `GravixRtc.setup` (Android) / `GravixRtcSetup.setup` (iOS) ran. */
17
+ setUp: boolean;
18
+ features: Record<GravixNativeFeature, boolean>;
19
+ }
20
+ /** Thrown by a native-only feature on a platform where it is not implemented yet. */
21
+ export declare class GravixUnsupportedError extends Error {
22
+ readonly code: "not_supported_on_platform";
23
+ readonly feature: GravixNativeFeature;
24
+ readonly operation: string;
25
+ readonly platform: string;
26
+ constructor(feature: GravixNativeFeature, operation: string, platform: string);
27
+ }
28
+ /** The native capability map (read once, then cached). Without the native module every feature is false. */
29
+ export declare function getCapabilities(): GravixCapabilities;
30
+ /** Whether a native-only feature is available on this platform. */
31
+ export declare function isFeatureSupported(feature: GravixNativeFeature): boolean;
32
+ /**
33
+ * Throws {@link GravixUnsupportedError} while `feature` is not supported here.
34
+ * When the native side reports it supported but this JS layer has no binding
35
+ * for `operation` yet, that is an SDK bug, reported as a plain Error.
36
+ */
37
+ export declare function unsupported(feature: GravixNativeFeature, operation: string): never;
38
+ /** Async form of {@link unsupported} for promise-returning APIs. */
39
+ export declare function unsupportedAsync(feature: GravixNativeFeature, operation: string): Promise<never>;
40
+ /** Test hook. @internal */
41
+ export declare function __resetCapabilitiesForTests(): void;
42
+ //# sourceMappingURL=unsupported.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unsupported.d.ts","sourceRoot":"","sources":["../../../src/unsupported.ts"],"names":[],"mappings":"AAMA;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,oIAQlB,CAAC;AAEX,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAEnE,MAAM,WAAW,kBAAkB;IACjC,iDAAiD;IACjD,QAAQ,EAAE,MAAM,CAAC;IACjB,0EAA0E;IAC1E,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,8EAA8E;IAC9E,KAAK,EAAE,OAAO,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAC;CAChD;AAED,qFAAqF;AACrF,qBAAa,sBAAuB,SAAQ,KAAK;IAC/C,QAAQ,CAAC,IAAI,EAAG,2BAA2B,CAAU;IACrD,QAAQ,CAAC,OAAO,EAAE,mBAAmB,CAAC;IACtC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;gBAGxB,OAAO,EAAE,mBAAmB,EAC5B,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM;CAanB;AAUD,4GAA4G;AAC5G,wBAAgB,eAAe,IAAI,kBAAkB,CA2BpD;AAED,mEAAmE;AACnE,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAExE;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CACzB,OAAO,EAAE,mBAAmB,EAC5B,SAAS,EAAE,MAAM,GAChB,KAAK,CASP;AAED,oEAAoE;AACpE,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,mBAAmB,EAC5B,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,KAAK,CAAC,CAMhB;AAED,2BAA2B;AAC3B,wBAAgB,2BAA2B,IAAI,IAAI,CAElD"}
@@ -0,0 +1,3 @@
1
+ /** Version of gravix-rtc-react-native (kept equal to package.json by a unit test). */
2
+ export declare const GRAVIX_RTC_RN_VERSION = "0.2.0";
3
+ //# sourceMappingURL=version.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../../src/version.ts"],"names":[],"mappings":"AAEA,sFAAsF;AACtF,eAAO,MAAM,qBAAqB,UAAU,CAAC"}
package/metro/index.js ADDED
@@ -0,0 +1,39 @@
1
+ // Copyright (c) 2026 Gravity Compile. MIT License; see LICENSE.
2
+ 'use strict';
3
+
4
+ /**
5
+ * Metro config helper for apps using gravix-rtc-react-native.
6
+ *
7
+ * const { withGravixRtc } = require('gravix-rtc-react-native/metro');
8
+ * module.exports = withGravixRtc(getDefaultConfig(__dirname));
9
+ *
10
+ * gravix-rtc's web noise-suppression controller lazily does
11
+ * `import('gravix-rtc/noise')` (AudioWorklet + WASM, uses `import.meta`).
12
+ * Metro resolves dynamic imports at build time, and Hermes cannot compile
13
+ * `import.meta`, so that module is swapped for a stub that rejects with a
14
+ * clear error. Native noise suppression is `GravixNoiseSuppression`.
15
+ */
16
+ const path = require('path');
17
+
18
+ const STUBBED = new Set(['gravix-rtc/noise']);
19
+ const STUB_PATH = path.join(__dirname, 'noise-stub.js');
20
+
21
+ function withGravixRtc(config) {
22
+ const resolver = config.resolver || {};
23
+ const upstream = resolver.resolveRequest;
24
+ return {
25
+ ...config,
26
+ resolver: {
27
+ ...resolver,
28
+ resolveRequest(context, moduleName, platform) {
29
+ if (STUBBED.has(moduleName) && platform !== 'web') {
30
+ return { type: 'sourceFile', filePath: STUB_PATH };
31
+ }
32
+ if (upstream) return upstream(context, moduleName, platform);
33
+ return context.resolveRequest(context, moduleName, platform);
34
+ },
35
+ },
36
+ };
37
+ }
38
+
39
+ module.exports = { withGravixRtc, STUBBED_MODULES: [...STUBBED] };
@@ -0,0 +1,10 @@
1
+ // Copyright (c) 2026 Gravity Compile. MIT License; see LICENSE.
2
+ 'use strict';
3
+
4
+ // Stands in for gravix-rtc/noise (browser AudioWorklet + WASM) in React Native
5
+ // bundles; see ./index.js. Importing it fails, which gravix-rtc treats as
6
+ // "web noise suppression unavailable".
7
+ throw new Error(
8
+ 'gravix-rtc/noise (web WASM noise suppression) is not available in React Native; ' +
9
+ 'use GravixNoiseSuppression from gravix-rtc-react-native'
10
+ );