expo-modules-core 1.11.13 → 1.12.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 (417) hide show
  1. package/CHANGELOG.md +72 -15
  2. package/ExpoModulesCore.podspec +7 -4
  3. package/android/ExpoModulesCorePlugin.gradle +36 -28
  4. package/android/build.gradle +12 -93
  5. package/android/proguard-rules.pro +0 -8
  6. package/android/src/main/cpp/Exceptions.cpp +1 -1
  7. package/android/src/main/cpp/Exceptions.h +1 -1
  8. package/android/src/main/cpp/ExpoModulesHostObject.cpp +7 -6
  9. package/android/src/main/cpp/ExpoModulesHostObject.h +3 -3
  10. package/android/src/main/cpp/JNIInjector.cpp +4 -2
  11. package/android/src/main/cpp/JSIContext.cpp +354 -0
  12. package/android/src/main/cpp/{JSIInteropModuleRegistry.h → JSIContext.h} +90 -9
  13. package/android/src/main/cpp/JavaCallback.cpp +210 -24
  14. package/android/src/main/cpp/JavaCallback.h +42 -7
  15. package/android/src/main/cpp/JavaScriptFunction.cpp +20 -6
  16. package/android/src/main/cpp/JavaScriptFunction.h +4 -1
  17. package/android/src/main/cpp/JavaScriptModuleObject.cpp +118 -82
  18. package/android/src/main/cpp/JavaScriptModuleObject.h +21 -18
  19. package/android/src/main/cpp/JavaScriptObject.cpp +7 -8
  20. package/android/src/main/cpp/JavaScriptObject.h +4 -2
  21. package/android/src/main/cpp/JavaScriptRuntime.cpp +18 -41
  22. package/android/src/main/cpp/JavaScriptRuntime.h +2 -8
  23. package/android/src/main/cpp/JavaScriptTypedArray.cpp +3 -3
  24. package/android/src/main/cpp/JavaScriptTypedArray.h +1 -1
  25. package/android/src/main/cpp/JavaScriptValue.cpp +7 -7
  26. package/android/src/main/cpp/JavaScriptValue.h +1 -1
  27. package/android/src/main/cpp/JavaScriptWeakObject.cpp +4 -4
  28. package/android/src/main/cpp/JavaScriptWeakObject.h +1 -1
  29. package/android/src/main/cpp/MethodMetadata.cpp +44 -120
  30. package/android/src/main/cpp/MethodMetadata.h +5 -11
  31. package/android/src/main/cpp/WeakRuntimeHolder.cpp +3 -3
  32. package/android/src/main/cpp/WeakRuntimeHolder.h +2 -2
  33. package/android/src/main/cpp/types/AnyType.cpp +1 -1
  34. package/android/src/main/cpp/types/AnyType.h +1 -1
  35. package/android/src/main/cpp/types/FrontendConverter.cpp +32 -43
  36. package/android/src/main/cpp/types/FrontendConverter.h +1 -23
  37. package/android/src/main/cpp/types/JNIToJSIConverter.cpp +5 -10
  38. package/android/src/main/cpp/types/JNIToJSIConverter.h +6 -2
  39. package/android/src/main/java/expo/modules/adapters/react/ModuleRegistryAdapter.java +3 -0
  40. package/android/src/main/java/expo/modules/adapters/react/NativeModulesProxy.java +14 -100
  41. package/android/src/main/java/expo/modules/adapters/react/ReactAdapterPackage.java +3 -5
  42. package/android/src/main/java/expo/modules/adapters/react/ReactModuleRegistryProvider.java +6 -22
  43. package/android/src/main/java/expo/modules/adapters/react/apploader/RNHeadlessAppLoader.kt +8 -4
  44. package/android/src/main/java/expo/modules/adapters/react/services/EventEmitterModule.java +0 -1
  45. package/android/src/main/java/expo/modules/adapters/react/services/UIManagerModuleWrapper.java +23 -8
  46. package/android/src/main/java/expo/modules/core/BasePackage.java +0 -10
  47. package/android/src/main/java/expo/modules/core/ModulePriorities.kt +1 -0
  48. package/android/src/main/java/expo/modules/core/ModuleRegistry.java +2 -32
  49. package/android/src/main/java/expo/modules/core/ModuleRegistryProvider.java +0 -18
  50. package/android/src/main/java/expo/modules/core/Promise.java +2 -0
  51. package/android/src/main/java/expo/modules/core/interfaces/Package.java +0 -17
  52. package/android/src/main/java/expo/modules/core/interfaces/ReactActivityHandler.java +0 -9
  53. package/android/src/main/java/expo/modules/core/interfaces/ReactNativeHostHandler.java +24 -31
  54. package/android/src/main/java/expo/modules/core/logging/LogHandler.kt +1 -7
  55. package/android/src/main/java/expo/modules/core/logging/LogHandlers.kt +11 -0
  56. package/android/src/main/java/expo/modules/core/logging/Logger.kt +18 -29
  57. package/android/src/main/java/expo/modules/core/logging/LoggerTimer.kt +11 -0
  58. package/android/src/main/java/expo/modules/core/logging/OSLogHandler.kt +2 -4
  59. package/android/src/main/java/expo/modules/core/logging/PersistentFileLogHandler.kt +1 -3
  60. package/android/src/main/java/expo/modules/interfaces/constants/ConstantsInterface.java +0 -2
  61. package/android/src/main/java/expo/modules/interfaces/permissions/PermissionsStatus.java +1 -1
  62. package/android/src/main/java/expo/modules/kotlin/AppContext.kt +43 -24
  63. package/android/src/main/java/expo/modules/kotlin/ArrayExtenstions.kt +15 -0
  64. package/android/src/main/java/expo/modules/kotlin/CoreLogger.kt +2 -2
  65. package/android/src/main/java/expo/modules/kotlin/DynamicExtenstions.kt +0 -3
  66. package/android/src/main/java/expo/modules/kotlin/ExpoBridgeModule.kt +41 -0
  67. package/android/src/main/java/expo/modules/kotlin/ExpoModulesHelper.kt +1 -2
  68. package/android/src/main/java/expo/modules/kotlin/KPromiseWrapper.kt +1 -2
  69. package/android/src/main/java/expo/modules/kotlin/KotlinInteropModuleRegistry.kt +1 -33
  70. package/android/src/main/java/expo/modules/kotlin/ModuleHolder.kt +7 -6
  71. package/android/src/main/java/expo/modules/kotlin/ModuleRegistry.kt +12 -12
  72. package/android/src/main/java/expo/modules/kotlin/Promise.kt +10 -0
  73. package/android/src/main/java/expo/modules/kotlin/ReactExtensions.kt +14 -0
  74. package/android/src/main/java/expo/modules/kotlin/Utils.kt +4 -1
  75. package/android/src/main/java/expo/modules/kotlin/activityaware/AppCompatActivityAwareHelper.kt +1 -1
  76. package/android/src/main/java/expo/modules/kotlin/activityresult/AppContextActivityResultCaller.kt +1 -1
  77. package/android/src/main/java/expo/modules/kotlin/activityresult/AppContextActivityResultRegistry.kt +6 -6
  78. package/android/src/main/java/expo/modules/kotlin/classcomponent/ClassComponentBuilder.kt +44 -15
  79. package/android/src/main/java/expo/modules/kotlin/defaultmodules/CoreModule.kt +31 -1
  80. package/android/src/main/java/expo/modules/kotlin/defaultmodules/ErrorManagerModule.kt +2 -4
  81. package/android/src/main/java/expo/modules/kotlin/events/KModuleEventEmitterWrapper.kt +11 -4
  82. package/android/src/main/java/expo/modules/kotlin/exception/CodedException.kt +2 -3
  83. package/android/src/main/java/expo/modules/kotlin/functions/AsyncFunctionBuilder.kt +136 -43
  84. package/android/src/main/java/expo/modules/kotlin/functions/AsyncFunctionComponent.kt +71 -2
  85. package/android/src/main/java/expo/modules/kotlin/functions/FunctionBuilder.kt +39 -12
  86. package/android/src/main/java/expo/modules/kotlin/jni/ExpectedType.kt +2 -2
  87. package/android/src/main/java/expo/modules/kotlin/jni/JNIDeallocator.kt +1 -1
  88. package/android/src/main/java/expo/modules/kotlin/jni/{JSIInteropModuleRegistry.kt → JSIContext.kt} +90 -14
  89. package/android/src/main/java/expo/modules/kotlin/jni/JavaCallback.kt +51 -24
  90. package/android/src/main/java/expo/modules/kotlin/jni/JavaScriptFunction.kt +3 -3
  91. package/android/src/main/java/expo/modules/kotlin/jni/JavaScriptModuleObject.kt +4 -1
  92. package/android/src/main/java/expo/modules/kotlin/jni/JavaScriptObject.kt +1 -0
  93. package/android/src/main/java/expo/modules/kotlin/jni/JavaScriptValue.kt +1 -0
  94. package/android/src/main/java/expo/modules/kotlin/jni/PromiseImpl.kt +20 -0
  95. package/android/src/main/java/expo/modules/kotlin/modules/Module.kt +0 -1
  96. package/android/src/main/java/expo/modules/kotlin/modules/ModuleDefinitionBuilder.kt +1 -1
  97. package/android/src/main/java/expo/modules/kotlin/objects/ObjectDefinitionBuilder.kt +164 -65
  98. package/android/src/main/java/expo/modules/kotlin/objects/PropertyComponentBuilder.kt +3 -4
  99. package/android/src/main/java/expo/modules/kotlin/sharedobjects/ClassRegistry.kt +21 -0
  100. package/android/src/main/java/expo/modules/kotlin/sharedobjects/SharedObject.kt +34 -1
  101. package/android/src/main/java/expo/modules/kotlin/sharedobjects/SharedObjectRegistry.kt +23 -8
  102. package/android/src/main/java/expo/modules/kotlin/sharedobjects/SharedRef.kt +7 -1
  103. package/android/src/main/java/expo/modules/kotlin/tracing/ExpoTrace.kt +4 -0
  104. package/android/src/main/java/expo/modules/kotlin/types/AnyType.kt +134 -2
  105. package/android/src/main/java/expo/modules/kotlin/types/EnforceType.kt +60 -0
  106. package/android/src/main/java/expo/modules/kotlin/types/EnumTypeConverter.kt +2 -2
  107. package/android/src/main/java/expo/modules/kotlin/types/TypeConverter.kt +0 -2
  108. package/android/src/main/java/expo/modules/kotlin/types/TypeConverterProvider.kt +3 -27
  109. package/android/src/main/java/expo/modules/kotlin/types/UnitTypeConverter.kt +3 -7
  110. package/android/src/main/java/expo/modules/kotlin/types/io/PathTypeConverter.kt +3 -0
  111. package/android/src/main/java/expo/modules/kotlin/viewevent/ViewEvent.kt +2 -5
  112. package/android/src/main/java/expo/modules/kotlin/views/ViewDefinitionBuilder.kt +137 -48
  113. package/android/src/main/java/expo/modules/kotlin/views/ViewManagerDefinition.kt +2 -5
  114. package/build/EventEmitter.d.ts +2 -2
  115. package/build/EventEmitter.d.ts.map +1 -1
  116. package/build/EventEmitter.js +8 -8
  117. package/build/EventEmitter.js.map +1 -1
  118. package/build/NativeModule.d.ts +4 -0
  119. package/build/NativeModule.d.ts.map +1 -0
  120. package/build/NativeModule.js +4 -0
  121. package/build/NativeModule.js.map +1 -0
  122. package/build/NativeModulesProxy.d.ts.map +1 -1
  123. package/build/NativeModulesProxy.native.d.ts.map +1 -1
  124. package/build/NativeModulesProxy.native.js +4 -0
  125. package/build/NativeModulesProxy.native.js.map +1 -1
  126. package/build/NativeModulesProxy.types.d.ts +2 -2
  127. package/build/NativeModulesProxy.types.d.ts.map +1 -1
  128. package/build/NativeModulesProxy.types.js.map +1 -1
  129. package/build/NativeViewManagerAdapter.native.d.ts.map +1 -1
  130. package/build/NativeViewManagerAdapter.native.js +20 -1
  131. package/build/NativeViewManagerAdapter.native.js.map +1 -1
  132. package/build/PermissionsHook.d.ts.map +1 -1
  133. package/build/PermissionsHook.js +2 -0
  134. package/build/PermissionsHook.js.map +1 -1
  135. package/build/Platform.d.ts.map +1 -1
  136. package/build/Refs.d.ts +8 -0
  137. package/build/Refs.d.ts.map +1 -0
  138. package/build/Refs.js +10 -0
  139. package/build/Refs.js.map +1 -0
  140. package/build/SharedObject.d.ts +4 -0
  141. package/build/SharedObject.d.ts.map +1 -0
  142. package/build/SharedObject.js +4 -0
  143. package/build/SharedObject.js.map +1 -0
  144. package/build/createWebModule.d.ts +2 -0
  145. package/build/createWebModule.d.ts.map +1 -0
  146. package/build/createWebModule.js +6 -0
  147. package/build/createWebModule.js.map +1 -0
  148. package/build/createWebModule.web.d.ts +2 -0
  149. package/build/createWebModule.web.d.ts.map +1 -0
  150. package/build/createWebModule.web.js +6 -0
  151. package/build/createWebModule.web.js.map +1 -0
  152. package/build/ensureNativeModulesAreInstalled.d.ts +6 -0
  153. package/build/ensureNativeModulesAreInstalled.d.ts.map +1 -0
  154. package/build/ensureNativeModulesAreInstalled.js +26 -0
  155. package/build/ensureNativeModulesAreInstalled.js.map +1 -0
  156. package/build/environment/browser.js.map +1 -1
  157. package/build/hooks/useReleasingSharedObject.d.ts +7 -0
  158. package/build/hooks/useReleasingSharedObject.d.ts.map +1 -0
  159. package/build/hooks/useReleasingSharedObject.js +40 -0
  160. package/build/hooks/useReleasingSharedObject.js.map +1 -0
  161. package/build/index.d.ts +8 -1
  162. package/build/index.d.ts.map +1 -1
  163. package/build/index.js +8 -0
  164. package/build/index.js.map +1 -1
  165. package/build/requireNativeModule.d.ts +0 -17
  166. package/build/requireNativeModule.d.ts.map +1 -1
  167. package/build/requireNativeModule.js +2 -23
  168. package/build/requireNativeModule.js.map +1 -1
  169. package/build/sweet/setUpErrorManager.fx.js.map +1 -1
  170. package/build/ts-declarations/EventEmitter.d.ts +50 -0
  171. package/build/ts-declarations/EventEmitter.d.ts.map +1 -0
  172. package/build/ts-declarations/EventEmitter.js +2 -0
  173. package/build/ts-declarations/EventEmitter.js.map +1 -0
  174. package/build/ts-declarations/NativeModule.d.ts +14 -0
  175. package/build/ts-declarations/NativeModule.d.ts.map +1 -0
  176. package/build/ts-declarations/NativeModule.js +2 -0
  177. package/build/ts-declarations/NativeModule.js.map +1 -0
  178. package/build/ts-declarations/SharedObject.d.ts +14 -0
  179. package/build/ts-declarations/SharedObject.d.ts.map +1 -0
  180. package/build/ts-declarations/SharedObject.js +2 -0
  181. package/build/ts-declarations/SharedObject.js.map +1 -0
  182. package/build/ts-declarations/global.d.ts +49 -0
  183. package/build/ts-declarations/global.d.ts.map +1 -0
  184. package/build/ts-declarations/global.js +2 -0
  185. package/build/ts-declarations/global.js.map +1 -0
  186. package/build/uuid/lib/bytesToUuid.js.map +1 -1
  187. package/build/uuid/lib/sha1.js.map +1 -1
  188. package/build/uuid/lib/v35.js.map +1 -1
  189. package/build/uuid/uuid.js.map +1 -1
  190. package/build/uuid/uuid.web.js.map +1 -1
  191. package/build/web/CoreModule.d.ts +17 -0
  192. package/build/web/CoreModule.d.ts.map +1 -0
  193. package/build/web/CoreModule.js +51 -0
  194. package/build/web/CoreModule.js.map +1 -0
  195. package/build/web/index.d.ts +1 -0
  196. package/build/web/index.d.ts.map +1 -0
  197. package/build/web/index.js +1 -0
  198. package/build/web/index.js.map +1 -0
  199. package/build/web/index.web.d.ts +2 -0
  200. package/build/web/index.web.d.ts.map +1 -0
  201. package/build/web/index.web.js +2 -0
  202. package/build/web/index.web.js.map +1 -0
  203. package/common/cpp/BridgelessJSCallInvoker.h +41 -0
  204. package/common/cpp/EventEmitter.cpp +294 -0
  205. package/common/cpp/EventEmitter.h +111 -0
  206. package/common/cpp/JSIUtils.cpp +116 -11
  207. package/common/cpp/JSIUtils.h +54 -7
  208. package/common/cpp/LazyObject.cpp +15 -3
  209. package/common/cpp/LazyObject.h +13 -0
  210. package/common/cpp/NativeModule.cpp +16 -0
  211. package/common/cpp/NativeModule.h +34 -0
  212. package/common/cpp/ObjectDeallocator.cpp +3 -5
  213. package/common/cpp/ObjectDeallocator.h +2 -3
  214. package/common/cpp/SharedObject.cpp +69 -0
  215. package/common/cpp/SharedObject.h +59 -0
  216. package/common/cpp/TestingSyncJSCallInvoker.h +44 -0
  217. package/ios/Api/Builders/ClassComponentBuilder.swift +34 -0
  218. package/ios/{Objects → Api/Builders}/ObjectDefinitionBuilder.swift +3 -3
  219. package/ios/Api/Builders/ViewDefinitionBuilder.swift +53 -0
  220. package/ios/Api/Factories/AsyncFunctionFactories.swift +173 -0
  221. package/ios/{Classes/ClassComponentFactories.swift → Api/Factories/ClassFactories.swift} +19 -19
  222. package/ios/{Functions/ConcurrentFunctionDefinition.swift → Api/Factories/ConcurrentFunctionFactories.swift} +0 -113
  223. package/ios/{Modules/ModuleDefinitionComponents.swift → Api/Factories/EventListenersFactories.swift} +0 -20
  224. package/ios/Api/Factories/ModuleFactories.swift +6 -0
  225. package/ios/{Objects/ObjectDefinitionComponents.swift → Api/Factories/ObjectFactories.swift} +5 -5
  226. package/ios/Api/Factories/PropertyFactories.swift +50 -0
  227. package/ios/Api/Factories/SyncFunctionFactories.swift +173 -0
  228. package/ios/{Views/ViewManagerDefinitionComponents.swift → Api/Factories/ViewFactories.swift} +7 -6
  229. package/ios/AppDelegates/EXAppDelegateWrapper.h +0 -21
  230. package/ios/AppDelegates/EXAppDelegateWrapper.mm +37 -29
  231. package/ios/{AppContext.swift → Core/AppContext.swift} +34 -11
  232. package/ios/Core/Classes/AnyClassDefinitionElement.swift +37 -0
  233. package/ios/{Classes/ClassComponent.swift → Core/Classes/ClassDefinition.swift} +10 -10
  234. package/ios/{Conversions.swift → Core/Conversions.swift} +1 -1
  235. package/ios/{DynamicTypes → Core/DynamicTypes}/DynamicSharedObjectType.swift +3 -3
  236. package/ios/Core/Events/EventObservingDefinition.swift +79 -0
  237. package/ios/Core/Events/LegacyEventEmitterCompat.swift +32 -0
  238. package/ios/Core/ExpoBridgeModule.h +18 -0
  239. package/ios/Core/ExpoBridgeModule.mm +88 -0
  240. package/ios/Core/ExpoRuntime.swift +6 -0
  241. package/ios/{Functions/AnyFunction.swift → Core/Functions/AnyFunctionDefinition.swift} +9 -2
  242. package/ios/Core/Functions/AsyncFunctionDefinition.swift +150 -0
  243. package/ios/Core/Functions/ConcurrentFunctionDefinition.swift +112 -0
  244. package/ios/Core/Functions/SyncFunctionDefinition.swift +108 -0
  245. package/ios/{JavaScriptUtils.swift → Core/JavaScriptUtils.swift} +4 -4
  246. package/ios/{Logging → Core/Logging}/LogHandlers.swift +12 -5
  247. package/ios/{Logging → Core/Logging}/Logger.swift +14 -92
  248. package/ios/Core/Logging/LoggerTimer.swift +22 -0
  249. package/ios/{ModuleHolder.swift → Core/ModuleHolder.swift} +2 -10
  250. package/ios/Core/Modules/CoreModule.swift +43 -0
  251. package/ios/{Modules → Core/Modules}/ModuleDefinition.swift +20 -12
  252. package/ios/{Modules → Core/Modules}/ModuleDefinitionBuilder.swift +1 -3
  253. package/ios/{Objects → Core/Objects}/ObjectDefinition.swift +9 -9
  254. package/ios/{Objects/PropertyComponent.swift → Core/Objects/PropertyDefinition.swift} +11 -64
  255. package/ios/Core/Protocols/AnyDefinition.swift +4 -0
  256. package/ios/Core/Protocols/AnyExpoView.swift +7 -0
  257. package/ios/Core/Protocols/AnyModule.swift +17 -0
  258. package/ios/Core/Protocols/AnyViewDefinition.swift +34 -0
  259. package/ios/Core/SharedObjects/SharedObject.swift +80 -0
  260. package/ios/{SharedObjects → Core/SharedObjects}/SharedObjectRegistry.swift +45 -19
  261. package/ios/{Views → Core/Views}/AnyViewProp.swift +1 -1
  262. package/ios/{Views → Core/Views}/ComponentData.swift +7 -7
  263. package/ios/{Views → Core/Views}/ExpoView.swift +1 -1
  264. package/ios/Core/Views/ViewDefinition.swift +97 -0
  265. package/ios/{Views → Core/Views}/ViewLifecycleMethod.swift +1 -1
  266. package/ios/{Views → Core/Views}/ViewModuleWrapper.swift +1 -1
  267. package/ios/Fabric/ExpoFabricView.swift +5 -6
  268. package/ios/FileSystemUtilities/FileSystemLegacyUtilities.swift +111 -0
  269. package/ios/JSI/EXJSIInstaller.h +28 -0
  270. package/ios/JSI/EXJSIInstaller.mm +54 -10
  271. package/ios/JSI/EXJSIUtils.h +15 -11
  272. package/ios/JSI/EXJSIUtils.mm +21 -49
  273. package/ios/JSI/EXJavaScriptObject.mm +2 -2
  274. package/ios/JSI/EXJavaScriptRuntime.h +15 -0
  275. package/ios/JSI/EXJavaScriptRuntime.mm +53 -26
  276. package/ios/JSI/EXSharedObjectUtils.h +15 -0
  277. package/ios/JSI/EXSharedObjectUtils.mm +18 -0
  278. package/ios/JSI/JavaScriptRuntime.swift +16 -0
  279. package/ios/Legacy/ModuleRegistry/EXModuleRegistry.m +1 -0
  280. package/ios/Legacy/ModuleRegistryProvider/EXModuleRegistryProvider.m +5 -0
  281. package/ios/Legacy/NativeModulesProxy/EXNativeModulesProxy.mm +5 -4
  282. package/ios/Legacy/Services/EXReactNativeAdapter.mm +34 -28
  283. package/ios/ReactDelegates/EXReactDelegateWrapper.h +4 -12
  284. package/ios/ReactDelegates/EXReactDelegateWrapper.mm +41 -0
  285. package/ios/ReactDelegates/EXReactRootViewFactory.h +38 -0
  286. package/ios/ReactDelegates/EXReactRootViewFactory.mm +54 -0
  287. package/ios/ReactDelegates/ExpoReactDelegate.swift +22 -15
  288. package/ios/ReactDelegates/ExpoReactDelegateHandler.swift +10 -21
  289. package/ios/ReactDelegates/RCTAppDelegate+Recreate.h +28 -0
  290. package/ios/ReactDelegates/RCTAppDelegate+Recreate.mm +47 -0
  291. package/ios/Tests/{ClassComponentSpec.swift → ClassDefinitionSpec.swift} +6 -6
  292. package/ios/Tests/ConvertiblesSpec.swift +6 -1
  293. package/ios/Tests/CoreModuleSpec.swift +0 -4
  294. package/ios/Tests/DynamicTypeSpec.swift +1 -1
  295. package/ios/Tests/EventEmitterSpec.swift +274 -0
  296. package/ios/Tests/ExceptionsSpec.swift +114 -54
  297. package/ios/Tests/ExpoModulesSpec.swift +4 -3
  298. package/ios/Tests/LoggerSpec.swift +80 -0
  299. package/ios/Tests/{PropertyComponentSpec.swift → PropertyDefinitionSpec.swift} +1 -1
  300. package/ios/Tests/SharedObjectRegistrySpec.swift +34 -28
  301. package/ios/Tests/SharedObjectSpec.swift +141 -0
  302. package/ios/Tests/ViewDefinitionSpec.swift +1 -1
  303. package/package.json +2 -2
  304. package/src/EventEmitter.ts +15 -18
  305. package/src/NativeModule.ts +6 -0
  306. package/src/NativeModulesProxy.native.ts +5 -0
  307. package/src/NativeModulesProxy.types.ts +2 -2
  308. package/src/NativeViewManagerAdapter.native.tsx +25 -1
  309. package/src/PermissionsHook.ts +4 -0
  310. package/src/Refs.ts +10 -0
  311. package/src/SharedObject.ts +6 -0
  312. package/src/createWebModule.ts +5 -0
  313. package/src/createWebModule.web.ts +6 -0
  314. package/src/ensureNativeModulesAreInstalled.ts +24 -0
  315. package/src/hooks/useReleasingSharedObject.ts +51 -0
  316. package/src/index.ts +13 -0
  317. package/src/requireNativeModule.ts +2 -51
  318. package/src/ts-declarations/EventEmitter.ts +65 -0
  319. package/src/ts-declarations/ExpoModules.d.ts +0 -5
  320. package/src/ts-declarations/NativeModule.ts +18 -0
  321. package/src/ts-declarations/SharedObject.ts +16 -0
  322. package/src/ts-declarations/global.ts +60 -0
  323. package/src/web/CoreModule.ts +83 -0
  324. package/src/web/index.ts +0 -0
  325. package/src/web/index.web.ts +1 -0
  326. package/android/src/main/cpp/JSIInteropModuleRegistry.cpp +0 -196
  327. package/android/src/main/java/expo/modules/adapters/react/ArgumentsHelper.java +0 -48
  328. package/android/src/main/java/expo/modules/adapters/react/PromiseWrapper.java +0 -38
  329. package/android/src/main/java/expo/modules/adapters/react/services/CookieManagerModule.java +0 -53
  330. package/android/src/main/java/expo/modules/core/ArgumentsHelper.java +0 -44
  331. package/android/src/main/java/expo/modules/core/ExportedModule.java +0 -173
  332. package/android/src/main/java/expo/modules/core/ModuleRegistryDelegate.kt +0 -12
  333. package/android/src/main/java/expo/modules/core/ViewManager.java +0 -9
  334. package/android/src/main/java/expo/modules/core/interfaces/ExpoMethod.java +0 -12
  335. package/android/src/main/java/expo/modules/core/interfaces/ExpoProp.java +0 -10
  336. package/android/src/main/java/expo/modules/core/logging/LoggerOptions.kt +0 -29
  337. package/android-annotation/build.gradle +0 -48
  338. package/android-annotation/src/main/java/expo/modules/annotation/Config.kt +0 -7
  339. package/android-annotation/src/main/java/expo/modules/annotation/ConverterBinder.kt +0 -7
  340. package/android-annotation-processor/build.gradle +0 -54
  341. package/android-annotation-processor/src/main/java/expo/modules/annotationprocessor/ExpoSymbolProcessor.kt +0 -175
  342. package/android-annotation-processor/src/main/java/expo/modules/annotationprocessor/ExpoSymbolProcessorProvider.kt +0 -10
  343. package/android-annotation-processor/src/main/resources/META-INF/services/com.google.devtools.ksp.processing.SymbolProcessorProvider +0 -1
  344. package/ios/Classes/ClassComponentElement.swift +0 -37
  345. package/ios/Classes/ClassComponentElementsBuilder.swift +0 -34
  346. package/ios/ExpoBridgeModule.m +0 -7
  347. package/ios/ExpoBridgeModule.swift +0 -108
  348. package/ios/ExpoRuntime.swift +0 -28
  349. package/ios/Functions/AsyncFunctionComponent.swift +0 -327
  350. package/ios/Functions/SyncFunctionComponent.swift +0 -282
  351. package/ios/Interfaces/Font/EXFontManagerInterface.h +0 -9
  352. package/ios/Interfaces/Font/EXFontProcessorInterface.h +0 -15
  353. package/ios/Interfaces/Font/EXFontScalerInterface.h +0 -9
  354. package/ios/Interfaces/Font/EXFontScalersManagerInterface.h +0 -9
  355. package/ios/Legacy/Services/EXReactFontManager.h +0 -6
  356. package/ios/Legacy/Services/EXReactFontManager.m +0 -130
  357. package/ios/Modules/AnyModule.swift +0 -53
  358. package/ios/Modules/CoreModule.swift +0 -17
  359. package/ios/ReactDelegates/EXRCTBridgeDelegateInterceptor.h +0 -16
  360. package/ios/ReactDelegates/EXRCTBridgeDelegateInterceptor.m +0 -49
  361. package/ios/ReactDelegates/EXReactCompatibleHelpers.h +0 -15
  362. package/ios/ReactDelegates/EXReactCompatibleHelpers.m +0 -25
  363. package/ios/ReactDelegates/EXReactDelegateWrapper.m +0 -53
  364. package/ios/SharedObjects/SharedObject.swift +0 -31
  365. package/ios/Views/ViewDefinition.swift +0 -114
  366. package/ios/Views/ViewFactory.swift +0 -16
  367. package/ios/Views/ViewManagerDefinition.swift +0 -77
  368. package/ios/Views/ViewManagerDefinitionBuilder.swift +0 -11
  369. /package/ios/{AppContextConfig.swift → Core/AppContextConfig.swift} +0 -0
  370. /package/ios/{Arguments → Core/Arguments}/AnyArgument.swift +0 -0
  371. /package/ios/{Arguments → Core/Arguments}/Convertible.swift +0 -0
  372. /package/ios/{Arguments → Core/Arguments}/Convertibles.swift +0 -0
  373. /package/ios/{Arguments → Core/Arguments}/Enumerable.swift +0 -0
  374. /package/ios/{Classes → Core/Classes}/ClassRegistry.swift +0 -0
  375. /package/ios/{Convertibles → Core/Convertibles}/Convertibles+Color.swift +0 -0
  376. /package/ios/{Convertibles → Core/Convertibles}/Either.swift +0 -0
  377. /package/ios/{DynamicTypes → Core/DynamicTypes}/AnyDynamicType.swift +0 -0
  378. /package/ios/{DynamicTypes → Core/DynamicTypes}/DynamicArrayType.swift +0 -0
  379. /package/ios/{DynamicTypes → Core/DynamicTypes}/DynamicConvertibleType.swift +0 -0
  380. /package/ios/{DynamicTypes → Core/DynamicTypes}/DynamicDataType.swift +0 -0
  381. /package/ios/{DynamicTypes → Core/DynamicTypes}/DynamicDictionaryType.swift +0 -0
  382. /package/ios/{DynamicTypes → Core/DynamicTypes}/DynamicEnumType.swift +0 -0
  383. /package/ios/{DynamicTypes → Core/DynamicTypes}/DynamicJavaScriptType.swift +0 -0
  384. /package/ios/{DynamicTypes → Core/DynamicTypes}/DynamicOptionalType.swift +0 -0
  385. /package/ios/{DynamicTypes → Core/DynamicTypes}/DynamicRawType.swift +0 -0
  386. /package/ios/{DynamicTypes → Core/DynamicTypes}/DynamicType.swift +0 -0
  387. /package/ios/{DynamicTypes → Core/DynamicTypes}/DynamicTypedArrayType.swift +0 -0
  388. /package/ios/{DynamicTypes → Core/DynamicTypes}/DynamicViewType.swift +0 -0
  389. /package/ios/{EventListener.swift → Core/EventListener.swift} +0 -0
  390. /package/ios/{Events → Core/Events}/Callback.swift +0 -0
  391. /package/ios/{Events → Core/Events}/EventDispatcher.swift +0 -0
  392. /package/ios/{Exceptions → Core/Exceptions}/ChainableException.swift +0 -0
  393. /package/ios/{Exceptions → Core/Exceptions}/CodedError.swift +0 -0
  394. /package/ios/{Exceptions → Core/Exceptions}/CommonExceptions.swift +0 -0
  395. /package/ios/{Exceptions → Core/Exceptions}/Exception.swift +0 -0
  396. /package/ios/{Exceptions → Core/Exceptions}/ExceptionOrigin.swift +0 -0
  397. /package/ios/{Exceptions → Core/Exceptions}/GenericException.swift +0 -0
  398. /package/ios/{Exceptions → Core/Exceptions}/UnexpectedException.swift +0 -0
  399. /package/ios/{JavaScriptFunction.swift → Core/JavaScriptFunction.swift} +0 -0
  400. /package/ios/{Logging → Core/Logging}/LogType.swift +0 -0
  401. /package/ios/{Logging → Core/Logging}/PersistentFileLog.swift +0 -0
  402. /package/ios/{ModuleRegistry.swift → Core/ModuleRegistry.swift} +0 -0
  403. /package/ios/{Modules → Core/Modules}/Module.swift +0 -0
  404. /package/ios/{ModulesProvider.swift → Core/ModulesProvider.swift} +0 -0
  405. /package/ios/{Objects → Core/Objects}/JavaScriptObjectBuilder.swift +0 -0
  406. /package/ios/{Promise.swift → Core/Promise.swift} +0 -0
  407. /package/ios/{Records → Core/Records}/AnyField.swift +0 -0
  408. /package/ios/{Records → Core/Records}/Field.swift +0 -0
  409. /package/ios/{Records → Core/Records}/FieldExtensions.swift +0 -0
  410. /package/ios/{Records → Core/Records}/FieldOption.swift +0 -0
  411. /package/ios/{Records → Core/Records}/Record.swift +0 -0
  412. /package/ios/{SharedObjects → Core/SharedObjects}/SharedRef.swift +0 -0
  413. /package/ios/{TypedArrays → Core/TypedArrays}/AnyTypedArray.swift +0 -0
  414. /package/ios/{TypedArrays → Core/TypedArrays}/ConcreteTypedArrays.swift +0 -0
  415. /package/ios/{TypedArrays → Core/TypedArrays}/GenericTypedArray.swift +0 -0
  416. /package/ios/{TypedArrays → Core/TypedArrays}/TypedArray.swift +0 -0
  417. /package/ios/{Views → Core/Views}/ConcreteViewProp.swift +0 -0
