@breeztech/breez-sdk-spark-react-native 0.1.8-dev1

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 (103) hide show
  1. package/LICENSE +20 -0
  2. package/README.md +54 -0
  3. package/android/CMakeLists.txt +79 -0
  4. package/android/build.gradle +143 -0
  5. package/android/cpp-adapter.cpp +63 -0
  6. package/android/generated/android/app/build/generated/source/codegen/java/com/facebook/fbreact/specs/NativeBreezSdkSparkReactNativeSpec.java +41 -0
  7. package/android/generated/android/app/build/generated/source/codegen/jni/BreezSdkSparkReactNativeSpec-generated.cpp +38 -0
  8. package/android/generated/android/app/build/generated/source/codegen/jni/BreezSdkSparkReactNativeSpec.h +31 -0
  9. package/android/generated/android/app/build/generated/source/codegen/jni/CMakeLists.txt +36 -0
  10. package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/BreezSdkSparkReactNativeSpec/BreezSdkSparkReactNativeSpecJSI-generated.cpp +32 -0
  11. package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/BreezSdkSparkReactNativeSpec/BreezSdkSparkReactNativeSpecJSI.h +80 -0
  12. package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/BreezSdkSparkReactNativeSpec/ComponentDescriptors.cpp +22 -0
  13. package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/BreezSdkSparkReactNativeSpec/ComponentDescriptors.h +24 -0
  14. package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/BreezSdkSparkReactNativeSpec/EventEmitters.cpp +16 -0
  15. package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/BreezSdkSparkReactNativeSpec/EventEmitters.h +17 -0
  16. package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/BreezSdkSparkReactNativeSpec/Props.cpp +19 -0
  17. package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/BreezSdkSparkReactNativeSpec/Props.h +18 -0
  18. package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/BreezSdkSparkReactNativeSpec/ShadowNodes.cpp +17 -0
  19. package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/BreezSdkSparkReactNativeSpec/ShadowNodes.h +23 -0
  20. package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/BreezSdkSparkReactNativeSpec/States.cpp +16 -0
  21. package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/BreezSdkSparkReactNativeSpec/States.h +19 -0
  22. package/android/gradle.properties +5 -0
  23. package/android/src/main/AndroidManifest.xml +5 -0
  24. package/android/src/main/AndroidManifestNew.xml +2 -0
  25. package/android/src/main/java/com/breeztech/breezsdkspark/BreezSdkSparkReactNativeModule.kt +43 -0
  26. package/android/src/main/java/com/breeztech/breezsdkspark/BreezSdkSparkReactNativePackage.kt +34 -0
  27. package/breeztech-breez-sdk-spark-react-native.podspec +44 -0
  28. package/cpp/breeztech-breez-sdk-spark-react-native.cpp +20 -0
  29. package/cpp/breeztech-breez-sdk-spark-react-native.h +15 -0
  30. package/cpp/generated/breez_sdk_common.cpp +3834 -0
  31. package/cpp/generated/breez_sdk_common.hpp +251 -0
  32. package/cpp/generated/breez_sdk_spark.cpp +8722 -0
  33. package/cpp/generated/breez_sdk_spark.hpp +589 -0
  34. package/cpp/generated/breez_sdk_spark_bindings.cpp +1750 -0
  35. package/cpp/generated/breez_sdk_spark_bindings.hpp +65 -0
  36. package/ios/BreezSdkSparkReactNative.h +16 -0
  37. package/ios/BreezSdkSparkReactNative.mm +66 -0
  38. package/ios/generated/build/generated/ios/BreezSdkSparkReactNativeSpec/BreezSdkSparkReactNativeSpec-generated.mm +46 -0
  39. package/ios/generated/build/generated/ios/BreezSdkSparkReactNativeSpec/BreezSdkSparkReactNativeSpec.h +63 -0
  40. package/ios/generated/build/generated/ios/BreezSdkSparkReactNativeSpecJSI-generated.cpp +32 -0
  41. package/ios/generated/build/generated/ios/BreezSdkSparkReactNativeSpecJSI.h +80 -0
  42. package/ios/generated/build/generated/ios/react/renderer/components/BreezSdkSparkReactNativeSpec/ComponentDescriptors.cpp +22 -0
  43. package/ios/generated/build/generated/ios/react/renderer/components/BreezSdkSparkReactNativeSpec/ComponentDescriptors.h +24 -0
  44. package/ios/generated/build/generated/ios/react/renderer/components/BreezSdkSparkReactNativeSpec/EventEmitters.cpp +16 -0
  45. package/ios/generated/build/generated/ios/react/renderer/components/BreezSdkSparkReactNativeSpec/EventEmitters.h +17 -0
  46. package/ios/generated/build/generated/ios/react/renderer/components/BreezSdkSparkReactNativeSpec/Props.cpp +19 -0
  47. package/ios/generated/build/generated/ios/react/renderer/components/BreezSdkSparkReactNativeSpec/Props.h +18 -0
  48. package/ios/generated/build/generated/ios/react/renderer/components/BreezSdkSparkReactNativeSpec/RCTComponentViewHelpers.h +18 -0
  49. package/ios/generated/build/generated/ios/react/renderer/components/BreezSdkSparkReactNativeSpec/ShadowNodes.cpp +17 -0
  50. package/ios/generated/build/generated/ios/react/renderer/components/BreezSdkSparkReactNativeSpec/ShadowNodes.h +23 -0
  51. package/ios/generated/build/generated/ios/react/renderer/components/BreezSdkSparkReactNativeSpec/States.cpp +16 -0
  52. package/ios/generated/build/generated/ios/react/renderer/components/BreezSdkSparkReactNativeSpec/States.h +19 -0
  53. package/lib/commonjs/NativeBreezSdkSparkReactNative.js +10 -0
  54. package/lib/commonjs/NativeBreezSdkSparkReactNative.js.map +1 -0
  55. package/lib/commonjs/generated/breez_sdk_common-ffi.js +44 -0
  56. package/lib/commonjs/generated/breez_sdk_common-ffi.js.map +1 -0
  57. package/lib/commonjs/generated/breez_sdk_common.js +3948 -0
  58. package/lib/commonjs/generated/breez_sdk_common.js.map +1 -0
  59. package/lib/commonjs/generated/breez_sdk_spark-ffi.js +44 -0
  60. package/lib/commonjs/generated/breez_sdk_spark-ffi.js.map +1 -0
  61. package/lib/commonjs/generated/breez_sdk_spark.js +5775 -0
  62. package/lib/commonjs/generated/breez_sdk_spark.js.map +1 -0
  63. package/lib/commonjs/generated/breez_sdk_spark_bindings-ffi.js +44 -0
  64. package/lib/commonjs/generated/breez_sdk_spark_bindings-ffi.js.map +1 -0
  65. package/lib/commonjs/generated/breez_sdk_spark_bindings.js +51 -0
  66. package/lib/commonjs/generated/breez_sdk_spark_bindings.js.map +1 -0
  67. package/lib/commonjs/index.js +81 -0
  68. package/lib/commonjs/index.js.map +1 -0
  69. package/lib/commonjs/package.json +1 -0
  70. package/lib/module/NativeBreezSdkSparkReactNative.js +7 -0
  71. package/lib/module/NativeBreezSdkSparkReactNative.js.map +1 -0
  72. package/lib/module/generated/breez_sdk_common-ffi.js +43 -0
  73. package/lib/module/generated/breez_sdk_common-ffi.js.map +1 -0
  74. package/lib/module/generated/breez_sdk_common.js +3942 -0
  75. package/lib/module/generated/breez_sdk_common.js.map +1 -0
  76. package/lib/module/generated/breez_sdk_spark-ffi.js +43 -0
  77. package/lib/module/generated/breez_sdk_spark-ffi.js.map +1 -0
  78. package/lib/module/generated/breez_sdk_spark.js +5759 -0
  79. package/lib/module/generated/breez_sdk_spark.js.map +1 -0
  80. package/lib/module/generated/breez_sdk_spark_bindings-ffi.js +43 -0
  81. package/lib/module/generated/breez_sdk_spark_bindings-ffi.js.map +1 -0
  82. package/lib/module/generated/breez_sdk_spark_bindings.js +46 -0
  83. package/lib/module/generated/breez_sdk_spark_bindings.js.map +1 -0
  84. package/lib/module/index.js +44 -0
  85. package/lib/module/index.js.map +1 -0
  86. package/lib/module/package.json +1 -0
  87. package/lib/typescript/commonjs/package.json +1 -0
  88. package/lib/typescript/commonjs/src/NativeBreezSdkSparkReactNative.d.ts +8 -0
  89. package/lib/typescript/commonjs/src/NativeBreezSdkSparkReactNative.d.ts.map +1 -0
  90. package/lib/typescript/module/package.json +1 -0
  91. package/lib/typescript/module/src/NativeBreezSdkSparkReactNative.d.ts +8 -0
  92. package/lib/typescript/module/src/NativeBreezSdkSparkReactNative.d.ts.map +1 -0
  93. package/package.json +189 -0
  94. package/react-native.config.js +12 -0
  95. package/scripts/postinstall.sh +14 -0
  96. package/src/NativeBreezSdkSparkReactNative.ts +10 -0
  97. package/src/generated/breez_sdk_common-ffi.ts +394 -0
  98. package/src/generated/breez_sdk_common.ts +5502 -0
  99. package/src/generated/breez_sdk_spark-ffi.ts +751 -0
  100. package/src/generated/breez_sdk_spark.ts +9179 -0
  101. package/src/generated/breez_sdk_spark_bindings-ffi.ts +185 -0
  102. package/src/generated/breez_sdk_spark_bindings.ts +103 -0
  103. package/src/index.tsx +42 -0
