@dittolive/ditto 4.5.0 → 4.5.1-experimental.aarch64-linux.1.aarch64

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 (289) hide show
  1. package/README.md +2 -2
  2. package/node/ditto.cjs.js +2 -9620
  3. package/node/{ditto.linux-x64.node → ditto.linux-arm64.node} +0 -0
  4. package/package.json +38 -34
  5. package/types/ditto.d.ts +0 -2
  6. package/web/ditto.es6.js +1 -1
  7. package/web/ditto.umd.js +1 -1
  8. package/web/ditto.wasm +0 -0
  9. package/DittoReactNative.podspec +0 -27
  10. package/node/ditto.darwin-arm64.node +0 -0
  11. package/node/ditto.darwin-x64.node +0 -0
  12. package/node/ditto.linux-arm.node +0 -0
  13. package/node/ditto.win32-x64.node +0 -0
  14. package/node/transports.darwin-arm64.node +0 -0
  15. package/node/transports.darwin-x64.node +0 -0
  16. package/react-native/android/CMakeLists.txt +0 -37
  17. package/react-native/android/build.gradle +0 -203
  18. package/react-native/android/cpp-adapter.cpp +0 -254
  19. package/react-native/android/gradle.properties +0 -5
  20. package/react-native/android/src/main/AndroidManifest.xml +0 -4
  21. package/react-native/android/src/main/java/com/dittolive/rnsdk/DittoRNSDKModule.java +0 -85
  22. package/react-native/android/src/main/java/com/dittolive/rnsdk/DittoRNSDKPackage.java +0 -28
  23. package/react-native/boost/boost/assert.hpp +0 -85
  24. package/react-native/boost/boost/config/abi/borland_prefix.hpp +0 -27
  25. package/react-native/boost/boost/config/abi/borland_suffix.hpp +0 -12
  26. package/react-native/boost/boost/config/abi/msvc_prefix.hpp +0 -22
  27. package/react-native/boost/boost/config/abi/msvc_suffix.hpp +0 -8
  28. package/react-native/boost/boost/config/abi_prefix.hpp +0 -25
  29. package/react-native/boost/boost/config/abi_suffix.hpp +0 -25
  30. package/react-native/boost/boost/config/assert_cxx03.hpp +0 -211
  31. package/react-native/boost/boost/config/assert_cxx11.hpp +0 -209
  32. package/react-native/boost/boost/config/assert_cxx14.hpp +0 -47
  33. package/react-native/boost/boost/config/assert_cxx17.hpp +0 -62
  34. package/react-native/boost/boost/config/assert_cxx20.hpp +0 -59
  35. package/react-native/boost/boost/config/assert_cxx98.hpp +0 -23
  36. package/react-native/boost/boost/config/auto_link.hpp +0 -525
  37. package/react-native/boost/boost/config/compiler/borland.hpp +0 -339
  38. package/react-native/boost/boost/config/compiler/clang.hpp +0 -366
  39. package/react-native/boost/boost/config/compiler/clang_version.hpp +0 -83
  40. package/react-native/boost/boost/config/compiler/codegear.hpp +0 -385
  41. package/react-native/boost/boost/config/compiler/comeau.hpp +0 -59
  42. package/react-native/boost/boost/config/compiler/common_edg.hpp +0 -183
  43. package/react-native/boost/boost/config/compiler/compaq_cxx.hpp +0 -19
  44. package/react-native/boost/boost/config/compiler/cray.hpp +0 -446
  45. package/react-native/boost/boost/config/compiler/diab.hpp +0 -26
  46. package/react-native/boost/boost/config/compiler/digitalmars.hpp +0 -143
  47. package/react-native/boost/boost/config/compiler/gcc.hpp +0 -383
  48. package/react-native/boost/boost/config/compiler/gcc_xml.hpp +0 -114
  49. package/react-native/boost/boost/config/compiler/greenhills.hpp +0 -28
  50. package/react-native/boost/boost/config/compiler/hp_acc.hpp +0 -149
  51. package/react-native/boost/boost/config/compiler/intel.hpp +0 -577
  52. package/react-native/boost/boost/config/compiler/kai.hpp +0 -33
  53. package/react-native/boost/boost/config/compiler/metrowerks.hpp +0 -198
  54. package/react-native/boost/boost/config/compiler/mpw.hpp +0 -140
  55. package/react-native/boost/boost/config/compiler/nvcc.hpp +0 -61
  56. package/react-native/boost/boost/config/compiler/pathscale.hpp +0 -138
  57. package/react-native/boost/boost/config/compiler/pgi.hpp +0 -23
  58. package/react-native/boost/boost/config/compiler/sgi_mipspro.hpp +0 -29
  59. package/react-native/boost/boost/config/compiler/sunpro_cc.hpp +0 -222
  60. package/react-native/boost/boost/config/compiler/vacpp.hpp +0 -186
  61. package/react-native/boost/boost/config/compiler/visualc.hpp +0 -391
  62. package/react-native/boost/boost/config/compiler/xlcpp.hpp +0 -299
  63. package/react-native/boost/boost/config/compiler/xlcpp_zos.hpp +0 -173
  64. package/react-native/boost/boost/config/detail/cxx_composite.hpp +0 -203
  65. package/react-native/boost/boost/config/detail/posix_features.hpp +0 -95
  66. package/react-native/boost/boost/config/detail/select_compiler_config.hpp +0 -157
  67. package/react-native/boost/boost/config/detail/select_platform_config.hpp +0 -147
  68. package/react-native/boost/boost/config/detail/select_stdlib_config.hpp +0 -121
  69. package/react-native/boost/boost/config/detail/suffix.hpp +0 -1294
  70. package/react-native/boost/boost/config/header_deprecated.hpp +0 -26
  71. package/react-native/boost/boost/config/helper_macros.hpp +0 -37
  72. package/react-native/boost/boost/config/no_tr1/cmath.hpp +0 -28
  73. package/react-native/boost/boost/config/no_tr1/complex.hpp +0 -28
  74. package/react-native/boost/boost/config/no_tr1/functional.hpp +0 -28
  75. package/react-native/boost/boost/config/no_tr1/memory.hpp +0 -28
  76. package/react-native/boost/boost/config/no_tr1/utility.hpp +0 -28
  77. package/react-native/boost/boost/config/platform/aix.hpp +0 -33
  78. package/react-native/boost/boost/config/platform/amigaos.hpp +0 -15
  79. package/react-native/boost/boost/config/platform/beos.hpp +0 -26
  80. package/react-native/boost/boost/config/platform/bsd.hpp +0 -83
  81. package/react-native/boost/boost/config/platform/cloudabi.hpp +0 -18
  82. package/react-native/boost/boost/config/platform/cray.hpp +0 -18
  83. package/react-native/boost/boost/config/platform/cygwin.hpp +0 -71
  84. package/react-native/boost/boost/config/platform/haiku.hpp +0 -31
  85. package/react-native/boost/boost/config/platform/hpux.hpp +0 -87
  86. package/react-native/boost/boost/config/platform/irix.hpp +0 -31
  87. package/react-native/boost/boost/config/platform/linux.hpp +0 -106
  88. package/react-native/boost/boost/config/platform/macos.hpp +0 -87
  89. package/react-native/boost/boost/config/platform/qnxnto.hpp +0 -31
  90. package/react-native/boost/boost/config/platform/solaris.hpp +0 -31
  91. package/react-native/boost/boost/config/platform/symbian.hpp +0 -97
  92. package/react-native/boost/boost/config/platform/vms.hpp +0 -25
  93. package/react-native/boost/boost/config/platform/vxworks.hpp +0 -422
  94. package/react-native/boost/boost/config/platform/wasm.hpp +0 -23
  95. package/react-native/boost/boost/config/platform/win32.hpp +0 -90
  96. package/react-native/boost/boost/config/platform/zos.hpp +0 -32
  97. package/react-native/boost/boost/config/pragma_message.hpp +0 -31
  98. package/react-native/boost/boost/config/requires_threads.hpp +0 -92
  99. package/react-native/boost/boost/config/stdlib/dinkumware.hpp +0 -324
  100. package/react-native/boost/boost/config/stdlib/libcomo.hpp +0 -93
  101. package/react-native/boost/boost/config/stdlib/libcpp.hpp +0 -180
  102. package/react-native/boost/boost/config/stdlib/libstdcpp3.hpp +0 -482
  103. package/react-native/boost/boost/config/stdlib/modena.hpp +0 -79
  104. package/react-native/boost/boost/config/stdlib/msl.hpp +0 -98
  105. package/react-native/boost/boost/config/stdlib/roguewave.hpp +0 -208
  106. package/react-native/boost/boost/config/stdlib/sgi.hpp +0 -168
  107. package/react-native/boost/boost/config/stdlib/stlport.hpp +0 -258
  108. package/react-native/boost/boost/config/stdlib/vacpp.hpp +0 -74
  109. package/react-native/boost/boost/config/stdlib/xlcpp_zos.hpp +0 -61
  110. package/react-native/boost/boost/config/user.hpp +0 -133
  111. package/react-native/boost/boost/config/warning_disable.hpp +0 -47
  112. package/react-native/boost/boost/config/workaround.hpp +0 -305
  113. package/react-native/boost/boost/config.hpp +0 -67
  114. package/react-native/boost/boost/cstdint.hpp +0 -556
  115. package/react-native/boost/boost/intrusive_ptr.hpp +0 -18
  116. package/react-native/boost/boost/smart_ptr/detail/atomic_count.hpp +0 -103
  117. package/react-native/boost/boost/smart_ptr/detail/atomic_count_gcc.hpp +0 -79
  118. package/react-native/boost/boost/smart_ptr/detail/atomic_count_gcc_atomic.hpp +0 -63
  119. package/react-native/boost/boost/smart_ptr/detail/atomic_count_gcc_x86.hpp +0 -88
  120. package/react-native/boost/boost/smart_ptr/detail/atomic_count_nt.hpp +0 -66
  121. package/react-native/boost/boost/smart_ptr/detail/atomic_count_pt.hpp +0 -104
  122. package/react-native/boost/boost/smart_ptr/detail/atomic_count_spin.hpp +0 -69
  123. package/react-native/boost/boost/smart_ptr/detail/atomic_count_std_atomic.hpp +0 -67
  124. package/react-native/boost/boost/smart_ptr/detail/atomic_count_sync.hpp +0 -72
  125. package/react-native/boost/boost/smart_ptr/detail/atomic_count_win32.hpp +0 -70
  126. package/react-native/boost/boost/smart_ptr/detail/local_counted_base.hpp +0 -148
  127. package/react-native/boost/boost/smart_ptr/detail/local_sp_deleter.hpp +0 -91
  128. package/react-native/boost/boost/smart_ptr/detail/operator_bool.hpp +0 -64
  129. package/react-native/boost/boost/smart_ptr/detail/requires_cxx11.hpp +0 -23
  130. package/react-native/boost/boost/smart_ptr/detail/shared_count.hpp +0 -707
  131. package/react-native/boost/boost/smart_ptr/detail/sp_convertible.hpp +0 -92
  132. package/react-native/boost/boost/smart_ptr/detail/sp_counted_base.hpp +0 -92
  133. package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_acc_ia64.hpp +0 -163
  134. package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_aix.hpp +0 -152
  135. package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_cw_ppc.hpp +0 -185
  136. package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_gcc_atomic.hpp +0 -148
  137. package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_gcc_ia64.hpp +0 -170
  138. package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_gcc_mips.hpp +0 -200
  139. package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_gcc_ppc.hpp +0 -194
  140. package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_gcc_sparc.hpp +0 -179
  141. package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_gcc_x86.hpp +0 -186
  142. package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_nt.hpp +0 -119
  143. package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_pt.hpp +0 -147
  144. package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_snc_ps3.hpp +0 -174
  145. package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_spin.hpp +0 -141
  146. package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_std_atomic.hpp +0 -147
  147. package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_sync.hpp +0 -165
  148. package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_vacpp_ppc.hpp +0 -163
  149. package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_w32.hpp +0 -140
  150. package/react-native/boost/boost/smart_ptr/detail/sp_counted_impl.hpp +0 -309
  151. package/react-native/boost/boost/smart_ptr/detail/sp_disable_deprecated.hpp +0 -40
  152. package/react-native/boost/boost/smart_ptr/detail/sp_forward.hpp +0 -52
  153. package/react-native/boost/boost/smart_ptr/detail/sp_has_gcc_intrinsics.hpp +0 -27
  154. package/react-native/boost/boost/smart_ptr/detail/sp_has_sync_intrinsics.hpp +0 -69
  155. package/react-native/boost/boost/smart_ptr/detail/sp_interlocked.hpp +0 -173
  156. package/react-native/boost/boost/smart_ptr/detail/sp_noexcept.hpp +0 -48
  157. package/react-native/boost/boost/smart_ptr/detail/sp_nullptr_t.hpp +0 -45
  158. package/react-native/boost/boost/smart_ptr/detail/sp_obsolete.hpp +0 -32
  159. package/react-native/boost/boost/smart_ptr/detail/sp_thread_pause.hpp +0 -51
  160. package/react-native/boost/boost/smart_ptr/detail/sp_thread_sleep.hpp +0 -104
  161. package/react-native/boost/boost/smart_ptr/detail/sp_thread_yield.hpp +0 -100
  162. package/react-native/boost/boost/smart_ptr/detail/sp_typeinfo_.hpp +0 -58
  163. package/react-native/boost/boost/smart_ptr/detail/sp_win32_sleep.hpp +0 -49
  164. package/react-native/boost/boost/smart_ptr/intrusive_ptr.hpp +0 -409
  165. package/react-native/boost/boost/smart_ptr/intrusive_ref_counter.hpp +0 -188
  166. package/react-native/cpp/include/Attachment.h +0 -16
  167. package/react-native/cpp/include/Authentication.h +0 -23
  168. package/react-native/cpp/include/Collection.h +0 -13
  169. package/react-native/cpp/include/DQL.h +0 -21
  170. package/react-native/cpp/include/Document.h +0 -17
  171. package/react-native/cpp/include/Identity.h +0 -17
  172. package/react-native/cpp/include/Lifecycle.h +0 -16
  173. package/react-native/cpp/include/LiveQuery.h +0 -17
  174. package/react-native/cpp/include/Logger.h +0 -22
  175. package/react-native/cpp/include/Misc.h +0 -26
  176. package/react-native/cpp/include/Presence.h +0 -14
  177. package/react-native/cpp/include/RetainableState.h +0 -24
  178. package/react-native/cpp/include/SmallPeerInfo.h +0 -17
  179. package/react-native/cpp/include/Transports.h +0 -25
  180. package/react-native/cpp/include/TypedArray.hpp +0 -167
  181. package/react-native/cpp/include/Utils.h +0 -61
  182. package/react-native/cpp/include/main.h +0 -10
  183. package/react-native/cpp/src/Attachment.cpp +0 -86
  184. package/react-native/cpp/src/Authentication.cpp +0 -224
  185. package/react-native/cpp/src/Collection.cpp +0 -54
  186. package/react-native/cpp/src/DQL.cpp +0 -254
  187. package/react-native/cpp/src/Document.cpp +0 -146
  188. package/react-native/cpp/src/Identity.cpp +0 -123
  189. package/react-native/cpp/src/Lifecycle.cpp +0 -75
  190. package/react-native/cpp/src/LiveQuery.cpp +0 -64
  191. package/react-native/cpp/src/Logger.cpp +0 -200
  192. package/react-native/cpp/src/Misc.cpp +0 -271
  193. package/react-native/cpp/src/Presence.cpp +0 -77
  194. package/react-native/cpp/src/RetainableState.cpp +0 -15
  195. package/react-native/cpp/src/SmallPeerInfo.cpp +0 -108
  196. package/react-native/cpp/src/Transports.cpp +0 -270
  197. package/react-native/cpp/src/TypedArray.cpp +0 -303
  198. package/react-native/cpp/src/Utils.cpp +0 -138
  199. package/react-native/cpp/src/main.cpp +0 -149
  200. package/react-native/dittoffi/dittoffi.h +0 -4698
  201. package/react-native/dittoffi/ifaddrs.cpp +0 -385
  202. package/react-native/dittoffi/ifaddrs.h +0 -206
  203. package/react-native/ios/DittoRNSDK.h +0 -7
  204. package/react-native/ios/DittoRNSDK.mm +0 -107
  205. package/react-native/ios/YeetJSIUtils.h +0 -60
  206. package/react-native/ios/YeetJSIUtils.mm +0 -196
  207. package/react-native/lib/commonjs/ditto.rn.js +0 -93
  208. package/react-native/lib/commonjs/ditto.rn.js.map +0 -1
  209. package/react-native/lib/commonjs/index.js +0 -14
  210. package/react-native/lib/commonjs/index.js.map +0 -1
  211. package/react-native/lib/module/ditto.rn.js +0 -83
  212. package/react-native/lib/module/ditto.rn.js.map +0 -1
  213. package/react-native/lib/module/index.js +0 -13
  214. package/react-native/lib/module/index.js.map +0 -1
  215. package/react-native/lib/typescript/ditto.rn.d.ts +0 -15
  216. package/react-native/lib/typescript/ditto.rn.d.ts.map +0 -1
  217. package/react-native/lib/typescript/index.d.ts +0 -1
  218. package/react-native/lib/typescript/index.d.ts.map +0 -1
  219. package/react-native/scripts/ruby/include_local_boost.rb +0 -78
  220. package/react-native/src/ditto.rn.ts +0 -91
  221. package/react-native/src/environment/environment.fallback.ts +0 -4
  222. package/react-native/src/index.ts +0 -26
  223. package/react-native/src/sources/@cbor-redux.ts +0 -2
  224. package/react-native/src/sources/@ditto.core.ts +0 -1
  225. package/react-native/src/sources/@environment.ts +0 -2
  226. package/react-native/src/sources/attachment-fetch-event.ts +0 -54
  227. package/react-native/src/sources/attachment-fetcher-manager.ts +0 -129
  228. package/react-native/src/sources/attachment-fetcher.ts +0 -124
  229. package/react-native/src/sources/attachment-token.ts +0 -48
  230. package/react-native/src/sources/attachment.ts +0 -59
  231. package/react-native/src/sources/augment.ts +0 -89
  232. package/react-native/src/sources/authenticator.ts +0 -314
  233. package/react-native/src/sources/base-pending-cursor-operation.ts +0 -237
  234. package/react-native/src/sources/base-pending-id-specific-operation.ts +0 -109
  235. package/react-native/src/sources/bridge.ts +0 -549
  236. package/react-native/src/sources/build-time-constants.ts +0 -4
  237. package/react-native/src/sources/cbor.ts +0 -35
  238. package/react-native/src/sources/collection-interface.ts +0 -67
  239. package/react-native/src/sources/collection.ts +0 -212
  240. package/react-native/src/sources/collections-event.ts +0 -99
  241. package/react-native/src/sources/counter.ts +0 -77
  242. package/react-native/src/sources/ditto.ts +0 -945
  243. package/react-native/src/sources/document-id.ts +0 -159
  244. package/react-native/src/sources/document-path.ts +0 -303
  245. package/react-native/src/sources/document.ts +0 -192
  246. package/react-native/src/sources/epilogue.ts +0 -24
  247. package/react-native/src/sources/error-codes.ts +0 -52
  248. package/react-native/src/sources/error.ts +0 -203
  249. package/react-native/src/sources/essentials.ts +0 -53
  250. package/react-native/src/sources/ffi-error.ts +0 -117
  251. package/react-native/src/sources/ffi.ts +0 -1972
  252. package/react-native/src/sources/identity.ts +0 -163
  253. package/react-native/src/sources/init.ts +0 -70
  254. package/react-native/src/sources/internal.ts +0 -113
  255. package/react-native/src/sources/keep-alive.ts +0 -69
  256. package/react-native/src/sources/key-path.ts +0 -195
  257. package/react-native/src/sources/live-query-event.ts +0 -208
  258. package/react-native/src/sources/live-query-manager.ts +0 -101
  259. package/react-native/src/sources/live-query.ts +0 -164
  260. package/react-native/src/sources/logger.ts +0 -196
  261. package/react-native/src/sources/observer-manager.ts +0 -175
  262. package/react-native/src/sources/observer.ts +0 -77
  263. package/react-native/src/sources/pending-collections-operation.ts +0 -232
  264. package/react-native/src/sources/pending-cursor-operation.ts +0 -218
  265. package/react-native/src/sources/pending-id-specific-operation.ts +0 -216
  266. package/react-native/src/sources/presence-manager.ts +0 -160
  267. package/react-native/src/sources/presence.ts +0 -238
  268. package/react-native/src/sources/query-result-item.ts +0 -116
  269. package/react-native/src/sources/query-result.ts +0 -55
  270. package/react-native/src/sources/register.ts +0 -92
  271. package/react-native/src/sources/small-peer-info.ts +0 -176
  272. package/react-native/src/sources/static-tcp-client.ts +0 -6
  273. package/react-native/src/sources/store-observer.ts +0 -176
  274. package/react-native/src/sources/store.ts +0 -365
  275. package/react-native/src/sources/subscription-manager.ts +0 -98
  276. package/react-native/src/sources/subscription.ts +0 -88
  277. package/react-native/src/sources/sync-subscription.ts +0 -90
  278. package/react-native/src/sources/sync.ts +0 -495
  279. package/react-native/src/sources/test-helpers.ts +0 -24
  280. package/react-native/src/sources/transport-conditions-manager.ts +0 -104
  281. package/react-native/src/sources/transport-config.ts +0 -428
  282. package/react-native/src/sources/update-result.ts +0 -66
  283. package/react-native/src/sources/update-results-map.ts +0 -57
  284. package/react-native/src/sources/websocket-client.ts +0 -6
  285. package/react-native/src/sources/write-transaction-collection.ts +0 -122
  286. package/react-native/src/sources/write-transaction-pending-cursor-operation.ts +0 -101
  287. package/react-native/src/sources/write-transaction-pending-id-specific-operation.ts +0 -72
  288. package/react-native/src/sources/write-transaction.ts +0 -119
  289. package/react-native.config.js +0 -9
