@fedimint/react-native-bindings 0.0.0-om-rn1-d72fdc108a01df2d7d64c2b85c8b1f9fd43927cb

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 (111) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +7 -0
  3. package/ReactNative.podspec +45 -0
  4. package/ReactNativeBindings.podspec +44 -0
  5. package/android/CMakeLists.txt +76 -0
  6. package/android/build.gradle +144 -0
  7. package/android/cpp-adapter.cpp +44 -0
  8. package/android/generated/java/com/fedimint/reactnative/NativeReactNativeBindingsSpec.java +41 -0
  9. package/android/generated/jni/CMakeLists.txt +28 -0
  10. package/android/generated/jni/ReactNativeBindingsSpec-generated.cpp +38 -0
  11. package/android/generated/jni/ReactNativeBindingsSpec.h +31 -0
  12. package/android/generated/jni/react/renderer/components/ReactNativeBindingsSpec/ComponentDescriptors.cpp +22 -0
  13. package/android/generated/jni/react/renderer/components/ReactNativeBindingsSpec/ComponentDescriptors.h +24 -0
  14. package/android/generated/jni/react/renderer/components/ReactNativeBindingsSpec/EventEmitters.cpp +16 -0
  15. package/android/generated/jni/react/renderer/components/ReactNativeBindingsSpec/EventEmitters.h +17 -0
  16. package/android/generated/jni/react/renderer/components/ReactNativeBindingsSpec/Props.cpp +19 -0
  17. package/android/generated/jni/react/renderer/components/ReactNativeBindingsSpec/Props.h +18 -0
  18. package/android/generated/jni/react/renderer/components/ReactNativeBindingsSpec/ReactNativeBindingsSpecJSI.h +45 -0
  19. package/android/generated/jni/react/renderer/components/ReactNativeBindingsSpec/ShadowNodes.cpp +17 -0
  20. package/android/generated/jni/react/renderer/components/ReactNativeBindingsSpec/ShadowNodes.h +23 -0
  21. package/android/generated/jni/react/renderer/components/ReactNativeBindingsSpec/States.cpp +16 -0
  22. package/android/generated/jni/react/renderer/components/ReactNativeBindingsSpec/States.h +20 -0
  23. package/android/src/main/AndroidManifest.xml +5 -0
  24. package/android/src/main/java/com/fedimint/reactnative/ReactNativeBindingsModule.kt +43 -0
  25. package/android/src/main/java/com/fedimint/reactnative/ReactNativeBindingsPackage.kt +34 -0
  26. package/app.plugin.js +1 -0
  27. package/cpp/fedimint-react-native-bindings.cpp +16 -0
  28. package/cpp/fedimint-react-native-bindings.h +15 -0
  29. package/cpp/generated/fedimint_client_uniffi.cpp +2281 -0
  30. package/cpp/generated/fedimint_client_uniffi.hpp +95 -0
  31. package/ios/ReactNativeBindings.h +16 -0
  32. package/ios/ReactNativeBindings.mm +66 -0
  33. package/ios/generated/ReactCodegen/ReactNativeBindingsSpec/ComponentDescriptors.cpp +22 -0
  34. package/ios/generated/ReactCodegen/ReactNativeBindingsSpec/ComponentDescriptors.h +24 -0
  35. package/ios/generated/ReactCodegen/ReactNativeBindingsSpec/EventEmitters.cpp +16 -0
  36. package/ios/generated/ReactCodegen/ReactNativeBindingsSpec/EventEmitters.h +17 -0
  37. package/ios/generated/ReactCodegen/ReactNativeBindingsSpec/Props.cpp +19 -0
  38. package/ios/generated/ReactCodegen/ReactNativeBindingsSpec/Props.h +18 -0
  39. package/ios/generated/ReactCodegen/ReactNativeBindingsSpec/RCTComponentViewHelpers.h +18 -0
  40. package/ios/generated/ReactCodegen/ReactNativeBindingsSpec/ReactNativeBindingsSpec-generated.mm +46 -0
  41. package/ios/generated/ReactCodegen/ReactNativeBindingsSpec/ReactNativeBindingsSpec.h +63 -0
  42. package/ios/generated/ReactCodegen/ReactNativeBindingsSpec/ShadowNodes.cpp +17 -0
  43. package/ios/generated/ReactCodegen/ReactNativeBindingsSpec/ShadowNodes.h +23 -0
  44. package/ios/generated/ReactCodegen/ReactNativeBindingsSpec/States.cpp +16 -0
  45. package/ios/generated/ReactCodegen/ReactNativeBindingsSpec/States.h +20 -0
  46. package/ios/generated/ReactCodegen/ReactNativeBindingsSpecJSI.h +45 -0
  47. package/lib/commonjs/NativeReactNativeBindings.js +10 -0
  48. package/lib/commonjs/NativeReactNativeBindings.js.map +1 -0
  49. package/lib/commonjs/generated/fedimint_client_uniffi-ffi.js +44 -0
  50. package/lib/commonjs/generated/fedimint_client_uniffi-ffi.js.map +1 -0
  51. package/lib/commonjs/generated/fedimint_client_uniffi.js +426 -0
  52. package/lib/commonjs/generated/fedimint_client_uniffi.js.map +1 -0
  53. package/lib/commonjs/index.js +63 -0
  54. package/lib/commonjs/index.js.map +1 -0
  55. package/lib/commonjs/package.json +1 -0
  56. package/lib/module/NativeReactNativeBindings.js +7 -0
  57. package/lib/module/NativeReactNativeBindings.js.map +1 -0
  58. package/lib/module/generated/fedimint_client_uniffi-ffi.js +43 -0
  59. package/lib/module/generated/fedimint_client_uniffi-ffi.js.map +1 -0
  60. package/lib/module/generated/fedimint_client_uniffi.js +420 -0
  61. package/lib/module/generated/fedimint_client_uniffi.js.map +1 -0
  62. package/lib/module/index.js +43 -0
  63. package/lib/module/index.js.map +1 -0
  64. package/lib/module/package.json +1 -0
  65. package/lib/typescript/commonjs/package.json +1 -0
  66. package/lib/typescript/commonjs/plugin/src/index.d.ts +11 -0
  67. package/lib/typescript/commonjs/plugin/src/index.d.ts.map +1 -0
  68. package/lib/typescript/commonjs/plugin/src/utils.d.ts +9 -0
  69. package/lib/typescript/commonjs/plugin/src/utils.d.ts.map +1 -0
  70. package/lib/typescript/commonjs/plugin/src/withAndroid.d.ts +6 -0
  71. package/lib/typescript/commonjs/plugin/src/withAndroid.d.ts.map +1 -0
  72. package/lib/typescript/commonjs/plugin/src/withBinaryArtifacts.d.ts +7 -0
  73. package/lib/typescript/commonjs/plugin/src/withBinaryArtifacts.d.ts.map +1 -0
  74. package/lib/typescript/commonjs/plugin/src/withIOS.d.ts +7 -0
  75. package/lib/typescript/commonjs/plugin/src/withIOS.d.ts.map +1 -0
  76. package/lib/typescript/commonjs/src/NativeReactNativeBindings.d.ts +8 -0
  77. package/lib/typescript/commonjs/src/NativeReactNativeBindings.d.ts.map +1 -0
  78. package/lib/typescript/commonjs/src/generated/fedimint_client_uniffi-ffi.d.ts +95 -0
  79. package/lib/typescript/commonjs/src/generated/fedimint_client_uniffi-ffi.d.ts.map +1 -0
  80. package/lib/typescript/commonjs/src/generated/fedimint_client_uniffi.d.ts +501 -0
  81. package/lib/typescript/commonjs/src/generated/fedimint_client_uniffi.d.ts.map +1 -0
  82. package/lib/typescript/commonjs/src/index.d.ts +8 -0
  83. package/lib/typescript/commonjs/src/index.d.ts.map +1 -0
  84. package/lib/typescript/module/package.json +1 -0
  85. package/lib/typescript/module/plugin/src/index.d.ts +11 -0
  86. package/lib/typescript/module/plugin/src/index.d.ts.map +1 -0
  87. package/lib/typescript/module/plugin/src/utils.d.ts +9 -0
  88. package/lib/typescript/module/plugin/src/utils.d.ts.map +1 -0
  89. package/lib/typescript/module/plugin/src/withAndroid.d.ts +6 -0
  90. package/lib/typescript/module/plugin/src/withAndroid.d.ts.map +1 -0
  91. package/lib/typescript/module/plugin/src/withBinaryArtifacts.d.ts +7 -0
  92. package/lib/typescript/module/plugin/src/withBinaryArtifacts.d.ts.map +1 -0
  93. package/lib/typescript/module/plugin/src/withIOS.d.ts +7 -0
  94. package/lib/typescript/module/plugin/src/withIOS.d.ts.map +1 -0
  95. package/lib/typescript/module/src/NativeReactNativeBindings.d.ts +8 -0
  96. package/lib/typescript/module/src/NativeReactNativeBindings.d.ts.map +1 -0
  97. package/lib/typescript/module/src/generated/fedimint_client_uniffi-ffi.d.ts +95 -0
  98. package/lib/typescript/module/src/generated/fedimint_client_uniffi-ffi.d.ts.map +1 -0
  99. package/lib/typescript/module/src/generated/fedimint_client_uniffi.d.ts +501 -0
  100. package/lib/typescript/module/src/generated/fedimint_client_uniffi.d.ts.map +1 -0
  101. package/lib/typescript/module/src/index.d.ts +8 -0
  102. package/lib/typescript/module/src/index.d.ts.map +1 -0
  103. package/package.json +146 -0
  104. package/patches/rn083_callinvoker.patch +50 -0
  105. package/plugin/tsconfig.json +18 -0
  106. package/react-native.config.js +15 -0
  107. package/scripts/download-binaries.js +111 -0
  108. package/src/NativeReactNativeBindings.ts +10 -0
  109. package/src/generated/fedimint_client_uniffi-ffi.ts +221 -0
  110. package/src/generated/fedimint_client_uniffi.ts +651 -0
  111. package/src/index.tsx +41 -0