@@ -0,0 +1,65 @@
1
+ // This file was autogenerated by some hot garbage in the
2
+ // `uniffi-bindgen-react-native` crate. Trust me, you don't want to mess with
3
+ // it!
4
+ #pragma once
5
+ #include "UniffiCallInvoker.h"
6
+ #include <ReactCommon/CallInvoker.h>
7
+ #include <iostream>
8
+ #include <jsi/jsi.h>
9
+ #include <map>
10
+ #include <memory>
11
+
12
+ namespace react = facebook::react;
13
+ namespace jsi = facebook::jsi;
14
+
15
+ class NativeBreezSdkSparkBindings : public jsi::HostObject {
16
+ private:
17
+ // For calling back into JS from Rust.
18
+ std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker;
19
+
20
+ protected:
21
+ std::map<std::string, jsi::Value> props;
22
+ jsi::Value cpp_uniffi_internal_fn_func_ffi__string_to_byte_length(
23
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
24
+ size_t count);
25
+ jsi::Value cpp_uniffi_internal_fn_func_ffi__string_to_arraybuffer(
26
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
27
+ size_t count);
28
+ jsi::Value cpp_uniffi_internal_fn_func_ffi__arraybuffer_to_string(
29
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
30
+ size_t count);
31
+ jsi::Value cpp_ffi_breez_sdk_spark_bindings_uniffi_contract_version(
32
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args,
33
+ size_t count);
34
+
35
+ public:
36
+ NativeBreezSdkSparkBindings(
37
+ jsi::Runtime &rt,
38
+ std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker);
39
+ virtual ~NativeBreezSdkSparkBindings();
40
+
41
+ /**
42
+ * The entry point into the crate.
43
+ *
44
+ * React Native must call `NativeBreezSdkSparkBindings.registerModule(rt,
45
+ * callInvoker)` before using the Javascript interface.
46
+ */
47
+ static void registerModule(jsi::Runtime &rt,
48
+ std::shared_ptr<react::CallInvoker> callInvoker);
49
+
50
+ /**
51
+ * Some cleanup into the crate goes here.
52
+ *
53
+ * Current implementation is empty, however, this is not guaranteed to always
54
+ * be the case.
55
+ *
56
+ * Clients should call `NativeBreezSdkSparkBindings.unregisterModule(rt)`
57
+ * after final use where possible.
58
+ */
59
+ static void unregisterModule(jsi::Runtime &rt);
60
+
61
+ virtual jsi::Value get(jsi::Runtime &rt, const jsi::PropNameID &name);
62
+ virtual void set(jsi::Runtime &rt, const jsi::PropNameID &name,
63
+ const jsi::Value &value);
64
+ virtual std::vector<jsi::PropNameID> getPropertyNames(jsi::Runtime &rt);
65
+ };
@@ -0,0 +1,16 @@
1
+ // Generated by uniffi-bindgen-react-native
2
+ #ifdef __cplusplus
3
+ #import "breeztech-breez-sdk-spark-react-native.h"
4
+ #endif
5
+
6
+ #ifdef RCT_NEW_ARCH_ENABLED
7
+ #import "BreezSdkSparkReactNativeSpec.h"
8
+
9
+ @interface BreezSdkSparkReactNative : NSObject <NativeBreezSdkSparkReactNativeSpec>
10
+ #else
11
+ #import <React/RCTBridgeModule.h>
12
+
13
+ @interface BreezSdkSparkReactNative : NSObject <RCTBridgeModule>
14
+ #endif
15
+
16
+ @end
@@ -0,0 +1,66 @@
1
+ // Generated by uniffi-bindgen-react-native
2
+ #import "BreezSdkSparkReactNative.h"
3
+
4
+ namespace uniffi_generated {
5
+ using namespace facebook::react;
6
+ /**
7
+ * ObjC++ class for module 'NativeBreezSdkSparkReactNative'
8
+ */
9
+ class JSI_EXPORT NativeBreezSdkSparkReactNativeSpecJSI : public ObjCTurboModule {
10
+ public:
11
+ NativeBreezSdkSparkReactNativeSpecJSI(const ObjCTurboModule::InitParams &params);
12
+ std::shared_ptr<CallInvoker> callInvoker;
13
+ };
14
+
15
+ static facebook::jsi::Value __hostFunction_BreezSdkSparkReactNative_installRustCrate(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
16
+ auto& tm = static_cast<NativeBreezSdkSparkReactNativeSpecJSI&>(turboModule);
17
+ auto jsInvoker = tm.callInvoker;
18
+ uint8_t result = breeztech_breezsdksparkreactnative::installRustCrate(rt, jsInvoker);
19
+ return facebook::jsi::Value(rt, result);
20
+ }
21
+ static facebook::jsi::Value __hostFunction_BreezSdkSparkReactNative_cleanupRustCrate(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
22
+ uint8_t result = breeztech_breezsdksparkreactnative::cleanupRustCrate(rt);
23
+ return facebook::jsi::Value(rt, result);
24
+ }
25
+
26
+ NativeBreezSdkSparkReactNativeSpecJSI::NativeBreezSdkSparkReactNativeSpecJSI(const ObjCTurboModule::InitParams &params)
27
+ : ObjCTurboModule(params), callInvoker(params.jsInvoker) {
28
+ this->methodMap_["installRustCrate"] = MethodMetadata {1, __hostFunction_BreezSdkSparkReactNative_installRustCrate};
29
+ this->methodMap_["cleanupRustCrate"] = MethodMetadata {1, __hostFunction_BreezSdkSparkReactNative_cleanupRustCrate};
30
+ }
31
+ } // namespace uniffi_generated
32
+
33
+ @implementation BreezSdkSparkReactNative
34
+ RCT_EXPORT_MODULE()
35
+
36
+ // Don't compile this code when we build for the old architecture.
37
+ #ifdef RCT_NEW_ARCH_ENABLED
38
+
39
+ // Automated testing checks breeztech_breezsdksparkreactnative
40
+ // by comparing the whole line here.
41
+ /*
42
+ - (NSNumber *)multiply:(double)a b:(double)b {
43
+ NSNumber *result = @(breeztech_breezsdksparkreactnative::multiply(a, b));
44
+ }
45
+ */
46
+
47
+ - (NSNumber *)installRustCrate {
48
+ @throw [NSException exceptionWithName:@"UnreachableException"
49
+ reason:@"This method should never be called."
50
+ userInfo:nil];
51
+ }
52
+
53
+ - (NSNumber *)cleanupRustCrate {
54
+ @throw [NSException exceptionWithName:@"UnreachableException"
55
+ reason:@"This method should never be called."
56
+ userInfo:nil];
57
+ }
58
+
59
+ - (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
60
+ (const facebook::react::ObjCTurboModule::InitParams &)params
61
+ {
62
+ return std::make_shared<uniffi_generated::NativeBreezSdkSparkReactNativeSpecJSI>(params);
63
+ }
64
+ #endif
65
+
66
+ @end
@@ -0,0 +1,46 @@
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: GenerateModuleObjCpp
8
+ *
9
+ * We create an umbrella header (and corresponding implementation) here since
10
+ * Cxx compilation in BUCK has a limitation: source-code producing genrule()s
11
+ * must have a single output. More files => more genrule()s => slower builds.
12
+ */
13
+
14
+ #import "BreezSdkSparkReactNativeSpec.h"
15
+
16
+
17
+ @implementation NativeBreezSdkSparkReactNativeSpecBase
18
+
19
+
20
+ - (void)setEventEmitterCallback:(EventEmitterCallbackWrapper *)eventEmitterCallbackWrapper
21
+ {
22
+ _eventEmitterCallback = std::move(eventEmitterCallbackWrapper->_eventEmitterCallback);
23
+ }
24
+ @end
25
+
26
+
27
+ namespace facebook::react {
28
+
29
+ static facebook::jsi::Value __hostFunction_NativeBreezSdkSparkReactNativeSpecJSI_installRustCrate(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
30
+ return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, BooleanKind, "installRustCrate", @selector(installRustCrate), args, count);
31
+ }
32
+
33
+ static facebook::jsi::Value __hostFunction_NativeBreezSdkSparkReactNativeSpecJSI_cleanupRustCrate(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
34
+ return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, BooleanKind, "cleanupRustCrate", @selector(cleanupRustCrate), args, count);
35
+ }
36
+
37
+ NativeBreezSdkSparkReactNativeSpecJSI::NativeBreezSdkSparkReactNativeSpecJSI(const ObjCTurboModule::InitParams &params)
38
+ : ObjCTurboModule(params) {
39
+
40
+ methodMap_["installRustCrate"] = MethodMetadata {0, __hostFunction_NativeBreezSdkSparkReactNativeSpecJSI_installRustCrate};
41
+
42
+
43
+ methodMap_["cleanupRustCrate"] = MethodMetadata {0, __hostFunction_NativeBreezSdkSparkReactNativeSpecJSI_cleanupRustCrate};
44
+
45
+ }
46
+ } // namespace facebook::react
@@ -0,0 +1,63 @@
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: GenerateModuleObjCpp
8
+ *
9
+ * We create an umbrella header (and corresponding implementation) here since
10
+ * Cxx compilation in BUCK has a limitation: source-code producing genrule()s
11
+ * must have a single output. More files => more genrule()s => slower builds.
12
+ */
13
+
14
+ #ifndef __cplusplus
15
+ #error This file must be compiled as Obj-C++. If you are importing it, you must change your file extension to .mm.
16
+ #endif
17
+
18
+ // Avoid multiple includes of BreezSdkSparkReactNativeSpec symbols
19
+ #ifndef BreezSdkSparkReactNativeSpec_H
20
+ #define BreezSdkSparkReactNativeSpec_H
21
+
22
+ #import <Foundation/Foundation.h>
23
+ #import <RCTRequired/RCTRequired.h>
24
+ #import <RCTTypeSafety/RCTConvertHelpers.h>
25
+ #import <RCTTypeSafety/RCTTypedModuleConstants.h>
26
+ #import <React/RCTBridgeModule.h>
27
+ #import <React/RCTCxxConvert.h>
28
+ #import <React/RCTManagedPointer.h>
29
+ #import <ReactCommon/RCTTurboModule.h>
30
+ #import <optional>
31
+ #import <vector>
32
+
33
+
34
+ NS_ASSUME_NONNULL_BEGIN
35
+
36
+ @protocol NativeBreezSdkSparkReactNativeSpec <RCTBridgeModule, RCTTurboModule>
37
+
38
+ - (NSNumber *)installRustCrate;
39
+ - (NSNumber *)cleanupRustCrate;
40
+
41
+ @end
42
+
43
+ @interface NativeBreezSdkSparkReactNativeSpecBase : NSObject {
44
+ @protected
45
+ facebook::react::EventEmitterCallback _eventEmitterCallback;
46
+ }
47
+ - (void)setEventEmitterCallback:(EventEmitterCallbackWrapper *)eventEmitterCallbackWrapper;
48
+
49
+
50
+ @end
51
+
52
+ namespace facebook::react {
53
+ /**
54
+ * ObjC++ class for module 'NativeBreezSdkSparkReactNative'
55
+ */
56
+ class JSI_EXPORT NativeBreezSdkSparkReactNativeSpecJSI : public ObjCTurboModule {
57
+ public:
58
+ NativeBreezSdkSparkReactNativeSpecJSI(const ObjCTurboModule::InitParams &params);
59
+ };
60
+ } // namespace facebook::react
61
+
62
+ NS_ASSUME_NONNULL_END
63
+ #endif // BreezSdkSparkReactNativeSpec_H
@@ -0,0 +1,32 @@
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: GenerateModuleCpp.js
8
+ */
9
+
10
+ #include "BreezSdkSparkReactNativeSpecJSI.h"
11
+
12
+ namespace facebook::react {
13
+
14
+ static jsi::Value __hostFunction_NativeBreezSdkSparkReactNativeCxxSpecJSI_installRustCrate(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
15
+ return static_cast<NativeBreezSdkSparkReactNativeCxxSpecJSI *>(&turboModule)->installRustCrate(
16
+ rt
17
+ );
18
+ }
19
+ static jsi::Value __hostFunction_NativeBreezSdkSparkReactNativeCxxSpecJSI_cleanupRustCrate(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
20
+ return static_cast<NativeBreezSdkSparkReactNativeCxxSpecJSI *>(&turboModule)->cleanupRustCrate(
21
+ rt
22
+ );
23
+ }
24
+
25
+ NativeBreezSdkSparkReactNativeCxxSpecJSI::NativeBreezSdkSparkReactNativeCxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker)
26
+ : TurboModule("BreezSdkSparkReactNative", jsInvoker) {
27
+ methodMap_["installRustCrate"] = MethodMetadata {0, __hostFunction_NativeBreezSdkSparkReactNativeCxxSpecJSI_installRustCrate};
28
+ methodMap_["cleanupRustCrate"] = MethodMetadata {0, __hostFunction_NativeBreezSdkSparkReactNativeCxxSpecJSI_cleanupRustCrate};
29
+ }
30
+
31
+
32
+ } // namespace facebook::react
@@ -0,0 +1,80 @@
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
+ class JSI_EXPORT NativeBreezSdkSparkReactNativeCxxSpecJSI : public TurboModule {
19
+ protected:
20
+ NativeBreezSdkSparkReactNativeCxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker);
21
+
22
+ public:
23
+ virtual bool installRustCrate(jsi::Runtime &rt) = 0;
24
+ virtual bool cleanupRustCrate(jsi::Runtime &rt) = 0;
25
+
26
+ };
27
+
28
+ template <typename T>
29
+ class JSI_EXPORT NativeBreezSdkSparkReactNativeCxxSpec : public TurboModule {
30
+ public:
31
+ jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override {
32
+ return delegate_.create(rt, propName);
33
+ }
34
+
35
+ std::vector<jsi::PropNameID> getPropertyNames(jsi::Runtime& runtime) override {
36
+ return delegate_.getPropertyNames(runtime);
37
+ }
38
+
39
+ static constexpr std::string_view kModuleName = "BreezSdkSparkReactNative";
40
+
41
+ protected:
42
+ NativeBreezSdkSparkReactNativeCxxSpec(std::shared_ptr<CallInvoker> jsInvoker)
43
+ : TurboModule(std::string{NativeBreezSdkSparkReactNativeCxxSpec::kModuleName}, jsInvoker),
44
+ delegate_(reinterpret_cast<T*>(this), jsInvoker) {}
45
+
46
+
47
+ private:
48
+ class Delegate : public NativeBreezSdkSparkReactNativeCxxSpecJSI {
49
+ public:
50
+ Delegate(T *instance, std::shared_ptr<CallInvoker> jsInvoker) :
51
+ NativeBreezSdkSparkReactNativeCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {
52
+
53
+ }
54
+
55
+ bool installRustCrate(jsi::Runtime &rt) override {
56
+ static_assert(
57
+ bridging::getParameterCount(&T::installRustCrate) == 1,
58
+ "Expected installRustCrate(...) to have 1 parameters");
59
+
60
+ return bridging::callFromJs<bool>(
61
+ rt, &T::installRustCrate, jsInvoker_, instance_);
62
+ }
63
+ bool cleanupRustCrate(jsi::Runtime &rt) override {
64
+ static_assert(
65
+ bridging::getParameterCount(&T::cleanupRustCrate) == 1,
66
+ "Expected cleanupRustCrate(...) to have 1 parameters");
67
+
68
+ return bridging::callFromJs<bool>(
69
+ rt, &T::cleanupRustCrate, jsInvoker_, instance_);
70
+ }
71
+
72
+ private:
73
+ friend class NativeBreezSdkSparkReactNativeCxxSpec;
74
+ T *instance_;
75
+ };
76
+
77
+ Delegate delegate_;
78
+ };
79
+
80
+ } // namespace facebook::react
@@ -0,0 +1,22 @@
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: GenerateComponentDescriptorCpp.js
9
+ */
10
+
11
+ #include <react/renderer/components/BreezSdkSparkReactNativeSpec/ComponentDescriptors.h>
12
+ #include <react/renderer/core/ConcreteComponentDescriptor.h>
13
+ #include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
14
+
15
+ namespace facebook::react {
16
+
17
+ void BreezSdkSparkReactNativeSpec_registerComponentDescriptorsFromCodegen(
18
+ std::shared_ptr<const ComponentDescriptorProviderRegistry> registry) {
19
+
20
+ }
21
+
22
+ } // namespace facebook::react
@@ -0,0 +1,24 @@
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: GenerateComponentDescriptorH.js
9
+ */
10
+
11
+ #pragma once
12
+
13
+ #include <react/renderer/components/BreezSdkSparkReactNativeSpec/ShadowNodes.h>
14
+ #include <react/renderer/core/ConcreteComponentDescriptor.h>
15
+ #include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
16
+
17
+ namespace facebook::react {
18
+
19
+
20
+
21
+ void BreezSdkSparkReactNativeSpec_registerComponentDescriptorsFromCodegen(
22
+ std::shared_ptr<const ComponentDescriptorProviderRegistry> registry);
23
+
24
+ } // 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: GenerateEventEmitterCpp.js
9
+ */
10
+
11
+ #include <react/renderer/components/BreezSdkSparkReactNativeSpec/EventEmitters.h>
12
+
13
+
14
+ namespace facebook::react {
15
+
16
+ } // 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: GenerateEventEmitterH.js
9
+ */
10
+ #pragma once
11
+
12
+ #include <react/renderer/components/view/ViewEventEmitter.h>
13
+
14
+
15
+ namespace facebook::react {
16
+
17
+ } // namespace facebook::react
@@ -0,0 +1,19 @@
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: GeneratePropsCpp.js
9
+ */
10
+
11
+ #include <react/renderer/components/BreezSdkSparkReactNativeSpec/Props.h>
12
+ #include <react/renderer/core/PropsParserContext.h>
13
+ #include <react/renderer/core/propsConversions.h>
14
+
15
+ namespace facebook::react {
16
+
17
+
18
+
19
+ } // namespace facebook::react
@@ -0,0 +1,18 @@
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: GeneratePropsH.js
9
+ */
10
+ #pragma once
11
+
12
+
13
+
14
+ namespace facebook::react {
15
+
16
+
17
+
18
+ } // namespace facebook::react
@@ -0,0 +1,18 @@
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: GenerateComponentHObjCpp.js
8
+ */
9
+
10
+ #import <Foundation/Foundation.h>
11
+ #import <React/RCTDefines.h>
12
+ #import <React/RCTLog.h>
13
+
14
+ NS_ASSUME_NONNULL_BEGIN
15
+
16
+
17
+
18
+ NS_ASSUME_NONNULL_END
@@ -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 <react/renderer/components/BreezSdkSparkReactNativeSpec/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 <react/renderer/components/BreezSdkSparkReactNativeSpec/EventEmitters.h>
14
+ #include <react/renderer/components/BreezSdkSparkReactNativeSpec/Props.h>
15
+ #include <react/renderer/components/BreezSdkSparkReactNativeSpec/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 <react/renderer/components/BreezSdkSparkReactNativeSpec/States.h>
11
+
12
+ namespace facebook::react {
13
+
14
+
15
+
16
+ } // namespace facebook::react
@@ -0,0 +1,19 @@
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
+ #ifdef ANDROID
12
+ #include <folly/dynamic.h>
13
+ #endif
14
+
15
+ namespace facebook::react {
16
+
17
+
18
+
19
+ } // namespace facebook::react
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _reactNative = require("react-native");
8
+ // Generated by uniffi-bindgen-react-native
9
+ var _default = exports.default = _reactNative.TurboModuleRegistry.getEnforcing('BreezSdkSparkReactNative');
10
+ //# sourceMappingURL=NativeBreezSdkSparkReactNative.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","_default","exports","default","TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../src","sources":["NativeBreezSdkSparkReactNative.ts"],"mappings":";;;;;;AAEA,IAAAA,YAAA,GAAAC,OAAA;AAFA;AAAA,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GASeC,gCAAmB,CAACC,YAAY,CAAO,0BAA0B,CAAC","ignoreList":[]}
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ // This file was autogenerated by some hot garbage in the `uniffi-bindgen-react-native` crate.
8
+ // Trust me, you don't want to mess with it!
9
+
10
+ // Casting globalThis to any allows us to look for `NativeBreezSdkCommon`
11
+ // if it was added via JSI.
12
+ //
13
+ // We use a getter here rather than simply `globalThis.NativeBreezSdkCommon` so that
14
+ // if/when the startup sequence isn't just so, an empty value isn't inadvertantly cached.
15
+ const getter = () => globalThis.NativeBreezSdkCommon;
16
+ var _default = exports.default = getter; // Structs and function types for calling back into Typescript from Rust.
17
+ // UniffiRustFutureContinuationCallback is generated as part of the component interface's
18
+ // ffi_definitions. However, we need it in the runtime.
19
+ // We could:
20
+ // (a) do some complicated template logic to ensure the declaration is not generated here (possible)
21
+ // (b) import the generated declaration into the runtime (m a y b e) or…
22
+ // (c) generate the declaration anyway, and use a different declaration in the runtime.
23
+ //
24
+ // We chose (c) here as the simplest. In addition, we perform a compile time check that
25
+ // the two versions of `UniffiRustFutureContinuationCallback` are structurally equivalent.
26
+ //
27
+ // If you see the error:
28
+ // ```
29
+ // Type 'true' is not assignable to type 'false'.(2322)
30
+ // ```
31
+ // Then a new version of uniffi has changed the signature of the callback. Most likely, code in
32
+ // `typescript/src/async-rust-call.ts` will need to be changed.
33
+ //
34
+ // If you see the error:
35
+ // ```
36
+ // Cannot find name 'UniffiRustFutureContinuationCallback'. Did you mean 'RuntimeUniffiRustFutureContinuationCallback'?(2552)
37
+ // ```
38
+ // then you may not be using callbacks or promises, and uniffi is now not generating Futures and callbacks.
39
+ // You should not generate this if that is the case.
40
+ //
41
+ // ('You' being the bindings generator maintainer).
42
+ const isRustFutureContinuationCallbackTypeCompatible = true;
43
+ const isUniffiForeignFutureTypeCompatible = true;
44
+ //# sourceMappingURL=breez_sdk_common-ffi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["getter","globalThis","NativeBreezSdkCommon","_default","exports","default","isRustFutureContinuationCallbackTypeCompatible","isUniffiForeignFutureTypeCompatible"],"sourceRoot":"../../../src","sources":["generated/breez_sdk_common-ffi.ts"],"mappings":";;;;;;AAAA;AACA;;AA+MA;AACA;AACA;AACA;AACA;AACA,MAAMA,MAAmC,GAAGA,CAAA,KACzCC,UAAU,CAASC,oBAAoB;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAC5BL,MAAM,EAErB;AAgJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMM,8CAGL,GAAG,IAAI;AACR,MAAMC,mCAGL,GAAG,IAAI","ignoreList":[]}