@@ -1,107 +0,0 @@
1
- #import "DittoRNSDK.h"
2
- #import <React/RCTBridge+Private.h>
3
- #import <React/RCTUtils.h>
4
- #import <jsi/jsi.h>
5
- #import "main.h"
6
- #import <sys/utsname.h>
7
- #import "YeetJSIUtils.h"
8
- #import <React/RCTBridge+Private.h>
9
- #import "TypedArray.hpp"
10
-
11
- using namespace facebook::jsi;
12
-
13
- @implementation DittoRNSDK
14
-
15
- @synthesize bridge = _bridge;
16
- @synthesize methodQueue = _methodQueue;
17
-
18
- RCT_EXPORT_MODULE()
19
-
20
- + (BOOL)requiresMainQueueSetup
21
- {
22
- return YES;
23
- }
24
-
25
- RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(install)
26
- {
27
- RCTBridge* bridge = [RCTBridge currentBridge];
28
- RCTCxxBridge* cxxBridge = (RCTCxxBridge*)bridge;
29
- Runtime *jsiRuntime = (Runtime *) cxxBridge.runtime;
30
-
31
- sharedjsi::install(*jsiRuntime);
32
- install(*jsiRuntime);
33
-
34
- return @true;
35
- }
36
-
37
- static void install(jsi::Runtime &jsiRuntime) {
38
- auto getDeviceName = Function::createFromHostFunction(jsiRuntime,
39
- PropNameID::forAscii(jsiRuntime,
40
- "getDeviceName"),
41
- 0,
42
- [](Runtime &runtime,
43
- const Value &thisValue,
44
- const Value *arguments,
45
- size_t count) -> Value {
46
-
47
- return convertNSStringToJSIString(runtime, [[UIDevice currentDevice] name]);
48
- });
49
-
50
- jsiRuntime.global().setProperty(jsiRuntime, "getDeviceName", std::move(getDeviceName));
51
-
52
- auto createDirectory = Function::createFromHostFunction(jsiRuntime,
53
- PropNameID::forAscii(jsiRuntime,
54
- "createDirectory"),
55
- 0,
56
- [](Runtime &runtime,
57
- const Value &thisValue,
58
- const Value *arguments,
59
- size_t count) -> Value {
60
-
61
- NSFileManager *fileManager = [NSFileManager defaultManager];
62
- NSString *path = convertJSIStringToNSString(runtime, arguments[0].toString(runtime));
63
- NSString *finalPath = path;
64
-
65
- if (![path hasPrefix:@"/"]) {
66
- NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
67
- NSString *documentsDirectory = [paths objectAtIndex:0];
68
- finalPath = [documentsDirectory stringByAppendingPathComponent:path];
69
- }
70
-
71
- if (![fileManager fileExistsAtPath:finalPath]) {
72
- NSError *error;
73
- [fileManager createDirectoryAtPath:finalPath withIntermediateDirectories:YES attributes:nil error:&error];
74
- if (error) {
75
- NSLog(@"Error creating directory: %@", error.localizedDescription);
76
- }
77
- }
78
-
79
- return convertNSStringToJSIString(runtime, finalPath);
80
- });
81
-
82
- jsiRuntime.global().setProperty(jsiRuntime, "createDirectory", std::move(createDirectory));
83
-
84
- auto getRandomValues = jsi::Function::createFromHostFunction(jsiRuntime,
85
- jsi::PropNameID::forUtf8(jsiRuntime, "getRandomValues"),
86
- 1,
87
- [](jsi::Runtime& runtime,
88
- const jsi::Value& thisArg,
89
- const jsi::Value* args,
90
- size_t count) -> jsi::Value {
91
- TypedArrayBase typedArrayBase(runtime, args[0].asObject(runtime));
92
- auto byteLength = typedArrayBase.byteLength(runtime);
93
-
94
- NSMutableData *data = [NSMutableData dataWithLength:byteLength];
95
- int result = SecRandomCopyBytes(kSecRandomDefault, byteLength, data.mutableBytes);
96
- if (result != errSecSuccess) { }
97
-
98
- auto typedArray = TypedArray<TypedArrayKind::Uint16Array>(runtime, byteLength);
99
- auto arrayBuffer = typedArray.getBuffer(runtime);
100
- memcpy(arrayBuffer.data(runtime), data.bytes, data.length);
101
- return typedArray;
102
- });
103
-
104
- jsiRuntime.global().setProperty(jsiRuntime, "getRandomValues", std::move(getRandomValues));
105
- }
106
-
107
- @end
@@ -1,60 +0,0 @@
1
- //
2
- // YeetJSIUTils.h
3
- // yeet
4
- //
5
- // Created by Jarred WSumner on 1/30/20.
6
- // Copyright © 2020 Facebook. All rights reserved.
7
- //
8
-
9
- #import <Foundation/Foundation.h>
10
- #import <jsi/jsi.h>
11
- #import <React/RCTBridgeModule.h>
12
-
13
- using namespace facebook;
14
- /**
15
- * All static helper functions are ObjC++ specific.
16
- */
17
- jsi::Value convertNSNumberToJSIBoolean(jsi::Runtime &runtime, NSNumber *value);
18
- jsi::Value convertNSNumberToJSINumber(jsi::Runtime &runtime, NSNumber *value);
19
- jsi::String convertNSStringToJSIString(jsi::Runtime &runtime, NSString *value);
20
- jsi::Value convertObjCObjectToJSIValue(jsi::Runtime &runtime, id value);;
21
- jsi::Object convertNSDictionaryToJSIObject(jsi::Runtime &runtime, NSDictionary *value);
22
- jsi::Array convertNSArrayToJSIArray(jsi::Runtime &runtime, NSArray *value);
23
- std::vector<jsi::Value> convertNSArrayToStdVector(jsi::Runtime &runtime, NSArray *value);
24
- jsi::Value convertObjCObjectToJSIValue(jsi::Runtime &runtime, id value);
25
- id convertJSIValueToObjCObject(
26
- jsi::Runtime &runtime,
27
- const jsi::Value &value);
28
- NSString* convertJSIStringToNSString(jsi::Runtime &runtime, const jsi::String &value);
29
- NSArray* convertJSIArrayToNSArray(
30
- jsi::Runtime &runtime,
31
- const jsi::Array &value);
32
- NSDictionary *convertJSIObjectToNSDictionary(
33
- jsi::Runtime &runtime,
34
- const jsi::Object &value);
35
- RCTResponseSenderBlock convertJSIFunctionToCallback(
36
- jsi::Runtime &runtime,
37
- const jsi::Function &value);
38
- id convertJSIValueToObjCObject(
39
- jsi::Runtime &runtime,
40
- const jsi::Value &value);
41
- RCTResponseSenderBlock convertJSIFunctionToCallback(
42
- jsi::Runtime &runtime,
43
- const jsi::Function &value);
44
-
45
- struct Promise {
46
- Promise(jsi::Runtime &rt, jsi::Function resolve, jsi::Function reject);
47
-
48
- void resolve(const jsi::Value &result);
49
- void reject(const std::string &error);
50
-
51
- jsi::Runtime &runtime_;
52
- jsi::Function resolve_;
53
- jsi::Function reject_;
54
- };
55
-
56
- using PromiseSetupFunctionType =
57
- std::function<void(jsi::Runtime &rt, std::shared_ptr<Promise>)>;
58
- jsi::Value createPromiseAsJSIValue(
59
- jsi::Runtime &rt,
60
- const PromiseSetupFunctionType func);
@@ -1,196 +0,0 @@
1
- //
2
- // REAJsiUtilities.cpp
3
- // RNReanimated
4
- //
5
- // Created by Christian Falch on 25/04/2019.
6
- // Copyright © 2019 Facebook. All rights reserved.
7
- //
8
-
9
- #include "YeetJSIUtils.h"
10
- #import <React/RCTConvert.h>
11
- #import <React/RCTBridgeModule.h>
12
- //#import <ReactCommon/TurboModuleUtils.h>
13
-
14
- /**
15
- * All helper functions are ObjC++ specific.
16
- */
17
- jsi::Value convertNSNumberToJSIBoolean(jsi::Runtime &runtime, NSNumber *value)
18
- {
19
- return jsi::Value((bool)[value boolValue]);
20
- }
21
-
22
- jsi::Value convertNSNumberToJSINumber(jsi::Runtime &runtime, NSNumber *value)
23
- {
24
- return jsi::Value([value doubleValue]);
25
- }
26
-
27
- jsi::String convertNSStringToJSIString(jsi::Runtime &runtime, NSString *value)
28
- {
29
- return jsi::String::createFromUtf8(runtime, [value UTF8String] ?: "");
30
- }
31
-
32
- jsi::Value convertObjCObjectToJSIValue(jsi::Runtime &runtime, id value);
33
- jsi::Object convertNSDictionaryToJSIObject(jsi::Runtime &runtime, NSDictionary *value)
34
- {
35
- jsi::Object result = jsi::Object(runtime);
36
- for (NSString *k in value) {
37
- result.setProperty(runtime, [k UTF8String], convertObjCObjectToJSIValue(runtime, value[k]));
38
- }
39
- return result;
40
- }
41
-
42
- jsi::Array convertNSArrayToJSIArray(jsi::Runtime &runtime, NSArray *value)
43
- {
44
- jsi::Array result = jsi::Array(runtime, value.count);
45
- for (size_t i = 0; i < value.count; i++) {
46
- result.setValueAtIndex(runtime, i, convertObjCObjectToJSIValue(runtime, value[i]));
47
- }
48
- return result;
49
- }
50
-
51
- std::vector<jsi::Value> convertNSArrayToStdVector(jsi::Runtime &runtime, NSArray *value)
52
- {
53
- std::vector<jsi::Value> result;
54
- for (size_t i = 0; i < value.count; i++) {
55
- result.emplace_back(convertObjCObjectToJSIValue(runtime, value[i]));
56
- }
57
- return result;
58
- }
59
-
60
- jsi::Value convertObjCObjectToJSIValue(jsi::Runtime &runtime, id value)
61
- {
62
- if ([value isKindOfClass:[NSString class]]) {
63
- return convertNSStringToJSIString(runtime, (NSString *)value);
64
- } else if ([value isKindOfClass:[NSNumber class]]) {
65
- if ([value isKindOfClass:[@YES class]]) {
66
- return convertNSNumberToJSIBoolean(runtime, (NSNumber *)value);
67
- }
68
- return convertNSNumberToJSINumber(runtime, (NSNumber *)value);
69
- } else if ([value isKindOfClass:[NSDictionary class]]) {
70
- return convertNSDictionaryToJSIObject(runtime, (NSDictionary *)value);
71
- } else if ([value isKindOfClass:[NSArray class]]) {
72
- return convertNSArrayToJSIArray(runtime, (NSArray *)value);
73
- } else if (value == (id)kCFNull) {
74
- return jsi::Value::null();
75
- }
76
- return jsi::Value::undefined();
77
- }
78
-
79
- id convertJSIValueToObjCObject(
80
- jsi::Runtime &runtime,
81
- const jsi::Value &value);
82
- NSString *convertJSIStringToNSString(jsi::Runtime &runtime, const jsi::String &value)
83
- {
84
- return [NSString stringWithUTF8String:value.utf8(runtime).c_str()];
85
- }
86
-
87
- NSArray *convertJSIArrayToNSArray(
88
- jsi::Runtime &runtime,
89
- const jsi::Array &value)
90
- {
91
- size_t size = value.size(runtime);
92
- NSMutableArray *result = [NSMutableArray new];
93
- for (size_t i = 0; i < size; i++) {
94
- // Insert kCFNull when it's `undefined` value to preserve the indices.
95
- [result
96
- addObject:convertJSIValueToObjCObject(runtime, value.getValueAtIndex(runtime, i)) ?: (id)kCFNull];
97
- }
98
- return [result copy];
99
- }
100
-
101
- NSDictionary *convertJSIObjectToNSDictionary(
102
- jsi::Runtime &runtime,
103
- const jsi::Object &value)
104
- {
105
- jsi::Array propertyNames = value.getPropertyNames(runtime);
106
- size_t size = propertyNames.size(runtime);
107
- NSMutableDictionary *result = [NSMutableDictionary new];
108
- for (size_t i = 0; i < size; i++) {
109
- jsi::String name = propertyNames.getValueAtIndex(runtime, i).getString(runtime);
110
- NSString *k = convertJSIStringToNSString(runtime, name);
111
- id v = convertJSIValueToObjCObject(runtime, value.getProperty(runtime, name));
112
- if (v) {
113
- result[k] = v;
114
- }
115
- }
116
- return [result copy];
117
- }
118
-
119
- RCTResponseSenderBlock convertJSIFunctionToCallback(
120
- jsi::Runtime &runtime,
121
- const jsi::Function &value)
122
- {
123
- __block auto cb = value.getFunction(runtime);
124
-
125
- return ^(NSArray *responses) {
126
- cb.call(runtime, convertNSArrayToJSIArray(runtime, responses), 2);
127
- };
128
- }
129
-
130
- id convertJSIValueToObjCObject(
131
- jsi::Runtime &runtime,
132
- const jsi::Value &value)
133
- {
134
- if (value.isUndefined() || value.isNull()) {
135
- return nil;
136
- }
137
- if (value.isBool()) {
138
- return @(value.getBool());
139
- }
140
- if (value.isNumber()) {
141
- return @(value.getNumber());
142
- }
143
- if (value.isString()) {
144
- return convertJSIStringToNSString(runtime, value.getString(runtime));
145
- }
146
- if (value.isObject()) {
147
- jsi::Object o = value.getObject(runtime);
148
- if (o.isArray(runtime)) {
149
- return convertJSIArrayToNSArray(runtime, o.getArray(runtime));
150
- }
151
- if (o.isFunction(runtime)) {
152
- return convertJSIFunctionToCallback(runtime, std::move(o.getFunction(runtime)));
153
- }
154
- return convertJSIObjectToNSDictionary(runtime, o);
155
- }
156
-
157
- throw std::runtime_error("Unsupported jsi::jsi::Value kind");
158
- }
159
-
160
- Promise::Promise(jsi::Runtime &rt, jsi::Function resolve, jsi::Function reject)
161
- : runtime_(rt), resolve_(std::move(resolve)), reject_(std::move(reject)) {}
162
-
163
- void Promise::resolve(const jsi::Value &result) {
164
- resolve_.call(runtime_, result);
165
- }
166
-
167
- void Promise::reject(const std::string &message) {
168
- jsi::Object error(runtime_);
169
- error.setProperty(
170
- runtime_, "message", jsi::String::createFromUtf8(runtime_, message));
171
- reject_.call(runtime_, error);
172
- }
173
-
174
- jsi::Value createPromiseAsJSIValue(
175
- jsi::Runtime &rt,
176
- const PromiseSetupFunctionType func) {
177
- jsi::Function JSPromise = rt.global().getPropertyAsFunction(rt, "Promise");
178
- jsi::Function fn = jsi::Function::createFromHostFunction(
179
- rt,
180
- jsi::PropNameID::forAscii(rt, "fn"),
181
- 2,
182
- [func](
183
- jsi::Runtime &rt2,
184
- const jsi::Value &thisVal,
185
- const jsi::Value *args,
186
- size_t count) {
187
- jsi::Function resolve = args[0].getObject(rt2).getFunction(rt2);
188
- jsi::Function reject = args[1].getObject(rt2).getFunction(rt2);
189
- auto wrapper = std::make_shared<Promise>(
190
- rt2, std::move(resolve), std::move(reject));
191
- func(rt2, wrapper);
192
- return jsi::Value::undefined();
193
- });
194
-
195
- return JSPromise.callAsConstructor(rt, fn);
196
- }
@@ -1,93 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.boxCBytesIntoBuffer = boxCBytesIntoBuffer;
7
- exports.boxCStringIntoString = boxCStringIntoString;
8
- exports.ditto_sdk_transports_init = ditto_sdk_transports_init;
9
- exports.getDeadlockTimeout = getDeadlockTimeout;
10
- exports.getMissingAndroidPermissions = getMissingAndroidPermissions;
11
- exports.setDeadlockTimeout = setDeadlockTimeout;
12
- var _reactNative = require("react-native");
13
- var _weakrefs = require("@ungap/weakrefs");
14
- require("fastestsmallesttextencoderdecoder");
15
- // HACK: We're currently filling weakrefs with a broken implementation that is
16
- // leaking. (#10730)
17
- // @ts-ignore No types provided by the 3rd party
18
- // No need to define types for each of them as these will not be used anywhere,
19
- // but rather just pollute and require maintenance. It's good to highlight that
20
- // these will be exported, though.
21
- const dittoCore = global;
22
- const isLoaded = typeof dittoCore.getDeviceName === 'function';
23
- if (!isLoaded) {
24
- var _NativeModules$DittoR;
25
- const result = (_NativeModules$DittoR = _reactNative.NativeModules.DittoRNSDK) === null || _NativeModules$DittoR === void 0 ? void 0 : _NativeModules$DittoR.install();
26
- if (!result) {
27
- throw new Error('JSI bindings were not installed for: DittoRNSDK Module');
28
- }
29
-
30
- // We're queueing JSI background tasks and poll them at specific intervals,
31
- // as JSI doesn't give us a proper solution (yet).
32
- // TODO: Improve / fine-tune workaround. (#10685)
33
- setInterval(() => {
34
- dittoCore.ditto_tick();
35
- }, 50);
36
-
37
- // Stay as close as possible to the JS SDK with the API
38
- // We have to rename the shim that has a different name.
39
- if (typeof global.FinalizationRegistry === 'undefined' && typeof _weakrefs.FinalizationGroup !== 'undefined') {
40
- global.FinalizationRegistry = _weakrefs.FinalizationGroup;
41
- }
42
- }
43
-
44
- // Export JSI methods.
45
- Object.keys(dittoCore)
46
- // we will provide our own decorated implementation.
47
- .filter(key => key !== 'ditto_sdk_transports_init').forEach(key => {
48
- exports[key] = dittoCore[key];
49
- });
50
-
51
- //
52
- // Needed as for JS SDK API's.
53
- //
54
-
55
- // Decorated implementation with an extra step of setting the context for
56
- // Transports to work on Android.
57
- function ditto_sdk_transports_init(transportsErrorPointer) {
58
- if (_reactNative.Platform.OS === 'android') {
59
- const res = dittoCore.ditto_sdk_transports_set_android_context();
60
- if (!res) {
61
- throw new Error("Couldn't manage to set Android context with `ditto_sdk_transports_set_android_context()`");
62
- }
63
- }
64
- return dittoCore.ditto_sdk_transports_init(transportsErrorPointer);
65
- }
66
-
67
- /**
68
- * Get the list of missing Android permissions for syncing. The returned value
69
- * can be passed directly to `PermissionsAndroid.requestMultiple()`.
70
- *
71
- * Returns an empty array on other platforms.
72
- */
73
- function getMissingAndroidPermissions() {
74
- if (_reactNative.Platform.OS !== 'android') {
75
- return [];
76
- }
77
- return dittoCore.ditto_sdk_transports_android_missing_permissions();
78
- }
79
- function boxCStringIntoString(something) {
80
- return something;
81
- }
82
- function boxCBytesIntoBuffer(cborBytes) {
83
- // @ts-ignore
84
- const bytes = dittoCore.sliceBoxedToUInt8Array(cborBytes);
85
- return bytes ? new Uint8Array(bytes) : null;
86
- }
87
- function getDeadlockTimeout() {
88
- return 0;
89
- }
90
- function setDeadlockTimeout(something) {
91
- return something;
92
- }
93
- //# sourceMappingURL=ditto.rn.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_reactNative","require","_weakrefs","dittoCore","global","isLoaded","getDeviceName","_NativeModules$DittoR","result","NativeModules","DittoRNSDK","install","Error","setInterval","ditto_tick","FinalizationRegistry","FinalizationGroup","Object","keys","filter","key","forEach","exports","ditto_sdk_transports_init","transportsErrorPointer","Platform","OS","res","ditto_sdk_transports_set_android_context","getMissingAndroidPermissions","ditto_sdk_transports_android_missing_permissions","boxCStringIntoString","something","boxCBytesIntoBuffer","cborBytes","bytes","sliceBoxedToUInt8Array","Uint8Array","getDeadlockTimeout","setDeadlockTimeout"],"sourceRoot":"../../src","sources":["ditto.rn.ts"],"mappings":";;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAIA,IAAAC,SAAA,GAAAD,OAAA;AACAA,OAAA;AAJA;AACA;AACA;AAIA;AACA;AACA;AAmBA,MAAME,SAAS,GAAGC,MAAkC;AACpD,MAAMC,QAAQ,GAAG,OAAOF,SAAS,CAACG,aAAa,KAAK,UAAU;AAC9D,IAAI,CAACD,QAAQ,EAAE;EAAA,IAAAE,qBAAA;EACb,MAAMC,MAAM,IAAAD,qBAAA,GAAGE,0BAAa,CAACC,UAAU,cAAAH,qBAAA,uBAAxBA,qBAAA,CAA0BI,OAAO,CAAC,CAAC;EAElD,IAAI,CAACH,MAAM,EAAE;IACX,MAAM,IAAII,KAAK,CAAC,wDAAwD,CAAC;EAC3E;;EAEA;EACA;EACA;EACAC,WAAW,CAAC,MAAM;IAChBV,SAAS,CAACW,UAAU,CAAC,CAAC;EACxB,CAAC,EAAE,EAAE,CAAC;;EAEN;EACA;EACA,IACE,OAAOV,MAAM,CAACW,oBAAoB,KAAK,WAAW,IAClD,OAAOC,2BAAiB,KAAK,WAAW,EACxC;IACAZ,MAAM,CAACW,oBAAoB,GAAGC,2BAAiB;EACjD;AACF;;AAEA;AACAC,MAAM,CAACC,IAAI,CAACf,SAAS;AACnB;AAAA,CACCgB,MAAM,CAAEC,GAAG,IAAKA,GAAG,KAAK,2BAA2B,CAAC,CACpDC,OAAO,CAAED,GAAG,IAAK;EAChBE,OAAO,CAACF,GAAG,CAAC,GAAGjB,SAAS,CAACiB,GAAG,CAAwB;AACtD,CAAC,CAAC;;AAEJ;AACA;AACA;;AAEA;AACA;AACO,SAASG,yBAAyBA,CACvCC,sBAA2B,EAClB;EACT,IAAIC,qBAAQ,CAACC,EAAE,KAAK,SAAS,EAAE;IAC7B,MAAMC,GAAG,GAAGxB,SAAS,CAACyB,wCAAwC,CAAC,CAAC;IAChE,IAAI,CAACD,GAAG,EAAE;MACR,MAAM,IAAIf,KAAK,CACb,0FACF,CAAC;IACH;EACF;EAEA,OAAOT,SAAS,CAACoB,yBAAyB,CAACC,sBAAsB,CAAC;AACpE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,SAASK,4BAA4BA,CAAA,EAAiB;EAC3D,IAAIJ,qBAAQ,CAACC,EAAE,KAAK,SAAS,EAAE;IAC7B,OAAO,EAAE;EACX;EACA,OAAOvB,SAAS,CAAC2B,gDAAgD,CAAC,CAAC;AACrE;AAEO,SAASC,oBAAoBA,CAACC,SAAc,EAAE;EACnD,OAAOA,SAAS;AAClB;AAEO,SAASC,mBAAmBA,CAACC,SAAc,EAAE;EAClD;EACA,MAAMC,KAAK,GAAGhC,SAAS,CAACiC,sBAAsB,CAACF,SAAS,CAAC;EACzD,OAAOC,KAAK,GAAG,IAAIE,UAAU,CAACF,KAAK,CAAC,GAAG,IAAI;AAC7C;AAEO,SAASG,kBAAkBA,CAAA,EAAW;EAC3C,OAAO,CAAC;AACV;AAEO,SAASC,kBAAkBA,CAACP,SAAc,EAAE;EACjD,OAAOA,SAAS;AAClB"}
@@ -1,14 +0,0 @@
1
- export {getMissingAndroidPermissions} from './ditto.rn';
2
- export {TransportConfig} from '../../sources/transport-config';
3
- export {Ditto} from '../../sources/ditto';
4
- export {Logger} from '../../sources/logger';
5
-
6
- export type {AuthenticationHandler} from '../../sources/authenticator';
7
- export type {Identity} from '../../sources/identity';
8
- export type {QueryResult} from '../../sources/query-result';
9
- export type {QueryResultItem} from '../../sources/query-result-item';
10
- export type {LogLevel} from '../../sources/logger';
11
-
12
- export * from '../../sources/epilogue';
13
- ('use strict');
14
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sourceRoot":"../../src","sources":["index.ts"],"mappings":"AAAA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AAAA"}
@@ -1,83 +0,0 @@
1
- import { NativeModules, Platform } from 'react-native';
2
- // HACK: We're currently filling weakrefs with a broken implementation that is
3
- // leaking. (#10730)
4
- // @ts-ignore No types provided by the 3rd party
5
- import { FinalizationGroup } from '@ungap/weakrefs';
6
- import 'fastestsmallesttextencoderdecoder';
7
-
8
- // No need to define types for each of them as these will not be used anywhere,
9
- // but rather just pollute and require maintenance. It's good to highlight that
10
- // these will be exported, though.
11
- const dittoCore = global;
12
- const isLoaded = typeof dittoCore.getDeviceName === 'function';
13
- if (!isLoaded) {
14
- var _NativeModules$DittoR;
15
- const result = (_NativeModules$DittoR = NativeModules.DittoRNSDK) === null || _NativeModules$DittoR === void 0 ? void 0 : _NativeModules$DittoR.install();
16
- if (!result) {
17
- throw new Error('JSI bindings were not installed for: DittoRNSDK Module');
18
- }
19
-
20
- // We're queueing JSI background tasks and poll them at specific intervals,
21
- // as JSI doesn't give us a proper solution (yet).
22
- // TODO: Improve / fine-tune workaround. (#10685)
23
- setInterval(() => {
24
- dittoCore.ditto_tick();
25
- }, 50);
26
-
27
- // Stay as close as possible to the JS SDK with the API
28
- // We have to rename the shim that has a different name.
29
- if (typeof global.FinalizationRegistry === 'undefined' && typeof FinalizationGroup !== 'undefined') {
30
- global.FinalizationRegistry = FinalizationGroup;
31
- }
32
- }
33
-
34
- // Export JSI methods.
35
- Object.keys(dittoCore)
36
- // we will provide our own decorated implementation.
37
- .filter(key => key !== 'ditto_sdk_transports_init').forEach(key => {
38
- exports[key] = dittoCore[key];
39
- });
40
-
41
- //
42
- // Needed as for JS SDK API's.
43
- //
44
-
45
- // Decorated implementation with an extra step of setting the context for
46
- // Transports to work on Android.
47
- export function ditto_sdk_transports_init(transportsErrorPointer) {
48
- if (Platform.OS === 'android') {
49
- const res = dittoCore.ditto_sdk_transports_set_android_context();
50
- if (!res) {
51
- throw new Error("Couldn't manage to set Android context with `ditto_sdk_transports_set_android_context()`");
52
- }
53
- }
54
- return dittoCore.ditto_sdk_transports_init(transportsErrorPointer);
55
- }
56
-
57
- /**
58
- * Get the list of missing Android permissions for syncing. The returned value
59
- * can be passed directly to `PermissionsAndroid.requestMultiple()`.
60
- *
61
- * Returns an empty array on other platforms.
62
- */
63
- export function getMissingAndroidPermissions() {
64
- if (Platform.OS !== 'android') {
65
- return [];
66
- }
67
- return dittoCore.ditto_sdk_transports_android_missing_permissions();
68
- }
69
- export function boxCStringIntoString(something) {
70
- return something;
71
- }
72
- export function boxCBytesIntoBuffer(cborBytes) {
73
- // @ts-ignore
74
- const bytes = dittoCore.sliceBoxedToUInt8Array(cborBytes);
75
- return bytes ? new Uint8Array(bytes) : null;
76
- }
77
- export function getDeadlockTimeout() {
78
- return 0;
79
- }
80
- export function setDeadlockTimeout(something) {
81
- return something;
82
- }
83
- //# sourceMappingURL=ditto.rn.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["NativeModules","Platform","FinalizationGroup","dittoCore","global","isLoaded","getDeviceName","_NativeModules$DittoR","result","DittoRNSDK","install","Error","setInterval","ditto_tick","FinalizationRegistry","Object","keys","filter","key","forEach","exports","ditto_sdk_transports_init","transportsErrorPointer","OS","res","ditto_sdk_transports_set_android_context","getMissingAndroidPermissions","ditto_sdk_transports_android_missing_permissions","boxCStringIntoString","something","boxCBytesIntoBuffer","cborBytes","bytes","sliceBoxedToUInt8Array","Uint8Array","getDeadlockTimeout","setDeadlockTimeout"],"sourceRoot":"../../src","sources":["ditto.rn.ts"],"mappings":"AAAA,SAASA,aAAa,EAAEC,QAAQ,QAAyB,cAAc;AACvE;AACA;AACA;AACA,SAASC,iBAAiB,QAAQ,iBAAiB;AACnD,OAAO,mCAAmC;;AAE1C;AACA;AACA;AAmBA,MAAMC,SAAS,GAAGC,MAAkC;AACpD,MAAMC,QAAQ,GAAG,OAAOF,SAAS,CAACG,aAAa,KAAK,UAAU;AAC9D,IAAI,CAACD,QAAQ,EAAE;EAAA,IAAAE,qBAAA;EACb,MAAMC,MAAM,IAAAD,qBAAA,GAAGP,aAAa,CAACS,UAAU,cAAAF,qBAAA,uBAAxBA,qBAAA,CAA0BG,OAAO,CAAC,CAAC;EAElD,IAAI,CAACF,MAAM,EAAE;IACX,MAAM,IAAIG,KAAK,CAAC,wDAAwD,CAAC;EAC3E;;EAEA;EACA;EACA;EACAC,WAAW,CAAC,MAAM;IAChBT,SAAS,CAACU,UAAU,CAAC,CAAC;EACxB,CAAC,EAAE,EAAE,CAAC;;EAEN;EACA;EACA,IACE,OAAOT,MAAM,CAACU,oBAAoB,KAAK,WAAW,IAClD,OAAOZ,iBAAiB,KAAK,WAAW,EACxC;IACAE,MAAM,CAACU,oBAAoB,GAAGZ,iBAAiB;EACjD;AACF;;AAEA;AACAa,MAAM,CAACC,IAAI,CAACb,SAAS;AACnB;AAAA,CACCc,MAAM,CAAEC,GAAG,IAAKA,GAAG,KAAK,2BAA2B,CAAC,CACpDC,OAAO,CAAED,GAAG,IAAK;EAChBE,OAAO,CAACF,GAAG,CAAC,GAAGf,SAAS,CAACe,GAAG,CAAwB;AACtD,CAAC,CAAC;;AAEJ;AACA;AACA;;AAEA;AACA;AACA,OAAO,SAASG,yBAAyBA,CACvCC,sBAA2B,EAClB;EACT,IAAIrB,QAAQ,CAACsB,EAAE,KAAK,SAAS,EAAE;IAC7B,MAAMC,GAAG,GAAGrB,SAAS,CAACsB,wCAAwC,CAAC,CAAC;IAChE,IAAI,CAACD,GAAG,EAAE;MACR,MAAM,IAAIb,KAAK,CACb,0FACF,CAAC;IACH;EACF;EAEA,OAAOR,SAAS,CAACkB,yBAAyB,CAACC,sBAAsB,CAAC;AACpE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASI,4BAA4BA,CAAA,EAAiB;EAC3D,IAAIzB,QAAQ,CAACsB,EAAE,KAAK,SAAS,EAAE;IAC7B,OAAO,EAAE;EACX;EACA,OAAOpB,SAAS,CAACwB,gDAAgD,CAAC,CAAC;AACrE;AAEA,OAAO,SAASC,oBAAoBA,CAACC,SAAc,EAAE;EACnD,OAAOA,SAAS;AAClB;AAEA,OAAO,SAASC,mBAAmBA,CAACC,SAAc,EAAE;EAClD;EACA,MAAMC,KAAK,GAAG7B,SAAS,CAAC8B,sBAAsB,CAACF,SAAS,CAAC;EACzD,OAAOC,KAAK,GAAG,IAAIE,UAAU,CAACF,KAAK,CAAC,GAAG,IAAI;AAC7C;AAEA,OAAO,SAASG,kBAAkBA,CAAA,EAAW;EAC3C,OAAO,CAAC;AACV;AAEA,OAAO,SAASC,kBAAkBA,CAACP,SAAc,EAAE;EACjD,OAAOA,SAAS;AAClB"}
@@ -1,13 +0,0 @@
1
- export {getMissingAndroidPermissions} from './ditto.rn';
2
- export {TransportConfig} from '../../sources/transport-config';
3
- export {Ditto} from '../../sources/ditto';
4
- export {Logger} from '../../sources/logger';
5
-
6
- export type {AuthenticationHandler} from '../../sources/authenticator';
7
- export type {Identity} from '../../sources/identity';
8
- export type {QueryResult} from '../../sources/query-result';
9
- export type {QueryResultItem} from '../../sources/query-result-item';
10
- export type {LogLevel} from '../../sources/logger';
11
-
12
- export * from '../../sources/epilogue';
13
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sourceRoot":"../../src","sources":["index.ts"],"mappings":"AAAA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA"}
@@ -1,15 +0,0 @@
1
- import { type Permission } from 'react-native';
2
- import 'fastestsmallesttextencoderdecoder';
3
- export declare function ditto_sdk_transports_init(transportsErrorPointer: any): boolean;
4
- /**
5
- * Get the list of missing Android permissions for syncing. The returned value
6
- * can be passed directly to `PermissionsAndroid.requestMultiple()`.
7
- *
8
- * Returns an empty array on other platforms.
9
- */
10
- export declare function getMissingAndroidPermissions(): Permission[];
11
- export declare function boxCStringIntoString(something: any): any;
12
- export declare function boxCBytesIntoBuffer(cborBytes: any): Uint8Array | null;
13
- export declare function getDeadlockTimeout(): number;
14
- export declare function setDeadlockTimeout(something: any): any;
15
- //# sourceMappingURL=ditto.rn.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ditto.rn.d.ts","sourceRoot":"","sources":["../../src/ditto.rn.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAKxE,OAAO,mCAAmC,CAAC;AA+D3C,wBAAgB,yBAAyB,CACvC,sBAAsB,EAAE,GAAG,GAC1B,OAAO,CAWT;AAED;;;;;GAKG;AACH,wBAAgB,4BAA4B,IAAI,UAAU,EAAE,CAK3D;AAED,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,GAAG,OAElD;AAED,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,GAAG,qBAIjD;AAED,wBAAgB,kBAAkB,IAAI,MAAM,CAE3C;AAED,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,GAAG,OAEhD"}
@@ -1 +0,0 @@
1
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":""}