@@ -0,0 +1,45 @@
1
+ /**
2
+ * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
3
+ *
4
+ * Do not edit this file as changes may cause incorrect behavior and will be lost
5
+ * once the code is regenerated.
6
+ *
7
+ * @generated by codegen project: GenerateModuleH.js
8
+ */
9
+
10
+ #pragma once
11
+
12
+ #include <ReactCommon/TurboModule.h>
13
+ #include <react/bridging/Bridging.h>
14
+
15
+ namespace facebook::react {
16
+
17
+
18
+ template <typename T>
19
+ class JSI_EXPORT NativeReactNativeBindingsCxxSpec : public TurboModule {
20
+ public:
21
+ static constexpr std::string_view kModuleName = "ReactNativeBindings";
22
+
23
+ protected:
24
+ NativeReactNativeBindingsCxxSpec(std::shared_ptr<CallInvoker> jsInvoker) : TurboModule(std::string{NativeReactNativeBindingsCxxSpec::kModuleName}, jsInvoker) {
25
+ methodMap_["installRustCrate"] = MethodMetadata {.argCount = 0, .invoker = __installRustCrate};
26
+ methodMap_["cleanupRustCrate"] = MethodMetadata {.argCount = 0, .invoker = __cleanupRustCrate};
27
+ }
28
+
29
+ private:
30
+ static jsi::Value __installRustCrate(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* /*args*/, size_t /*count*/) {
31
+ static_assert(
32
+ bridging::getParameterCount(&T::installRustCrate) == 1,
33
+ "Expected installRustCrate(...) to have 1 parameters");
34
+ return bridging::callFromJs<bool>(rt, &T::installRustCrate, static_cast<NativeReactNativeBindingsCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule));
35
+ }
36
+
37
+ static jsi::Value __cleanupRustCrate(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* /*args*/, size_t /*count*/) {
38
+ static_assert(
39
+ bridging::getParameterCount(&T::cleanupRustCrate) == 1,
40
+ "Expected cleanupRustCrate(...) to have 1 parameters");
41
+ return bridging::callFromJs<bool>(rt, &T::cleanupRustCrate, static_cast<NativeReactNativeBindingsCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule));
42
+ }
43
+ };
44
+
45
+ } // namespace facebook::react
@@ -0,0 +1,17 @@
1
+
2
+ /**
3
+ * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
4
+ *
5
+ * Do not edit this file as changes may cause incorrect behavior and will be lost
6
+ * once the code is regenerated.
7
+ *
8
+ * @generated by codegen project: GenerateShadowNodeCpp.js
9
+ */
10
+
11
+ #include "ShadowNodes.h"
12
+
13
+ namespace facebook::react {
14
+
15
+
16
+
17
+ } // namespace facebook::react
@@ -0,0 +1,23 @@
1
+
2
+ /**
3
+ * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
4
+ *
5
+ * Do not edit this file as changes may cause incorrect behavior and will be lost
6
+ * once the code is regenerated.
7
+ *
8
+ * @generated by codegen project: GenerateShadowNodeH.js
9
+ */
10
+
11
+ #pragma once
12
+
13
+ #include "EventEmitters.h"
14
+ #include "Props.h"
15
+ #include "States.h"
16
+ #include <react/renderer/components/view/ConcreteViewShadowNode.h>
17
+ #include <jsi/jsi.h>
18
+
19
+ namespace facebook::react {
20
+
21
+
22
+
23
+ } // namespace facebook::react
@@ -0,0 +1,16 @@
1
+
2
+ /**
3
+ * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
4
+ *
5
+ * Do not edit this file as changes may cause incorrect behavior and will be lost
6
+ * once the code is regenerated.
7
+ *
8
+ * @generated by codegen project: GenerateStateCpp.js
9
+ */
10
+ #include "States.h"
11
+
12
+ namespace facebook::react {
13
+
14
+
15
+
16
+ } // namespace facebook::react
@@ -0,0 +1,20 @@
1
+ /**
2
+ * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
3
+ *
4
+ * Do not edit this file as changes may cause incorrect behavior and will be lost
5
+ * once the code is regenerated.
6
+ *
7
+ * @generated by codegen project: GenerateStateH.js
8
+ */
9
+ #pragma once
10
+
11
+ #include <react/renderer/core/StateData.h>
12
+ #ifdef RN_SERIALIZABLE_STATE
13
+ #include <folly/dynamic.h>
14
+ #endif
15
+
16
+ namespace facebook::react {
17
+
18
+
19
+
20
+ } // namespace facebook::react
@@ -0,0 +1,5 @@
1
+
2
+ <!-- Generated by uniffi-bindgen-react-native -->
3
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android"
4
+ package="com.fedimint.reactnative">
5
+ </manifest>
@@ -0,0 +1,43 @@
1
+ // Generated by uniffi-bindgen-react-native
2
+ package com.fedimint.reactnative
3
+
4
+ import com.facebook.react.bridge.ReactApplicationContext
5
+ import com.facebook.react.module.annotations.ReactModule
6
+ import com.facebook.react.turbomodule.core.interfaces.CallInvokerHolder
7
+
8
+ @ReactModule(name = ReactNativeBindingsModule.NAME)
9
+ class ReactNativeBindingsModule(reactContext: ReactApplicationContext) :
10
+ NativeReactNativeBindingsSpec(reactContext) {
11
+
12
+ override fun getName(): String {
13
+ return NAME
14
+ }
15
+
16
+ // Two native methods implemented in cpp-adapter.cpp, and ultimately
17
+ // fedimint-react-native-bindings.cpp
18
+
19
+ external fun nativeInstallRustCrate(runtimePointer: Long, callInvoker: CallInvokerHolder): Boolean
20
+ external fun nativeCleanupRustCrate(runtimePointer: Long): Boolean
21
+
22
+ override fun installRustCrate(): Boolean {
23
+ val context = this.reactApplicationContext
24
+ return nativeInstallRustCrate(
25
+ context.javaScriptContextHolder!!.get(),
26
+ context.jsCallInvokerHolder!!
27
+ )
28
+ }
29
+
30
+ override fun cleanupRustCrate(): Boolean {
31
+ return nativeCleanupRustCrate(
32
+ this.reactApplicationContext.javaScriptContextHolder!!.get()
33
+ )
34
+ }
35
+
36
+ companion object {
37
+ const val NAME = "ReactNativeBindings"
38
+
39
+ init {
40
+ System.loadLibrary("fedimint-react-native-bindings")
41
+ }
42
+ }
43
+ }
@@ -0,0 +1,34 @@
1
+ // Generated by uniffi-bindgen-react-native
2
+ package com.fedimint.reactnative
3
+
4
+ import com.facebook.react.TurboReactPackage
5
+ import com.facebook.react.bridge.NativeModule
6
+ import com.facebook.react.bridge.ReactApplicationContext
7
+ import com.facebook.react.module.model.ReactModuleInfo
8
+ import com.facebook.react.module.model.ReactModuleInfoProvider
9
+ import java.util.HashMap
10
+
11
+ class ReactNativeBindingsPackage : TurboReactPackage() {
12
+ override fun getModule(name: String, reactContext: ReactApplicationContext): NativeModule? {
13
+ return if (name == ReactNativeBindingsModule.NAME) {
14
+ ReactNativeBindingsModule(reactContext)
15
+ } else {
16
+ null
17
+ }
18
+ }
19
+
20
+ override fun getReactModuleInfoProvider(): ReactModuleInfoProvider {
21
+ return ReactModuleInfoProvider {
22
+ val moduleInfos: MutableMap<String, ReactModuleInfo> = HashMap()
23
+ moduleInfos[ReactNativeBindingsModule.NAME] = ReactModuleInfo(
24
+ ReactNativeBindingsModule.NAME,
25
+ ReactNativeBindingsModule.NAME,
26
+ false, // canOverrideExistingModule
27
+ false, // needsEagerInit
28
+ false, // isCxxModule
29
+ true // isTurboModule
30
+ )
31
+ moduleInfos
32
+ }
33
+ }
34
+ }
package/app.plugin.js ADDED
@@ -0,0 +1 @@
1
+ module.exports = require('./plugin/build');
@@ -0,0 +1,16 @@
1
+ // Generated by uniffi-bindgen-react-native
2
+ #include "fedimint-react-native-bindings.h"
3
+ #include "generated/fedimint_client_uniffi.hpp"
4
+
5
+ namespace fedimint_reactnativebindings {
6
+ using namespace facebook;
7
+
8
+ uint8_t installRustCrate(jsi::Runtime &runtime, std::shared_ptr<react::CallInvoker> callInvoker) {
9
+ NativeFedimintClientUniffi::registerModule(runtime, callInvoker);
10
+ return true;
11
+ }
12
+
13
+ uint8_t cleanupRustCrate(jsi::Runtime &runtime) {
14
+ return false;
15
+ }
16
+ }
@@ -0,0 +1,15 @@
1
+ #ifndef FEDIMINT_REACTNATIVEBINDINGS_H
2
+ #define FEDIMINT_REACTNATIVEBINDINGS_H
3
+ // Generated by uniffi-bindgen-react-native
4
+ #include <cstdint>
5
+ #include <jsi/jsi.h>
6
+ #include <ReactCommon/CallInvoker.h>
7
+
8
+ namespace fedimint_reactnativebindings {
9
+ using namespace facebook;
10
+
11
+ uint8_t installRustCrate(jsi::Runtime &runtime, std::shared_ptr<react::CallInvoker> callInvoker);
12
+ uint8_t cleanupRustCrate(jsi::Runtime &runtime);
13
+ }
14
+
15
+ #endif /* FEDIMINT_REACTNATIVEBINDINGS_H */