cojson-core-rn 0.19.10
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.
- package/CojsonCoreRn.podspec +44 -0
- package/CojsonCoreRnFramework.xcframework/Info.plist +43 -0
- package/CojsonCoreRnFramework.xcframework/ios-arm64/libcojson_core_rn.a +0 -0
- package/CojsonCoreRnFramework.xcframework/ios-arm64-simulator/libcojson_core_rn.a +0 -0
- package/LICENSE.txt +19 -0
- package/README.md +50 -0
- package/android/CMakeLists.txt +76 -0
- package/android/build.gradle +144 -0
- package/android/cpp-adapter.cpp +43 -0
- package/android/gradle.properties +5 -0
- package/android/src/main/AndroidManifest.xml +5 -0
- package/android/src/main/java/com/cojsoncorern/CojsonCoreRnModule.kt +43 -0
- package/android/src/main/java/com/cojsoncorern/CojsonCoreRnPackage.kt +34 -0
- package/android/src/main/jniLibs/arm64-v8a/libcojson_core_rn.a +0 -0
- package/android/src/main/jniLibs/armeabi-v7a/libcojson_core_rn.a +0 -0
- package/android/src/main/jniLibs/x86/libcojson_core_rn.a +0 -0
- package/android/src/main/jniLibs/x86_64/libcojson_core_rn.a +0 -0
- package/cpp/cojson-core-rn.cpp +16 -0
- package/cpp/cojson-core-rn.h +15 -0
- package/cpp/generated/cojson_core_rn.cpp +3523 -0
- package/cpp/generated/cojson_core_rn.hpp +128 -0
- package/ios/CojsonCoreRn.h +16 -0
- package/ios/CojsonCoreRn.mm +66 -0
- package/lib/module/NativeCojsonCoreRn.js +7 -0
- package/lib/module/NativeCojsonCoreRn.js.map +1 -0
- package/lib/module/generated/cojson_core_rn-ffi.js +43 -0
- package/lib/module/generated/cojson_core_rn-ffi.js.map +1 -0
- package/lib/module/generated/cojson_core_rn.js +1311 -0
- package/lib/module/generated/cojson_core_rn.js.map +1 -0
- package/lib/module/index.js +43 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/NativeCojsonCoreRn.d.ts +8 -0
- package/lib/typescript/src/NativeCojsonCoreRn.d.ts.map +1 -0
- package/lib/typescript/src/generated/cojson_core_rn-ffi.d.ts +158 -0
- package/lib/typescript/src/generated/cojson_core_rn-ffi.d.ts.map +1 -0
- package/lib/typescript/src/generated/cojson_core_rn.d.ts +1299 -0
- package/lib/typescript/src/generated/cojson_core_rn.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +8 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/package.json +167 -0
- package/src/NativeCojsonCoreRn.ts +10 -0
- package/src/generated/cojson_core_rn-ffi.ts +429 -0
- package/src/generated/cojson_core_rn.ts +2342 -0
- package/src/index.tsx +41 -0
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
// This file was autogenerated by some hot garbage in the `uniffi-bindgen-react-native` crate.
|
|
2
|
+
// Trust me, you don't want to mess with it!
|
|
3
|
+
#pragma once
|
|
4
|
+
#include <jsi/jsi.h>
|
|
5
|
+
#include <iostream>
|
|
6
|
+
#include <map>
|
|
7
|
+
#include <memory>
|
|
8
|
+
#include <ReactCommon/CallInvoker.h>
|
|
9
|
+
#include "UniffiCallInvoker.h"
|
|
10
|
+
|
|
11
|
+
namespace react = facebook::react;
|
|
12
|
+
namespace jsi = facebook::jsi;
|
|
13
|
+
|
|
14
|
+
class NativeCojsonCoreRn : public jsi::HostObject {
|
|
15
|
+
private:
|
|
16
|
+
// For calling back into JS from Rust.
|
|
17
|
+
std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker;
|
|
18
|
+
|
|
19
|
+
protected:
|
|
20
|
+
std::map<std::string,jsi::Value> props;
|
|
21
|
+
jsi::Value cpp_uniffi_internal_fn_func_ffi__string_to_byte_length(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
22
|
+
jsi::Value cpp_uniffi_internal_fn_func_ffi__string_to_arraybuffer(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
23
|
+
jsi::Value cpp_uniffi_internal_fn_func_ffi__arraybuffer_to_string(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
24
|
+
jsi::Value cpp_uniffi_cojson_core_rn_fn_clone_blake3hasher(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
25
|
+
jsi::Value cpp_uniffi_cojson_core_rn_fn_free_blake3hasher(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
26
|
+
jsi::Value cpp_uniffi_cojson_core_rn_fn_constructor_blake3hasher_new(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
27
|
+
jsi::Value cpp_uniffi_cojson_core_rn_fn_method_blake3hasher_clone_hasher(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
28
|
+
jsi::Value cpp_uniffi_cojson_core_rn_fn_method_blake3hasher_finalize(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
29
|
+
jsi::Value cpp_uniffi_cojson_core_rn_fn_method_blake3hasher_update(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
30
|
+
jsi::Value cpp_uniffi_cojson_core_rn_fn_clone_sessionlog(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
31
|
+
jsi::Value cpp_uniffi_cojson_core_rn_fn_free_sessionlog(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
32
|
+
jsi::Value cpp_uniffi_cojson_core_rn_fn_constructor_sessionlog_new(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
33
|
+
jsi::Value cpp_uniffi_cojson_core_rn_fn_method_sessionlog_add_new_private_transaction(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
34
|
+
jsi::Value cpp_uniffi_cojson_core_rn_fn_method_sessionlog_add_new_trusting_transaction(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
35
|
+
jsi::Value cpp_uniffi_cojson_core_rn_fn_method_sessionlog_clone_session_log(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
36
|
+
jsi::Value cpp_uniffi_cojson_core_rn_fn_method_sessionlog_decrypt_next_transaction_changes_json(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
37
|
+
jsi::Value cpp_uniffi_cojson_core_rn_fn_method_sessionlog_decrypt_next_transaction_meta_json(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
38
|
+
jsi::Value cpp_uniffi_cojson_core_rn_fn_method_sessionlog_try_add(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
39
|
+
jsi::Value cpp_uniffi_cojson_core_rn_fn_func_blake3_hash_once(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
40
|
+
jsi::Value cpp_uniffi_cojson_core_rn_fn_func_blake3_hash_once_with_context(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
41
|
+
jsi::Value cpp_uniffi_cojson_core_rn_fn_func_decrypt(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
42
|
+
jsi::Value cpp_uniffi_cojson_core_rn_fn_func_decrypt_xsalsa20(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
43
|
+
jsi::Value cpp_uniffi_cojson_core_rn_fn_func_ed25519_sign(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
44
|
+
jsi::Value cpp_uniffi_cojson_core_rn_fn_func_ed25519_signature_from_bytes(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
45
|
+
jsi::Value cpp_uniffi_cojson_core_rn_fn_func_ed25519_signing_key_from_bytes(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
46
|
+
jsi::Value cpp_uniffi_cojson_core_rn_fn_func_ed25519_signing_key_sign(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
47
|
+
jsi::Value cpp_uniffi_cojson_core_rn_fn_func_ed25519_signing_key_to_public(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
48
|
+
jsi::Value cpp_uniffi_cojson_core_rn_fn_func_ed25519_verify(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
49
|
+
jsi::Value cpp_uniffi_cojson_core_rn_fn_func_ed25519_verifying_key(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
50
|
+
jsi::Value cpp_uniffi_cojson_core_rn_fn_func_ed25519_verifying_key_from_bytes(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
51
|
+
jsi::Value cpp_uniffi_cojson_core_rn_fn_func_encrypt(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
52
|
+
jsi::Value cpp_uniffi_cojson_core_rn_fn_func_encrypt_xsalsa20(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
53
|
+
jsi::Value cpp_uniffi_cojson_core_rn_fn_func_generate_nonce(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
54
|
+
jsi::Value cpp_uniffi_cojson_core_rn_fn_func_get_sealer_id(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
55
|
+
jsi::Value cpp_uniffi_cojson_core_rn_fn_func_get_signer_id(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
56
|
+
jsi::Value cpp_uniffi_cojson_core_rn_fn_func_new_ed25519_signing_key(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
57
|
+
jsi::Value cpp_uniffi_cojson_core_rn_fn_func_new_x25519_private_key(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
58
|
+
jsi::Value cpp_uniffi_cojson_core_rn_fn_func_seal(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
59
|
+
jsi::Value cpp_uniffi_cojson_core_rn_fn_func_sign(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
60
|
+
jsi::Value cpp_uniffi_cojson_core_rn_fn_func_unseal(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
61
|
+
jsi::Value cpp_uniffi_cojson_core_rn_fn_func_verify(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
62
|
+
jsi::Value cpp_uniffi_cojson_core_rn_fn_func_x25519_diffie_hellman(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
63
|
+
jsi::Value cpp_uniffi_cojson_core_rn_fn_func_x25519_public_key(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
64
|
+
jsi::Value cpp_uniffi_cojson_core_rn_checksum_func_blake3_hash_once(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
65
|
+
jsi::Value cpp_uniffi_cojson_core_rn_checksum_func_blake3_hash_once_with_context(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
66
|
+
jsi::Value cpp_uniffi_cojson_core_rn_checksum_func_decrypt(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
67
|
+
jsi::Value cpp_uniffi_cojson_core_rn_checksum_func_decrypt_xsalsa20(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
68
|
+
jsi::Value cpp_uniffi_cojson_core_rn_checksum_func_ed25519_sign(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
69
|
+
jsi::Value cpp_uniffi_cojson_core_rn_checksum_func_ed25519_signature_from_bytes(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
70
|
+
jsi::Value cpp_uniffi_cojson_core_rn_checksum_func_ed25519_signing_key_from_bytes(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
71
|
+
jsi::Value cpp_uniffi_cojson_core_rn_checksum_func_ed25519_signing_key_sign(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
72
|
+
jsi::Value cpp_uniffi_cojson_core_rn_checksum_func_ed25519_signing_key_to_public(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
73
|
+
jsi::Value cpp_uniffi_cojson_core_rn_checksum_func_ed25519_verify(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
74
|
+
jsi::Value cpp_uniffi_cojson_core_rn_checksum_func_ed25519_verifying_key(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
75
|
+
jsi::Value cpp_uniffi_cojson_core_rn_checksum_func_ed25519_verifying_key_from_bytes(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
76
|
+
jsi::Value cpp_uniffi_cojson_core_rn_checksum_func_encrypt(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
77
|
+
jsi::Value cpp_uniffi_cojson_core_rn_checksum_func_encrypt_xsalsa20(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
78
|
+
jsi::Value cpp_uniffi_cojson_core_rn_checksum_func_generate_nonce(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
79
|
+
jsi::Value cpp_uniffi_cojson_core_rn_checksum_func_get_sealer_id(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
80
|
+
jsi::Value cpp_uniffi_cojson_core_rn_checksum_func_get_signer_id(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
81
|
+
jsi::Value cpp_uniffi_cojson_core_rn_checksum_func_new_ed25519_signing_key(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
82
|
+
jsi::Value cpp_uniffi_cojson_core_rn_checksum_func_new_x25519_private_key(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
83
|
+
jsi::Value cpp_uniffi_cojson_core_rn_checksum_func_seal(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
84
|
+
jsi::Value cpp_uniffi_cojson_core_rn_checksum_func_sign(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
85
|
+
jsi::Value cpp_uniffi_cojson_core_rn_checksum_func_unseal(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
86
|
+
jsi::Value cpp_uniffi_cojson_core_rn_checksum_func_verify(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
87
|
+
jsi::Value cpp_uniffi_cojson_core_rn_checksum_func_x25519_diffie_hellman(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
88
|
+
jsi::Value cpp_uniffi_cojson_core_rn_checksum_func_x25519_public_key(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
89
|
+
jsi::Value cpp_uniffi_cojson_core_rn_checksum_method_blake3hasher_clone_hasher(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
90
|
+
jsi::Value cpp_uniffi_cojson_core_rn_checksum_method_blake3hasher_finalize(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
91
|
+
jsi::Value cpp_uniffi_cojson_core_rn_checksum_method_blake3hasher_update(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
92
|
+
jsi::Value cpp_uniffi_cojson_core_rn_checksum_method_sessionlog_add_new_private_transaction(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
93
|
+
jsi::Value cpp_uniffi_cojson_core_rn_checksum_method_sessionlog_add_new_trusting_transaction(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
94
|
+
jsi::Value cpp_uniffi_cojson_core_rn_checksum_method_sessionlog_clone_session_log(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
95
|
+
jsi::Value cpp_uniffi_cojson_core_rn_checksum_method_sessionlog_decrypt_next_transaction_changes_json(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
96
|
+
jsi::Value cpp_uniffi_cojson_core_rn_checksum_method_sessionlog_decrypt_next_transaction_meta_json(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
97
|
+
jsi::Value cpp_uniffi_cojson_core_rn_checksum_method_sessionlog_try_add(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
98
|
+
jsi::Value cpp_uniffi_cojson_core_rn_checksum_constructor_blake3hasher_new(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
99
|
+
jsi::Value cpp_uniffi_cojson_core_rn_checksum_constructor_sessionlog_new(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
100
|
+
jsi::Value cpp_ffi_cojson_core_rn_uniffi_contract_version(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
101
|
+
jsi::Value cpp_uniffi_internal_fn_method_blake3hasher_ffi__bless_pointer(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
102
|
+
jsi::Value cpp_uniffi_internal_fn_method_sessionlog_ffi__bless_pointer(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count);
|
|
103
|
+
|
|
104
|
+
public:
|
|
105
|
+
NativeCojsonCoreRn(jsi::Runtime &rt, std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker);
|
|
106
|
+
virtual ~NativeCojsonCoreRn();
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* The entry point into the crate.
|
|
110
|
+
*
|
|
111
|
+
* React Native must call `NativeCojsonCoreRn.registerModule(rt, callInvoker)` before using
|
|
112
|
+
* the Javascript interface.
|
|
113
|
+
*/
|
|
114
|
+
static void registerModule(jsi::Runtime &rt, std::shared_ptr<react::CallInvoker> callInvoker);
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Some cleanup into the crate goes here.
|
|
118
|
+
*
|
|
119
|
+
* Current implementation is empty, however, this is not guaranteed to always be the case.
|
|
120
|
+
*
|
|
121
|
+
* Clients should call `NativeCojsonCoreRn.unregisterModule(rt)` after final use where possible.
|
|
122
|
+
*/
|
|
123
|
+
static void unregisterModule(jsi::Runtime &rt);
|
|
124
|
+
|
|
125
|
+
virtual jsi::Value get(jsi::Runtime& rt, const jsi::PropNameID& name);
|
|
126
|
+
virtual void set(jsi::Runtime& rt,const jsi::PropNameID& name,const jsi::Value& value);
|
|
127
|
+
virtual std::vector<jsi::PropNameID> getPropertyNames(jsi::Runtime& rt);
|
|
128
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Generated by uniffi-bindgen-react-native
|
|
2
|
+
#ifdef __cplusplus
|
|
3
|
+
#import "cojson-core-rn.h"
|
|
4
|
+
#endif
|
|
5
|
+
|
|
6
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
7
|
+
#import "CojsonCoreRnSpec.h"
|
|
8
|
+
|
|
9
|
+
@interface CojsonCoreRn : NSObject <NativeCojsonCoreRnSpec>
|
|
10
|
+
#else
|
|
11
|
+
#import <React/RCTBridgeModule.h>
|
|
12
|
+
|
|
13
|
+
@interface CojsonCoreRn : NSObject <RCTBridgeModule>
|
|
14
|
+
#endif
|
|
15
|
+
|
|
16
|
+
@end
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
// Generated by uniffi-bindgen-react-native
|
|
2
|
+
#import "CojsonCoreRn.h"
|
|
3
|
+
|
|
4
|
+
namespace uniffi_generated {
|
|
5
|
+
using namespace facebook::react;
|
|
6
|
+
/**
|
|
7
|
+
* ObjC++ class for module 'NativeCojsonCoreRn'
|
|
8
|
+
*/
|
|
9
|
+
class JSI_EXPORT NativeCojsonCoreRnSpecJSI : public ObjCTurboModule {
|
|
10
|
+
public:
|
|
11
|
+
NativeCojsonCoreRnSpecJSI(const ObjCTurboModule::InitParams ¶ms);
|
|
12
|
+
std::shared_ptr<CallInvoker> callInvoker;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
static facebook::jsi::Value __hostFunction_CojsonCoreRn_installRustCrate(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
16
|
+
auto& tm = static_cast<NativeCojsonCoreRnSpecJSI&>(turboModule);
|
|
17
|
+
auto jsInvoker = tm.callInvoker;
|
|
18
|
+
uint8_t result = cojsoncorern::installRustCrate(rt, jsInvoker);
|
|
19
|
+
return facebook::jsi::Value(rt, result);
|
|
20
|
+
}
|
|
21
|
+
static facebook::jsi::Value __hostFunction_CojsonCoreRn_cleanupRustCrate(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
22
|
+
uint8_t result = cojsoncorern::cleanupRustCrate(rt);
|
|
23
|
+
return facebook::jsi::Value(rt, result);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
NativeCojsonCoreRnSpecJSI::NativeCojsonCoreRnSpecJSI(const ObjCTurboModule::InitParams ¶ms)
|
|
27
|
+
: ObjCTurboModule(params), callInvoker(params.jsInvoker) {
|
|
28
|
+
this->methodMap_["installRustCrate"] = MethodMetadata {1, __hostFunction_CojsonCoreRn_installRustCrate};
|
|
29
|
+
this->methodMap_["cleanupRustCrate"] = MethodMetadata {1, __hostFunction_CojsonCoreRn_cleanupRustCrate};
|
|
30
|
+
}
|
|
31
|
+
} // namespace uniffi_generated
|
|
32
|
+
|
|
33
|
+
@implementation CojsonCoreRn
|
|
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 cojsoncorern
|
|
40
|
+
// by comparing the whole line here.
|
|
41
|
+
/*
|
|
42
|
+
- (NSNumber *)multiply:(double)a b:(double)b {
|
|
43
|
+
NSNumber *result = @(cojsoncorern::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::NativeCojsonCoreRnSpecJSI>(params);
|
|
63
|
+
}
|
|
64
|
+
#endif
|
|
65
|
+
|
|
66
|
+
@end
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../src","sources":["NativeCojsonCoreRn.ts"],"mappings":";;AAAA;;AAEA,SAASA,mBAAmB,QAAQ,cAAc;AAOlD,eAAeA,mBAAmB,CAACC,YAAY,CAAO,cAAc,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// This file was autogenerated by some hot garbage in the `uniffi-bindgen-react-native` crate.
|
|
4
|
+
// Trust me, you don't want to mess with it!
|
|
5
|
+
|
|
6
|
+
// Casting globalThis to any allows us to look for `NativeCojsonCoreRn`
|
|
7
|
+
// if it was added via JSI.
|
|
8
|
+
//
|
|
9
|
+
// We use a getter here rather than simply `globalThis.NativeCojsonCoreRn` so that
|
|
10
|
+
// if/when the startup sequence isn't just so, an empty value isn't inadvertantly cached.
|
|
11
|
+
const getter = () => globalThis.NativeCojsonCoreRn;
|
|
12
|
+
export default getter;
|
|
13
|
+
|
|
14
|
+
// Structs and function types for calling back into Typescript from Rust.
|
|
15
|
+
|
|
16
|
+
// UniffiRustFutureContinuationCallback is generated as part of the component interface's
|
|
17
|
+
// ffi_definitions. However, we need it in the runtime.
|
|
18
|
+
// We could:
|
|
19
|
+
// (a) do some complicated template logic to ensure the declaration is not generated here (possible)
|
|
20
|
+
// (b) import the generated declaration into the runtime (m a y b e) or…
|
|
21
|
+
// (c) generate the declaration anyway, and use a different declaration in the runtime.
|
|
22
|
+
//
|
|
23
|
+
// We chose (c) here as the simplest. In addition, we perform a compile time check that
|
|
24
|
+
// the two versions of `UniffiRustFutureContinuationCallback` are structurally equivalent.
|
|
25
|
+
//
|
|
26
|
+
// If you see the error:
|
|
27
|
+
// ```
|
|
28
|
+
// Type 'true' is not assignable to type 'false'.(2322)
|
|
29
|
+
// ```
|
|
30
|
+
// Then a new version of uniffi has changed the signature of the callback. Most likely, code in
|
|
31
|
+
// `typescript/src/async-rust-call.ts` will need to be changed.
|
|
32
|
+
//
|
|
33
|
+
// If you see the error:
|
|
34
|
+
// ```
|
|
35
|
+
// Cannot find name 'UniffiRustFutureContinuationCallback'. Did you mean 'RuntimeUniffiRustFutureContinuationCallback'?(2552)
|
|
36
|
+
// ```
|
|
37
|
+
// then you may not be using callbacks or promises, and uniffi is now not generating Futures and callbacks.
|
|
38
|
+
// You should not generate this if that is the case.
|
|
39
|
+
//
|
|
40
|
+
// ('You' being the bindings generator maintainer).
|
|
41
|
+
const isRustFutureContinuationCallbackTypeCompatible = true;
|
|
42
|
+
const isUniffiForeignFutureTypeCompatible = true;
|
|
43
|
+
//# sourceMappingURL=cojson_core_rn-ffi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["getter","globalThis","NativeCojsonCoreRn","isRustFutureContinuationCallbackTypeCompatible","isUniffiForeignFutureTypeCompatible"],"sourceRoot":"../../../src","sources":["generated/cojson_core_rn-ffi.ts"],"mappings":";;AAAA;AACA;;AA+QA;AACA;AACA;AACA;AACA;AACA,MAAMA,MAAmC,GAAGA,CAAA,KACzCC,UAAU,CAASC,kBAAkB;AACxC,eAAeF,MAAM;;AAErB;;AAmHA;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,MAAMG,8CAGL,GAAG,IAAI;AACR,MAAMC,mCAGL,GAAG,IAAI","ignoreList":[]}
|