package/build/index.js CHANGED
@@ -1,16 +1,22 @@
1
1
  import { DeviceEventEmitter } from 'react-native';
2
2
  import { EventEmitter } from './EventEmitter';
3
+ import NativeModule from './NativeModule';
3
4
  import NativeModulesProxy from './NativeModulesProxy';
4
5
  import { requireNativeViewManager } from './NativeViewManagerAdapter';
5
6
  import Platform from './Platform';
7
+ import SharedObject from './SharedObject';
6
8
  import { CodedError } from './errors/CodedError';
7
9
  import { UnavailabilityError } from './errors/UnavailabilityError';
8
10
  import './sweet/setUpErrorManager.fx';
11
+ import './web/index';
9
12
  export { default as uuid } from './uuid';
10
13
  export { DeviceEventEmitter, EventEmitter, NativeModulesProxy, Platform, requireNativeViewManager,
14
+ // Globals
15
+ SharedObject, NativeModule,
11
16
  // Errors
12
17
  CodedError, UnavailabilityError, };
13
18
  export * from './requireNativeModule';
19
+ export * from './createWebModule';
14
20
  export * from './TypedArrays.types';
15
21
  /**
16
22
  * @deprecated renamed to `DeviceEventEmitter`
@@ -18,4 +24,6 @@ export * from './TypedArrays.types';
18
24
  export const SyntheticPlatformEmitter = DeviceEventEmitter;
19
25
  export * from './PermissionsInterface';
20
26
  export * from './PermissionsHook';
27
+ export * from './Refs';
28
+ export * from './hooks/useReleasingSharedObject';
21
29
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAElD,OAAO,EAAE,YAAY,EAAgB,MAAM,gBAAgB,CAAC;AAC5D,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AAEtD,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAEnE,OAAO,8BAA8B,CAAC;AAEtC,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,QAAQ,CAAC;AAEzC,OAAO,EACL,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,EAElB,QAAQ,EAER,wBAAwB;AACxB,SAAS;AACT,UAAU,EACV,mBAAmB,GACpB,CAAC;AAEF,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AAEpC;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,kBAAkB,CAAC;AAE3D,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC","sourcesContent":["import { DeviceEventEmitter } from 'react-native';\n\nimport { EventEmitter, Subscription } from './EventEmitter';\nimport NativeModulesProxy from './NativeModulesProxy';\nimport { ProxyNativeModule } from './NativeModulesProxy.types';\nimport { requireNativeViewManager } from './NativeViewManagerAdapter';\nimport Platform from './Platform';\nimport { CodedError } from './errors/CodedError';\nimport { UnavailabilityError } from './errors/UnavailabilityError';\n\nimport './sweet/setUpErrorManager.fx';\n\nexport { default as uuid } from './uuid';\n\nexport {\n DeviceEventEmitter,\n EventEmitter,\n NativeModulesProxy,\n ProxyNativeModule,\n Platform,\n Subscription,\n requireNativeViewManager,\n // Errors\n CodedError,\n UnavailabilityError,\n};\n\nexport * from './requireNativeModule';\nexport * from './TypedArrays.types';\n\n/**\n * @deprecated renamed to `DeviceEventEmitter`\n */\nexport const SyntheticPlatformEmitter = DeviceEventEmitter;\n\nexport * from './PermissionsInterface';\nexport * from './PermissionsHook';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAElD,OAAO,EAAE,YAAY,EAAgB,MAAM,gBAAgB,CAAC;AAC5D,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AAEtD,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAEnE,OAAO,8BAA8B,CAAC;AACtC,OAAO,aAAa,CAAC;AAIrB,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,QAAQ,CAAC;AAEzC,OAAO,EACL,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,EAElB,QAAQ,EAER,wBAAwB;AACxB,UAAU;AACV,YAAY,EACZ,YAAY;AACZ,SAAS;AACT,UAAU,EACV,mBAAmB,GACpB,CAAC;AAEF,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AAEpC;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,kBAAkB,CAAC;AAE3D,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAElC,cAAc,QAAQ,CAAC;AAEvB,cAAc,kCAAkC,CAAC","sourcesContent":["import { DeviceEventEmitter } from 'react-native';\n\nimport { EventEmitter, Subscription } from './EventEmitter';\nimport NativeModule from './NativeModule';\nimport NativeModulesProxy from './NativeModulesProxy';\nimport { ProxyNativeModule } from './NativeModulesProxy.types';\nimport { requireNativeViewManager } from './NativeViewManagerAdapter';\nimport Platform from './Platform';\nimport SharedObject from './SharedObject';\nimport { CodedError } from './errors/CodedError';\nimport { UnavailabilityError } from './errors/UnavailabilityError';\n\nimport './sweet/setUpErrorManager.fx';\nimport './web/index';\n\nexport type * from './ts-declarations/global';\n\nexport { default as uuid } from './uuid';\n\nexport {\n DeviceEventEmitter,\n EventEmitter,\n NativeModulesProxy,\n ProxyNativeModule,\n Platform,\n Subscription,\n requireNativeViewManager,\n // Globals\n SharedObject,\n NativeModule,\n // Errors\n CodedError,\n UnavailabilityError,\n};\n\nexport * from './requireNativeModule';\nexport * from './createWebModule';\nexport * from './TypedArrays.types';\n\n/**\n * @deprecated renamed to `DeviceEventEmitter`\n */\nexport const SyntheticPlatformEmitter = DeviceEventEmitter;\n\nexport * from './PermissionsInterface';\nexport * from './PermissionsHook';\n\nexport * from './Refs';\n\nexport * from './hooks/useReleasingSharedObject';\n"]}
@@ -1,19 +1,3 @@
1
- type ExpoObject = {
2
- modules: undefined | {
3
- [key: string]: any;
4
- };
5
- uuidv4: () => string;
6
- uuidv5: (name: string, namespace: string) => string;
7
- };
8
- declare global {
9
- var expo: ExpoObject | undefined;
10
- /**
11
- * @deprecated `global.ExpoModules` is deprecated, use `global.expo.modules` instead.
12
- */
13
- var ExpoModules: undefined | {
14
- [key: string]: any;
15
- };
16
- }
17
1
  /**
18
2
  * Imports the native module registered with given name. In the first place it tries to load
19
3
  * the module installed through the JSI host object and then falls back to the bridge proxy module.
@@ -32,5 +16,4 @@ export declare function requireNativeModule<ModuleType = any>(moduleName: string
32
16
  * @returns Object representing the native module or `null` when it cannot be found.
33
17
  */
34
18
  export declare function requireOptionalNativeModule<ModuleType = any>(moduleName: string): ModuleType | null;
35
- export {};
36
19
  //# sourceMappingURL=requireNativeModule.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"requireNativeModule.d.ts","sourceRoot":"","sources":["../src/requireNativeModule.ts"],"names":[],"mappings":"AAIA,KAAK,UAAU,GAAG;IAChB,OAAO,EACH,SAAS,GACT;QACE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KACpB,CAAC;IACN,MAAM,EAAE,MAAM,MAAM,CAAC;IACrB,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;CACrD,CAAC;AAEF,OAAO,CAAC,MAAM,CAAC;IAEb,IAAI,IAAI,EAAE,UAAU,GAAG,SAAS,CAAC;IAEjC;;OAEG;IAEH,IAAI,WAAW,EACX,SAAS,GACT;QACE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KACpB,CAAC;CACP;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,GAAG,GAAG,EAAE,UAAU,EAAE,MAAM,GAAG,UAAU,CAOpF;AAED;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CAAC,UAAU,GAAG,GAAG,EAC1D,UAAU,EAAE,MAAM,GACjB,UAAU,GAAG,IAAI,CASnB"}
1
+ {"version":3,"file":"requireNativeModule.d.ts","sourceRoot":"","sources":["../src/requireNativeModule.ts"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,GAAG,GAAG,EAAE,UAAU,EAAE,MAAM,GAAG,UAAU,CAOpF;AAED;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CAAC,UAAU,GAAG,GAAG,EAC1D,UAAU,EAAE,MAAM,GACjB,UAAU,GAAG,IAAI,CAInB"}
@@ -1,5 +1,5 @@
1
- import { NativeModules } from 'react-native';
2
1
  import NativeModulesProxy from './NativeModulesProxy';
2
+ import { ensureNativeModulesAreInstalled } from './ensureNativeModulesAreInstalled';
3
3
  /**
4
4
  * Imports the native module registered with given name. In the first place it tries to load
5
5
  * the module installed through the JSI host object and then falls back to the bridge proxy module.
@@ -25,27 +25,6 @@ export function requireNativeModule(moduleName) {
25
25
  */
26
26
  export function requireOptionalNativeModule(moduleName) {
27
27
  ensureNativeModulesAreInstalled();
28
- return (globalThis.expo?.modules?.[moduleName] ??
29
- globalThis.ExpoModules?.[moduleName] ??
30
- NativeModulesProxy[moduleName] ??
31
- null);
32
- }
33
- /**
34
- * Ensures that the native modules are installed in the current runtime.
35
- * Otherwise, it synchronously calls a native function that installs them.
36
- */
37
- function ensureNativeModulesAreInstalled() {
38
- if (globalThis.expo) {
39
- return;
40
- }
41
- try {
42
- // TODO: ExpoModulesCore shouldn't be optional here,
43
- // but to keep backwards compatibility let's just ignore it in SDK 50.
44
- // In most cases the modules were already installed from the native side.
45
- NativeModules.ExpoModulesCore?.installModules();
46
- }
47
- catch (error) {
48
- console.error(`Unable to install Expo modules: ${error}`);
49
- }
28
+ return globalThis.expo?.modules?.[moduleName] ?? NativeModulesProxy[moduleName] ?? null;
50
29
  }
51
30
  //# sourceMappingURL=requireNativeModule.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"requireNativeModule.js","sourceRoot":"","sources":["../src/requireNativeModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AA2BtD;;;;;;;;GAQG;AACH,MAAM,UAAU,mBAAmB,CAAmB,UAAkB;IACtE,MAAM,YAAY,GAAG,2BAA2B,CAAa,UAAU,CAAC,CAAC;IAEzE,IAAI,CAAC,YAAY,EAAE;QACjB,MAAM,IAAI,KAAK,CAAC,8BAA8B,UAAU,GAAG,CAAC,CAAC;KAC9D;IACD,OAAO,YAAY,CAAC;AACtB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,2BAA2B,CACzC,UAAkB;IAElB,+BAA+B,EAAE,CAAC;IAElC,OAAO,CACL,UAAU,CAAC,IAAI,EAAE,OAAO,EAAE,CAAC,UAAU,CAAC;QACtC,UAAU,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC;QACpC,kBAAkB,CAAC,UAAU,CAAC;QAC9B,IAAI,CACL,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,SAAS,+BAA+B;IACtC,IAAI,UAAU,CAAC,IAAI,EAAE;QACnB,OAAO;KACR;IACD,IAAI;QACF,oDAAoD;QACpD,sEAAsE;QACtE,yEAAyE;QACzE,aAAa,CAAC,eAAe,EAAE,cAAc,EAAE,CAAC;KACjD;IAAC,OAAO,KAAK,EAAE;QACd,OAAO,CAAC,KAAK,CAAC,mCAAmC,KAAK,EAAE,CAAC,CAAC;KAC3D;AACH,CAAC","sourcesContent":["import { NativeModules } from 'react-native';\n\nimport NativeModulesProxy from './NativeModulesProxy';\n\ntype ExpoObject = {\n modules:\n | undefined\n | {\n [key: string]: any;\n };\n uuidv4: () => string;\n uuidv5: (name: string, namespace: string) => string;\n};\n\ndeclare global {\n // eslint-disable-next-line no-var\n var expo: ExpoObject | undefined;\n\n /**\n * @deprecated `global.ExpoModules` is deprecated, use `global.expo.modules` instead.\n */\n // eslint-disable-next-line no-var\n var ExpoModules:\n | undefined\n | {\n [key: string]: any;\n };\n}\n\n/**\n * Imports the native module registered with given name. In the first place it tries to load\n * the module installed through the JSI host object and then falls back to the bridge proxy module.\n * Notice that the modules loaded from the proxy may not support some features like synchronous functions.\n *\n * @param moduleName Name of the requested native module.\n * @returns Object representing the native module.\n * @throws Error when there is no native module with given name.\n */\nexport function requireNativeModule<ModuleType = any>(moduleName: string): ModuleType {\n const nativeModule = requireOptionalNativeModule<ModuleType>(moduleName);\n\n if (!nativeModule) {\n throw new Error(`Cannot find native module '${moduleName}'`);\n }\n return nativeModule;\n}\n\n/**\n * Imports the native module registered with the given name. The same as `requireNativeModule`,\n * but returns `null` when the module cannot be found instead of throwing an error.\n *\n * @param moduleName Name of the requested native module.\n * @returns Object representing the native module or `null` when it cannot be found.\n */\nexport function requireOptionalNativeModule<ModuleType = any>(\n moduleName: string\n): ModuleType | null {\n ensureNativeModulesAreInstalled();\n\n return (\n globalThis.expo?.modules?.[moduleName] ??\n globalThis.ExpoModules?.[moduleName] ??\n NativeModulesProxy[moduleName] ??\n null\n );\n}\n\n/**\n * Ensures that the native modules are installed in the current runtime.\n * Otherwise, it synchronously calls a native function that installs them.\n */\nfunction ensureNativeModulesAreInstalled(): void {\n if (globalThis.expo) {\n return;\n }\n try {\n // TODO: ExpoModulesCore shouldn't be optional here,\n // but to keep backwards compatibility let's just ignore it in SDK 50.\n // In most cases the modules were already installed from the native side.\n NativeModules.ExpoModulesCore?.installModules();\n } catch (error) {\n console.error(`Unable to install Expo modules: ${error}`);\n }\n}\n"]}
1
+ {"version":3,"file":"requireNativeModule.js","sourceRoot":"","sources":["../src/requireNativeModule.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,+BAA+B,EAAE,MAAM,mCAAmC,CAAC;AAEpF;;;;;;;;GAQG;AACH,MAAM,UAAU,mBAAmB,CAAmB,UAAkB;IACtE,MAAM,YAAY,GAAG,2BAA2B,CAAa,UAAU,CAAC,CAAC;IAEzE,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,MAAM,IAAI,KAAK,CAAC,8BAA8B,UAAU,GAAG,CAAC,CAAC;IAC/D,CAAC;IACD,OAAO,YAAY,CAAC;AACtB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,2BAA2B,CACzC,UAAkB;IAElB,+BAA+B,EAAE,CAAC;IAElC,OAAO,UAAU,CAAC,IAAI,EAAE,OAAO,EAAE,CAAC,UAAU,CAAC,IAAI,kBAAkB,CAAC,UAAU,CAAC,IAAI,IAAI,CAAC;AAC1F,CAAC","sourcesContent":["import NativeModulesProxy from './NativeModulesProxy';\nimport { ensureNativeModulesAreInstalled } from './ensureNativeModulesAreInstalled';\n\n/**\n * Imports the native module registered with given name. In the first place it tries to load\n * the module installed through the JSI host object and then falls back to the bridge proxy module.\n * Notice that the modules loaded from the proxy may not support some features like synchronous functions.\n *\n * @param moduleName Name of the requested native module.\n * @returns Object representing the native module.\n * @throws Error when there is no native module with given name.\n */\nexport function requireNativeModule<ModuleType = any>(moduleName: string): ModuleType {\n const nativeModule = requireOptionalNativeModule<ModuleType>(moduleName);\n\n if (!nativeModule) {\n throw new Error(`Cannot find native module '${moduleName}'`);\n }\n return nativeModule;\n}\n\n/**\n * Imports the native module registered with the given name. The same as `requireNativeModule`,\n * but returns `null` when the module cannot be found instead of throwing an error.\n *\n * @param moduleName Name of the requested native module.\n * @returns Object representing the native module or `null` when it cannot be found.\n */\nexport function requireOptionalNativeModule<ModuleType = any>(\n moduleName: string\n): ModuleType | null {\n ensureNativeModulesAreInstalled();\n\n return globalThis.expo?.modules?.[moduleName] ?? NativeModulesProxy[moduleName] ?? null;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"setUpErrorManager.fx.js","sourceRoot":"","sources":["../../src/sweet/setUpErrorManager.fx.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,QAAQ,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD,IAAI,OAAO,IAAI,QAAQ,CAAC,EAAE,KAAK,SAAS,IAAI,kBAAkB,EAAE;IAC9D,MAAM,cAAc,GAAG,4CAA4C,CAAC;IACpE,MAAM,YAAY,GAAG,0CAA0C,CAAC;IAChE,MAAM,YAAY,GAAG,IAAI,YAAY,CAAC,kBAAkB,CAAC,CAAC;IAE1D,YAAY,CAAC,WAAW,CAAC,cAAc,EAAE,CAAC,EAAE,OAAO,EAAuB,EAAE,EAAE;QAC5E,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACzB,CAAC,CAAC,CAAC;IAEH,YAAY,CAAC,WAAW,CAAC,YAAY,EAAE,CAAC,EAAE,OAAO,EAAuB,EAAE,EAAE;QAC1E,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACxB,CAAC,CAAC,CAAC;CACJ;AAED,oFAAoF;AACpF,UAAU,CAAC,0BAA0B,GAAG,UAAU,CAAC","sourcesContent":["import NativeErrorManager from './NativeErrorManager';\nimport { EventEmitter } from '../EventEmitter';\nimport Platform from '../Platform';\nimport { CodedError } from '../errors/CodedError';\n\nif (__DEV__ && Platform.OS === 'android' && NativeErrorManager) {\n const onNewException = 'ExpoModulesCoreErrorManager.onNewException';\n const onNewWarning = 'ExpoModulesCoreErrorManager.onNewWarning';\n const eventEmitter = new EventEmitter(NativeErrorManager);\n\n eventEmitter.addListener(onNewException, ({ message }: { message: string }) => {\n console.error(message);\n });\n\n eventEmitter.addListener(onNewWarning, ({ message }: { message: string }) => {\n console.warn(message);\n });\n}\n\n// We have to export `CodedError` via global object to use in later in the C++ code.\nglobalThis.ExpoModulesCore_CodedError = CodedError;\n"]}
1
+ {"version":3,"file":"setUpErrorManager.fx.js","sourceRoot":"","sources":["../../src/sweet/setUpErrorManager.fx.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,QAAQ,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD,IAAI,OAAO,IAAI,QAAQ,CAAC,EAAE,KAAK,SAAS,IAAI,kBAAkB,EAAE,CAAC;IAC/D,MAAM,cAAc,GAAG,4CAA4C,CAAC;IACpE,MAAM,YAAY,GAAG,0CAA0C,CAAC;IAChE,MAAM,YAAY,GAAG,IAAI,YAAY,CAAC,kBAAkB,CAAC,CAAC;IAE1D,YAAY,CAAC,WAAW,CAAC,cAAc,EAAE,CAAC,EAAE,OAAO,EAAuB,EAAE,EAAE;QAC5E,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACzB,CAAC,CAAC,CAAC;IAEH,YAAY,CAAC,WAAW,CAAC,YAAY,EAAE,CAAC,EAAE,OAAO,EAAuB,EAAE,EAAE;QAC1E,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACxB,CAAC,CAAC,CAAC;AACL,CAAC;AAED,oFAAoF;AACpF,UAAU,CAAC,0BAA0B,GAAG,UAAU,CAAC","sourcesContent":["import NativeErrorManager from './NativeErrorManager';\nimport { EventEmitter } from '../EventEmitter';\nimport Platform from '../Platform';\nimport { CodedError } from '../errors/CodedError';\n\nif (__DEV__ && Platform.OS === 'android' && NativeErrorManager) {\n const onNewException = 'ExpoModulesCoreErrorManager.onNewException';\n const onNewWarning = 'ExpoModulesCoreErrorManager.onNewWarning';\n const eventEmitter = new EventEmitter(NativeErrorManager);\n\n eventEmitter.addListener(onNewException, ({ message }: { message: string }) => {\n console.error(message);\n });\n\n eventEmitter.addListener(onNewWarning, ({ message }: { message: string }) => {\n console.warn(message);\n });\n}\n\n// We have to export `CodedError` via global object to use in later in the C++ code.\nglobalThis.ExpoModulesCore_CodedError = CodedError;\n"]}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Base type of the events map, whose keys represent supported event names
3
+ * and values are the signatures of the listener for that specific event.
4
+ */
5
+ export type EventsMap = Record<string, (...args: any[]) => void>;
6
+ /**
7
+ * A subscription object that allows to conveniently remove an event listener from the emitter.
8
+ */
9
+ export type EventSubscription = {
10
+ /**
11
+ * Removes an event listener for which the subscription has been created.
12
+ * After calling this function, the listener will no longer receive any events from the emitter.
13
+ */
14
+ remove(): void;
15
+ };
16
+ /**
17
+ * A class that provides a consistent API for emitting and listening to events.
18
+ * It shares many concepts with other emitter APIs, such as Node's EventEmitter and `fbemitter`.
19
+ * When the event is emitted, all of the functions attached to that specific event are called *synchronously*.
20
+ * Any values returned by the called listeners are *ignored* and discarded.
21
+ * Its implementation is written in C++ and common for all the platforms.
22
+ */
23
+ export declare class EventEmitter<TEventsMap extends EventsMap = Record<never, never>> {
24
+ /**
25
+ * Creates a new event emitter instance.
26
+ */
27
+ constructor();
28
+ /**
29
+ * Adds a listener for the given event name.
30
+ */
31
+ addListener<EventName extends keyof TEventsMap>(eventName: EventName, listener: TEventsMap[EventName]): EventSubscription;
32
+ /**
33
+ * Removes a listener for the given event name.
34
+ */
35
+ removeListener<EventName extends keyof TEventsMap>(eventName: EventName, listener: TEventsMap[EventName]): void;
36
+ /**
37
+ * Removes all listeners for the given event name.
38
+ */
39
+ removeAllListeners(eventName: keyof TEventsMap): void;
40
+ /**
41
+ * Synchronously calls all of the listeners attached to that specific event.
42
+ * The event can include any number of arguments that will be passed to the listeners.
43
+ */
44
+ emit<EventName extends keyof TEventsMap>(eventName: EventName, ...args: Parameters<TEventsMap[EventName]>): void;
45
+ /**
46
+ * Returns a number of listeners added to the given event.
47
+ */
48
+ listenerCount<EventName extends keyof TEventsMap>(eventName: EventName): number;
49
+ }
50
+ //# sourceMappingURL=EventEmitter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EventEmitter.d.ts","sourceRoot":"","sources":["../../src/ts-declarations/EventEmitter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,CAAC,CAAC;AAEjE;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;;OAGG;IACH,MAAM,IAAI,IAAI,CAAC;CAChB,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,OAAO,YAAY,CAAC,UAAU,SAAS,SAAS,GAAG,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC;IACnF;;OAEG;;IAGH;;OAEG;IACH,WAAW,CAAC,SAAS,SAAS,MAAM,UAAU,EAC5C,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,UAAU,CAAC,SAAS,CAAC,GAC9B,iBAAiB;IAEpB;;OAEG;IACH,cAAc,CAAC,SAAS,SAAS,MAAM,UAAU,EAC/C,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,UAAU,CAAC,SAAS,CAAC,GAC9B,IAAI;IAEP;;OAEG;IACH,kBAAkB,CAAC,SAAS,EAAE,MAAM,UAAU,GAAG,IAAI;IAErD;;;OAGG;IACH,IAAI,CAAC,SAAS,SAAS,MAAM,UAAU,EACrC,SAAS,EAAE,SAAS,EACpB,GAAG,IAAI,EAAE,UAAU,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,GACzC,IAAI;IAEP;;OAEG;IACH,aAAa,CAAC,SAAS,SAAS,MAAM,UAAU,EAAE,SAAS,EAAE,SAAS,GAAG,MAAM;CAChF"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=EventEmitter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EventEmitter.js","sourceRoot":"","sources":["../../src/ts-declarations/EventEmitter.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Base type of the events map, whose keys represent supported event names\n * and values are the signatures of the listener for that specific event.\n */\nexport type EventsMap = Record<string, (...args: any[]) => void>;\n\n/**\n * A subscription object that allows to conveniently remove an event listener from the emitter.\n */\nexport type EventSubscription = {\n /**\n * Removes an event listener for which the subscription has been created.\n * After calling this function, the listener will no longer receive any events from the emitter.\n */\n remove(): void;\n};\n\n/**\n * A class that provides a consistent API for emitting and listening to events.\n * It shares many concepts with other emitter APIs, such as Node's EventEmitter and `fbemitter`.\n * When the event is emitted, all of the functions attached to that specific event are called *synchronously*.\n * Any values returned by the called listeners are *ignored* and discarded.\n * Its implementation is written in C++ and common for all the platforms.\n */\nexport declare class EventEmitter<TEventsMap extends EventsMap = Record<never, never>> {\n /**\n * Creates a new event emitter instance.\n */\n constructor();\n\n /**\n * Adds a listener for the given event name.\n */\n addListener<EventName extends keyof TEventsMap>(\n eventName: EventName,\n listener: TEventsMap[EventName]\n ): EventSubscription;\n\n /**\n * Removes a listener for the given event name.\n */\n removeListener<EventName extends keyof TEventsMap>(\n eventName: EventName,\n listener: TEventsMap[EventName]\n ): void;\n\n /**\n * Removes all listeners for the given event name.\n */\n removeAllListeners(eventName: keyof TEventsMap): void;\n\n /**\n * Synchronously calls all of the listeners attached to that specific event.\n * The event can include any number of arguments that will be passed to the listeners.\n */\n emit<EventName extends keyof TEventsMap>(\n eventName: EventName,\n ...args: Parameters<TEventsMap[EventName]>\n ): void;\n\n /**\n * Returns a number of listeners added to the given event.\n */\n listenerCount<EventName extends keyof TEventsMap>(eventName: EventName): number;\n}\n"]}
@@ -0,0 +1,14 @@
1
+ import type { EventEmitter, EventsMap } from './EventEmitter';
2
+ /**
3
+ * A class for all native modules. Extends the {@link EventEmitter} class.
4
+ */
5
+ export declare class NativeModule<TEventsMap extends EventsMap = Record<never, never>> extends EventEmitter<TEventsMap> {
6
+ /**
7
+ * A prototype of the native component exported by the module.
8
+ * @deprecated It will be removed in favor of another API that supports multiple components per module.
9
+ * @private
10
+ */
11
+ ViewPrototype?: object;
12
+ [key: string]: any;
13
+ }
14
+ //# sourceMappingURL=NativeModule.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NativeModule.d.ts","sourceRoot":"","sources":["../../src/ts-declarations/NativeModule.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE9D;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,YAAY,CAC/B,UAAU,SAAS,SAAS,GAAG,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,CACnD,SAAQ,YAAY,CAAC,UAAU,CAAC;IAChC;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAGvB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=NativeModule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NativeModule.js","sourceRoot":"","sources":["../../src/ts-declarations/NativeModule.ts"],"names":[],"mappings":"","sourcesContent":["import type { EventEmitter, EventsMap } from './EventEmitter';\n\n/**\n * A class for all native modules. Extends the {@link EventEmitter} class.\n */\nexport declare class NativeModule<\n TEventsMap extends EventsMap = Record<never, never>,\n> extends EventEmitter<TEventsMap> {\n /**\n * A prototype of the native component exported by the module.\n * @deprecated It will be removed in favor of another API that supports multiple components per module.\n * @private\n */\n ViewPrototype?: object;\n\n // Ideally if we don't have it, but not all modules have concrete types in `requireNativeModule`.\n [key: string]: any;\n}\n"]}
@@ -0,0 +1,14 @@
1
+ import type { EventEmitter, EventsMap } from './EventEmitter';
2
+ /**
3
+ * Base class for all shared objects that extends the EventEmitter class.
4
+ * The implementation is written in C++, installed through JSI and common for mobile platforms.
5
+ */
6
+ export declare class SharedObject<TEventsMap extends EventsMap = Record<never, never>> extends EventEmitter<TEventsMap> {
7
+ /**
8
+ * A function that detaches the JS and native objects to let the native object deallocate
9
+ * before the JS object gets deallocated by the JS garbagge collector. Any subsequent calls to native
10
+ * functions of the object will throw an error as it is no longer associated with its native counterpart.
11
+ */
12
+ release(): void;
13
+ }
14
+ //# sourceMappingURL=SharedObject.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SharedObject.d.ts","sourceRoot":"","sources":["../../src/ts-declarations/SharedObject.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE9D;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,YAAY,CAC/B,UAAU,SAAS,SAAS,GAAG,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,CACnD,SAAQ,YAAY,CAAC,UAAU,CAAC;IAChC;;;;OAIG;IACH,OAAO,IAAI,IAAI;CAChB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=SharedObject.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SharedObject.js","sourceRoot":"","sources":["../../src/ts-declarations/SharedObject.ts"],"names":[],"mappings":"","sourcesContent":["import type { EventEmitter, EventsMap } from './EventEmitter';\n\n/**\n * Base class for all shared objects that extends the EventEmitter class.\n * The implementation is written in C++, installed through JSI and common for mobile platforms.\n */\nexport declare class SharedObject<\n TEventsMap extends EventsMap = Record<never, never>,\n> extends EventEmitter<TEventsMap> {\n /**\n * A function that detaches the JS and native objects to let the native object deallocate\n * before the JS object gets deallocated by the JS garbagge collector. Any subsequent calls to native\n * functions of the object will throw an error as it is no longer associated with its native counterpart.\n */\n release(): void;\n}\n"]}
@@ -0,0 +1,49 @@
1
+ import type { EventEmitter } from './EventEmitter';
2
+ import type { NativeModule } from './NativeModule';
3
+ import type { SharedObject } from './SharedObject';
4
+ export interface ExpoGlobal {
5
+ /**
6
+ * Host object that is used to access native Expo modules.
7
+ */
8
+ modules: Record<string, any>;
9
+ /**
10
+ * @see EventEmitter
11
+ */
12
+ EventEmitter: typeof EventEmitter;
13
+ /**
14
+ * @see SharedObject
15
+ */
16
+ SharedObject: typeof SharedObject;
17
+ /**
18
+ * @see NativeModule
19
+ */
20
+ NativeModule: typeof NativeModule;
21
+ /**
22
+ * Generates a random UUID v4 string.
23
+ */
24
+ uuidv4(): string;
25
+ /**
26
+ * Generates a UUID v5 string representation of the value in the specified namespace.
27
+ */
28
+ uuidv5(name: string, namespace: string): string;
29
+ /**
30
+ * Returns a static view config of the native view with the given name
31
+ * or `null` if the view has not been registered.
32
+ */
33
+ getViewConfig(viewName: string): ViewConfig | null;
34
+ }
35
+ type ViewConfig = {
36
+ validAttributes: Record<string, any>;
37
+ directEventTypes: Record<string, {
38
+ registrationName: string;
39
+ }>;
40
+ };
41
+ declare global {
42
+ /**
43
+ * Global object containing all the native bindings installed by Expo.
44
+ * This object is not available in projects without the `expo` package installed.
45
+ */
46
+ var expo: ExpoGlobal;
47
+ }
48
+ export {};
49
+ //# sourceMappingURL=global.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"global.d.ts","sourceRoot":"","sources":["../../src/ts-declarations/global.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD,MAAM,WAAW,UAAU;IACzB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAI7B;;OAEG;IACH,YAAY,EAAE,OAAO,YAAY,CAAC;IAElC;;OAEG;IACH,YAAY,EAAE,OAAO,YAAY,CAAC;IAElC;;OAEG;IACH,YAAY,EAAE,OAAO,YAAY,CAAC;IAIlC;;OAEG;IACH,MAAM,IAAI,MAAM,CAAC;IAEjB;;OAEG;IACH,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;IAEhD;;;OAGG;IACH,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI,CAAC;CACpD;AAED,KAAK,UAAU,GAAG;IAChB,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACrC,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,gBAAgB,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAChE,CAAC;AAIF,OAAO,CAAC,MAAM,CAAC;IACb;;;OAGG;IACH,IAAI,IAAI,EAAE,UAAU,CAAC;CACtB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=global.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"global.js","sourceRoot":"","sources":["../../src/ts-declarations/global.ts"],"names":[],"mappings":"","sourcesContent":["import type { EventEmitter } from './EventEmitter';\nimport type { NativeModule } from './NativeModule';\nimport type { SharedObject } from './SharedObject';\n\nexport interface ExpoGlobal {\n /**\n * Host object that is used to access native Expo modules.\n */\n modules: Record<string, any>;\n\n // Natively defined JS classes\n\n /**\n * @see EventEmitter\n */\n EventEmitter: typeof EventEmitter;\n\n /**\n * @see SharedObject\n */\n SharedObject: typeof SharedObject;\n\n /**\n * @see NativeModule\n */\n NativeModule: typeof NativeModule;\n\n // Utils\n\n /**\n * Generates a random UUID v4 string.\n */\n uuidv4(): string;\n\n /**\n * Generates a UUID v5 string representation of the value in the specified namespace.\n */\n uuidv5(name: string, namespace: string): string;\n\n /**\n * Returns a static view config of the native view with the given name\n * or `null` if the view has not been registered.\n */\n getViewConfig(viewName: string): ViewConfig | null;\n}\n\ntype ViewConfig = {\n validAttributes: Record<string, any>;\n directEventTypes: Record<string, { registrationName: string }>;\n};\n\n/* eslint-disable no-var */\n\ndeclare global {\n /**\n * Global object containing all the native bindings installed by Expo.\n * This object is not available in projects without the `expo` package installed.\n */\n var expo: ExpoGlobal;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"bytesToUuid.js","sourceRoot":"","sources":["../../../src/uuid/lib/bytesToUuid.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,SAAS,GAAa,EAAE,CAAC;AAC/B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,EAAE,CAAC,EAAE;IAC5B,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;CACnD;AAED,SAAS,WAAW,CAAC,GAAa,EAAE,MAAe;IACjD,IAAI,CAAC,GAAG,MAAM,IAAI,CAAC,CAAC;IACpB,MAAM,GAAG,GAAG,SAAS,CAAC;IACtB,iHAAiH;IACjH,OAAO;QACL,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;QACb,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;QACb,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;QACb,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;QACb,GAAG;QACH,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;QACb,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;QACb,GAAG;QACH,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;QACb,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;QACb,GAAG;QACH,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;QACb,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;QACb,GAAG;QACH,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;QACb,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;QACb,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;QACb,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;QACb,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;QACb,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;KACd,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACb,CAAC;AAED,eAAe,WAAW,CAAC","sourcesContent":["/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\nconst byteToHex: string[] = [];\nfor (let i = 0; i < 256; ++i) {\n byteToHex[i] = (i + 0x100).toString(16).substr(1);\n}\n\nfunction bytesToUuid(buf: number[], offset?: number) {\n let i = offset || 0;\n const bth = byteToHex;\n // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4\n return [\n bth[buf[i++]],\n bth[buf[i++]],\n bth[buf[i++]],\n bth[buf[i++]],\n '-',\n bth[buf[i++]],\n bth[buf[i++]],\n '-',\n bth[buf[i++]],\n bth[buf[i++]],\n '-',\n bth[buf[i++]],\n bth[buf[i++]],\n '-',\n bth[buf[i++]],\n bth[buf[i++]],\n bth[buf[i++]],\n bth[buf[i++]],\n bth[buf[i++]],\n bth[buf[i++]],\n ].join('');\n}\n\nexport default bytesToUuid;\n"]}
1
+ {"version":3,"file":"bytesToUuid.js","sourceRoot":"","sources":["../../../src/uuid/lib/bytesToUuid.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAA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AC,EAAE,CAAC,CAAC;QACb,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;KACd,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACb,CAAC;AAED,eAAe,WAAW,CAAC","sourcesContent":["/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\nconst byteToHex: string[] = [];\nfor (let i = 0; i < 256; ++i) {\n byteToHex[i] = (i + 0x100).toString(16).substr(1);\n}\n\nfunction bytesToUuid(buf: number[], offset?: number) {\n let i = offset || 0;\n const bth = byteToHex;\n // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4\n return [\n bth[buf[i++]],\n bth[buf[i++]],\n bth[buf[i++]],\n bth[buf[i++]],\n '-',\n bth[buf[i++]],\n bth[buf[i++]],\n '-',\n bth[buf[i++]],\n bth[buf[i++]],\n '-',\n bth[buf[i++]],\n bth[buf[i++]],\n '-',\n bth[buf[i++]],\n bth[buf[i++]],\n bth[buf[i++]],\n bth[buf[i++]],\n bth[buf[i++]],\n bth[buf[i++]],\n ].join('');\n}\n\nexport default bytesToUuid;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"sha1.js","sourceRoot":"","sources":["../../../src/uuid/lib/sha1.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,kDAAkD;AAClD,YAAY,CAAC;AAEb,SAAS,CAAC,CAAC,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS;IACnD,QAAQ,CAAC,EAAE;QACT,KAAK,CAAC;YACJ,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QAC5B,KAAK,CAAC;YACJ,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACnB,KAAK,CAAC;YACJ,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,C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,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,GAAG,IAAI;QACnB,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI;QAClB,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI;QACX,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,GAAG,IAAI;QACnB,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,GAAG,IAAI;QACnB,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI;QAClB,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI;QACX,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,GAAG,IAAI;QACnB,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,GAAG,IAAI;QACnB,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI;QAClB,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI;KACZ,CAAC;AACJ,CAAC;AAED,eAAe,IAAI,CAAC","sourcesContent":["// Adapted from Chris Veness' SHA1 code at\n// http://www.movable-type.co.uk/scripts/sha1.html\n'use strict';\n\nfunction f(s: number, x: number, y: number, z: number) {\n switch (s) {\n case 0:\n return (x & y) ^ (~x & z);\n case 1:\n return x ^ y ^ z;\n case 2:\n return (x & y) ^ (x & z) ^ (y & z);\n case 3:\n return x ^ y ^ z;\n default:\n return 0;\n }\n}\n\nfunction ROTL(x: number, n: number) {\n return (x << n) | (x >>> (32 - n));\n}\n\nfunction sha1(bytes: number[] | string) {\n const K = [0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6];\n const H = [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0];\n\n if (typeof bytes == 'string') {\n const msg = unescape(encodeURIComponent(bytes)); // UTF8 escape\n bytes = new Array(msg.length);\n for (let i = 0; i < msg.length; i++) bytes[i] = msg.charCodeAt(i);\n }\n\n bytes.push(0x80);\n\n const l = bytes.length / 4 + 2;\n const N = Math.ceil(l / 16);\n const M = new Array(N);\n\n for (let i = 0; i < N; i++) {\n M[i] = new Array(16);\n for (let j = 0; j < 16; j++) {\n M[i][j] =\n (bytes[i * 64 + j * 4] << 24) |\n (bytes[i * 64 + j * 4 + 1] << 16) |\n (bytes[i * 64 + j * 4 + 2] << 8) |\n bytes[i * 64 + j * 4 + 3];\n }\n }\n\n M[N - 1][14] = ((bytes.length - 1) * 8) / Math.pow(2, 32);\n M[N - 1][14] = Math.floor(M[N - 1][14]);\n M[N - 1][15] = ((bytes.length - 1) * 8) & 0xffffffff;\n\n for (let i = 0; i < N; i++) {\n const W = new Array(80);\n\n for (let t = 0; t < 16; t++) W[t] = M[i][t];\n for (let t = 16; t < 80; t++) {\n W[t] = ROTL(W[t - 3] ^ W[t - 8] ^ W[t - 14] ^ W[t - 16], 1);\n }\n\n let a = H[0];\n let b = H[1];\n let c = H[2];\n let d = H[3];\n let e = H[4];\n\n for (let t = 0; t < 80; t++) {\n const s = Math.floor(t / 20);\n const T = (ROTL(a, 5) + f(s, b, c, d) + e + K[s] + W[t]) >>> 0;\n e = d;\n d = c;\n c = ROTL(b, 30) >>> 0;\n b = a;\n a = T;\n }\n\n H[0] = (H[0] + a) >>> 0;\n H[1] = (H[1] + b) >>> 0;\n H[2] = (H[2] + c) >>> 0;\n H[3] = (H[3] + d) >>> 0;\n H[4] = (H[4] + e) >>> 0;\n }\n\n return [\n (H[0] >> 24) & 0xff,\n (H[0] >> 16) & 0xff,\n (H[0] >> 8) & 0xff,\n H[0] & 0xff,\n (H[1] >> 24) & 0xff,\n (H[1] >> 16) & 0xff,\n (H[1] >> 8) & 0xff,\n H[1] & 0xff,\n (H[2] >> 24) & 0xff,\n (H[2] >> 16) & 0xff,\n (H[2] >> 8) & 0xff,\n H[2] & 0xff,\n (H[3] >> 24) & 0xff,\n (H[3] >> 16) & 0xff,\n (H[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,IAAI;QACnB,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI;QAClB,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI;KACZ,CAAC;AACJ,CAAC;AAED,eAAe,IAAI,CAAC","sourcesContent":["// Adapted from Chris Veness' SHA1 code at\n// http://www.movable-type.co.uk/scripts/sha1.html\n'use strict';\n\nfunction f(s: number, x: number, y: number, z: number) {\n switch (s) {\n case 0:\n return (x & y) ^ (~x & z);\n case 1:\n return x ^ y ^ z;\n case 2:\n return (x & y) ^ (x & z) ^ (y & z);\n case 3:\n return x ^ y ^ z;\n default:\n return 0;\n }\n}\n\nfunction ROTL(x: number, n: number) {\n return (x << n) | (x >>> (32 - n));\n}\n\nfunction sha1(bytes: number[] | string) {\n const K = [0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6];\n const H = [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0];\n\n if (typeof bytes == 'string') {\n const msg = unescape(encodeURIComponent(bytes)); // UTF8 escape\n bytes = new Array(msg.length);\n for (let i = 0; i < msg.length; i++) bytes[i] = msg.charCodeAt(i);\n }\n\n bytes.push(0x80);\n\n const l = bytes.length / 4 + 2;\n const N = Math.ceil(l / 16);\n const M = new Array(N);\n\n for (let i = 0; i < N; i++) {\n M[i] = new Array(16);\n for (let j = 0; j < 16; j++) {\n M[i][j] =\n (bytes[i * 64 + j * 4] << 24) |\n (bytes[i * 64 + j * 4 + 1] << 16) |\n (bytes[i * 64 + j * 4 + 2] << 8) |\n bytes[i * 64 + j * 4 + 3];\n }\n }\n\n M[N - 1][14] = ((bytes.length - 1) * 8) / Math.pow(2, 32);\n M[N - 1][14] = Math.floor(M[N - 1][14]);\n M[N - 1][15] = ((bytes.length - 1) * 8) & 0xffffffff;\n\n for (let i = 0; i < N; i++) {\n const W = new Array(80);\n\n for (let t = 0; t < 16; t++) W[t] = M[i][t];\n for (let t = 16; t < 80; t++) {\n W[t] = ROTL(W[t - 3] ^ W[t - 8] ^ W[t - 14] ^ W[t - 16], 1);\n }\n\n let a = H[0];\n let b = H[1];\n let c = H[2];\n let d = H[3];\n let e = H[4];\n\n for (let t = 0; t < 80; t++) {\n const s = Math.floor(t / 20);\n const T = (ROTL(a, 5) + f(s, b, c, d) + e + K[s] + W[t]) >>> 0;\n e = d;\n d = c;\n c = ROTL(b, 30) >>> 0;\n b = a;\n a = T;\n }\n\n H[0] = (H[0] + a) >>> 0;\n H[1] = (H[1] + b) >>> 0;\n H[2] = (H[2] + c) >>> 0;\n H[3] = (H[3] + d) >>> 0;\n H[4] = (H[4] + e) >>> 0;\n }\n\n return [\n (H[0] >> 24) & 0xff,\n (H[0] >> 16) & 0xff,\n (H[0] >> 8) & 0xff,\n H[0] & 0xff,\n (H[1] >> 24) & 0xff,\n (H[1] >> 16) & 0xff,\n (H[1] >> 8) & 0xff,\n H[1] & 0xff,\n (H[2] >> 24) & 0xff,\n (H[2] >> 16) & 0xff,\n (H[2] >> 8) & 0xff,\n H[2] & 0xff,\n (H[3] >> 24) & 0xff,\n (H[3] >> 16) & 0xff,\n (H[3] >> 8) & 0xff,\n H[3] & 0xff,\n (H[4] >> 24) & 0xff,\n (H[4] >> 16) & 0xff,\n (H[4] >> 8) & 0xff,\n H[4] & 0xff,\n ];\n}\n\nexport default sha1;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"v35.js","sourceRoot":"","sources":["../../../src/uuid/lib/v35.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,eAAe,CAAC;AAExC,SAAS,WAAW,CAAC,IAAY;IAC/B,yDAAyD;IACzD,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,IAAI,CAAC,OAAO,CAAC,iBAAiB,EAAE,CAAC,GAAW,EAAE,EAAE;QAC9C,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC;QAC9B,OAAO,EAAE,CAAC;IACZ,CAAC,C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AI,CAAC,GAAG,OAAO,CAAC;QACvC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;QAEpC,IAAI,GAAG,EAAE;YACP,KAAK,IAAI,GAAG,GAAG,CAAC,EAAE,GAAG,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE;gBACjC,GAAG,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;aAC7B;SACF;QAED,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC;IAC5B,CAAC,CAAC;IAEF,yDAAyD;IACzD,IAAI;QACF,YAAY,CAAC,IAAI,GAAG,IAAI,CAAC;KAC1B;IAAC,MAAM,GAAE;IAEV,yCAAyC;IACzC,YAAY,CAAC,GAAG,GAAG,sCAAsC,CAAC;IAC1D,YAAY,CAAC,GAAG,GAAG,sCAAsC,CAAC;IAE1D,OAAO,YAAY,CAAC;AACtB,CAAC","sourcesContent":["import bytesToUuid from './bytesToUuid';\n\nfunction uuidToBytes(uuid: string) {\n // Note: We assume we're being passed a valid uuid string\n const bytes: number[] = [];\n uuid.replace(/[a-fA-F0-9]{2}/g, (hex: string) => {\n bytes.push(parseInt(hex, 16));\n return '';\n });\n\n return bytes;\n}\n\nfunction stringToBytes(str: string) {\n str = unescape(encodeURIComponent(str)); // UTF8 escape\n const bytes: number[] = new Array(str.length);\n for (let i = 0; i < str.length; i++) {\n bytes[i] = str.charCodeAt(i);\n }\n return bytes;\n}\n\nexport default function (\n name: string,\n version: number,\n hashfunc: (bytes: number[] | string) => number[]\n) {\n const generateUUID = function (\n value: number[] | string,\n namespace: number[] | string,\n buf?: number[],\n offset?: number\n ): string {\n const off = (buf && offset) || 0;\n\n if (typeof value == 'string') value = stringToBytes(value);\n if (typeof namespace == 'string') namespace = uuidToBytes(namespace);\n\n if (!Array.isArray(value)) throw TypeError('value must be an array of bytes');\n if (!Array.isArray(namespace) || namespace.length !== 16)\n throw TypeError('namespace must be uuid string or an Array of 16 byte values');\n\n // Per 4.3\n const bytes = hashfunc(namespace.concat(value));\n bytes[6] = (bytes[6] & 0x0f) | version;\n bytes[8] = (bytes[8] & 0x3f) | 0x80;\n\n if (buf) {\n for (let idx = 0; idx < 16; ++idx) {\n buf[off + idx] = bytes[idx];\n }\n }\n\n return bytesToUuid(bytes);\n };\n\n // Function#name is not settable on some platforms (#270)\n try {\n generateUUID.name = name;\n } catch {}\n\n // Pre-defined namespaces, per Appendix C\n generateUUID.DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';\n generateUUID.URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';\n\n return generateUUID;\n}\n"]}
1
+ {"version":3,"file":"v35.js","sourceRoot":"","sources":["../../../src/uuid/lib/v35.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,eAAe,CAAC;AAExC,SAAS,WAAW,CAAC,IAAY;IAC/B,yDAAyD;IACzD,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,IAAI,CAAC,OAAO,CAAC,iBAAiB,EAAE,CAAC,GAAW,EAAE,EAAE;QAC9C,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC;QAC9B,OAAO,EAAE,CAAC;IACZ,CAAC,CAAC,CAAC;IAEH,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,aAAa,CAAC,GAAW;IAChC,GAAG,GAAG,QAAQ,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,cAAc;IACvD,MAAM,KAAK,GAAa,IAAI,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAC9C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACpC,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,C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;IAC5B,CAAC,CAAC;IAEF,yDAAyD;IACzD,IAAI,CAAC;QACH,YAAY,CAAC,IAAI,GAAG,IAAI,CAAC;IAC3B,CAAC;IAAC,MAAM,CAAC,CAAA,CAAC;IAEV,yCAAyC;IACzC,YAAY,CAAC,GAAG,GAAG,sCAAsC,CAAC;IAC1D,YAAY,CAAC,GAAG,GAAG,sCAAsC,CAAC;IAE1D,OAAO,YAAY,CAAC;AACtB,CAAC","sourcesContent":["import bytesToUuid from './bytesToUuid';\n\nfunction uuidToBytes(uuid: string) {\n // Note: We assume we're being passed a valid uuid string\n const bytes: number[] = [];\n uuid.replace(/[a-fA-F0-9]{2}/g, (hex: string) => {\n bytes.push(parseInt(hex, 16));\n return '';\n });\n\n return bytes;\n}\n\nfunction stringToBytes(str: string) {\n str = unescape(encodeURIComponent(str)); // UTF8 escape\n const bytes: number[] = new Array(str.length);\n for (let i = 0; i < str.length; i++) {\n bytes[i] = str.charCodeAt(i);\n }\n return bytes;\n}\n\nexport default function (\n name: string,\n version: number,\n hashfunc: (bytes: number[] | string) => number[]\n) {\n const generateUUID = function (\n value: number[] | string,\n namespace: number[] | string,\n buf?: number[],\n offset?: number\n ): string {\n const off = (buf && offset) || 0;\n\n if (typeof value == 'string') value = stringToBytes(value);\n if (typeof namespace == 'string') namespace = uuidToBytes(namespace);\n\n if (!Array.isArray(value)) throw TypeError('value must be an array of bytes');\n if (!Array.isArray(namespace) || namespace.length !== 16)\n throw TypeError('namespace must be uuid string or an Array of 16 byte values');\n\n // Per 4.3\n const bytes = hashfunc(namespace.concat(value));\n bytes[6] = (bytes[6] & 0x0f) | version;\n bytes[8] = (bytes[8] & 0x3f) | 0x80;\n\n if (buf) {\n for (let idx = 0; idx < 16; ++idx) {\n buf[off + idx] = bytes[idx];\n }\n }\n\n return bytesToUuid(bytes);\n };\n\n // Function#name is not settable on some platforms (#270)\n try {\n generateUUID.name = name;\n } catch {}\n\n // Pre-defined namespaces, per Appendix C\n generateUUID.DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';\n generateUUID.URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';\n\n return generateUUID;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"uuid.js","sourceRoot":"","sources":["../../src/uuid/uuid.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAQ,eAAe,EAAE,MAAM,cAAc,CAAC;AAErD,MAAM,YAAY,GAAG,UAAU,EAAE,IAAI,EAAE,MAAM,CAAC;AAC9C,MAAM,YAAY,GAAG,UAAU,EAAE,IAAI,EAAE,MAAM,CAAC;AAE9C,SAAS,MAAM;IACb,IAAI,CAAC,YAAY,EAAE;QACjB,MAAM,KAAK,CACT,oFAAoF,CACrF,CAAC;KACH;IAED,OAAO,YAAY,EAAE,CAAC;AACxB,CAAC;AAED,SAAS,MAAM,CAAC,IAAY,EAAE,SAA4B;IACxD,MAAM,eAAe,GACnB,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,SAAS,CAAC,MAAM,KAAK,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAE3F,sEAAsE;IACtE,IAAI,KAAK,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE;QAClC,MAAM,IAAI,KAAK,CAAC,uEAAuE,CAAC,CAAC;KAC1F;IAED,IAAI,CAAC,YAAY,EAAE;QACjB,MAAM,KAAK,CAAC,iFAAiF,CAAC,CAAC;KAChG;IAED,OAAO,YAAY,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC;AAC7C,CAAC;AAED,MAAM,IAAI,GAAS;IACjB,EAAE,EAAE,MAAM;IACV,EAAE,EAAE,MAAM;IACV,SAAS,EAAE,eAAe;CAC3B,CAAC;AACF,eAAe,IAAI,CAAC","sourcesContent":["import bytesToUuid from './lib/bytesToUuid';\nimport { UUID, Uuidv5Namespace } from './uuid.types';\n\nconst nativeUuidv4 = globalThis?.expo?.uuidv4;\nconst nativeUuidv5 = globalThis?.expo?.uuidv5;\n\nfunction uuidv4(): string {\n if (!nativeUuidv4) {\n throw Error(\n \"Native UUID version 4 generator implementation wasn't found in `expo-modules-core`\"\n );\n }\n\n return nativeUuidv4();\n}\n\nfunction uuidv5(name: string, namespace: string | number[]) {\n const parsedNamespace =\n Array.isArray(namespace) && namespace.length === 16 ? bytesToUuid(namespace) : namespace;\n\n // If parsed namespace is still an array it means that it wasn't valid\n if (Array.isArray(parsedNamespace)) {\n throw new Error('`namespace` must be a valid UUID string or an Array of 16 byte values');\n }\n\n if (!nativeUuidv5) {\n throw Error(\"Native UUID type 5 generator implementation wasn't found in `expo-modules-core`\");\n }\n\n return nativeUuidv5(name, parsedNamespace);\n}\n\nconst uuid: UUID = {\n v4: uuidv4,\n v5: uuidv5,\n namespace: Uuidv5Namespace,\n};\nexport default uuid;\n"]}
1
+ {"version":3,"file":"uuid.js","sourceRoot":"","sources":["../../src/uuid/uuid.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAQ,eAAe,EAAE,MAAM,cAAc,CAAC;AAErD,MAAM,YAAY,GAAG,UAAU,EAAE,IAAI,EAAE,MAAM,CAAC;AAC9C,MAAM,YAAY,GAAG,UAAU,EAAE,IAAI,EAAE,MAAM,CAAC;AAE9C,SAAS,MAAM;IACb,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,MAAM,KAAK,CACT,oFAAoF,CACrF,CAAC;IACJ,CAAC;IAED,OAAO,YAAY,EAAE,CAAC;AACxB,CAAC;AAED,SAAS,MAAM,CAAC,IAAY,EAAE,SAA4B;IACxD,MAAM,eAAe,GACnB,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,SAAS,CAAC,MAAM,KAAK,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAE3F,sEAAsE;IACtE,IAAI,KAAK,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE,CAAC;QACnC,MAAM,IAAI,KAAK,CAAC,uEAAuE,CAAC,CAAC;IAC3F,CAAC;IAED,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,MAAM,KAAK,CAAC,iFAAiF,CAAC,CAAC;IACjG,CAAC;IAED,OAAO,YAAY,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC;AAC7C,CAAC;AAED,MAAM,IAAI,GAAS;IACjB,EAAE,EAAE,MAAM;IACV,EAAE,EAAE,MAAM;IACV,SAAS,EAAE,eAAe;CAC3B,CAAC;AACF,eAAe,IAAI,CAAC","sourcesContent":["import bytesToUuid from './lib/bytesToUuid';\nimport { UUID, Uuidv5Namespace } from './uuid.types';\n\nconst nativeUuidv4 = globalThis?.expo?.uuidv4;\nconst nativeUuidv5 = globalThis?.expo?.uuidv5;\n\nfunction uuidv4(): string {\n if (!nativeUuidv4) {\n throw Error(\n \"Native UUID version 4 generator implementation wasn't found in `expo-modules-core`\"\n );\n }\n\n return nativeUuidv4();\n}\n\nfunction uuidv5(name: string, namespace: string | number[]) {\n const parsedNamespace =\n Array.isArray(namespace) && namespace.length === 16 ? bytesToUuid(namespace) : namespace;\n\n // If parsed namespace is still an array it means that it wasn't valid\n if (Array.isArray(parsedNamespace)) {\n throw new Error('`namespace` must be a valid UUID string or an Array of 16 byte values');\n }\n\n if (!nativeUuidv5) {\n throw Error(\"Native UUID type 5 generator implementation wasn't found in `expo-modules-core`\");\n }\n\n return nativeUuidv5(name, parsedNamespace);\n}\n\nconst uuid: UUID = {\n v4: uuidv4,\n v5: uuidv5,\n namespace: Uuidv5Namespace,\n};\nexport default uuid;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"uuid.web.js","sourceRoot":"","sources":["../../src/uuid/uuid.web.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,YAAY,CAAC;AAC9B,OAAO,GAAG,MAAM,WAAW,CAAC;AAC5B,OAAO,EAAQ,eAAe,EAAE,MAAM,cAAc,CAAC;AAErD,SAAS,MAAM;IACb,+DAA+D;IAC/D,MAAM,YAAY,GAChB,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,MAAM,CAAC,UAAU,KAAK,WAAW;QACvE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC;QACnB,CAAC,CAAC,MAAM,CAAC;IAEb,IAAI,CAAC,YAAY,EAAE,UAAU,EAAE;QAC7B,MAAM,KAAK,CAAC,0DAA0D,CAAC,CAAC;KACzE;IACD,OAAO,YAAY,CAAC,UAAU,EAAE,CAAC;AACnC,CAAC;AAED,MAAM,IAAI,GAAS;IACjB,EAAE,EAAE,MAAM;IACV,EAAE,EAAE,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;IACzB,SAAS,EAAE,eAAe;CAC3B,CAAC;AAEF,eAAe,IAAI,CAAC","sourcesContent":["import sha1 from './lib/sha1';\nimport v35 from './lib/v35';\nimport { UUID, Uuidv5Namespace } from './uuid.types';\n\nfunction uuidv4(): string {\n // Crypto needs to be required when run in Node.js environment.\n const cryptoObject =\n typeof crypto === 'undefined' || typeof crypto.randomUUID === 'undefined'\n ? require('crypto')\n : crypto;\n\n if (!cryptoObject?.randomUUID) {\n throw Error(\"The browser doesn't support `crypto.randomUUID` function\");\n }\n return cryptoObject.randomUUID();\n}\n\nconst uuid: UUID = {\n v4: uuidv4,\n v5: v35('v5', 0x50, sha1),\n namespace: Uuidv5Namespace,\n};\n\nexport default uuid;\n"]}
1
+ {"version":3,"file":"uuid.web.js","sourceRoot":"","sources":["../../src/uuid/uuid.web.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,YAAY,CAAC;AAC9B,OAAO,GAAG,MAAM,WAAW,CAAC;AAC5B,OAAO,EAAQ,eAAe,EAAE,MAAM,cAAc,CAAC;AAErD,SAAS,MAAM;IACb,+DAA+D;IAC/D,MAAM,YAAY,GAChB,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,MAAM,CAAC,UAAU,KAAK,WAAW;QACvE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC;QACnB,CAAC,CAAC,MAAM,CAAC;IAEb,IAAI,CAAC,YAAY,EAAE,UAAU,EAAE,CAAC;QAC9B,MAAM,KAAK,CAAC,0DAA0D,CAAC,CAAC;IAC1E,CAAC;IACD,OAAO,YAAY,CAAC,UAAU,EAAE,CAAC;AACnC,CAAC;AAED,MAAM,IAAI,GAAS;IACjB,EAAE,EAAE,MAAM;IACV,EAAE,EAAE,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;IACzB,SAAS,EAAE,eAAe;CAC3B,CAAC;AAEF,eAAe,IAAI,CAAC","sourcesContent":["import sha1 from './lib/sha1';\nimport v35 from './lib/v35';\nimport { UUID, Uuidv5Namespace } from './uuid.types';\n\nfunction uuidv4(): string {\n // Crypto needs to be required when run in Node.js environment.\n const cryptoObject =\n typeof crypto === 'undefined' || typeof crypto.randomUUID === 'undefined'\n ? require('crypto')\n : crypto;\n\n if (!cryptoObject?.randomUUID) {\n throw Error(\"The browser doesn't support `crypto.randomUUID` function\");\n }\n return cryptoObject.randomUUID();\n}\n\nconst uuid: UUID = {\n v4: uuidv4,\n v5: v35('v5', 0x50, sha1),\n namespace: Uuidv5Namespace,\n};\n\nexport default uuid;\n"]}
@@ -0,0 +1,17 @@
1
+ import type { EventEmitter as EventEmitterType, EventSubscription, EventsMap } from '../ts-declarations/EventEmitter';
2
+ import type { NativeModule as NativeModuleType } from '../ts-declarations/NativeModule';
3
+ declare class EventEmitter<TEventsMap extends EventsMap> implements EventEmitterType {
4
+ private listeners?;
5
+ addListener<EventName extends keyof TEventsMap>(eventName: EventName, listener: TEventsMap[EventName]): EventSubscription;
6
+ removeListener<EventName extends keyof TEventsMap>(eventName: EventName, listener: TEventsMap[EventName]): void;
7
+ removeAllListeners<EventName extends keyof TEventsMap>(eventName: EventName): void;
8
+ emit<EventName extends keyof TEventsMap>(eventName: EventName, ...args: Parameters<TEventsMap[EventName]>): void;
9
+ listenerCount<EventName extends keyof TEventsMap>(eventName: EventName): number;
10
+ }
11
+ export declare class NativeModule<TEventsMap extends Record<never, never>> extends EventEmitter<TEventsMap> implements NativeModuleType {
12
+ [key: string]: any;
13
+ ViewPrototype?: object | undefined;
14
+ __expo_module_name__?: string;
15
+ }
16
+ export {};
17
+ //# sourceMappingURL=CoreModule.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CoreModule.d.ts","sourceRoot":"","sources":["../../src/web/CoreModule.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,IAAI,gBAAgB,EAChC,iBAAiB,EACjB,SAAS,EACV,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,YAAY,IAAI,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAIxF,cAAM,YAAY,CAAC,UAAU,SAAS,SAAS,CAAE,YAAW,gBAAgB;IAC1E,OAAO,CAAC,SAAS,CAAC,CAAuC;IAEzD,WAAW,CAAC,SAAS,SAAS,MAAM,UAAU,EAC5C,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,UAAU,CAAC,SAAS,CAAC,GAC9B,iBAAiB;IAgBpB,cAAc,CAAC,SAAS,SAAS,MAAM,UAAU,EAC/C,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,UAAU,CAAC,SAAS,CAAC,GAC9B,IAAI;IAIP,kBAAkB,CAAC,SAAS,SAAS,MAAM,UAAU,EAAE,SAAS,EAAE,SAAS,GAAG,IAAI;IAIlF,IAAI,CAAC,SAAS,SAAS,MAAM,UAAU,EACrC,SAAS,EAAE,SAAS,EACpB,GAAG,IAAI,EAAE,UAAU,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,GACzC,IAAI;IAIP,aAAa,CAAC,SAAS,SAAS,MAAM,UAAU,EAAE,SAAS,EAAE,SAAS,GAAG,MAAM;CAGhF;AAED,qBAAa,YAAY,CAAC,UAAU,SAAS,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,CAC/D,SAAQ,YAAY,CAAC,UAAU,CAC/B,YAAW,gBAAgB;IAE3B,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B"}
@@ -0,0 +1,51 @@
1
+ import uuid from '../uuid';
2
+ class EventEmitter {
3
+ listeners;
4
+ addListener(eventName, listener) {
5
+ if (!this.listeners) {
6
+ this.listeners = new Map();
7
+ }
8
+ if (!this.listeners?.has(eventName)) {
9
+ this.listeners?.set(eventName, new Set());
10
+ }
11
+ this.listeners?.get(eventName)?.add(listener);
12
+ return {
13
+ remove: () => {
14
+ this.removeListener(eventName, listener);
15
+ },
16
+ };
17
+ }
18
+ removeListener(eventName, listener) {
19
+ this.listeners?.get(eventName)?.delete(listener);
20
+ }
21
+ removeAllListeners(eventName) {
22
+ this.listeners?.get(eventName)?.clear();
23
+ }
24
+ emit(eventName, ...args) {
25
+ this.listeners?.get(eventName)?.forEach((listener) => listener(...args));
26
+ }
27
+ listenerCount(eventName) {
28
+ return this.listeners?.get(eventName)?.size ?? 0;
29
+ }
30
+ }
31
+ export class NativeModule extends EventEmitter {
32
+ ViewPrototype;
33
+ __expo_module_name__;
34
+ }
35
+ class SharedObject extends EventEmitter {
36
+ release() {
37
+ throw new Error('Method not implemented.');
38
+ }
39
+ }
40
+ globalThis.expo = {
41
+ EventEmitter,
42
+ NativeModule,
43
+ SharedObject,
44
+ modules: {},
45
+ uuidv4: uuid.v4,
46
+ uuidv5: uuid.v5,
47
+ getViewConfig: () => {
48
+ throw new Error('Method not implemented.');
49
+ },
50
+ };
51
+ //# sourceMappingURL=CoreModule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CoreModule.js","sourceRoot":"","sources":["../../src/web/CoreModule.ts"],"names":[],"mappings":"AAOA,OAAO,IAAI,MAAM,SAAS,CAAC;AAE3B,MAA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CAAsB;IACnC,oBAAoB,CAAU;CAC/B;AAED,MAAM,YACJ,SAAQ,YAAwB;IAGhC,OAAO;QACL,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;CACF;AAED,UAAU,CAAC,IAAI,GAAG;IAChB,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,OAAO,EAAE,EAAE;IACX,MAAM,EAAE,IAAI,CAAC,EAAE;IACf,MAAM,EAAE,IAAI,CAAC,EAAE;IACf,aAAa,EAAE,GAAG,EAAE;QAClB,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;CACF,CAAC","sourcesContent":["import type {\n EventEmitter as EventEmitterType,\n EventSubscription,\n EventsMap,\n} from '../ts-declarations/EventEmitter';\nimport type { NativeModule as NativeModuleType } from '../ts-declarations/NativeModule';\nimport type { SharedObject as SharedObjectType } from '../ts-declarations/SharedObject';\nimport uuid from '../uuid';\n\nclass EventEmitter<TEventsMap extends EventsMap> implements EventEmitterType {\n private listeners?: Map<keyof TEventsMap, Set<Function>>;\n\n addListener<EventName extends keyof TEventsMap>(\n eventName: EventName,\n listener: TEventsMap[EventName]\n ): EventSubscription {\n if (!this.listeners) {\n this.listeners = new Map();\n }\n if (!this.listeners?.has(eventName)) {\n this.listeners?.set(eventName, new Set());\n }\n this.listeners?.get(eventName)?.add(listener);\n\n return {\n remove: () => {\n this.removeListener(eventName, listener);\n },\n };\n }\n\n removeListener<EventName extends keyof TEventsMap>(\n eventName: EventName,\n listener: TEventsMap[EventName]\n ): void {\n this.listeners?.get(eventName)?.delete(listener);\n }\n\n removeAllListeners<EventName extends keyof TEventsMap>(eventName: EventName): void {\n this.listeners?.get(eventName)?.clear();\n }\n\n emit<EventName extends keyof TEventsMap>(\n eventName: EventName,\n ...args: Parameters<TEventsMap[EventName]>\n ): void {\n this.listeners?.get(eventName)?.forEach((listener) => listener(...args));\n }\n\n listenerCount<EventName extends keyof TEventsMap>(eventName: EventName): number {\n return this.listeners?.get(eventName)?.size ?? 0;\n }\n}\n\nexport class NativeModule<TEventsMap extends Record<never, never>>\n extends EventEmitter<TEventsMap>\n implements NativeModuleType\n{\n [key: string]: any;\n ViewPrototype?: object | undefined;\n __expo_module_name__?: string;\n}\n\nclass SharedObject<TEventsMap extends Record<never, never>>\n extends EventEmitter<TEventsMap>\n implements SharedObjectType\n{\n release(): void {\n throw new Error('Method not implemented.');\n }\n}\n\nglobalThis.expo = {\n EventEmitter,\n NativeModule,\n SharedObject,\n modules: {},\n uuidv4: uuid.v4,\n uuidv5: uuid.v5,\n getViewConfig: () => {\n throw new Error('Method not implemented.');\n },\n};\n"]}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/web/index.ts"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/web/index.ts"],"names":[],"mappings":"","sourcesContent":[""]}
@@ -0,0 +1,2 @@
1
+ import './CoreModule';
2
+ //# sourceMappingURL=index.web.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.web.d.ts","sourceRoot":"","sources":["../../src/web/index.web.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC"}
@@ -0,0 +1,2 @@
1
+ import './CoreModule';
2
+ //# sourceMappingURL=index.web.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.web.js","sourceRoot":"","sources":["../../src/web/index.web.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC","sourcesContent":["import './CoreModule';\n"]}
@@ -0,0 +1,41 @@
1
+ // Copyright 2024-present 650 Industries. All rights reserved.
2
+
3
+ #pragma once
4
+
5
+ #ifdef __cplusplus
6
+
7
+ #include <ReactCommon/CallInvoker.h>
8
+ #include <ReactCommon/RuntimeExecutor.h>
9
+
10
+ namespace expo {
11
+
12
+ class BridgelessJSCallInvoker : public react::CallInvoker {
13
+ public:
14
+ explicit BridgelessJSCallInvoker(react::RuntimeExecutor runtimeExecutor) : runtimeExecutor_(std::move(runtimeExecutor)) {}
15
+
16
+ #if REACT_NATIVE_TARGET_VERSION >= 75
17
+ void invokeAsync(react::CallFunc &&func) noexcept override {
18
+ runtimeExecutor_([func = std::move(func)](jsi::Runtime &runtime) { func(runtime); });
19
+ }
20
+
21
+ void invokeSync(react::CallFunc &&func) override {
22
+ throw std::runtime_error("Synchronous native -> JS calls are currently not supported.");
23
+ }
24
+ #else
25
+ void invokeAsync(std::function<void()> &&func) noexcept override {
26
+ runtimeExecutor_([func = std::move(func)](jsi::Runtime &runtime) { func(); });
27
+ }
28
+
29
+ void invokeSync(std::function<void()> &&func) override {
30
+ throw std::runtime_error("Synchronous native -> JS calls are currently not supported.");
31
+ }
32
+ #endif
33
+
34
+ private:
35
+ react::RuntimeExecutor runtimeExecutor_;
36
+
37
+ }; // class BridgelessJSCallInvoker
38
+
39
+ } // namespace expo
40
+
41
+ #endif // __cplusplus