@succinctlabs/react-native-zcam1 0.2.7 → 0.4.0-alpha.1
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/Zcam1Sdk.podspec +2 -2
- package/android/CMakeLists.txt +114 -0
- package/android/build.gradle +213 -0
- package/android/cpp-adapter-proving.cpp +35 -0
- package/android/cpp-adapter.cpp +35 -0
- package/android/src/main/AndroidManifest.xml +5 -0
- package/android/src/main/java/com/succinctlabs/zcam1sdk/Zcam1CaptureModule.kt +156 -0
- package/android/src/main/java/com/succinctlabs/zcam1sdk/Zcam1CapturePackage.kt +38 -0
- package/android/src/main/java/com/succinctlabs/zcam1sdk/Zcam1ProvingModule.kt +43 -0
- package/android/src/main/java/com/succinctlabs/zcam1sdk/Zcam1ProvingPackage.kt +34 -0
- package/android/src/main/java/com/succinctlabs/zcam1sdk/Zcam1SdkModule.kt +43 -0
- package/android/src/main/java/com/succinctlabs/zcam1sdk/Zcam1SdkPackage.kt +34 -0
- package/android/src/main/java/com/succinctlabs/zcam1sdk/camera/CameraUtils.kt +80 -0
- package/android/src/main/java/com/succinctlabs/zcam1sdk/camera/Zcam1CameraService.kt +588 -0
- package/android/src/main/java/com/succinctlabs/zcam1sdk/camera/Zcam1CameraView.kt +107 -0
- package/android/src/main/java/com/succinctlabs/zcam1sdk/camera/Zcam1CameraViewManager.kt +33 -0
- package/android/src/main/java/com/succinctlabs/zcam1sdk/camera/Zcam1OrientationManager.kt +73 -0
- package/cpp/generated/zcam1_c2pa_utils.cpp +170 -365
- package/cpp/generated/zcam1_c2pa_utils.hpp +0 -4
- package/cpp/generated/zcam1_certs_utils.cpp +121 -250
- package/cpp/generated/zcam1_common.cpp +1871 -0
- package/cpp/generated/zcam1_common.hpp +52 -0
- package/cpp/generated/zcam1_verify_utils.cpp +138 -265
- package/cpp/generated/zcam1_verify_utils.hpp +2 -2
- package/cpp/proving/generated/zcam1_common.cpp +1871 -0
- package/cpp/proving/generated/zcam1_common.hpp +52 -0
- package/cpp/proving/generated/zcam1_proving_utils.cpp +355 -417
- package/cpp/proving/generated/zcam1_proving_utils.hpp +13 -17
- package/cpp/proving/zcam1-proving.cpp +2 -0
- package/cpp/zcam1-sdk.cpp +2 -0
- package/lib/module/bindings.js +4 -0
- package/lib/module/bindings.js.map +1 -1
- package/lib/module/camera.js +71 -13
- package/lib/module/camera.js.map +1 -1
- package/lib/module/capture.js +115 -38
- package/lib/module/capture.js.map +1 -1
- package/lib/module/common.js +18 -2
- package/lib/module/common.js.map +1 -1
- package/lib/module/generated/zcam1_c2pa_utils-ffi.js +4 -0
- package/lib/module/generated/zcam1_c2pa_utils-ffi.js.map +1 -1
- package/lib/module/generated/zcam1_c2pa_utils.js +117 -9
- package/lib/module/generated/zcam1_c2pa_utils.js.map +1 -1
- package/lib/module/generated/zcam1_certs_utils-ffi.js +4 -0
- package/lib/module/generated/zcam1_certs_utils-ffi.js.map +1 -1
- package/lib/module/generated/zcam1_certs_utils.js +6 -2
- package/lib/module/generated/zcam1_certs_utils.js.map +1 -1
- package/lib/module/generated/zcam1_common-ffi.js +47 -0
- package/lib/module/generated/zcam1_common-ffi.js.map +1 -0
- package/lib/module/generated/zcam1_common.js +60 -0
- package/lib/module/generated/zcam1_common.js.map +1 -0
- package/lib/module/generated/zcam1_proving_utils-ffi.js +4 -0
- package/lib/module/generated/zcam1_proving_utils-ffi.js.map +1 -1
- package/lib/module/generated/zcam1_proving_utils.js +53 -46
- package/lib/module/generated/zcam1_proving_utils.js.map +1 -1
- package/lib/module/generated/zcam1_verify_utils-ffi.js +4 -0
- package/lib/module/generated/zcam1_verify_utils-ffi.js.map +1 -1
- package/lib/module/generated/zcam1_verify_utils.js +70 -22
- package/lib/module/generated/zcam1_verify_utils.js.map +1 -1
- package/lib/module/index.js +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/proving/NativeZcam1Proving.js +1 -1
- package/lib/module/proving/index.js +1 -1
- package/lib/module/proving/index.js.map +1 -1
- package/lib/module/proving/prove.js +14 -8
- package/lib/module/proving/prove.js.map +1 -1
- package/lib/module/utils.js +19 -14
- package/lib/module/utils.js.map +1 -1
- package/lib/module/verify.js +14 -22
- package/lib/module/verify.js.map +1 -1
- package/lib/typescript/src/bindings.d.ts +3 -0
- package/lib/typescript/src/bindings.d.ts.map +1 -1
- package/lib/typescript/src/camera.d.ts +15 -0
- package/lib/typescript/src/camera.d.ts.map +1 -1
- package/lib/typescript/src/capture.d.ts +40 -1
- package/lib/typescript/src/capture.d.ts.map +1 -1
- package/lib/typescript/src/common.d.ts.map +1 -1
- package/lib/typescript/src/generated/zcam1_c2pa_utils-ffi.d.ts +37 -46
- package/lib/typescript/src/generated/zcam1_c2pa_utils-ffi.d.ts.map +1 -1
- package/lib/typescript/src/generated/zcam1_c2pa_utils.d.ts +110 -8
- package/lib/typescript/src/generated/zcam1_c2pa_utils.d.ts.map +1 -1
- package/lib/typescript/src/generated/zcam1_certs_utils-ffi.d.ts +27 -32
- package/lib/typescript/src/generated/zcam1_certs_utils-ffi.d.ts.map +1 -1
- package/lib/typescript/src/generated/zcam1_certs_utils.d.ts.map +1 -1
- package/lib/typescript/src/generated/zcam1_common-ffi.d.ts +77 -0
- package/lib/typescript/src/generated/zcam1_common-ffi.d.ts.map +1 -0
- package/lib/typescript/src/generated/zcam1_common.d.ts +17 -0
- package/lib/typescript/src/generated/zcam1_common.d.ts.map +1 -0
- package/lib/typescript/src/generated/zcam1_proving_utils-ffi.d.ts +44 -51
- package/lib/typescript/src/generated/zcam1_proving_utils-ffi.d.ts.map +1 -1
- package/lib/typescript/src/generated/zcam1_proving_utils.d.ts +26 -26
- package/lib/typescript/src/generated/zcam1_proving_utils.d.ts.map +1 -1
- package/lib/typescript/src/generated/zcam1_verify_utils-ffi.d.ts +29 -34
- package/lib/typescript/src/generated/zcam1_verify_utils-ffi.d.ts.map +1 -1
- package/lib/typescript/src/generated/zcam1_verify_utils.d.ts +94 -14
- package/lib/typescript/src/generated/zcam1_verify_utils.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +1 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/proving/NativeZcam1Proving.d.ts +1 -1
- package/lib/typescript/src/proving/index.d.ts +1 -1
- package/lib/typescript/src/proving/index.d.ts.map +1 -1
- package/lib/typescript/src/proving/prove.d.ts +3 -3
- package/lib/typescript/src/proving/prove.d.ts.map +1 -1
- package/lib/typescript/src/utils.d.ts.map +1 -1
- package/lib/typescript/src/verify.d.ts +4 -3
- package/lib/typescript/src/verify.d.ts.map +1 -1
- package/package.json +13 -6
- package/react-native.config.js +11 -0
- package/src/bindings.tsx +4 -0
- package/src/camera.tsx +116 -11
- package/src/capture.tsx +150 -53
- package/src/common.tsx +22 -2
- package/src/generated/zcam1_c2pa_utils-ffi.ts +42 -56
- package/src/generated/zcam1_c2pa_utils.ts +224 -67
- package/src/generated/zcam1_certs_utils-ffi.ts +33 -36
- package/src/generated/zcam1_certs_utils.ts +27 -24
- package/src/generated/zcam1_common-ffi.ts +183 -0
- package/src/generated/zcam1_common.ts +116 -0
- package/src/generated/zcam1_proving_utils-ffi.ts +54 -67
- package/src/generated/zcam1_proving_utils.ts +133 -138
- package/src/generated/zcam1_verify_utils-ffi.ts +39 -40
- package/src/generated/zcam1_verify_utils.ts +109 -47
- package/src/index.ts +1 -1
- package/src/proving/NativeZcam1Proving.ts +2 -2
- package/src/proving/index.ts +1 -1
- package/src/proving/prove.tsx +22 -11
- package/src/utils.ts +26 -20
- package/src/verify.tsx +25 -42
|
@@ -20,118 +20,114 @@ extern "C" {
|
|
|
20
20
|
int8_t poll_result
|
|
21
21
|
);
|
|
22
22
|
typedef void
|
|
23
|
-
(*
|
|
23
|
+
(*UniffiForeignFutureDroppedCallback)(
|
|
24
24
|
uint64_t handle
|
|
25
25
|
);
|
|
26
26
|
typedef void
|
|
27
27
|
(*UniffiCallbackInterfaceFree)(
|
|
28
28
|
uint64_t handle
|
|
29
|
-
);
|
|
29
|
+
);
|
|
30
|
+
typedef uint64_t
|
|
31
|
+
(*UniffiCallbackInterfaceClone)(
|
|
32
|
+
uint64_t handle
|
|
33
|
+
);typedef struct UniffiForeignFutureDroppedCallbackStruct {
|
|
30
34
|
uint64_t handle;
|
|
31
|
-
|
|
32
|
-
}
|
|
35
|
+
UniffiForeignFutureDroppedCallback free;
|
|
36
|
+
} UniffiForeignFutureDroppedCallbackStruct;typedef struct UniffiForeignFutureResultU8 {
|
|
33
37
|
uint8_t return_value;
|
|
34
38
|
RustCallStatus call_status;
|
|
35
|
-
}
|
|
39
|
+
} UniffiForeignFutureResultU8;
|
|
36
40
|
typedef void
|
|
37
41
|
(*UniffiForeignFutureCompleteU8)(
|
|
38
42
|
uint64_t callback_data,
|
|
39
|
-
|
|
40
|
-
);typedef struct
|
|
43
|
+
UniffiForeignFutureResultU8 result
|
|
44
|
+
);typedef struct UniffiForeignFutureResultI8 {
|
|
41
45
|
int8_t return_value;
|
|
42
46
|
RustCallStatus call_status;
|
|
43
|
-
}
|
|
47
|
+
} UniffiForeignFutureResultI8;
|
|
44
48
|
typedef void
|
|
45
49
|
(*UniffiForeignFutureCompleteI8)(
|
|
46
50
|
uint64_t callback_data,
|
|
47
|
-
|
|
48
|
-
);typedef struct
|
|
51
|
+
UniffiForeignFutureResultI8 result
|
|
52
|
+
);typedef struct UniffiForeignFutureResultU16 {
|
|
49
53
|
uint16_t return_value;
|
|
50
54
|
RustCallStatus call_status;
|
|
51
|
-
}
|
|
55
|
+
} UniffiForeignFutureResultU16;
|
|
52
56
|
typedef void
|
|
53
57
|
(*UniffiForeignFutureCompleteU16)(
|
|
54
58
|
uint64_t callback_data,
|
|
55
|
-
|
|
56
|
-
);typedef struct
|
|
59
|
+
UniffiForeignFutureResultU16 result
|
|
60
|
+
);typedef struct UniffiForeignFutureResultI16 {
|
|
57
61
|
int16_t return_value;
|
|
58
62
|
RustCallStatus call_status;
|
|
59
|
-
}
|
|
63
|
+
} UniffiForeignFutureResultI16;
|
|
60
64
|
typedef void
|
|
61
65
|
(*UniffiForeignFutureCompleteI16)(
|
|
62
66
|
uint64_t callback_data,
|
|
63
|
-
|
|
64
|
-
);typedef struct
|
|
67
|
+
UniffiForeignFutureResultI16 result
|
|
68
|
+
);typedef struct UniffiForeignFutureResultU32 {
|
|
65
69
|
uint32_t return_value;
|
|
66
70
|
RustCallStatus call_status;
|
|
67
|
-
}
|
|
71
|
+
} UniffiForeignFutureResultU32;
|
|
68
72
|
typedef void
|
|
69
73
|
(*UniffiForeignFutureCompleteU32)(
|
|
70
74
|
uint64_t callback_data,
|
|
71
|
-
|
|
72
|
-
);typedef struct
|
|
75
|
+
UniffiForeignFutureResultU32 result
|
|
76
|
+
);typedef struct UniffiForeignFutureResultI32 {
|
|
73
77
|
int32_t return_value;
|
|
74
78
|
RustCallStatus call_status;
|
|
75
|
-
}
|
|
79
|
+
} UniffiForeignFutureResultI32;
|
|
76
80
|
typedef void
|
|
77
81
|
(*UniffiForeignFutureCompleteI32)(
|
|
78
82
|
uint64_t callback_data,
|
|
79
|
-
|
|
80
|
-
);typedef struct
|
|
83
|
+
UniffiForeignFutureResultI32 result
|
|
84
|
+
);typedef struct UniffiForeignFutureResultU64 {
|
|
81
85
|
uint64_t return_value;
|
|
82
86
|
RustCallStatus call_status;
|
|
83
|
-
}
|
|
87
|
+
} UniffiForeignFutureResultU64;
|
|
84
88
|
typedef void
|
|
85
89
|
(*UniffiForeignFutureCompleteU64)(
|
|
86
90
|
uint64_t callback_data,
|
|
87
|
-
|
|
88
|
-
);typedef struct
|
|
91
|
+
UniffiForeignFutureResultU64 result
|
|
92
|
+
);typedef struct UniffiForeignFutureResultI64 {
|
|
89
93
|
int64_t return_value;
|
|
90
94
|
RustCallStatus call_status;
|
|
91
|
-
}
|
|
95
|
+
} UniffiForeignFutureResultI64;
|
|
92
96
|
typedef void
|
|
93
97
|
(*UniffiForeignFutureCompleteI64)(
|
|
94
98
|
uint64_t callback_data,
|
|
95
|
-
|
|
96
|
-
);typedef struct
|
|
99
|
+
UniffiForeignFutureResultI64 result
|
|
100
|
+
);typedef struct UniffiForeignFutureResultF32 {
|
|
97
101
|
float return_value;
|
|
98
102
|
RustCallStatus call_status;
|
|
99
|
-
}
|
|
103
|
+
} UniffiForeignFutureResultF32;
|
|
100
104
|
typedef void
|
|
101
105
|
(*UniffiForeignFutureCompleteF32)(
|
|
102
106
|
uint64_t callback_data,
|
|
103
|
-
|
|
104
|
-
);typedef struct
|
|
107
|
+
UniffiForeignFutureResultF32 result
|
|
108
|
+
);typedef struct UniffiForeignFutureResultF64 {
|
|
105
109
|
double return_value;
|
|
106
110
|
RustCallStatus call_status;
|
|
107
|
-
}
|
|
111
|
+
} UniffiForeignFutureResultF64;
|
|
108
112
|
typedef void
|
|
109
113
|
(*UniffiForeignFutureCompleteF64)(
|
|
110
114
|
uint64_t callback_data,
|
|
111
|
-
|
|
112
|
-
);typedef struct
|
|
113
|
-
void * return_value;
|
|
114
|
-
RustCallStatus call_status;
|
|
115
|
-
} UniffiForeignFutureStructPointer;
|
|
116
|
-
typedef void
|
|
117
|
-
(*UniffiForeignFutureCompletePointer)(
|
|
118
|
-
uint64_t callback_data,
|
|
119
|
-
UniffiForeignFutureStructPointer result
|
|
120
|
-
);typedef struct UniffiForeignFutureStructRustBuffer {
|
|
115
|
+
UniffiForeignFutureResultF64 result
|
|
116
|
+
);typedef struct UniffiForeignFutureResultRustBuffer {
|
|
121
117
|
RustBuffer return_value;
|
|
122
118
|
RustCallStatus call_status;
|
|
123
|
-
}
|
|
119
|
+
} UniffiForeignFutureResultRustBuffer;
|
|
124
120
|
typedef void
|
|
125
121
|
(*UniffiForeignFutureCompleteRustBuffer)(
|
|
126
122
|
uint64_t callback_data,
|
|
127
|
-
|
|
128
|
-
);typedef struct
|
|
123
|
+
UniffiForeignFutureResultRustBuffer result
|
|
124
|
+
);typedef struct UniffiForeignFutureResultVoid {
|
|
129
125
|
RustCallStatus call_status;
|
|
130
|
-
}
|
|
126
|
+
} UniffiForeignFutureResultVoid;
|
|
131
127
|
typedef void
|
|
132
128
|
(*UniffiForeignFutureCompleteVoid)(
|
|
133
129
|
uint64_t callback_data,
|
|
134
|
-
|
|
130
|
+
UniffiForeignFutureResultVoid result
|
|
135
131
|
);
|
|
136
132
|
int8_t uniffi_zcam1_verify_utils_fn_func_verify_bindings_from_manifest(
|
|
137
133
|
RustBuffer bindings,
|
|
@@ -140,10 +136,12 @@ extern "C" {
|
|
|
140
136
|
int8_t production,
|
|
141
137
|
RustCallStatus *uniffi_out_err
|
|
142
138
|
);
|
|
143
|
-
int8_t
|
|
139
|
+
int8_t uniffi_zcam1_verify_utils_fn_func_verify_proof_from_manifest(
|
|
144
140
|
RustBuffer proof,
|
|
145
|
-
RustBuffer
|
|
146
|
-
RustBuffer
|
|
141
|
+
RustBuffer vk_hash,
|
|
142
|
+
RustBuffer photo_hash,
|
|
143
|
+
RustBuffer app_id,
|
|
144
|
+
RustBuffer platform,
|
|
147
145
|
RustCallStatus *uniffi_out_err
|
|
148
146
|
);
|
|
149
147
|
RustBuffer ffi_zcam1_verify_utils_rustbuffer_alloc(
|
|
@@ -313,21 +311,6 @@ extern "C" {
|
|
|
313
311
|
/*handle*/ uint64_t handle,
|
|
314
312
|
RustCallStatus *uniffi_out_err
|
|
315
313
|
);
|
|
316
|
-
void ffi_zcam1_verify_utils_rust_future_poll_pointer(
|
|
317
|
-
/*handle*/ uint64_t handle,
|
|
318
|
-
UniffiRustFutureContinuationCallback callback,
|
|
319
|
-
/*handle*/ uint64_t callback_data
|
|
320
|
-
);
|
|
321
|
-
void ffi_zcam1_verify_utils_rust_future_cancel_pointer(
|
|
322
|
-
/*handle*/ uint64_t handle
|
|
323
|
-
);
|
|
324
|
-
void ffi_zcam1_verify_utils_rust_future_free_pointer(
|
|
325
|
-
/*handle*/ uint64_t handle
|
|
326
|
-
);
|
|
327
|
-
void * ffi_zcam1_verify_utils_rust_future_complete_pointer(
|
|
328
|
-
/*handle*/ uint64_t handle,
|
|
329
|
-
RustCallStatus *uniffi_out_err
|
|
330
|
-
);
|
|
331
314
|
void ffi_zcam1_verify_utils_rust_future_poll_rust_buffer(
|
|
332
315
|
/*handle*/ uint64_t handle,
|
|
333
316
|
UniffiRustFutureContinuationCallback callback,
|
|
@@ -360,7 +343,7 @@ extern "C" {
|
|
|
360
343
|
);
|
|
361
344
|
uint16_t uniffi_zcam1_verify_utils_checksum_func_verify_bindings_from_manifest(
|
|
362
345
|
);
|
|
363
|
-
uint16_t
|
|
346
|
+
uint16_t uniffi_zcam1_verify_utils_checksum_func_verify_proof_from_manifest(
|
|
364
347
|
);
|
|
365
348
|
uint32_t ffi_zcam1_verify_utils_uniffi_contract_version(
|
|
366
349
|
);
|
|
@@ -656,7 +639,7 @@ namespace uniffi::zcam1_verify_utils::cb::rustfuturecontinuationcallback {
|
|
|
656
639
|
rs_pollResult);
|
|
657
640
|
}
|
|
658
641
|
|
|
659
|
-
static UniffiRustFutureContinuationCallback
|
|
642
|
+
[[maybe_unused]] static UniffiRustFutureContinuationCallback
|
|
660
643
|
makeCallbackFunction( // uniffi::zcam1_verify_utils::cb::rustfuturecontinuationcallback
|
|
661
644
|
jsi::Runtime &rt,
|
|
662
645
|
std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
|
|
@@ -703,49 +686,9 @@ namespace uniffi::zcam1_verify_utils::cb::rustfuturecontinuationcallback {
|
|
|
703
686
|
rsLambda = nullptr;
|
|
704
687
|
}
|
|
705
688
|
} // namespace uniffi::zcam1_verify_utils::cb::rustfuturecontinuationcallback
|
|
706
|
-
// Implementation of callback function calling from
|
|
707
|
-
// passed from Rust to JS as part of async callbacks.
|
|
708
|
-
namespace uniffi::zcam1_verify_utils {
|
|
709
|
-
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
689
|
+
// Implementation of callback function calling from Rust to JS ForeignFutureDroppedCallback
|
|
710
690
|
|
|
711
|
-
|
|
712
|
-
static jsi::Value toJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker, UniffiForeignFutureFree rsCallback) {
|
|
713
|
-
return jsi::Function::createFromHostFunction(
|
|
714
|
-
rt,
|
|
715
|
-
jsi::PropNameID::forAscii(rt, "--ForeignFutureFree"),
|
|
716
|
-
1,
|
|
717
|
-
[rsCallback, callInvoker](
|
|
718
|
-
jsi::Runtime &rt,
|
|
719
|
-
const jsi::Value &thisValue,
|
|
720
|
-
const jsi::Value *arguments,
|
|
721
|
-
size_t count) -> jsi::Value
|
|
722
|
-
{
|
|
723
|
-
return intoRust(rt, callInvoker, thisValue, arguments, count, rsCallback);
|
|
724
|
-
}
|
|
725
|
-
);
|
|
726
|
-
}
|
|
727
|
-
|
|
728
|
-
static jsi::Value intoRust(
|
|
729
|
-
jsi::Runtime &rt,
|
|
730
|
-
std::shared_ptr<CallInvoker> callInvoker,
|
|
731
|
-
const jsi::Value &thisValue,
|
|
732
|
-
const jsi::Value *args,
|
|
733
|
-
size_t count,
|
|
734
|
-
UniffiForeignFutureFree func) {
|
|
735
|
-
// Convert the arguments into the Rust, with Bridging<T>::fromJs,
|
|
736
|
-
// then call the rs_callback with those arguments.
|
|
737
|
-
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0])
|
|
738
|
-
);
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
return jsi::Value::undefined();
|
|
742
|
-
}
|
|
743
|
-
};
|
|
744
|
-
} // namespace uniffi::zcam1_verify_utils
|
|
745
|
-
// Implementation of free callback function CallbackInterfaceFree
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
// Callback function: uniffi::zcam1_verify_utils::st::foreignfuture::foreignfuture::free::UniffiCallbackInterfaceFree
|
|
691
|
+
// Callback function: uniffi::zcam1_verify_utils::cb::foreignfuturedroppedcallback::UniffiForeignFutureDroppedCallback
|
|
749
692
|
//
|
|
750
693
|
// We have the following constraints:
|
|
751
694
|
// - we need to pass a function pointer to Rust.
|
|
@@ -757,7 +700,7 @@ template <> struct Bridging<UniffiForeignFutureFree> {
|
|
|
757
700
|
//
|
|
758
701
|
// We then give the `callback` function pointer to Rust which will call the lambda sometime in the
|
|
759
702
|
// future.
|
|
760
|
-
namespace uniffi::zcam1_verify_utils::
|
|
703
|
+
namespace uniffi::zcam1_verify_utils::cb::foreignfuturedroppedcallback {
|
|
761
704
|
using namespace facebook;
|
|
762
705
|
|
|
763
706
|
// We need to store a lambda in a global so we can call it from
|
|
@@ -788,7 +731,7 @@ namespace uniffi::zcam1_verify_utils::st::foreignfuture::foreignfuture::free {
|
|
|
788
731
|
|
|
789
732
|
|
|
790
733
|
} catch (const jsi::JSError &error) {
|
|
791
|
-
std::cout << "Error in callback
|
|
734
|
+
std::cout << "Error in callback UniffiForeignFutureDroppedCallback: "
|
|
792
735
|
<< error.what() << std::endl;
|
|
793
736
|
throw error;
|
|
794
737
|
}
|
|
@@ -814,8 +757,8 @@ namespace uniffi::zcam1_verify_utils::st::foreignfuture::foreignfuture::free {
|
|
|
814
757
|
rs_handle);
|
|
815
758
|
}
|
|
816
759
|
|
|
817
|
-
static
|
|
818
|
-
makeCallbackFunction( // uniffi::zcam1_verify_utils::
|
|
760
|
+
[[maybe_unused]] static UniffiForeignFutureDroppedCallback
|
|
761
|
+
makeCallbackFunction( // uniffi::zcam1_verify_utils::cb::foreignfuturedroppedcallback
|
|
819
762
|
jsi::Runtime &rt,
|
|
820
763
|
std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
|
|
821
764
|
const jsi::Value &value) {
|
|
@@ -858,33 +801,35 @@ namespace uniffi::zcam1_verify_utils::st::foreignfuture::foreignfuture::free {
|
|
|
858
801
|
// then the pointer will no longer be left dangling.
|
|
859
802
|
rsLambda = nullptr;
|
|
860
803
|
}
|
|
861
|
-
} // namespace uniffi::zcam1_verify_utils::
|
|
804
|
+
} // namespace uniffi::zcam1_verify_utils::cb::foreignfuturedroppedcallback
|
|
805
|
+
// Implementation of free callback function CallbackInterfaceFree
|
|
806
|
+
|
|
862
807
|
namespace uniffi::zcam1_verify_utils {
|
|
863
808
|
using namespace facebook;
|
|
864
809
|
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
865
810
|
|
|
866
|
-
template <> struct Bridging<
|
|
867
|
-
static
|
|
811
|
+
template <> struct Bridging<UniffiForeignFutureDroppedCallbackStruct> {
|
|
812
|
+
static UniffiForeignFutureDroppedCallbackStruct fromJs(jsi::Runtime &rt,
|
|
868
813
|
std::shared_ptr<CallInvoker> callInvoker,
|
|
869
814
|
const jsi::Value &jsValue
|
|
870
815
|
) {
|
|
871
816
|
// Check if the input is an object
|
|
872
817
|
if (!jsValue.isObject()) {
|
|
873
|
-
throw jsi::JSError(rt, "Expected an object for
|
|
818
|
+
throw jsi::JSError(rt, "Expected an object for UniffiForeignFutureDroppedCallbackStruct");
|
|
874
819
|
}
|
|
875
820
|
|
|
876
821
|
// Get the object from the jsi::Value
|
|
877
822
|
auto jsObject = jsValue.getObject(rt);
|
|
878
823
|
|
|
879
824
|
// Create the vtable struct
|
|
880
|
-
|
|
825
|
+
UniffiForeignFutureDroppedCallbackStruct rsObject;
|
|
881
826
|
|
|
882
827
|
// Create the vtable from the js callbacks.
|
|
883
828
|
rsObject.handle = uniffi_jsi::Bridging<uint64_t>::fromJs(
|
|
884
829
|
rt, callInvoker,
|
|
885
830
|
jsObject.getProperty(rt, "handle")
|
|
886
831
|
);
|
|
887
|
-
rsObject.free = uniffi::zcam1_verify_utils::
|
|
832
|
+
rsObject.free = uniffi::zcam1_verify_utils::cb::foreignfuturedroppedcallback::makeCallbackFunction(
|
|
888
833
|
rt, callInvoker, jsObject.getProperty(rt, "free")
|
|
889
834
|
);
|
|
890
835
|
|
|
@@ -897,21 +842,21 @@ namespace uniffi::zcam1_verify_utils {
|
|
|
897
842
|
using namespace facebook;
|
|
898
843
|
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
899
844
|
|
|
900
|
-
template <> struct Bridging<
|
|
901
|
-
static
|
|
845
|
+
template <> struct Bridging<UniffiForeignFutureResultU8> {
|
|
846
|
+
static UniffiForeignFutureResultU8 fromJs(jsi::Runtime &rt,
|
|
902
847
|
std::shared_ptr<CallInvoker> callInvoker,
|
|
903
848
|
const jsi::Value &jsValue
|
|
904
849
|
) {
|
|
905
850
|
// Check if the input is an object
|
|
906
851
|
if (!jsValue.isObject()) {
|
|
907
|
-
throw jsi::JSError(rt, "Expected an object for
|
|
852
|
+
throw jsi::JSError(rt, "Expected an object for UniffiForeignFutureResultU8");
|
|
908
853
|
}
|
|
909
854
|
|
|
910
855
|
// Get the object from the jsi::Value
|
|
911
856
|
auto jsObject = jsValue.getObject(rt);
|
|
912
857
|
|
|
913
858
|
// Create the vtable struct
|
|
914
|
-
|
|
859
|
+
UniffiForeignFutureResultU8 rsObject;
|
|
915
860
|
|
|
916
861
|
// Create the vtable from the js callbacks.
|
|
917
862
|
rsObject.return_value = uniffi_jsi::Bridging<uint8_t>::fromJs(
|
|
@@ -959,7 +904,7 @@ template <> struct Bridging<UniffiForeignFutureCompleteU8> {
|
|
|
959
904
|
UniffiForeignFutureCompleteU8 func) {
|
|
960
905
|
// Convert the arguments into the Rust, with Bridging<T>::fromJs,
|
|
961
906
|
// then call the rs_callback with those arguments.
|
|
962
|
-
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_verify_utils::Bridging<
|
|
907
|
+
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_verify_utils::Bridging<UniffiForeignFutureResultU8>::fromJs(rt, callInvoker, args[1])
|
|
963
908
|
);
|
|
964
909
|
|
|
965
910
|
|
|
@@ -971,21 +916,21 @@ namespace uniffi::zcam1_verify_utils {
|
|
|
971
916
|
using namespace facebook;
|
|
972
917
|
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
973
918
|
|
|
974
|
-
template <> struct Bridging<
|
|
975
|
-
static
|
|
919
|
+
template <> struct Bridging<UniffiForeignFutureResultI8> {
|
|
920
|
+
static UniffiForeignFutureResultI8 fromJs(jsi::Runtime &rt,
|
|
976
921
|
std::shared_ptr<CallInvoker> callInvoker,
|
|
977
922
|
const jsi::Value &jsValue
|
|
978
923
|
) {
|
|
979
924
|
// Check if the input is an object
|
|
980
925
|
if (!jsValue.isObject()) {
|
|
981
|
-
throw jsi::JSError(rt, "Expected an object for
|
|
926
|
+
throw jsi::JSError(rt, "Expected an object for UniffiForeignFutureResultI8");
|
|
982
927
|
}
|
|
983
928
|
|
|
984
929
|
// Get the object from the jsi::Value
|
|
985
930
|
auto jsObject = jsValue.getObject(rt);
|
|
986
931
|
|
|
987
932
|
// Create the vtable struct
|
|
988
|
-
|
|
933
|
+
UniffiForeignFutureResultI8 rsObject;
|
|
989
934
|
|
|
990
935
|
// Create the vtable from the js callbacks.
|
|
991
936
|
rsObject.return_value = uniffi_jsi::Bridging<int8_t>::fromJs(
|
|
@@ -1033,7 +978,7 @@ template <> struct Bridging<UniffiForeignFutureCompleteI8> {
|
|
|
1033
978
|
UniffiForeignFutureCompleteI8 func) {
|
|
1034
979
|
// Convert the arguments into the Rust, with Bridging<T>::fromJs,
|
|
1035
980
|
// then call the rs_callback with those arguments.
|
|
1036
|
-
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_verify_utils::Bridging<
|
|
981
|
+
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_verify_utils::Bridging<UniffiForeignFutureResultI8>::fromJs(rt, callInvoker, args[1])
|
|
1037
982
|
);
|
|
1038
983
|
|
|
1039
984
|
|
|
@@ -1045,21 +990,21 @@ namespace uniffi::zcam1_verify_utils {
|
|
|
1045
990
|
using namespace facebook;
|
|
1046
991
|
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
1047
992
|
|
|
1048
|
-
template <> struct Bridging<
|
|
1049
|
-
static
|
|
993
|
+
template <> struct Bridging<UniffiForeignFutureResultU16> {
|
|
994
|
+
static UniffiForeignFutureResultU16 fromJs(jsi::Runtime &rt,
|
|
1050
995
|
std::shared_ptr<CallInvoker> callInvoker,
|
|
1051
996
|
const jsi::Value &jsValue
|
|
1052
997
|
) {
|
|
1053
998
|
// Check if the input is an object
|
|
1054
999
|
if (!jsValue.isObject()) {
|
|
1055
|
-
throw jsi::JSError(rt, "Expected an object for
|
|
1000
|
+
throw jsi::JSError(rt, "Expected an object for UniffiForeignFutureResultU16");
|
|
1056
1001
|
}
|
|
1057
1002
|
|
|
1058
1003
|
// Get the object from the jsi::Value
|
|
1059
1004
|
auto jsObject = jsValue.getObject(rt);
|
|
1060
1005
|
|
|
1061
1006
|
// Create the vtable struct
|
|
1062
|
-
|
|
1007
|
+
UniffiForeignFutureResultU16 rsObject;
|
|
1063
1008
|
|
|
1064
1009
|
// Create the vtable from the js callbacks.
|
|
1065
1010
|
rsObject.return_value = uniffi_jsi::Bridging<uint16_t>::fromJs(
|
|
@@ -1107,7 +1052,7 @@ template <> struct Bridging<UniffiForeignFutureCompleteU16> {
|
|
|
1107
1052
|
UniffiForeignFutureCompleteU16 func) {
|
|
1108
1053
|
// Convert the arguments into the Rust, with Bridging<T>::fromJs,
|
|
1109
1054
|
// then call the rs_callback with those arguments.
|
|
1110
|
-
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_verify_utils::Bridging<
|
|
1055
|
+
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_verify_utils::Bridging<UniffiForeignFutureResultU16>::fromJs(rt, callInvoker, args[1])
|
|
1111
1056
|
);
|
|
1112
1057
|
|
|
1113
1058
|
|
|
@@ -1119,21 +1064,21 @@ namespace uniffi::zcam1_verify_utils {
|
|
|
1119
1064
|
using namespace facebook;
|
|
1120
1065
|
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
1121
1066
|
|
|
1122
|
-
template <> struct Bridging<
|
|
1123
|
-
static
|
|
1067
|
+
template <> struct Bridging<UniffiForeignFutureResultI16> {
|
|
1068
|
+
static UniffiForeignFutureResultI16 fromJs(jsi::Runtime &rt,
|
|
1124
1069
|
std::shared_ptr<CallInvoker> callInvoker,
|
|
1125
1070
|
const jsi::Value &jsValue
|
|
1126
1071
|
) {
|
|
1127
1072
|
// Check if the input is an object
|
|
1128
1073
|
if (!jsValue.isObject()) {
|
|
1129
|
-
throw jsi::JSError(rt, "Expected an object for
|
|
1074
|
+
throw jsi::JSError(rt, "Expected an object for UniffiForeignFutureResultI16");
|
|
1130
1075
|
}
|
|
1131
1076
|
|
|
1132
1077
|
// Get the object from the jsi::Value
|
|
1133
1078
|
auto jsObject = jsValue.getObject(rt);
|
|
1134
1079
|
|
|
1135
1080
|
// Create the vtable struct
|
|
1136
|
-
|
|
1081
|
+
UniffiForeignFutureResultI16 rsObject;
|
|
1137
1082
|
|
|
1138
1083
|
// Create the vtable from the js callbacks.
|
|
1139
1084
|
rsObject.return_value = uniffi_jsi::Bridging<int16_t>::fromJs(
|
|
@@ -1181,7 +1126,7 @@ template <> struct Bridging<UniffiForeignFutureCompleteI16> {
|
|
|
1181
1126
|
UniffiForeignFutureCompleteI16 func) {
|
|
1182
1127
|
// Convert the arguments into the Rust, with Bridging<T>::fromJs,
|
|
1183
1128
|
// then call the rs_callback with those arguments.
|
|
1184
|
-
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_verify_utils::Bridging<
|
|
1129
|
+
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_verify_utils::Bridging<UniffiForeignFutureResultI16>::fromJs(rt, callInvoker, args[1])
|
|
1185
1130
|
);
|
|
1186
1131
|
|
|
1187
1132
|
|
|
@@ -1193,21 +1138,21 @@ namespace uniffi::zcam1_verify_utils {
|
|
|
1193
1138
|
using namespace facebook;
|
|
1194
1139
|
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
1195
1140
|
|
|
1196
|
-
template <> struct Bridging<
|
|
1197
|
-
static
|
|
1141
|
+
template <> struct Bridging<UniffiForeignFutureResultU32> {
|
|
1142
|
+
static UniffiForeignFutureResultU32 fromJs(jsi::Runtime &rt,
|
|
1198
1143
|
std::shared_ptr<CallInvoker> callInvoker,
|
|
1199
1144
|
const jsi::Value &jsValue
|
|
1200
1145
|
) {
|
|
1201
1146
|
// Check if the input is an object
|
|
1202
1147
|
if (!jsValue.isObject()) {
|
|
1203
|
-
throw jsi::JSError(rt, "Expected an object for
|
|
1148
|
+
throw jsi::JSError(rt, "Expected an object for UniffiForeignFutureResultU32");
|
|
1204
1149
|
}
|
|
1205
1150
|
|
|
1206
1151
|
// Get the object from the jsi::Value
|
|
1207
1152
|
auto jsObject = jsValue.getObject(rt);
|
|
1208
1153
|
|
|
1209
1154
|
// Create the vtable struct
|
|
1210
|
-
|
|
1155
|
+
UniffiForeignFutureResultU32 rsObject;
|
|
1211
1156
|
|
|
1212
1157
|
// Create the vtable from the js callbacks.
|
|
1213
1158
|
rsObject.return_value = uniffi_jsi::Bridging<uint32_t>::fromJs(
|
|
@@ -1255,7 +1200,7 @@ template <> struct Bridging<UniffiForeignFutureCompleteU32> {
|
|
|
1255
1200
|
UniffiForeignFutureCompleteU32 func) {
|
|
1256
1201
|
// Convert the arguments into the Rust, with Bridging<T>::fromJs,
|
|
1257
1202
|
// then call the rs_callback with those arguments.
|
|
1258
|
-
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_verify_utils::Bridging<
|
|
1203
|
+
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_verify_utils::Bridging<UniffiForeignFutureResultU32>::fromJs(rt, callInvoker, args[1])
|
|
1259
1204
|
);
|
|
1260
1205
|
|
|
1261
1206
|
|
|
@@ -1267,21 +1212,21 @@ namespace uniffi::zcam1_verify_utils {
|
|
|
1267
1212
|
using namespace facebook;
|
|
1268
1213
|
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
1269
1214
|
|
|
1270
|
-
template <> struct Bridging<
|
|
1271
|
-
static
|
|
1215
|
+
template <> struct Bridging<UniffiForeignFutureResultI32> {
|
|
1216
|
+
static UniffiForeignFutureResultI32 fromJs(jsi::Runtime &rt,
|
|
1272
1217
|
std::shared_ptr<CallInvoker> callInvoker,
|
|
1273
1218
|
const jsi::Value &jsValue
|
|
1274
1219
|
) {
|
|
1275
1220
|
// Check if the input is an object
|
|
1276
1221
|
if (!jsValue.isObject()) {
|
|
1277
|
-
throw jsi::JSError(rt, "Expected an object for
|
|
1222
|
+
throw jsi::JSError(rt, "Expected an object for UniffiForeignFutureResultI32");
|
|
1278
1223
|
}
|
|
1279
1224
|
|
|
1280
1225
|
// Get the object from the jsi::Value
|
|
1281
1226
|
auto jsObject = jsValue.getObject(rt);
|
|
1282
1227
|
|
|
1283
1228
|
// Create the vtable struct
|
|
1284
|
-
|
|
1229
|
+
UniffiForeignFutureResultI32 rsObject;
|
|
1285
1230
|
|
|
1286
1231
|
// Create the vtable from the js callbacks.
|
|
1287
1232
|
rsObject.return_value = uniffi_jsi::Bridging<int32_t>::fromJs(
|
|
@@ -1329,7 +1274,7 @@ template <> struct Bridging<UniffiForeignFutureCompleteI32> {
|
|
|
1329
1274
|
UniffiForeignFutureCompleteI32 func) {
|
|
1330
1275
|
// Convert the arguments into the Rust, with Bridging<T>::fromJs,
|
|
1331
1276
|
// then call the rs_callback with those arguments.
|
|
1332
|
-
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_verify_utils::Bridging<
|
|
1277
|
+
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_verify_utils::Bridging<UniffiForeignFutureResultI32>::fromJs(rt, callInvoker, args[1])
|
|
1333
1278
|
);
|
|
1334
1279
|
|
|
1335
1280
|
|
|
@@ -1341,21 +1286,21 @@ namespace uniffi::zcam1_verify_utils {
|
|
|
1341
1286
|
using namespace facebook;
|
|
1342
1287
|
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
1343
1288
|
|
|
1344
|
-
template <> struct Bridging<
|
|
1345
|
-
static
|
|
1289
|
+
template <> struct Bridging<UniffiForeignFutureResultU64> {
|
|
1290
|
+
static UniffiForeignFutureResultU64 fromJs(jsi::Runtime &rt,
|
|
1346
1291
|
std::shared_ptr<CallInvoker> callInvoker,
|
|
1347
1292
|
const jsi::Value &jsValue
|
|
1348
1293
|
) {
|
|
1349
1294
|
// Check if the input is an object
|
|
1350
1295
|
if (!jsValue.isObject()) {
|
|
1351
|
-
throw jsi::JSError(rt, "Expected an object for
|
|
1296
|
+
throw jsi::JSError(rt, "Expected an object for UniffiForeignFutureResultU64");
|
|
1352
1297
|
}
|
|
1353
1298
|
|
|
1354
1299
|
// Get the object from the jsi::Value
|
|
1355
1300
|
auto jsObject = jsValue.getObject(rt);
|
|
1356
1301
|
|
|
1357
1302
|
// Create the vtable struct
|
|
1358
|
-
|
|
1303
|
+
UniffiForeignFutureResultU64 rsObject;
|
|
1359
1304
|
|
|
1360
1305
|
// Create the vtable from the js callbacks.
|
|
1361
1306
|
rsObject.return_value = uniffi_jsi::Bridging<uint64_t>::fromJs(
|
|
@@ -1403,7 +1348,7 @@ template <> struct Bridging<UniffiForeignFutureCompleteU64> {
|
|
|
1403
1348
|
UniffiForeignFutureCompleteU64 func) {
|
|
1404
1349
|
// Convert the arguments into the Rust, with Bridging<T>::fromJs,
|
|
1405
1350
|
// then call the rs_callback with those arguments.
|
|
1406
|
-
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_verify_utils::Bridging<
|
|
1351
|
+
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_verify_utils::Bridging<UniffiForeignFutureResultU64>::fromJs(rt, callInvoker, args[1])
|
|
1407
1352
|
);
|
|
1408
1353
|
|
|
1409
1354
|
|
|
@@ -1415,21 +1360,21 @@ namespace uniffi::zcam1_verify_utils {
|
|
|
1415
1360
|
using namespace facebook;
|
|
1416
1361
|
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
1417
1362
|
|
|
1418
|
-
template <> struct Bridging<
|
|
1419
|
-
static
|
|
1363
|
+
template <> struct Bridging<UniffiForeignFutureResultI64> {
|
|
1364
|
+
static UniffiForeignFutureResultI64 fromJs(jsi::Runtime &rt,
|
|
1420
1365
|
std::shared_ptr<CallInvoker> callInvoker,
|
|
1421
1366
|
const jsi::Value &jsValue
|
|
1422
1367
|
) {
|
|
1423
1368
|
// Check if the input is an object
|
|
1424
1369
|
if (!jsValue.isObject()) {
|
|
1425
|
-
throw jsi::JSError(rt, "Expected an object for
|
|
1370
|
+
throw jsi::JSError(rt, "Expected an object for UniffiForeignFutureResultI64");
|
|
1426
1371
|
}
|
|
1427
1372
|
|
|
1428
1373
|
// Get the object from the jsi::Value
|
|
1429
1374
|
auto jsObject = jsValue.getObject(rt);
|
|
1430
1375
|
|
|
1431
1376
|
// Create the vtable struct
|
|
1432
|
-
|
|
1377
|
+
UniffiForeignFutureResultI64 rsObject;
|
|
1433
1378
|
|
|
1434
1379
|
// Create the vtable from the js callbacks.
|
|
1435
1380
|
rsObject.return_value = uniffi_jsi::Bridging<int64_t>::fromJs(
|
|
@@ -1477,7 +1422,7 @@ template <> struct Bridging<UniffiForeignFutureCompleteI64> {
|
|
|
1477
1422
|
UniffiForeignFutureCompleteI64 func) {
|
|
1478
1423
|
// Convert the arguments into the Rust, with Bridging<T>::fromJs,
|
|
1479
1424
|
// then call the rs_callback with those arguments.
|
|
1480
|
-
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_verify_utils::Bridging<
|
|
1425
|
+
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_verify_utils::Bridging<UniffiForeignFutureResultI64>::fromJs(rt, callInvoker, args[1])
|
|
1481
1426
|
);
|
|
1482
1427
|
|
|
1483
1428
|
|
|
@@ -1489,21 +1434,21 @@ namespace uniffi::zcam1_verify_utils {
|
|
|
1489
1434
|
using namespace facebook;
|
|
1490
1435
|
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
1491
1436
|
|
|
1492
|
-
template <> struct Bridging<
|
|
1493
|
-
static
|
|
1437
|
+
template <> struct Bridging<UniffiForeignFutureResultF32> {
|
|
1438
|
+
static UniffiForeignFutureResultF32 fromJs(jsi::Runtime &rt,
|
|
1494
1439
|
std::shared_ptr<CallInvoker> callInvoker,
|
|
1495
1440
|
const jsi::Value &jsValue
|
|
1496
1441
|
) {
|
|
1497
1442
|
// Check if the input is an object
|
|
1498
1443
|
if (!jsValue.isObject()) {
|
|
1499
|
-
throw jsi::JSError(rt, "Expected an object for
|
|
1444
|
+
throw jsi::JSError(rt, "Expected an object for UniffiForeignFutureResultF32");
|
|
1500
1445
|
}
|
|
1501
1446
|
|
|
1502
1447
|
// Get the object from the jsi::Value
|
|
1503
1448
|
auto jsObject = jsValue.getObject(rt);
|
|
1504
1449
|
|
|
1505
1450
|
// Create the vtable struct
|
|
1506
|
-
|
|
1451
|
+
UniffiForeignFutureResultF32 rsObject;
|
|
1507
1452
|
|
|
1508
1453
|
// Create the vtable from the js callbacks.
|
|
1509
1454
|
rsObject.return_value = uniffi_jsi::Bridging<float>::fromJs(
|
|
@@ -1551,7 +1496,7 @@ template <> struct Bridging<UniffiForeignFutureCompleteF32> {
|
|
|
1551
1496
|
UniffiForeignFutureCompleteF32 func) {
|
|
1552
1497
|
// Convert the arguments into the Rust, with Bridging<T>::fromJs,
|
|
1553
1498
|
// then call the rs_callback with those arguments.
|
|
1554
|
-
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_verify_utils::Bridging<
|
|
1499
|
+
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_verify_utils::Bridging<UniffiForeignFutureResultF32>::fromJs(rt, callInvoker, args[1])
|
|
1555
1500
|
);
|
|
1556
1501
|
|
|
1557
1502
|
|
|
@@ -1563,21 +1508,21 @@ namespace uniffi::zcam1_verify_utils {
|
|
|
1563
1508
|
using namespace facebook;
|
|
1564
1509
|
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
1565
1510
|
|
|
1566
|
-
template <> struct Bridging<
|
|
1567
|
-
static
|
|
1511
|
+
template <> struct Bridging<UniffiForeignFutureResultF64> {
|
|
1512
|
+
static UniffiForeignFutureResultF64 fromJs(jsi::Runtime &rt,
|
|
1568
1513
|
std::shared_ptr<CallInvoker> callInvoker,
|
|
1569
1514
|
const jsi::Value &jsValue
|
|
1570
1515
|
) {
|
|
1571
1516
|
// Check if the input is an object
|
|
1572
1517
|
if (!jsValue.isObject()) {
|
|
1573
|
-
throw jsi::JSError(rt, "Expected an object for
|
|
1518
|
+
throw jsi::JSError(rt, "Expected an object for UniffiForeignFutureResultF64");
|
|
1574
1519
|
}
|
|
1575
1520
|
|
|
1576
1521
|
// Get the object from the jsi::Value
|
|
1577
1522
|
auto jsObject = jsValue.getObject(rt);
|
|
1578
1523
|
|
|
1579
1524
|
// Create the vtable struct
|
|
1580
|
-
|
|
1525
|
+
UniffiForeignFutureResultF64 rsObject;
|
|
1581
1526
|
|
|
1582
1527
|
// Create the vtable from the js callbacks.
|
|
1583
1528
|
rsObject.return_value = uniffi_jsi::Bridging<double>::fromJs(
|
|
@@ -1625,81 +1570,7 @@ template <> struct Bridging<UniffiForeignFutureCompleteF64> {
|
|
|
1625
1570
|
UniffiForeignFutureCompleteF64 func) {
|
|
1626
1571
|
// Convert the arguments into the Rust, with Bridging<T>::fromJs,
|
|
1627
1572
|
// then call the rs_callback with those arguments.
|
|
1628
|
-
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_verify_utils::Bridging<
|
|
1629
|
-
);
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
return jsi::Value::undefined();
|
|
1633
|
-
}
|
|
1634
|
-
};
|
|
1635
|
-
} // namespace uniffi::zcam1_verify_utils
|
|
1636
|
-
namespace uniffi::zcam1_verify_utils {
|
|
1637
|
-
using namespace facebook;
|
|
1638
|
-
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
1639
|
-
|
|
1640
|
-
template <> struct Bridging<UniffiForeignFutureStructPointer> {
|
|
1641
|
-
static UniffiForeignFutureStructPointer fromJs(jsi::Runtime &rt,
|
|
1642
|
-
std::shared_ptr<CallInvoker> callInvoker,
|
|
1643
|
-
const jsi::Value &jsValue
|
|
1644
|
-
) {
|
|
1645
|
-
// Check if the input is an object
|
|
1646
|
-
if (!jsValue.isObject()) {
|
|
1647
|
-
throw jsi::JSError(rt, "Expected an object for UniffiForeignFutureStructPointer");
|
|
1648
|
-
}
|
|
1649
|
-
|
|
1650
|
-
// Get the object from the jsi::Value
|
|
1651
|
-
auto jsObject = jsValue.getObject(rt);
|
|
1652
|
-
|
|
1653
|
-
// Create the vtable struct
|
|
1654
|
-
UniffiForeignFutureStructPointer rsObject;
|
|
1655
|
-
|
|
1656
|
-
// Create the vtable from the js callbacks.
|
|
1657
|
-
rsObject.return_value = uniffi_jsi::Bridging<void *>::fromJs(
|
|
1658
|
-
rt, callInvoker,
|
|
1659
|
-
jsObject.getProperty(rt, "returnValue")
|
|
1660
|
-
);
|
|
1661
|
-
rsObject.call_status = uniffi::zcam1_verify_utils::Bridging<RustCallStatus>::fromJs(
|
|
1662
|
-
rt, callInvoker,
|
|
1663
|
-
jsObject.getProperty(rt, "callStatus")
|
|
1664
|
-
);
|
|
1665
|
-
|
|
1666
|
-
return rsObject;
|
|
1667
|
-
}
|
|
1668
|
-
};
|
|
1669
|
-
|
|
1670
|
-
} // namespace uniffi::zcam1_verify_utils
|
|
1671
|
-
// Implementation of callback function calling from JS to Rust ForeignFutureCompletePointer,
|
|
1672
|
-
// passed from Rust to JS as part of async callbacks.
|
|
1673
|
-
namespace uniffi::zcam1_verify_utils {
|
|
1674
|
-
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
1675
|
-
|
|
1676
|
-
template <> struct Bridging<UniffiForeignFutureCompletePointer> {
|
|
1677
|
-
static jsi::Value toJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker, UniffiForeignFutureCompletePointer rsCallback) {
|
|
1678
|
-
return jsi::Function::createFromHostFunction(
|
|
1679
|
-
rt,
|
|
1680
|
-
jsi::PropNameID::forAscii(rt, "--ForeignFutureCompletePointer"),
|
|
1681
|
-
2,
|
|
1682
|
-
[rsCallback, callInvoker](
|
|
1683
|
-
jsi::Runtime &rt,
|
|
1684
|
-
const jsi::Value &thisValue,
|
|
1685
|
-
const jsi::Value *arguments,
|
|
1686
|
-
size_t count) -> jsi::Value
|
|
1687
|
-
{
|
|
1688
|
-
return intoRust(rt, callInvoker, thisValue, arguments, count, rsCallback);
|
|
1689
|
-
}
|
|
1690
|
-
);
|
|
1691
|
-
}
|
|
1692
|
-
|
|
1693
|
-
static jsi::Value intoRust(
|
|
1694
|
-
jsi::Runtime &rt,
|
|
1695
|
-
std::shared_ptr<CallInvoker> callInvoker,
|
|
1696
|
-
const jsi::Value &thisValue,
|
|
1697
|
-
const jsi::Value *args,
|
|
1698
|
-
size_t count,
|
|
1699
|
-
UniffiForeignFutureCompletePointer func) {
|
|
1700
|
-
// Convert the arguments into the Rust, with Bridging<T>::fromJs,
|
|
1701
|
-
// then call the rs_callback with those arguments.
|
|
1702
|
-
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_verify_utils::Bridging<UniffiForeignFutureStructPointer>::fromJs(rt, callInvoker, args[1])
|
|
1573
|
+
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_verify_utils::Bridging<UniffiForeignFutureResultF64>::fromJs(rt, callInvoker, args[1])
|
|
1703
1574
|
);
|
|
1704
1575
|
|
|
1705
1576
|
|
|
@@ -1711,21 +1582,21 @@ namespace uniffi::zcam1_verify_utils {
|
|
|
1711
1582
|
using namespace facebook;
|
|
1712
1583
|
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
1713
1584
|
|
|
1714
|
-
template <> struct Bridging<
|
|
1715
|
-
static
|
|
1585
|
+
template <> struct Bridging<UniffiForeignFutureResultRustBuffer> {
|
|
1586
|
+
static UniffiForeignFutureResultRustBuffer fromJs(jsi::Runtime &rt,
|
|
1716
1587
|
std::shared_ptr<CallInvoker> callInvoker,
|
|
1717
1588
|
const jsi::Value &jsValue
|
|
1718
1589
|
) {
|
|
1719
1590
|
// Check if the input is an object
|
|
1720
1591
|
if (!jsValue.isObject()) {
|
|
1721
|
-
throw jsi::JSError(rt, "Expected an object for
|
|
1592
|
+
throw jsi::JSError(rt, "Expected an object for UniffiForeignFutureResultRustBuffer");
|
|
1722
1593
|
}
|
|
1723
1594
|
|
|
1724
1595
|
// Get the object from the jsi::Value
|
|
1725
1596
|
auto jsObject = jsValue.getObject(rt);
|
|
1726
1597
|
|
|
1727
1598
|
// Create the vtable struct
|
|
1728
|
-
|
|
1599
|
+
UniffiForeignFutureResultRustBuffer rsObject;
|
|
1729
1600
|
|
|
1730
1601
|
// Create the vtable from the js callbacks.
|
|
1731
1602
|
rsObject.return_value = uniffi::zcam1_verify_utils::Bridging<RustBuffer>::fromJs(
|
|
@@ -1773,7 +1644,7 @@ template <> struct Bridging<UniffiForeignFutureCompleteRustBuffer> {
|
|
|
1773
1644
|
UniffiForeignFutureCompleteRustBuffer func) {
|
|
1774
1645
|
// Convert the arguments into the Rust, with Bridging<T>::fromJs,
|
|
1775
1646
|
// then call the rs_callback with those arguments.
|
|
1776
|
-
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_verify_utils::Bridging<
|
|
1647
|
+
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_verify_utils::Bridging<UniffiForeignFutureResultRustBuffer>::fromJs(rt, callInvoker, args[1])
|
|
1777
1648
|
);
|
|
1778
1649
|
|
|
1779
1650
|
|
|
@@ -1785,21 +1656,21 @@ namespace uniffi::zcam1_verify_utils {
|
|
|
1785
1656
|
using namespace facebook;
|
|
1786
1657
|
using CallInvoker = uniffi_runtime::UniffiCallInvoker;
|
|
1787
1658
|
|
|
1788
|
-
template <> struct Bridging<
|
|
1789
|
-
static
|
|
1659
|
+
template <> struct Bridging<UniffiForeignFutureResultVoid> {
|
|
1660
|
+
static UniffiForeignFutureResultVoid fromJs(jsi::Runtime &rt,
|
|
1790
1661
|
std::shared_ptr<CallInvoker> callInvoker,
|
|
1791
1662
|
const jsi::Value &jsValue
|
|
1792
1663
|
) {
|
|
1793
1664
|
// Check if the input is an object
|
|
1794
1665
|
if (!jsValue.isObject()) {
|
|
1795
|
-
throw jsi::JSError(rt, "Expected an object for
|
|
1666
|
+
throw jsi::JSError(rt, "Expected an object for UniffiForeignFutureResultVoid");
|
|
1796
1667
|
}
|
|
1797
1668
|
|
|
1798
1669
|
// Get the object from the jsi::Value
|
|
1799
1670
|
auto jsObject = jsValue.getObject(rt);
|
|
1800
1671
|
|
|
1801
1672
|
// Create the vtable struct
|
|
1802
|
-
|
|
1673
|
+
UniffiForeignFutureResultVoid rsObject;
|
|
1803
1674
|
|
|
1804
1675
|
// Create the vtable from the js callbacks.
|
|
1805
1676
|
rsObject.call_status = uniffi::zcam1_verify_utils::Bridging<RustCallStatus>::fromJs(
|
|
@@ -1843,7 +1714,7 @@ template <> struct Bridging<UniffiForeignFutureCompleteVoid> {
|
|
|
1843
1714
|
UniffiForeignFutureCompleteVoid func) {
|
|
1844
1715
|
// Convert the arguments into the Rust, with Bridging<T>::fromJs,
|
|
1845
1716
|
// then call the rs_callback with those arguments.
|
|
1846
|
-
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_verify_utils::Bridging<
|
|
1717
|
+
func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_verify_utils::Bridging<UniffiForeignFutureResultVoid>::fromJs(rt, callInvoker, args[1])
|
|
1847
1718
|
);
|
|
1848
1719
|
|
|
1849
1720
|
|
|
@@ -1914,12 +1785,12 @@ NativeZcam1VerifyUtils::NativeZcam1VerifyUtils(
|
|
|
1914
1785
|
return this->cpp_uniffi_zcam1_verify_utils_fn_func_verify_bindings_from_manifest(rt, thisVal, args, count);
|
|
1915
1786
|
}
|
|
1916
1787
|
);
|
|
1917
|
-
props["
|
|
1788
|
+
props["ubrn_uniffi_zcam1_verify_utils_fn_func_verify_proof_from_manifest"] = jsi::Function::createFromHostFunction(
|
|
1918
1789
|
rt,
|
|
1919
|
-
jsi::PropNameID::forAscii(rt, "
|
|
1920
|
-
|
|
1790
|
+
jsi::PropNameID::forAscii(rt, "ubrn_uniffi_zcam1_verify_utils_fn_func_verify_proof_from_manifest"),
|
|
1791
|
+
5,
|
|
1921
1792
|
[this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
|
|
1922
|
-
return this->
|
|
1793
|
+
return this->cpp_uniffi_zcam1_verify_utils_fn_func_verify_proof_from_manifest(rt, thisVal, args, count);
|
|
1923
1794
|
}
|
|
1924
1795
|
);
|
|
1925
1796
|
props["ubrn_uniffi_zcam1_verify_utils_checksum_func_verify_bindings_from_manifest"] = jsi::Function::createFromHostFunction(
|
|
@@ -1930,12 +1801,12 @@ NativeZcam1VerifyUtils::NativeZcam1VerifyUtils(
|
|
|
1930
1801
|
return this->cpp_uniffi_zcam1_verify_utils_checksum_func_verify_bindings_from_manifest(rt, thisVal, args, count);
|
|
1931
1802
|
}
|
|
1932
1803
|
);
|
|
1933
|
-
props["
|
|
1804
|
+
props["ubrn_uniffi_zcam1_verify_utils_checksum_func_verify_proof_from_manifest"] = jsi::Function::createFromHostFunction(
|
|
1934
1805
|
rt,
|
|
1935
|
-
jsi::PropNameID::forAscii(rt, "
|
|
1806
|
+
jsi::PropNameID::forAscii(rt, "ubrn_uniffi_zcam1_verify_utils_checksum_func_verify_proof_from_manifest"),
|
|
1936
1807
|
0,
|
|
1937
1808
|
[this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
|
|
1938
|
-
return this->
|
|
1809
|
+
return this->cpp_uniffi_zcam1_verify_utils_checksum_func_verify_proof_from_manifest(rt, thisVal, args, count);
|
|
1939
1810
|
}
|
|
1940
1811
|
);
|
|
1941
1812
|
props["ubrn_ffi_zcam1_verify_utils_uniffi_contract_version"] = jsi::Function::createFromHostFunction(
|
|
@@ -1983,8 +1854,10 @@ void NativeZcam1VerifyUtils::set(jsi::Runtime& rt, const jsi::PropNameID& name,
|
|
|
1983
1854
|
NativeZcam1VerifyUtils::~NativeZcam1VerifyUtils() {
|
|
1984
1855
|
// Cleanup for callback function RustFutureContinuationCallback
|
|
1985
1856
|
uniffi::zcam1_verify_utils::cb::rustfuturecontinuationcallback::cleanup();
|
|
1857
|
+
// Cleanup for callback function ForeignFutureDroppedCallback
|
|
1858
|
+
uniffi::zcam1_verify_utils::cb::foreignfuturedroppedcallback::cleanup();
|
|
1986
1859
|
// Cleanup for "free" callback function CallbackInterfaceFree
|
|
1987
|
-
|
|
1860
|
+
|
|
1988
1861
|
}
|
|
1989
1862
|
|
|
1990
1863
|
// Utility functions for serialization/deserialization of strings.
|
|
@@ -2011,9 +1884,9 @@ jsi::Value NativeZcam1VerifyUtils::cpp_uniffi_zcam1_verify_utils_fn_func_verify_
|
|
|
2011
1884
|
|
|
2012
1885
|
return uniffi_jsi::Bridging<int8_t>::toJs(rt, callInvoker, value);
|
|
2013
1886
|
}
|
|
2014
|
-
jsi::Value NativeZcam1VerifyUtils::
|
|
1887
|
+
jsi::Value NativeZcam1VerifyUtils::cpp_uniffi_zcam1_verify_utils_fn_func_verify_proof_from_manifest(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
|
|
2015
1888
|
RustCallStatus status = uniffi::zcam1_verify_utils::Bridging<RustCallStatus>::rustSuccess(rt);
|
|
2016
|
-
auto value =
|
|
1889
|
+
auto value = uniffi_zcam1_verify_utils_fn_func_verify_proof_from_manifest(uniffi::zcam1_verify_utils::Bridging<RustBuffer>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_verify_utils::Bridging<RustBuffer>::fromJs(rt, callInvoker, args[1]), uniffi::zcam1_verify_utils::Bridging<RustBuffer>::fromJs(rt, callInvoker, args[2]), uniffi::zcam1_verify_utils::Bridging<RustBuffer>::fromJs(rt, callInvoker, args[3]), uniffi::zcam1_verify_utils::Bridging<RustBuffer>::fromJs(rt, callInvoker, args[4]),
|
|
2017
1890
|
&status
|
|
2018
1891
|
);
|
|
2019
1892
|
uniffi::zcam1_verify_utils::Bridging<RustCallStatus>::copyIntoJs(rt, callInvoker, status, args[count - 1]);
|
|
@@ -2028,8 +1901,8 @@ jsi::Value NativeZcam1VerifyUtils::cpp_uniffi_zcam1_verify_utils_checksum_func_v
|
|
|
2028
1901
|
|
|
2029
1902
|
return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
|
|
2030
1903
|
}
|
|
2031
|
-
jsi::Value NativeZcam1VerifyUtils::
|
|
2032
|
-
auto value =
|
|
1904
|
+
jsi::Value NativeZcam1VerifyUtils::cpp_uniffi_zcam1_verify_utils_checksum_func_verify_proof_from_manifest(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
|
|
1905
|
+
auto value = uniffi_zcam1_verify_utils_checksum_func_verify_proof_from_manifest(
|
|
2033
1906
|
);
|
|
2034
1907
|
|
|
2035
1908
|
|