@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.
Files changed (127) hide show
  1. package/Zcam1Sdk.podspec +2 -2
  2. package/android/CMakeLists.txt +114 -0
  3. package/android/build.gradle +213 -0
  4. package/android/cpp-adapter-proving.cpp +35 -0
  5. package/android/cpp-adapter.cpp +35 -0
  6. package/android/src/main/AndroidManifest.xml +5 -0
  7. package/android/src/main/java/com/succinctlabs/zcam1sdk/Zcam1CaptureModule.kt +156 -0
  8. package/android/src/main/java/com/succinctlabs/zcam1sdk/Zcam1CapturePackage.kt +38 -0
  9. package/android/src/main/java/com/succinctlabs/zcam1sdk/Zcam1ProvingModule.kt +43 -0
  10. package/android/src/main/java/com/succinctlabs/zcam1sdk/Zcam1ProvingPackage.kt +34 -0
  11. package/android/src/main/java/com/succinctlabs/zcam1sdk/Zcam1SdkModule.kt +43 -0
  12. package/android/src/main/java/com/succinctlabs/zcam1sdk/Zcam1SdkPackage.kt +34 -0
  13. package/android/src/main/java/com/succinctlabs/zcam1sdk/camera/CameraUtils.kt +80 -0
  14. package/android/src/main/java/com/succinctlabs/zcam1sdk/camera/Zcam1CameraService.kt +588 -0
  15. package/android/src/main/java/com/succinctlabs/zcam1sdk/camera/Zcam1CameraView.kt +107 -0
  16. package/android/src/main/java/com/succinctlabs/zcam1sdk/camera/Zcam1CameraViewManager.kt +33 -0
  17. package/android/src/main/java/com/succinctlabs/zcam1sdk/camera/Zcam1OrientationManager.kt +73 -0
  18. package/cpp/generated/zcam1_c2pa_utils.cpp +170 -365
  19. package/cpp/generated/zcam1_c2pa_utils.hpp +0 -4
  20. package/cpp/generated/zcam1_certs_utils.cpp +121 -250
  21. package/cpp/generated/zcam1_common.cpp +1871 -0
  22. package/cpp/generated/zcam1_common.hpp +52 -0
  23. package/cpp/generated/zcam1_verify_utils.cpp +138 -265
  24. package/cpp/generated/zcam1_verify_utils.hpp +2 -2
  25. package/cpp/proving/generated/zcam1_common.cpp +1871 -0
  26. package/cpp/proving/generated/zcam1_common.hpp +52 -0
  27. package/cpp/proving/generated/zcam1_proving_utils.cpp +355 -417
  28. package/cpp/proving/generated/zcam1_proving_utils.hpp +13 -17
  29. package/cpp/proving/zcam1-proving.cpp +2 -0
  30. package/cpp/zcam1-sdk.cpp +2 -0
  31. package/lib/module/bindings.js +4 -0
  32. package/lib/module/bindings.js.map +1 -1
  33. package/lib/module/camera.js +71 -13
  34. package/lib/module/camera.js.map +1 -1
  35. package/lib/module/capture.js +115 -38
  36. package/lib/module/capture.js.map +1 -1
  37. package/lib/module/common.js +18 -2
  38. package/lib/module/common.js.map +1 -1
  39. package/lib/module/generated/zcam1_c2pa_utils-ffi.js +4 -0
  40. package/lib/module/generated/zcam1_c2pa_utils-ffi.js.map +1 -1
  41. package/lib/module/generated/zcam1_c2pa_utils.js +117 -9
  42. package/lib/module/generated/zcam1_c2pa_utils.js.map +1 -1
  43. package/lib/module/generated/zcam1_certs_utils-ffi.js +4 -0
  44. package/lib/module/generated/zcam1_certs_utils-ffi.js.map +1 -1
  45. package/lib/module/generated/zcam1_certs_utils.js +6 -2
  46. package/lib/module/generated/zcam1_certs_utils.js.map +1 -1
  47. package/lib/module/generated/zcam1_common-ffi.js +47 -0
  48. package/lib/module/generated/zcam1_common-ffi.js.map +1 -0
  49. package/lib/module/generated/zcam1_common.js +60 -0
  50. package/lib/module/generated/zcam1_common.js.map +1 -0
  51. package/lib/module/generated/zcam1_proving_utils-ffi.js +4 -0
  52. package/lib/module/generated/zcam1_proving_utils-ffi.js.map +1 -1
  53. package/lib/module/generated/zcam1_proving_utils.js +53 -46
  54. package/lib/module/generated/zcam1_proving_utils.js.map +1 -1
  55. package/lib/module/generated/zcam1_verify_utils-ffi.js +4 -0
  56. package/lib/module/generated/zcam1_verify_utils-ffi.js.map +1 -1
  57. package/lib/module/generated/zcam1_verify_utils.js +70 -22
  58. package/lib/module/generated/zcam1_verify_utils.js.map +1 -1
  59. package/lib/module/index.js +1 -1
  60. package/lib/module/index.js.map +1 -1
  61. package/lib/module/proving/NativeZcam1Proving.js +1 -1
  62. package/lib/module/proving/index.js +1 -1
  63. package/lib/module/proving/index.js.map +1 -1
  64. package/lib/module/proving/prove.js +14 -8
  65. package/lib/module/proving/prove.js.map +1 -1
  66. package/lib/module/utils.js +19 -14
  67. package/lib/module/utils.js.map +1 -1
  68. package/lib/module/verify.js +14 -22
  69. package/lib/module/verify.js.map +1 -1
  70. package/lib/typescript/src/bindings.d.ts +3 -0
  71. package/lib/typescript/src/bindings.d.ts.map +1 -1
  72. package/lib/typescript/src/camera.d.ts +15 -0
  73. package/lib/typescript/src/camera.d.ts.map +1 -1
  74. package/lib/typescript/src/capture.d.ts +40 -1
  75. package/lib/typescript/src/capture.d.ts.map +1 -1
  76. package/lib/typescript/src/common.d.ts.map +1 -1
  77. package/lib/typescript/src/generated/zcam1_c2pa_utils-ffi.d.ts +37 -46
  78. package/lib/typescript/src/generated/zcam1_c2pa_utils-ffi.d.ts.map +1 -1
  79. package/lib/typescript/src/generated/zcam1_c2pa_utils.d.ts +110 -8
  80. package/lib/typescript/src/generated/zcam1_c2pa_utils.d.ts.map +1 -1
  81. package/lib/typescript/src/generated/zcam1_certs_utils-ffi.d.ts +27 -32
  82. package/lib/typescript/src/generated/zcam1_certs_utils-ffi.d.ts.map +1 -1
  83. package/lib/typescript/src/generated/zcam1_certs_utils.d.ts.map +1 -1
  84. package/lib/typescript/src/generated/zcam1_common-ffi.d.ts +77 -0
  85. package/lib/typescript/src/generated/zcam1_common-ffi.d.ts.map +1 -0
  86. package/lib/typescript/src/generated/zcam1_common.d.ts +17 -0
  87. package/lib/typescript/src/generated/zcam1_common.d.ts.map +1 -0
  88. package/lib/typescript/src/generated/zcam1_proving_utils-ffi.d.ts +44 -51
  89. package/lib/typescript/src/generated/zcam1_proving_utils-ffi.d.ts.map +1 -1
  90. package/lib/typescript/src/generated/zcam1_proving_utils.d.ts +26 -26
  91. package/lib/typescript/src/generated/zcam1_proving_utils.d.ts.map +1 -1
  92. package/lib/typescript/src/generated/zcam1_verify_utils-ffi.d.ts +29 -34
  93. package/lib/typescript/src/generated/zcam1_verify_utils-ffi.d.ts.map +1 -1
  94. package/lib/typescript/src/generated/zcam1_verify_utils.d.ts +94 -14
  95. package/lib/typescript/src/generated/zcam1_verify_utils.d.ts.map +1 -1
  96. package/lib/typescript/src/index.d.ts +1 -1
  97. package/lib/typescript/src/index.d.ts.map +1 -1
  98. package/lib/typescript/src/proving/NativeZcam1Proving.d.ts +1 -1
  99. package/lib/typescript/src/proving/index.d.ts +1 -1
  100. package/lib/typescript/src/proving/index.d.ts.map +1 -1
  101. package/lib/typescript/src/proving/prove.d.ts +3 -3
  102. package/lib/typescript/src/proving/prove.d.ts.map +1 -1
  103. package/lib/typescript/src/utils.d.ts.map +1 -1
  104. package/lib/typescript/src/verify.d.ts +4 -3
  105. package/lib/typescript/src/verify.d.ts.map +1 -1
  106. package/package.json +13 -6
  107. package/react-native.config.js +11 -0
  108. package/src/bindings.tsx +4 -0
  109. package/src/camera.tsx +116 -11
  110. package/src/capture.tsx +150 -53
  111. package/src/common.tsx +22 -2
  112. package/src/generated/zcam1_c2pa_utils-ffi.ts +42 -56
  113. package/src/generated/zcam1_c2pa_utils.ts +224 -67
  114. package/src/generated/zcam1_certs_utils-ffi.ts +33 -36
  115. package/src/generated/zcam1_certs_utils.ts +27 -24
  116. package/src/generated/zcam1_common-ffi.ts +183 -0
  117. package/src/generated/zcam1_common.ts +116 -0
  118. package/src/generated/zcam1_proving_utils-ffi.ts +54 -67
  119. package/src/generated/zcam1_proving_utils.ts +133 -138
  120. package/src/generated/zcam1_verify_utils-ffi.ts +39 -40
  121. package/src/generated/zcam1_verify_utils.ts +109 -47
  122. package/src/index.ts +1 -1
  123. package/src/proving/NativeZcam1Proving.ts +2 -2
  124. package/src/proving/index.ts +1 -1
  125. package/src/proving/prove.tsx +22 -11
  126. package/src/utils.ts +26 -20
  127. package/src/verify.tsx +25 -42
@@ -0,0 +1,1871 @@
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
+ #include "zcam1_common.hpp"
4
+
5
+ #include "UniffiJsiTypes.h"
6
+ #include <stdexcept>
7
+ #include <map>
8
+ #include <utility>
9
+ #include <iostream>
10
+ #include <thread>
11
+
12
+ namespace react = facebook::react;
13
+ namespace jsi = facebook::jsi;
14
+
15
+ // Calling into Rust.
16
+ extern "C" {
17
+ typedef void
18
+ (*UniffiRustFutureContinuationCallback)(
19
+ uint64_t data,
20
+ int8_t poll_result
21
+ );
22
+ typedef void
23
+ (*UniffiForeignFutureDroppedCallback)(
24
+ uint64_t handle
25
+ );
26
+ typedef void
27
+ (*UniffiCallbackInterfaceFree)(
28
+ uint64_t handle
29
+ );
30
+ typedef uint64_t
31
+ (*UniffiCallbackInterfaceClone)(
32
+ uint64_t handle
33
+ );typedef struct UniffiForeignFutureDroppedCallbackStruct {
34
+ uint64_t handle;
35
+ UniffiForeignFutureDroppedCallback free;
36
+ } UniffiForeignFutureDroppedCallbackStruct;typedef struct UniffiForeignFutureResultU8 {
37
+ uint8_t return_value;
38
+ RustCallStatus call_status;
39
+ } UniffiForeignFutureResultU8;
40
+ typedef void
41
+ (*UniffiForeignFutureCompleteU8)(
42
+ uint64_t callback_data,
43
+ UniffiForeignFutureResultU8 result
44
+ );typedef struct UniffiForeignFutureResultI8 {
45
+ int8_t return_value;
46
+ RustCallStatus call_status;
47
+ } UniffiForeignFutureResultI8;
48
+ typedef void
49
+ (*UniffiForeignFutureCompleteI8)(
50
+ uint64_t callback_data,
51
+ UniffiForeignFutureResultI8 result
52
+ );typedef struct UniffiForeignFutureResultU16 {
53
+ uint16_t return_value;
54
+ RustCallStatus call_status;
55
+ } UniffiForeignFutureResultU16;
56
+ typedef void
57
+ (*UniffiForeignFutureCompleteU16)(
58
+ uint64_t callback_data,
59
+ UniffiForeignFutureResultU16 result
60
+ );typedef struct UniffiForeignFutureResultI16 {
61
+ int16_t return_value;
62
+ RustCallStatus call_status;
63
+ } UniffiForeignFutureResultI16;
64
+ typedef void
65
+ (*UniffiForeignFutureCompleteI16)(
66
+ uint64_t callback_data,
67
+ UniffiForeignFutureResultI16 result
68
+ );typedef struct UniffiForeignFutureResultU32 {
69
+ uint32_t return_value;
70
+ RustCallStatus call_status;
71
+ } UniffiForeignFutureResultU32;
72
+ typedef void
73
+ (*UniffiForeignFutureCompleteU32)(
74
+ uint64_t callback_data,
75
+ UniffiForeignFutureResultU32 result
76
+ );typedef struct UniffiForeignFutureResultI32 {
77
+ int32_t return_value;
78
+ RustCallStatus call_status;
79
+ } UniffiForeignFutureResultI32;
80
+ typedef void
81
+ (*UniffiForeignFutureCompleteI32)(
82
+ uint64_t callback_data,
83
+ UniffiForeignFutureResultI32 result
84
+ );typedef struct UniffiForeignFutureResultU64 {
85
+ uint64_t return_value;
86
+ RustCallStatus call_status;
87
+ } UniffiForeignFutureResultU64;
88
+ typedef void
89
+ (*UniffiForeignFutureCompleteU64)(
90
+ uint64_t callback_data,
91
+ UniffiForeignFutureResultU64 result
92
+ );typedef struct UniffiForeignFutureResultI64 {
93
+ int64_t return_value;
94
+ RustCallStatus call_status;
95
+ } UniffiForeignFutureResultI64;
96
+ typedef void
97
+ (*UniffiForeignFutureCompleteI64)(
98
+ uint64_t callback_data,
99
+ UniffiForeignFutureResultI64 result
100
+ );typedef struct UniffiForeignFutureResultF32 {
101
+ float return_value;
102
+ RustCallStatus call_status;
103
+ } UniffiForeignFutureResultF32;
104
+ typedef void
105
+ (*UniffiForeignFutureCompleteF32)(
106
+ uint64_t callback_data,
107
+ UniffiForeignFutureResultF32 result
108
+ );typedef struct UniffiForeignFutureResultF64 {
109
+ double return_value;
110
+ RustCallStatus call_status;
111
+ } UniffiForeignFutureResultF64;
112
+ typedef void
113
+ (*UniffiForeignFutureCompleteF64)(
114
+ uint64_t callback_data,
115
+ UniffiForeignFutureResultF64 result
116
+ );typedef struct UniffiForeignFutureResultRustBuffer {
117
+ RustBuffer return_value;
118
+ RustCallStatus call_status;
119
+ } UniffiForeignFutureResultRustBuffer;
120
+ typedef void
121
+ (*UniffiForeignFutureCompleteRustBuffer)(
122
+ uint64_t callback_data,
123
+ UniffiForeignFutureResultRustBuffer result
124
+ );typedef struct UniffiForeignFutureResultVoid {
125
+ RustCallStatus call_status;
126
+ } UniffiForeignFutureResultVoid;
127
+ typedef void
128
+ (*UniffiForeignFutureCompleteVoid)(
129
+ uint64_t callback_data,
130
+ UniffiForeignFutureResultVoid result
131
+ );
132
+ RustBuffer uniffi_zcam1_common_fn_func_root_certs(
133
+ RustBuffer platform,
134
+ RustCallStatus *uniffi_out_err
135
+ );
136
+ RustBuffer ffi_zcam1_common_rustbuffer_alloc(
137
+ uint64_t size,
138
+ RustCallStatus *uniffi_out_err
139
+ );
140
+ RustBuffer ffi_zcam1_common_rustbuffer_from_bytes(
141
+ ForeignBytes bytes,
142
+ RustCallStatus *uniffi_out_err
143
+ );
144
+ void ffi_zcam1_common_rustbuffer_free(
145
+ RustBuffer buf,
146
+ RustCallStatus *uniffi_out_err
147
+ );
148
+ RustBuffer ffi_zcam1_common_rustbuffer_reserve(
149
+ RustBuffer buf,
150
+ uint64_t additional,
151
+ RustCallStatus *uniffi_out_err
152
+ );
153
+ void ffi_zcam1_common_rust_future_poll_u8(
154
+ /*handle*/ uint64_t handle,
155
+ UniffiRustFutureContinuationCallback callback,
156
+ /*handle*/ uint64_t callback_data
157
+ );
158
+ void ffi_zcam1_common_rust_future_cancel_u8(
159
+ /*handle*/ uint64_t handle
160
+ );
161
+ void ffi_zcam1_common_rust_future_free_u8(
162
+ /*handle*/ uint64_t handle
163
+ );
164
+ uint8_t ffi_zcam1_common_rust_future_complete_u8(
165
+ /*handle*/ uint64_t handle,
166
+ RustCallStatus *uniffi_out_err
167
+ );
168
+ void ffi_zcam1_common_rust_future_poll_i8(
169
+ /*handle*/ uint64_t handle,
170
+ UniffiRustFutureContinuationCallback callback,
171
+ /*handle*/ uint64_t callback_data
172
+ );
173
+ void ffi_zcam1_common_rust_future_cancel_i8(
174
+ /*handle*/ uint64_t handle
175
+ );
176
+ void ffi_zcam1_common_rust_future_free_i8(
177
+ /*handle*/ uint64_t handle
178
+ );
179
+ int8_t ffi_zcam1_common_rust_future_complete_i8(
180
+ /*handle*/ uint64_t handle,
181
+ RustCallStatus *uniffi_out_err
182
+ );
183
+ void ffi_zcam1_common_rust_future_poll_u16(
184
+ /*handle*/ uint64_t handle,
185
+ UniffiRustFutureContinuationCallback callback,
186
+ /*handle*/ uint64_t callback_data
187
+ );
188
+ void ffi_zcam1_common_rust_future_cancel_u16(
189
+ /*handle*/ uint64_t handle
190
+ );
191
+ void ffi_zcam1_common_rust_future_free_u16(
192
+ /*handle*/ uint64_t handle
193
+ );
194
+ uint16_t ffi_zcam1_common_rust_future_complete_u16(
195
+ /*handle*/ uint64_t handle,
196
+ RustCallStatus *uniffi_out_err
197
+ );
198
+ void ffi_zcam1_common_rust_future_poll_i16(
199
+ /*handle*/ uint64_t handle,
200
+ UniffiRustFutureContinuationCallback callback,
201
+ /*handle*/ uint64_t callback_data
202
+ );
203
+ void ffi_zcam1_common_rust_future_cancel_i16(
204
+ /*handle*/ uint64_t handle
205
+ );
206
+ void ffi_zcam1_common_rust_future_free_i16(
207
+ /*handle*/ uint64_t handle
208
+ );
209
+ int16_t ffi_zcam1_common_rust_future_complete_i16(
210
+ /*handle*/ uint64_t handle,
211
+ RustCallStatus *uniffi_out_err
212
+ );
213
+ void ffi_zcam1_common_rust_future_poll_u32(
214
+ /*handle*/ uint64_t handle,
215
+ UniffiRustFutureContinuationCallback callback,
216
+ /*handle*/ uint64_t callback_data
217
+ );
218
+ void ffi_zcam1_common_rust_future_cancel_u32(
219
+ /*handle*/ uint64_t handle
220
+ );
221
+ void ffi_zcam1_common_rust_future_free_u32(
222
+ /*handle*/ uint64_t handle
223
+ );
224
+ uint32_t ffi_zcam1_common_rust_future_complete_u32(
225
+ /*handle*/ uint64_t handle,
226
+ RustCallStatus *uniffi_out_err
227
+ );
228
+ void ffi_zcam1_common_rust_future_poll_i32(
229
+ /*handle*/ uint64_t handle,
230
+ UniffiRustFutureContinuationCallback callback,
231
+ /*handle*/ uint64_t callback_data
232
+ );
233
+ void ffi_zcam1_common_rust_future_cancel_i32(
234
+ /*handle*/ uint64_t handle
235
+ );
236
+ void ffi_zcam1_common_rust_future_free_i32(
237
+ /*handle*/ uint64_t handle
238
+ );
239
+ int32_t ffi_zcam1_common_rust_future_complete_i32(
240
+ /*handle*/ uint64_t handle,
241
+ RustCallStatus *uniffi_out_err
242
+ );
243
+ void ffi_zcam1_common_rust_future_poll_u64(
244
+ /*handle*/ uint64_t handle,
245
+ UniffiRustFutureContinuationCallback callback,
246
+ /*handle*/ uint64_t callback_data
247
+ );
248
+ void ffi_zcam1_common_rust_future_cancel_u64(
249
+ /*handle*/ uint64_t handle
250
+ );
251
+ void ffi_zcam1_common_rust_future_free_u64(
252
+ /*handle*/ uint64_t handle
253
+ );
254
+ uint64_t ffi_zcam1_common_rust_future_complete_u64(
255
+ /*handle*/ uint64_t handle,
256
+ RustCallStatus *uniffi_out_err
257
+ );
258
+ void ffi_zcam1_common_rust_future_poll_i64(
259
+ /*handle*/ uint64_t handle,
260
+ UniffiRustFutureContinuationCallback callback,
261
+ /*handle*/ uint64_t callback_data
262
+ );
263
+ void ffi_zcam1_common_rust_future_cancel_i64(
264
+ /*handle*/ uint64_t handle
265
+ );
266
+ void ffi_zcam1_common_rust_future_free_i64(
267
+ /*handle*/ uint64_t handle
268
+ );
269
+ int64_t ffi_zcam1_common_rust_future_complete_i64(
270
+ /*handle*/ uint64_t handle,
271
+ RustCallStatus *uniffi_out_err
272
+ );
273
+ void ffi_zcam1_common_rust_future_poll_f32(
274
+ /*handle*/ uint64_t handle,
275
+ UniffiRustFutureContinuationCallback callback,
276
+ /*handle*/ uint64_t callback_data
277
+ );
278
+ void ffi_zcam1_common_rust_future_cancel_f32(
279
+ /*handle*/ uint64_t handle
280
+ );
281
+ void ffi_zcam1_common_rust_future_free_f32(
282
+ /*handle*/ uint64_t handle
283
+ );
284
+ float ffi_zcam1_common_rust_future_complete_f32(
285
+ /*handle*/ uint64_t handle,
286
+ RustCallStatus *uniffi_out_err
287
+ );
288
+ void ffi_zcam1_common_rust_future_poll_f64(
289
+ /*handle*/ uint64_t handle,
290
+ UniffiRustFutureContinuationCallback callback,
291
+ /*handle*/ uint64_t callback_data
292
+ );
293
+ void ffi_zcam1_common_rust_future_cancel_f64(
294
+ /*handle*/ uint64_t handle
295
+ );
296
+ void ffi_zcam1_common_rust_future_free_f64(
297
+ /*handle*/ uint64_t handle
298
+ );
299
+ double ffi_zcam1_common_rust_future_complete_f64(
300
+ /*handle*/ uint64_t handle,
301
+ RustCallStatus *uniffi_out_err
302
+ );
303
+ void ffi_zcam1_common_rust_future_poll_rust_buffer(
304
+ /*handle*/ uint64_t handle,
305
+ UniffiRustFutureContinuationCallback callback,
306
+ /*handle*/ uint64_t callback_data
307
+ );
308
+ void ffi_zcam1_common_rust_future_cancel_rust_buffer(
309
+ /*handle*/ uint64_t handle
310
+ );
311
+ void ffi_zcam1_common_rust_future_free_rust_buffer(
312
+ /*handle*/ uint64_t handle
313
+ );
314
+ RustBuffer ffi_zcam1_common_rust_future_complete_rust_buffer(
315
+ /*handle*/ uint64_t handle,
316
+ RustCallStatus *uniffi_out_err
317
+ );
318
+ void ffi_zcam1_common_rust_future_poll_void(
319
+ /*handle*/ uint64_t handle,
320
+ UniffiRustFutureContinuationCallback callback,
321
+ /*handle*/ uint64_t callback_data
322
+ );
323
+ void ffi_zcam1_common_rust_future_cancel_void(
324
+ /*handle*/ uint64_t handle
325
+ );
326
+ void ffi_zcam1_common_rust_future_free_void(
327
+ /*handle*/ uint64_t handle
328
+ );
329
+ void ffi_zcam1_common_rust_future_complete_void(
330
+ /*handle*/ uint64_t handle,
331
+ RustCallStatus *uniffi_out_err
332
+ );
333
+ uint16_t uniffi_zcam1_common_checksum_func_root_certs(
334
+ );
335
+ uint32_t ffi_zcam1_common_uniffi_contract_version(
336
+ );
337
+ }
338
+
339
+
340
+ namespace uniffi::zcam1_common {
341
+ template <typename T> struct Bridging;
342
+
343
+ using namespace facebook;
344
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
345
+
346
+ template <typename T> struct Bridging<ReferenceHolder<T>> {
347
+ static jsi::Value jsNew(jsi::Runtime &rt) {
348
+ auto holder = jsi::Object(rt);
349
+ return holder;
350
+ }
351
+ static T fromJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker,
352
+ const jsi::Value &value) {
353
+ auto obj = value.asObject(rt);
354
+ if (obj.hasProperty(rt, "pointee")) {
355
+ auto pointee = obj.getProperty(rt, "pointee");
356
+ return uniffi::zcam1_common::Bridging<T>::fromJs(rt, callInvoker, pointee);
357
+ }
358
+ throw jsi::JSError(
359
+ rt,
360
+ "Expected ReferenceHolder to have a pointee property. This is likely a bug in uniffi-bindgen-react-native"
361
+ );
362
+ }
363
+ };
364
+ } // namespace uniffi::zcam1_common
365
+ namespace uniffi::zcam1_common {
366
+ using namespace facebook;
367
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
368
+
369
+ template <> struct Bridging<RustBuffer> {
370
+ static RustBuffer rustbuffer_alloc(int32_t size) {
371
+ RustCallStatus status = { UNIFFI_CALL_STATUS_OK };
372
+ return ffi_zcam1_common_rustbuffer_alloc(
373
+ size,
374
+ &status
375
+ );
376
+ }
377
+
378
+ static void rustbuffer_free(RustBuffer buf) {
379
+ RustCallStatus status = { UNIFFI_CALL_STATUS_OK };
380
+ ffi_zcam1_common_rustbuffer_free(
381
+ buf,
382
+ &status
383
+ );
384
+ }
385
+
386
+ static RustBuffer rustbuffer_from_bytes(ForeignBytes bytes) {
387
+ RustCallStatus status = { UNIFFI_CALL_STATUS_OK };
388
+ return ffi_zcam1_common_rustbuffer_from_bytes(
389
+ bytes,
390
+ &status
391
+ );
392
+ }
393
+
394
+ static RustBuffer fromJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker>,
395
+ const jsi::Value &value) {
396
+ try {
397
+ auto buffer = uniffi_jsi::Bridging<jsi::ArrayBuffer>::value_to_arraybuffer(rt, value);
398
+ auto bytes = ForeignBytes{
399
+ .len = static_cast<int32_t>(buffer.length(rt)),
400
+ .data = buffer.data(rt),
401
+ };
402
+
403
+ // This buffer is constructed from foreign bytes. Rust scaffolding copies
404
+ // the bytes, to make the RustBuffer.
405
+ auto buf = rustbuffer_from_bytes(bytes);
406
+ // Once it leaves this function, the buffer is immediately passed back
407
+ // into Rust, where it's used to deserialize into the Rust versions of the
408
+ // arguments. At that point, the copy is destroyed.
409
+ return buf;
410
+ } catch (const std::logic_error &e) {
411
+ throw jsi::JSError(rt, e.what());
412
+ }
413
+ }
414
+
415
+ static jsi::Value toJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker>,
416
+ RustBuffer buf) {
417
+ // We need to make a copy of the bytes from Rust's memory space into
418
+ // Javascripts memory space. We need to do this because the two languages
419
+ // manages memory very differently: a garbage collector needs to track all
420
+ // the memory at runtime, Rust is doing it all closer to compile time.
421
+ uint8_t *bytes = new uint8_t[buf.len];
422
+ std::memcpy(bytes, buf.data, buf.len);
423
+
424
+ // Construct an ArrayBuffer with copy of the bytes from the RustBuffer.
425
+ auto payload = std::make_shared<uniffi_jsi::CMutableBuffer>(
426
+ uniffi_jsi::CMutableBuffer((uint8_t *)bytes, buf.len));
427
+ auto arrayBuffer = jsi::ArrayBuffer(rt, payload);
428
+
429
+ // Once we have a Javascript version, we no longer need the Rust version, so
430
+ // we can call into Rust to tell it it's okay to free that memory.
431
+ rustbuffer_free(buf);
432
+
433
+ // Finally, return the ArrayBuffer.
434
+ return uniffi_jsi::Bridging<jsi::ArrayBuffer>::arraybuffer_to_value(rt, arrayBuffer);;
435
+ }
436
+ };
437
+
438
+ } // namespace uniffi::zcam1_common
439
+
440
+ namespace uniffi::zcam1_common {
441
+ using namespace facebook;
442
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
443
+
444
+ template <> struct Bridging<RustCallStatus> {
445
+ static jsi::Value jsSuccess(jsi::Runtime &rt) {
446
+ auto statusObject = jsi::Object(rt);
447
+ statusObject.setProperty(rt, "code", jsi::Value(rt, UNIFFI_CALL_STATUS_OK));
448
+ return statusObject;
449
+ }
450
+ static RustCallStatus rustSuccess(jsi::Runtime &rt) {
451
+ return {UNIFFI_CALL_STATUS_OK};
452
+ }
453
+ static void copyIntoJs(jsi::Runtime &rt,
454
+ std::shared_ptr<CallInvoker> callInvoker,
455
+ const RustCallStatus status,
456
+ const jsi::Value &jsStatus) {
457
+ auto statusObject = jsStatus.asObject(rt);
458
+ if (status.error_buf.data != nullptr) {
459
+ auto rbuf = Bridging<RustBuffer>::toJs(rt, callInvoker,
460
+ status.error_buf);
461
+ statusObject.setProperty(rt, "errorBuf", rbuf);
462
+ }
463
+ if (status.code != UNIFFI_CALL_STATUS_OK) {
464
+ auto code =
465
+ uniffi_jsi::Bridging<uint8_t>::toJs(rt, callInvoker, status.code);
466
+ statusObject.setProperty(rt, "code", code);
467
+ }
468
+ }
469
+
470
+ static RustCallStatus fromJs(jsi::Runtime &rt,
471
+ std::shared_ptr<CallInvoker> invoker,
472
+ const jsi::Value &jsStatus) {
473
+ RustCallStatus status;
474
+ auto statusObject = jsStatus.asObject(rt);
475
+ if (statusObject.hasProperty(rt, "errorBuf")) {
476
+ auto rbuf = statusObject.getProperty(rt, "errorBuf");
477
+ status.error_buf =
478
+ Bridging<RustBuffer>::fromJs(rt, invoker, rbuf);
479
+ }
480
+ if (statusObject.hasProperty(rt, "code")) {
481
+ auto code = statusObject.getProperty(rt, "code");
482
+ status.code = uniffi_jsi::Bridging<uint8_t>::fromJs(rt, invoker, code);
483
+ }
484
+ return status;
485
+ }
486
+
487
+ static void copyFromJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> invoker,
488
+ const jsi::Value &jsStatus, RustCallStatus *status) {
489
+ auto statusObject = jsStatus.asObject(rt);
490
+ if (statusObject.hasProperty(rt, "errorBuf")) {
491
+ auto rbuf = statusObject.getProperty(rt, "errorBuf");
492
+ status->error_buf =
493
+ Bridging<RustBuffer>::fromJs(rt, invoker, rbuf);
494
+ }
495
+ if (statusObject.hasProperty(rt, "code")) {
496
+ auto code = statusObject.getProperty(rt, "code");
497
+ status->code = uniffi_jsi::Bridging<uint8_t>::fromJs(rt, invoker, code);
498
+ }
499
+ }
500
+ };
501
+
502
+ } // namespace uniffi::zcam1_common
503
+ // In other uniffi bindings, it is assumed that the foreign language holds on
504
+ // to the vtable, which the Rust just gets a pointer to.
505
+ // Here, we need to hold on to them, but also be able to clear them at just the
506
+ // right time so we can support hot-reloading.
507
+ namespace uniffi::zcam1_common::registry {
508
+ template <typename T>
509
+ class VTableHolder {
510
+ public:
511
+ T vtable;
512
+ VTableHolder(T v) : vtable(v) {}
513
+ };
514
+
515
+ // Mutex to bind the storage and setting of vtable together.
516
+ // We declare it here, but the lock is taken by callers of the putTable
517
+ // method who are also sending a pointer to Rust.
518
+ static std::mutex vtableMutex;
519
+
520
+ // Registry to hold all vtables so they persist even when JS objects are GC'd.
521
+ // The only reason this exists is to prevent a dangling pointer in the
522
+ // Rust machinery: i.e. we don't need to access or write to this registry
523
+ // after startup.
524
+ // Registry to hold all vtables so they persist even when JS objects are GC'd.
525
+ // Maps string identifiers to vtable holders using type erasure
526
+ static std::unordered_map<std::string, std::shared_ptr<void>> vtableRegistry;
527
+
528
+ // Add a vtable to the registry with an identifier
529
+ template <typename T>
530
+ static T* putTable(std::string_view identifier, T vtable) {
531
+ auto holder = std::make_shared<VTableHolder<T>>(vtable);
532
+ // Store the raw pointer to the vtable before type erasure
533
+ T* rawPtr = &(holder->vtable);
534
+ // Store the holder using type erasure with the string identifier
535
+ vtableRegistry[std::string(identifier)] = std::shared_ptr<void>(holder);
536
+ return rawPtr;
537
+ }
538
+
539
+ // Clear the registry.
540
+ //
541
+ // Conceptually, this is called after teardown of the module (i.e. after
542
+ // teardown of the jsi::Runtime). However, because Rust is dropping callbacks
543
+ // because the Runtime is being torn down, we must keep the registry intact
544
+ // until after the runtime goes away.
545
+ //
546
+ // Therefore, in practice we should call this when the next runtime is
547
+ // being stood up.
548
+ static void clearRegistry() {
549
+ std::lock_guard<std::mutex> lock(vtableMutex);
550
+ vtableRegistry.clear();
551
+ }
552
+ } // namespace uniffi::zcam1_common::registry
553
+
554
+ // This calls into Rust.
555
+ // Implementation of callback function calling from Rust to JS RustFutureContinuationCallback
556
+
557
+ // Callback function: uniffi::zcam1_common::cb::rustfuturecontinuationcallback::UniffiRustFutureContinuationCallback
558
+ //
559
+ // We have the following constraints:
560
+ // - we need to pass a function pointer to Rust.
561
+ // - we need a jsi::Runtime and jsi::Function to call into JS.
562
+ // - function pointers can't store state, so we can't use a lamda.
563
+ //
564
+ // For this, we store a lambda as a global, as `rsLambda`. The `callback` function calls
565
+ // the lambda, which itself calls the `body` which then calls into JS.
566
+ //
567
+ // We then give the `callback` function pointer to Rust which will call the lambda sometime in the
568
+ // future.
569
+ namespace uniffi::zcam1_common::cb::rustfuturecontinuationcallback {
570
+ using namespace facebook;
571
+
572
+ // We need to store a lambda in a global so we can call it from
573
+ // a function pointer. The function pointer is passed to Rust.
574
+ static std::function<void(uint64_t, int8_t)> rsLambda = nullptr;
575
+
576
+ // This is the main body of the callback. It's called from the lambda,
577
+ // which itself is called from the callback function which is passed to Rust.
578
+ static void body(jsi::Runtime &rt,
579
+ std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
580
+ std::shared_ptr<jsi::Value> callbackValue
581
+ ,uint64_t rs_data
582
+ ,int8_t rs_pollResult) {
583
+
584
+ // Convert the arguments from Rust, into jsi::Values.
585
+ // We'll use the Bridging class to do this…
586
+ auto js_data = uniffi_jsi::Bridging<uint64_t>::toJs(rt, callInvoker, rs_data);
587
+ auto js_pollResult = uniffi_jsi::Bridging<int8_t>::toJs(rt, callInvoker, rs_pollResult);
588
+
589
+ // Now we are ready to call the callback.
590
+ // We are already on the JS thread, because this `body` function was
591
+ // invoked from the CallInvoker.
592
+ try {
593
+ // Getting the callback function
594
+ auto cb = callbackValue->asObject(rt).asFunction(rt);
595
+ auto uniffiResult = cb.call(rt, js_data, js_pollResult
596
+ );
597
+
598
+
599
+
600
+
601
+ } catch (const jsi::JSError &error) {
602
+ std::cout << "Error in callback UniffiRustFutureContinuationCallback: "
603
+ << error.what() << std::endl;
604
+ throw error;
605
+ }
606
+ }
607
+
608
+ static void callback(uint64_t rs_data, int8_t rs_pollResult) {
609
+ // If the runtime has shutdown, then there is no point in trying to
610
+ // call into Javascript. BUT how do we tell if the runtime has shutdown?
611
+ //
612
+ // Answer: the module destructor calls into callback `cleanup` method,
613
+ // which nulls out the rsLamda.
614
+ //
615
+ // If rsLamda is null, then there is no runtime to call into.
616
+ if (rsLambda == nullptr) {
617
+ // This only occurs when destructors are calling into Rust free/drop,
618
+ // which causes the JS callback to be dropped.
619
+ return;
620
+ }
621
+
622
+ // The runtime, the actual callback jsi::funtion, and the callInvoker
623
+ // are all in the lambda.
624
+ rsLambda(
625
+ rs_data,
626
+ rs_pollResult);
627
+ }
628
+
629
+ [[maybe_unused]] static UniffiRustFutureContinuationCallback
630
+ makeCallbackFunction( // uniffi::zcam1_common::cb::rustfuturecontinuationcallback
631
+ jsi::Runtime &rt,
632
+ std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
633
+ const jsi::Value &value) {
634
+ if (rsLambda != nullptr) {
635
+ // `makeCallbackFunction` is called in two circumstances:
636
+ //
637
+ // 1. at startup, when initializing callback interface vtables.
638
+ // 2. when polling futures. This happens at least once per future that is
639
+ // exposed to Javascript. We know that this is always the same function,
640
+ // `uniffiFutureContinuationCallback` in `async-rust-calls.ts`.
641
+ //
642
+ // We can therefore return the callback function without making anything
643
+ // new if we've been initialized already.
644
+ return callback;
645
+ }
646
+ auto callbackFunction = value.asObject(rt).asFunction(rt);
647
+ auto callbackValue = std::make_shared<jsi::Value>(rt, callbackFunction);
648
+ rsLambda = [&rt, callInvoker, callbackValue](uint64_t rs_data, int8_t rs_pollResult) {
649
+ // We immediately make a lambda which will do the work of transforming the
650
+ // arguments into JSI values and calling the callback.
651
+ uniffi_runtime::UniffiCallFunc jsLambda = [
652
+ callInvoker,
653
+ callbackValue
654
+ , rs_data
655
+ , rs_pollResult](jsi::Runtime &rt) mutable {
656
+ body(rt, callInvoker, callbackValue
657
+ , rs_data
658
+ , rs_pollResult);
659
+ };
660
+ // We'll then call that lambda from the callInvoker which will
661
+ // look after calling it on the correct thread.
662
+
663
+ callInvoker->invokeNonBlocking(rt, jsLambda);
664
+ };
665
+ return callback;
666
+ }
667
+
668
+ // This method is called from the destructor of NativeZcam1Common, which only happens
669
+ // when the jsi::Runtime is being destroyed.
670
+ static void cleanup() {
671
+ // The lambda holds a reference to the the Runtime, so when this is nulled out,
672
+ // then the pointer will no longer be left dangling.
673
+ rsLambda = nullptr;
674
+ }
675
+ } // namespace uniffi::zcam1_common::cb::rustfuturecontinuationcallback
676
+ // Implementation of callback function calling from Rust to JS ForeignFutureDroppedCallback
677
+
678
+ // Callback function: uniffi::zcam1_common::cb::foreignfuturedroppedcallback::UniffiForeignFutureDroppedCallback
679
+ //
680
+ // We have the following constraints:
681
+ // - we need to pass a function pointer to Rust.
682
+ // - we need a jsi::Runtime and jsi::Function to call into JS.
683
+ // - function pointers can't store state, so we can't use a lamda.
684
+ //
685
+ // For this, we store a lambda as a global, as `rsLambda`. The `callback` function calls
686
+ // the lambda, which itself calls the `body` which then calls into JS.
687
+ //
688
+ // We then give the `callback` function pointer to Rust which will call the lambda sometime in the
689
+ // future.
690
+ namespace uniffi::zcam1_common::cb::foreignfuturedroppedcallback {
691
+ using namespace facebook;
692
+
693
+ // We need to store a lambda in a global so we can call it from
694
+ // a function pointer. The function pointer is passed to Rust.
695
+ static std::function<void(uint64_t)> rsLambda = nullptr;
696
+
697
+ // This is the main body of the callback. It's called from the lambda,
698
+ // which itself is called from the callback function which is passed to Rust.
699
+ static void body(jsi::Runtime &rt,
700
+ std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
701
+ std::shared_ptr<jsi::Value> callbackValue
702
+ ,uint64_t rs_handle) {
703
+
704
+ // Convert the arguments from Rust, into jsi::Values.
705
+ // We'll use the Bridging class to do this…
706
+ auto js_handle = uniffi_jsi::Bridging<uint64_t>::toJs(rt, callInvoker, rs_handle);
707
+
708
+ // Now we are ready to call the callback.
709
+ // We are already on the JS thread, because this `body` function was
710
+ // invoked from the CallInvoker.
711
+ try {
712
+ // Getting the callback function
713
+ auto cb = callbackValue->asObject(rt).asFunction(rt);
714
+ auto uniffiResult = cb.call(rt, js_handle
715
+ );
716
+
717
+
718
+
719
+
720
+ } catch (const jsi::JSError &error) {
721
+ std::cout << "Error in callback UniffiForeignFutureDroppedCallback: "
722
+ << error.what() << std::endl;
723
+ throw error;
724
+ }
725
+ }
726
+
727
+ static void callback(uint64_t rs_handle) {
728
+ // If the runtime has shutdown, then there is no point in trying to
729
+ // call into Javascript. BUT how do we tell if the runtime has shutdown?
730
+ //
731
+ // Answer: the module destructor calls into callback `cleanup` method,
732
+ // which nulls out the rsLamda.
733
+ //
734
+ // If rsLamda is null, then there is no runtime to call into.
735
+ if (rsLambda == nullptr) {
736
+ // This only occurs when destructors are calling into Rust free/drop,
737
+ // which causes the JS callback to be dropped.
738
+ return;
739
+ }
740
+
741
+ // The runtime, the actual callback jsi::funtion, and the callInvoker
742
+ // are all in the lambda.
743
+ rsLambda(
744
+ rs_handle);
745
+ }
746
+
747
+ [[maybe_unused]] static UniffiForeignFutureDroppedCallback
748
+ makeCallbackFunction( // uniffi::zcam1_common::cb::foreignfuturedroppedcallback
749
+ jsi::Runtime &rt,
750
+ std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
751
+ const jsi::Value &value) {
752
+ if (rsLambda != nullptr) {
753
+ // `makeCallbackFunction` is called in two circumstances:
754
+ //
755
+ // 1. at startup, when initializing callback interface vtables.
756
+ // 2. when polling futures. This happens at least once per future that is
757
+ // exposed to Javascript. We know that this is always the same function,
758
+ // `uniffiFutureContinuationCallback` in `async-rust-calls.ts`.
759
+ //
760
+ // We can therefore return the callback function without making anything
761
+ // new if we've been initialized already.
762
+ return callback;
763
+ }
764
+ auto callbackFunction = value.asObject(rt).asFunction(rt);
765
+ auto callbackValue = std::make_shared<jsi::Value>(rt, callbackFunction);
766
+ rsLambda = [&rt, callInvoker, callbackValue](uint64_t rs_handle) {
767
+ // We immediately make a lambda which will do the work of transforming the
768
+ // arguments into JSI values and calling the callback.
769
+ uniffi_runtime::UniffiCallFunc jsLambda = [
770
+ callInvoker,
771
+ callbackValue
772
+ , rs_handle](jsi::Runtime &rt) mutable {
773
+ body(rt, callInvoker, callbackValue
774
+ , rs_handle);
775
+ };
776
+ // We'll then call that lambda from the callInvoker which will
777
+ // look after calling it on the correct thread.
778
+
779
+ callInvoker->invokeNonBlocking(rt, jsLambda);
780
+ };
781
+ return callback;
782
+ }
783
+
784
+ // This method is called from the destructor of NativeZcam1Common, which only happens
785
+ // when the jsi::Runtime is being destroyed.
786
+ static void cleanup() {
787
+ // The lambda holds a reference to the the Runtime, so when this is nulled out,
788
+ // then the pointer will no longer be left dangling.
789
+ rsLambda = nullptr;
790
+ }
791
+ } // namespace uniffi::zcam1_common::cb::foreignfuturedroppedcallback
792
+ // Implementation of free callback function CallbackInterfaceFree
793
+
794
+ namespace uniffi::zcam1_common {
795
+ using namespace facebook;
796
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
797
+
798
+ template <> struct Bridging<UniffiForeignFutureDroppedCallbackStruct> {
799
+ static UniffiForeignFutureDroppedCallbackStruct fromJs(jsi::Runtime &rt,
800
+ std::shared_ptr<CallInvoker> callInvoker,
801
+ const jsi::Value &jsValue
802
+ ) {
803
+ // Check if the input is an object
804
+ if (!jsValue.isObject()) {
805
+ throw jsi::JSError(rt, "Expected an object for UniffiForeignFutureDroppedCallbackStruct");
806
+ }
807
+
808
+ // Get the object from the jsi::Value
809
+ auto jsObject = jsValue.getObject(rt);
810
+
811
+ // Create the vtable struct
812
+ UniffiForeignFutureDroppedCallbackStruct rsObject;
813
+
814
+ // Create the vtable from the js callbacks.
815
+ rsObject.handle = uniffi_jsi::Bridging<uint64_t>::fromJs(
816
+ rt, callInvoker,
817
+ jsObject.getProperty(rt, "handle")
818
+ );
819
+ rsObject.free = uniffi::zcam1_common::cb::foreignfuturedroppedcallback::makeCallbackFunction(
820
+ rt, callInvoker, jsObject.getProperty(rt, "free")
821
+ );
822
+
823
+ return rsObject;
824
+ }
825
+ };
826
+
827
+ } // namespace uniffi::zcam1_common
828
+ namespace uniffi::zcam1_common {
829
+ using namespace facebook;
830
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
831
+
832
+ template <> struct Bridging<UniffiForeignFutureResultU8> {
833
+ static UniffiForeignFutureResultU8 fromJs(jsi::Runtime &rt,
834
+ std::shared_ptr<CallInvoker> callInvoker,
835
+ const jsi::Value &jsValue
836
+ ) {
837
+ // Check if the input is an object
838
+ if (!jsValue.isObject()) {
839
+ throw jsi::JSError(rt, "Expected an object for UniffiForeignFutureResultU8");
840
+ }
841
+
842
+ // Get the object from the jsi::Value
843
+ auto jsObject = jsValue.getObject(rt);
844
+
845
+ // Create the vtable struct
846
+ UniffiForeignFutureResultU8 rsObject;
847
+
848
+ // Create the vtable from the js callbacks.
849
+ rsObject.return_value = uniffi_jsi::Bridging<uint8_t>::fromJs(
850
+ rt, callInvoker,
851
+ jsObject.getProperty(rt, "returnValue")
852
+ );
853
+ rsObject.call_status = uniffi::zcam1_common::Bridging<RustCallStatus>::fromJs(
854
+ rt, callInvoker,
855
+ jsObject.getProperty(rt, "callStatus")
856
+ );
857
+
858
+ return rsObject;
859
+ }
860
+ };
861
+
862
+ } // namespace uniffi::zcam1_common
863
+ // Implementation of callback function calling from JS to Rust ForeignFutureCompleteU8,
864
+ // passed from Rust to JS as part of async callbacks.
865
+ namespace uniffi::zcam1_common {
866
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
867
+
868
+ template <> struct Bridging<UniffiForeignFutureCompleteU8> {
869
+ static jsi::Value toJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker, UniffiForeignFutureCompleteU8 rsCallback) {
870
+ return jsi::Function::createFromHostFunction(
871
+ rt,
872
+ jsi::PropNameID::forAscii(rt, "--ForeignFutureCompleteU8"),
873
+ 2,
874
+ [rsCallback, callInvoker](
875
+ jsi::Runtime &rt,
876
+ const jsi::Value &thisValue,
877
+ const jsi::Value *arguments,
878
+ size_t count) -> jsi::Value
879
+ {
880
+ return intoRust(rt, callInvoker, thisValue, arguments, count, rsCallback);
881
+ }
882
+ );
883
+ }
884
+
885
+ static jsi::Value intoRust(
886
+ jsi::Runtime &rt,
887
+ std::shared_ptr<CallInvoker> callInvoker,
888
+ const jsi::Value &thisValue,
889
+ const jsi::Value *args,
890
+ size_t count,
891
+ UniffiForeignFutureCompleteU8 func) {
892
+ // Convert the arguments into the Rust, with Bridging<T>::fromJs,
893
+ // then call the rs_callback with those arguments.
894
+ func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_common::Bridging<UniffiForeignFutureResultU8>::fromJs(rt, callInvoker, args[1])
895
+ );
896
+
897
+
898
+ return jsi::Value::undefined();
899
+ }
900
+ };
901
+ } // namespace uniffi::zcam1_common
902
+ namespace uniffi::zcam1_common {
903
+ using namespace facebook;
904
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
905
+
906
+ template <> struct Bridging<UniffiForeignFutureResultI8> {
907
+ static UniffiForeignFutureResultI8 fromJs(jsi::Runtime &rt,
908
+ std::shared_ptr<CallInvoker> callInvoker,
909
+ const jsi::Value &jsValue
910
+ ) {
911
+ // Check if the input is an object
912
+ if (!jsValue.isObject()) {
913
+ throw jsi::JSError(rt, "Expected an object for UniffiForeignFutureResultI8");
914
+ }
915
+
916
+ // Get the object from the jsi::Value
917
+ auto jsObject = jsValue.getObject(rt);
918
+
919
+ // Create the vtable struct
920
+ UniffiForeignFutureResultI8 rsObject;
921
+
922
+ // Create the vtable from the js callbacks.
923
+ rsObject.return_value = uniffi_jsi::Bridging<int8_t>::fromJs(
924
+ rt, callInvoker,
925
+ jsObject.getProperty(rt, "returnValue")
926
+ );
927
+ rsObject.call_status = uniffi::zcam1_common::Bridging<RustCallStatus>::fromJs(
928
+ rt, callInvoker,
929
+ jsObject.getProperty(rt, "callStatus")
930
+ );
931
+
932
+ return rsObject;
933
+ }
934
+ };
935
+
936
+ } // namespace uniffi::zcam1_common
937
+ // Implementation of callback function calling from JS to Rust ForeignFutureCompleteI8,
938
+ // passed from Rust to JS as part of async callbacks.
939
+ namespace uniffi::zcam1_common {
940
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
941
+
942
+ template <> struct Bridging<UniffiForeignFutureCompleteI8> {
943
+ static jsi::Value toJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker, UniffiForeignFutureCompleteI8 rsCallback) {
944
+ return jsi::Function::createFromHostFunction(
945
+ rt,
946
+ jsi::PropNameID::forAscii(rt, "--ForeignFutureCompleteI8"),
947
+ 2,
948
+ [rsCallback, callInvoker](
949
+ jsi::Runtime &rt,
950
+ const jsi::Value &thisValue,
951
+ const jsi::Value *arguments,
952
+ size_t count) -> jsi::Value
953
+ {
954
+ return intoRust(rt, callInvoker, thisValue, arguments, count, rsCallback);
955
+ }
956
+ );
957
+ }
958
+
959
+ static jsi::Value intoRust(
960
+ jsi::Runtime &rt,
961
+ std::shared_ptr<CallInvoker> callInvoker,
962
+ const jsi::Value &thisValue,
963
+ const jsi::Value *args,
964
+ size_t count,
965
+ UniffiForeignFutureCompleteI8 func) {
966
+ // Convert the arguments into the Rust, with Bridging<T>::fromJs,
967
+ // then call the rs_callback with those arguments.
968
+ func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_common::Bridging<UniffiForeignFutureResultI8>::fromJs(rt, callInvoker, args[1])
969
+ );
970
+
971
+
972
+ return jsi::Value::undefined();
973
+ }
974
+ };
975
+ } // namespace uniffi::zcam1_common
976
+ namespace uniffi::zcam1_common {
977
+ using namespace facebook;
978
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
979
+
980
+ template <> struct Bridging<UniffiForeignFutureResultU16> {
981
+ static UniffiForeignFutureResultU16 fromJs(jsi::Runtime &rt,
982
+ std::shared_ptr<CallInvoker> callInvoker,
983
+ const jsi::Value &jsValue
984
+ ) {
985
+ // Check if the input is an object
986
+ if (!jsValue.isObject()) {
987
+ throw jsi::JSError(rt, "Expected an object for UniffiForeignFutureResultU16");
988
+ }
989
+
990
+ // Get the object from the jsi::Value
991
+ auto jsObject = jsValue.getObject(rt);
992
+
993
+ // Create the vtable struct
994
+ UniffiForeignFutureResultU16 rsObject;
995
+
996
+ // Create the vtable from the js callbacks.
997
+ rsObject.return_value = uniffi_jsi::Bridging<uint16_t>::fromJs(
998
+ rt, callInvoker,
999
+ jsObject.getProperty(rt, "returnValue")
1000
+ );
1001
+ rsObject.call_status = uniffi::zcam1_common::Bridging<RustCallStatus>::fromJs(
1002
+ rt, callInvoker,
1003
+ jsObject.getProperty(rt, "callStatus")
1004
+ );
1005
+
1006
+ return rsObject;
1007
+ }
1008
+ };
1009
+
1010
+ } // namespace uniffi::zcam1_common
1011
+ // Implementation of callback function calling from JS to Rust ForeignFutureCompleteU16,
1012
+ // passed from Rust to JS as part of async callbacks.
1013
+ namespace uniffi::zcam1_common {
1014
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1015
+
1016
+ template <> struct Bridging<UniffiForeignFutureCompleteU16> {
1017
+ static jsi::Value toJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker, UniffiForeignFutureCompleteU16 rsCallback) {
1018
+ return jsi::Function::createFromHostFunction(
1019
+ rt,
1020
+ jsi::PropNameID::forAscii(rt, "--ForeignFutureCompleteU16"),
1021
+ 2,
1022
+ [rsCallback, callInvoker](
1023
+ jsi::Runtime &rt,
1024
+ const jsi::Value &thisValue,
1025
+ const jsi::Value *arguments,
1026
+ size_t count) -> jsi::Value
1027
+ {
1028
+ return intoRust(rt, callInvoker, thisValue, arguments, count, rsCallback);
1029
+ }
1030
+ );
1031
+ }
1032
+
1033
+ static jsi::Value intoRust(
1034
+ jsi::Runtime &rt,
1035
+ std::shared_ptr<CallInvoker> callInvoker,
1036
+ const jsi::Value &thisValue,
1037
+ const jsi::Value *args,
1038
+ size_t count,
1039
+ UniffiForeignFutureCompleteU16 func) {
1040
+ // Convert the arguments into the Rust, with Bridging<T>::fromJs,
1041
+ // then call the rs_callback with those arguments.
1042
+ func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_common::Bridging<UniffiForeignFutureResultU16>::fromJs(rt, callInvoker, args[1])
1043
+ );
1044
+
1045
+
1046
+ return jsi::Value::undefined();
1047
+ }
1048
+ };
1049
+ } // namespace uniffi::zcam1_common
1050
+ namespace uniffi::zcam1_common {
1051
+ using namespace facebook;
1052
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1053
+
1054
+ template <> struct Bridging<UniffiForeignFutureResultI16> {
1055
+ static UniffiForeignFutureResultI16 fromJs(jsi::Runtime &rt,
1056
+ std::shared_ptr<CallInvoker> callInvoker,
1057
+ const jsi::Value &jsValue
1058
+ ) {
1059
+ // Check if the input is an object
1060
+ if (!jsValue.isObject()) {
1061
+ throw jsi::JSError(rt, "Expected an object for UniffiForeignFutureResultI16");
1062
+ }
1063
+
1064
+ // Get the object from the jsi::Value
1065
+ auto jsObject = jsValue.getObject(rt);
1066
+
1067
+ // Create the vtable struct
1068
+ UniffiForeignFutureResultI16 rsObject;
1069
+
1070
+ // Create the vtable from the js callbacks.
1071
+ rsObject.return_value = uniffi_jsi::Bridging<int16_t>::fromJs(
1072
+ rt, callInvoker,
1073
+ jsObject.getProperty(rt, "returnValue")
1074
+ );
1075
+ rsObject.call_status = uniffi::zcam1_common::Bridging<RustCallStatus>::fromJs(
1076
+ rt, callInvoker,
1077
+ jsObject.getProperty(rt, "callStatus")
1078
+ );
1079
+
1080
+ return rsObject;
1081
+ }
1082
+ };
1083
+
1084
+ } // namespace uniffi::zcam1_common
1085
+ // Implementation of callback function calling from JS to Rust ForeignFutureCompleteI16,
1086
+ // passed from Rust to JS as part of async callbacks.
1087
+ namespace uniffi::zcam1_common {
1088
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1089
+
1090
+ template <> struct Bridging<UniffiForeignFutureCompleteI16> {
1091
+ static jsi::Value toJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker, UniffiForeignFutureCompleteI16 rsCallback) {
1092
+ return jsi::Function::createFromHostFunction(
1093
+ rt,
1094
+ jsi::PropNameID::forAscii(rt, "--ForeignFutureCompleteI16"),
1095
+ 2,
1096
+ [rsCallback, callInvoker](
1097
+ jsi::Runtime &rt,
1098
+ const jsi::Value &thisValue,
1099
+ const jsi::Value *arguments,
1100
+ size_t count) -> jsi::Value
1101
+ {
1102
+ return intoRust(rt, callInvoker, thisValue, arguments, count, rsCallback);
1103
+ }
1104
+ );
1105
+ }
1106
+
1107
+ static jsi::Value intoRust(
1108
+ jsi::Runtime &rt,
1109
+ std::shared_ptr<CallInvoker> callInvoker,
1110
+ const jsi::Value &thisValue,
1111
+ const jsi::Value *args,
1112
+ size_t count,
1113
+ UniffiForeignFutureCompleteI16 func) {
1114
+ // Convert the arguments into the Rust, with Bridging<T>::fromJs,
1115
+ // then call the rs_callback with those arguments.
1116
+ func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_common::Bridging<UniffiForeignFutureResultI16>::fromJs(rt, callInvoker, args[1])
1117
+ );
1118
+
1119
+
1120
+ return jsi::Value::undefined();
1121
+ }
1122
+ };
1123
+ } // namespace uniffi::zcam1_common
1124
+ namespace uniffi::zcam1_common {
1125
+ using namespace facebook;
1126
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1127
+
1128
+ template <> struct Bridging<UniffiForeignFutureResultU32> {
1129
+ static UniffiForeignFutureResultU32 fromJs(jsi::Runtime &rt,
1130
+ std::shared_ptr<CallInvoker> callInvoker,
1131
+ const jsi::Value &jsValue
1132
+ ) {
1133
+ // Check if the input is an object
1134
+ if (!jsValue.isObject()) {
1135
+ throw jsi::JSError(rt, "Expected an object for UniffiForeignFutureResultU32");
1136
+ }
1137
+
1138
+ // Get the object from the jsi::Value
1139
+ auto jsObject = jsValue.getObject(rt);
1140
+
1141
+ // Create the vtable struct
1142
+ UniffiForeignFutureResultU32 rsObject;
1143
+
1144
+ // Create the vtable from the js callbacks.
1145
+ rsObject.return_value = uniffi_jsi::Bridging<uint32_t>::fromJs(
1146
+ rt, callInvoker,
1147
+ jsObject.getProperty(rt, "returnValue")
1148
+ );
1149
+ rsObject.call_status = uniffi::zcam1_common::Bridging<RustCallStatus>::fromJs(
1150
+ rt, callInvoker,
1151
+ jsObject.getProperty(rt, "callStatus")
1152
+ );
1153
+
1154
+ return rsObject;
1155
+ }
1156
+ };
1157
+
1158
+ } // namespace uniffi::zcam1_common
1159
+ // Implementation of callback function calling from JS to Rust ForeignFutureCompleteU32,
1160
+ // passed from Rust to JS as part of async callbacks.
1161
+ namespace uniffi::zcam1_common {
1162
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1163
+
1164
+ template <> struct Bridging<UniffiForeignFutureCompleteU32> {
1165
+ static jsi::Value toJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker, UniffiForeignFutureCompleteU32 rsCallback) {
1166
+ return jsi::Function::createFromHostFunction(
1167
+ rt,
1168
+ jsi::PropNameID::forAscii(rt, "--ForeignFutureCompleteU32"),
1169
+ 2,
1170
+ [rsCallback, callInvoker](
1171
+ jsi::Runtime &rt,
1172
+ const jsi::Value &thisValue,
1173
+ const jsi::Value *arguments,
1174
+ size_t count) -> jsi::Value
1175
+ {
1176
+ return intoRust(rt, callInvoker, thisValue, arguments, count, rsCallback);
1177
+ }
1178
+ );
1179
+ }
1180
+
1181
+ static jsi::Value intoRust(
1182
+ jsi::Runtime &rt,
1183
+ std::shared_ptr<CallInvoker> callInvoker,
1184
+ const jsi::Value &thisValue,
1185
+ const jsi::Value *args,
1186
+ size_t count,
1187
+ UniffiForeignFutureCompleteU32 func) {
1188
+ // Convert the arguments into the Rust, with Bridging<T>::fromJs,
1189
+ // then call the rs_callback with those arguments.
1190
+ func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_common::Bridging<UniffiForeignFutureResultU32>::fromJs(rt, callInvoker, args[1])
1191
+ );
1192
+
1193
+
1194
+ return jsi::Value::undefined();
1195
+ }
1196
+ };
1197
+ } // namespace uniffi::zcam1_common
1198
+ namespace uniffi::zcam1_common {
1199
+ using namespace facebook;
1200
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1201
+
1202
+ template <> struct Bridging<UniffiForeignFutureResultI32> {
1203
+ static UniffiForeignFutureResultI32 fromJs(jsi::Runtime &rt,
1204
+ std::shared_ptr<CallInvoker> callInvoker,
1205
+ const jsi::Value &jsValue
1206
+ ) {
1207
+ // Check if the input is an object
1208
+ if (!jsValue.isObject()) {
1209
+ throw jsi::JSError(rt, "Expected an object for UniffiForeignFutureResultI32");
1210
+ }
1211
+
1212
+ // Get the object from the jsi::Value
1213
+ auto jsObject = jsValue.getObject(rt);
1214
+
1215
+ // Create the vtable struct
1216
+ UniffiForeignFutureResultI32 rsObject;
1217
+
1218
+ // Create the vtable from the js callbacks.
1219
+ rsObject.return_value = uniffi_jsi::Bridging<int32_t>::fromJs(
1220
+ rt, callInvoker,
1221
+ jsObject.getProperty(rt, "returnValue")
1222
+ );
1223
+ rsObject.call_status = uniffi::zcam1_common::Bridging<RustCallStatus>::fromJs(
1224
+ rt, callInvoker,
1225
+ jsObject.getProperty(rt, "callStatus")
1226
+ );
1227
+
1228
+ return rsObject;
1229
+ }
1230
+ };
1231
+
1232
+ } // namespace uniffi::zcam1_common
1233
+ // Implementation of callback function calling from JS to Rust ForeignFutureCompleteI32,
1234
+ // passed from Rust to JS as part of async callbacks.
1235
+ namespace uniffi::zcam1_common {
1236
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1237
+
1238
+ template <> struct Bridging<UniffiForeignFutureCompleteI32> {
1239
+ static jsi::Value toJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker, UniffiForeignFutureCompleteI32 rsCallback) {
1240
+ return jsi::Function::createFromHostFunction(
1241
+ rt,
1242
+ jsi::PropNameID::forAscii(rt, "--ForeignFutureCompleteI32"),
1243
+ 2,
1244
+ [rsCallback, callInvoker](
1245
+ jsi::Runtime &rt,
1246
+ const jsi::Value &thisValue,
1247
+ const jsi::Value *arguments,
1248
+ size_t count) -> jsi::Value
1249
+ {
1250
+ return intoRust(rt, callInvoker, thisValue, arguments, count, rsCallback);
1251
+ }
1252
+ );
1253
+ }
1254
+
1255
+ static jsi::Value intoRust(
1256
+ jsi::Runtime &rt,
1257
+ std::shared_ptr<CallInvoker> callInvoker,
1258
+ const jsi::Value &thisValue,
1259
+ const jsi::Value *args,
1260
+ size_t count,
1261
+ UniffiForeignFutureCompleteI32 func) {
1262
+ // Convert the arguments into the Rust, with Bridging<T>::fromJs,
1263
+ // then call the rs_callback with those arguments.
1264
+ func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_common::Bridging<UniffiForeignFutureResultI32>::fromJs(rt, callInvoker, args[1])
1265
+ );
1266
+
1267
+
1268
+ return jsi::Value::undefined();
1269
+ }
1270
+ };
1271
+ } // namespace uniffi::zcam1_common
1272
+ namespace uniffi::zcam1_common {
1273
+ using namespace facebook;
1274
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1275
+
1276
+ template <> struct Bridging<UniffiForeignFutureResultU64> {
1277
+ static UniffiForeignFutureResultU64 fromJs(jsi::Runtime &rt,
1278
+ std::shared_ptr<CallInvoker> callInvoker,
1279
+ const jsi::Value &jsValue
1280
+ ) {
1281
+ // Check if the input is an object
1282
+ if (!jsValue.isObject()) {
1283
+ throw jsi::JSError(rt, "Expected an object for UniffiForeignFutureResultU64");
1284
+ }
1285
+
1286
+ // Get the object from the jsi::Value
1287
+ auto jsObject = jsValue.getObject(rt);
1288
+
1289
+ // Create the vtable struct
1290
+ UniffiForeignFutureResultU64 rsObject;
1291
+
1292
+ // Create the vtable from the js callbacks.
1293
+ rsObject.return_value = uniffi_jsi::Bridging<uint64_t>::fromJs(
1294
+ rt, callInvoker,
1295
+ jsObject.getProperty(rt, "returnValue")
1296
+ );
1297
+ rsObject.call_status = uniffi::zcam1_common::Bridging<RustCallStatus>::fromJs(
1298
+ rt, callInvoker,
1299
+ jsObject.getProperty(rt, "callStatus")
1300
+ );
1301
+
1302
+ return rsObject;
1303
+ }
1304
+ };
1305
+
1306
+ } // namespace uniffi::zcam1_common
1307
+ // Implementation of callback function calling from JS to Rust ForeignFutureCompleteU64,
1308
+ // passed from Rust to JS as part of async callbacks.
1309
+ namespace uniffi::zcam1_common {
1310
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1311
+
1312
+ template <> struct Bridging<UniffiForeignFutureCompleteU64> {
1313
+ static jsi::Value toJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker, UniffiForeignFutureCompleteU64 rsCallback) {
1314
+ return jsi::Function::createFromHostFunction(
1315
+ rt,
1316
+ jsi::PropNameID::forAscii(rt, "--ForeignFutureCompleteU64"),
1317
+ 2,
1318
+ [rsCallback, callInvoker](
1319
+ jsi::Runtime &rt,
1320
+ const jsi::Value &thisValue,
1321
+ const jsi::Value *arguments,
1322
+ size_t count) -> jsi::Value
1323
+ {
1324
+ return intoRust(rt, callInvoker, thisValue, arguments, count, rsCallback);
1325
+ }
1326
+ );
1327
+ }
1328
+
1329
+ static jsi::Value intoRust(
1330
+ jsi::Runtime &rt,
1331
+ std::shared_ptr<CallInvoker> callInvoker,
1332
+ const jsi::Value &thisValue,
1333
+ const jsi::Value *args,
1334
+ size_t count,
1335
+ UniffiForeignFutureCompleteU64 func) {
1336
+ // Convert the arguments into the Rust, with Bridging<T>::fromJs,
1337
+ // then call the rs_callback with those arguments.
1338
+ func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_common::Bridging<UniffiForeignFutureResultU64>::fromJs(rt, callInvoker, args[1])
1339
+ );
1340
+
1341
+
1342
+ return jsi::Value::undefined();
1343
+ }
1344
+ };
1345
+ } // namespace uniffi::zcam1_common
1346
+ namespace uniffi::zcam1_common {
1347
+ using namespace facebook;
1348
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1349
+
1350
+ template <> struct Bridging<UniffiForeignFutureResultI64> {
1351
+ static UniffiForeignFutureResultI64 fromJs(jsi::Runtime &rt,
1352
+ std::shared_ptr<CallInvoker> callInvoker,
1353
+ const jsi::Value &jsValue
1354
+ ) {
1355
+ // Check if the input is an object
1356
+ if (!jsValue.isObject()) {
1357
+ throw jsi::JSError(rt, "Expected an object for UniffiForeignFutureResultI64");
1358
+ }
1359
+
1360
+ // Get the object from the jsi::Value
1361
+ auto jsObject = jsValue.getObject(rt);
1362
+
1363
+ // Create the vtable struct
1364
+ UniffiForeignFutureResultI64 rsObject;
1365
+
1366
+ // Create the vtable from the js callbacks.
1367
+ rsObject.return_value = uniffi_jsi::Bridging<int64_t>::fromJs(
1368
+ rt, callInvoker,
1369
+ jsObject.getProperty(rt, "returnValue")
1370
+ );
1371
+ rsObject.call_status = uniffi::zcam1_common::Bridging<RustCallStatus>::fromJs(
1372
+ rt, callInvoker,
1373
+ jsObject.getProperty(rt, "callStatus")
1374
+ );
1375
+
1376
+ return rsObject;
1377
+ }
1378
+ };
1379
+
1380
+ } // namespace uniffi::zcam1_common
1381
+ // Implementation of callback function calling from JS to Rust ForeignFutureCompleteI64,
1382
+ // passed from Rust to JS as part of async callbacks.
1383
+ namespace uniffi::zcam1_common {
1384
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1385
+
1386
+ template <> struct Bridging<UniffiForeignFutureCompleteI64> {
1387
+ static jsi::Value toJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker, UniffiForeignFutureCompleteI64 rsCallback) {
1388
+ return jsi::Function::createFromHostFunction(
1389
+ rt,
1390
+ jsi::PropNameID::forAscii(rt, "--ForeignFutureCompleteI64"),
1391
+ 2,
1392
+ [rsCallback, callInvoker](
1393
+ jsi::Runtime &rt,
1394
+ const jsi::Value &thisValue,
1395
+ const jsi::Value *arguments,
1396
+ size_t count) -> jsi::Value
1397
+ {
1398
+ return intoRust(rt, callInvoker, thisValue, arguments, count, rsCallback);
1399
+ }
1400
+ );
1401
+ }
1402
+
1403
+ static jsi::Value intoRust(
1404
+ jsi::Runtime &rt,
1405
+ std::shared_ptr<CallInvoker> callInvoker,
1406
+ const jsi::Value &thisValue,
1407
+ const jsi::Value *args,
1408
+ size_t count,
1409
+ UniffiForeignFutureCompleteI64 func) {
1410
+ // Convert the arguments into the Rust, with Bridging<T>::fromJs,
1411
+ // then call the rs_callback with those arguments.
1412
+ func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_common::Bridging<UniffiForeignFutureResultI64>::fromJs(rt, callInvoker, args[1])
1413
+ );
1414
+
1415
+
1416
+ return jsi::Value::undefined();
1417
+ }
1418
+ };
1419
+ } // namespace uniffi::zcam1_common
1420
+ namespace uniffi::zcam1_common {
1421
+ using namespace facebook;
1422
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1423
+
1424
+ template <> struct Bridging<UniffiForeignFutureResultF32> {
1425
+ static UniffiForeignFutureResultF32 fromJs(jsi::Runtime &rt,
1426
+ std::shared_ptr<CallInvoker> callInvoker,
1427
+ const jsi::Value &jsValue
1428
+ ) {
1429
+ // Check if the input is an object
1430
+ if (!jsValue.isObject()) {
1431
+ throw jsi::JSError(rt, "Expected an object for UniffiForeignFutureResultF32");
1432
+ }
1433
+
1434
+ // Get the object from the jsi::Value
1435
+ auto jsObject = jsValue.getObject(rt);
1436
+
1437
+ // Create the vtable struct
1438
+ UniffiForeignFutureResultF32 rsObject;
1439
+
1440
+ // Create the vtable from the js callbacks.
1441
+ rsObject.return_value = uniffi_jsi::Bridging<float>::fromJs(
1442
+ rt, callInvoker,
1443
+ jsObject.getProperty(rt, "returnValue")
1444
+ );
1445
+ rsObject.call_status = uniffi::zcam1_common::Bridging<RustCallStatus>::fromJs(
1446
+ rt, callInvoker,
1447
+ jsObject.getProperty(rt, "callStatus")
1448
+ );
1449
+
1450
+ return rsObject;
1451
+ }
1452
+ };
1453
+
1454
+ } // namespace uniffi::zcam1_common
1455
+ // Implementation of callback function calling from JS to Rust ForeignFutureCompleteF32,
1456
+ // passed from Rust to JS as part of async callbacks.
1457
+ namespace uniffi::zcam1_common {
1458
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1459
+
1460
+ template <> struct Bridging<UniffiForeignFutureCompleteF32> {
1461
+ static jsi::Value toJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker, UniffiForeignFutureCompleteF32 rsCallback) {
1462
+ return jsi::Function::createFromHostFunction(
1463
+ rt,
1464
+ jsi::PropNameID::forAscii(rt, "--ForeignFutureCompleteF32"),
1465
+ 2,
1466
+ [rsCallback, callInvoker](
1467
+ jsi::Runtime &rt,
1468
+ const jsi::Value &thisValue,
1469
+ const jsi::Value *arguments,
1470
+ size_t count) -> jsi::Value
1471
+ {
1472
+ return intoRust(rt, callInvoker, thisValue, arguments, count, rsCallback);
1473
+ }
1474
+ );
1475
+ }
1476
+
1477
+ static jsi::Value intoRust(
1478
+ jsi::Runtime &rt,
1479
+ std::shared_ptr<CallInvoker> callInvoker,
1480
+ const jsi::Value &thisValue,
1481
+ const jsi::Value *args,
1482
+ size_t count,
1483
+ UniffiForeignFutureCompleteF32 func) {
1484
+ // Convert the arguments into the Rust, with Bridging<T>::fromJs,
1485
+ // then call the rs_callback with those arguments.
1486
+ func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_common::Bridging<UniffiForeignFutureResultF32>::fromJs(rt, callInvoker, args[1])
1487
+ );
1488
+
1489
+
1490
+ return jsi::Value::undefined();
1491
+ }
1492
+ };
1493
+ } // namespace uniffi::zcam1_common
1494
+ namespace uniffi::zcam1_common {
1495
+ using namespace facebook;
1496
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1497
+
1498
+ template <> struct Bridging<UniffiForeignFutureResultF64> {
1499
+ static UniffiForeignFutureResultF64 fromJs(jsi::Runtime &rt,
1500
+ std::shared_ptr<CallInvoker> callInvoker,
1501
+ const jsi::Value &jsValue
1502
+ ) {
1503
+ // Check if the input is an object
1504
+ if (!jsValue.isObject()) {
1505
+ throw jsi::JSError(rt, "Expected an object for UniffiForeignFutureResultF64");
1506
+ }
1507
+
1508
+ // Get the object from the jsi::Value
1509
+ auto jsObject = jsValue.getObject(rt);
1510
+
1511
+ // Create the vtable struct
1512
+ UniffiForeignFutureResultF64 rsObject;
1513
+
1514
+ // Create the vtable from the js callbacks.
1515
+ rsObject.return_value = uniffi_jsi::Bridging<double>::fromJs(
1516
+ rt, callInvoker,
1517
+ jsObject.getProperty(rt, "returnValue")
1518
+ );
1519
+ rsObject.call_status = uniffi::zcam1_common::Bridging<RustCallStatus>::fromJs(
1520
+ rt, callInvoker,
1521
+ jsObject.getProperty(rt, "callStatus")
1522
+ );
1523
+
1524
+ return rsObject;
1525
+ }
1526
+ };
1527
+
1528
+ } // namespace uniffi::zcam1_common
1529
+ // Implementation of callback function calling from JS to Rust ForeignFutureCompleteF64,
1530
+ // passed from Rust to JS as part of async callbacks.
1531
+ namespace uniffi::zcam1_common {
1532
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1533
+
1534
+ template <> struct Bridging<UniffiForeignFutureCompleteF64> {
1535
+ static jsi::Value toJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker, UniffiForeignFutureCompleteF64 rsCallback) {
1536
+ return jsi::Function::createFromHostFunction(
1537
+ rt,
1538
+ jsi::PropNameID::forAscii(rt, "--ForeignFutureCompleteF64"),
1539
+ 2,
1540
+ [rsCallback, callInvoker](
1541
+ jsi::Runtime &rt,
1542
+ const jsi::Value &thisValue,
1543
+ const jsi::Value *arguments,
1544
+ size_t count) -> jsi::Value
1545
+ {
1546
+ return intoRust(rt, callInvoker, thisValue, arguments, count, rsCallback);
1547
+ }
1548
+ );
1549
+ }
1550
+
1551
+ static jsi::Value intoRust(
1552
+ jsi::Runtime &rt,
1553
+ std::shared_ptr<CallInvoker> callInvoker,
1554
+ const jsi::Value &thisValue,
1555
+ const jsi::Value *args,
1556
+ size_t count,
1557
+ UniffiForeignFutureCompleteF64 func) {
1558
+ // Convert the arguments into the Rust, with Bridging<T>::fromJs,
1559
+ // then call the rs_callback with those arguments.
1560
+ func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_common::Bridging<UniffiForeignFutureResultF64>::fromJs(rt, callInvoker, args[1])
1561
+ );
1562
+
1563
+
1564
+ return jsi::Value::undefined();
1565
+ }
1566
+ };
1567
+ } // namespace uniffi::zcam1_common
1568
+ namespace uniffi::zcam1_common {
1569
+ using namespace facebook;
1570
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1571
+
1572
+ template <> struct Bridging<UniffiForeignFutureResultRustBuffer> {
1573
+ static UniffiForeignFutureResultRustBuffer fromJs(jsi::Runtime &rt,
1574
+ std::shared_ptr<CallInvoker> callInvoker,
1575
+ const jsi::Value &jsValue
1576
+ ) {
1577
+ // Check if the input is an object
1578
+ if (!jsValue.isObject()) {
1579
+ throw jsi::JSError(rt, "Expected an object for UniffiForeignFutureResultRustBuffer");
1580
+ }
1581
+
1582
+ // Get the object from the jsi::Value
1583
+ auto jsObject = jsValue.getObject(rt);
1584
+
1585
+ // Create the vtable struct
1586
+ UniffiForeignFutureResultRustBuffer rsObject;
1587
+
1588
+ // Create the vtable from the js callbacks.
1589
+ rsObject.return_value = uniffi::zcam1_common::Bridging<RustBuffer>::fromJs(
1590
+ rt, callInvoker,
1591
+ jsObject.getProperty(rt, "returnValue")
1592
+ );
1593
+ rsObject.call_status = uniffi::zcam1_common::Bridging<RustCallStatus>::fromJs(
1594
+ rt, callInvoker,
1595
+ jsObject.getProperty(rt, "callStatus")
1596
+ );
1597
+
1598
+ return rsObject;
1599
+ }
1600
+ };
1601
+
1602
+ } // namespace uniffi::zcam1_common
1603
+ // Implementation of callback function calling from JS to Rust ForeignFutureCompleteRustBuffer,
1604
+ // passed from Rust to JS as part of async callbacks.
1605
+ namespace uniffi::zcam1_common {
1606
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1607
+
1608
+ template <> struct Bridging<UniffiForeignFutureCompleteRustBuffer> {
1609
+ static jsi::Value toJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker, UniffiForeignFutureCompleteRustBuffer rsCallback) {
1610
+ return jsi::Function::createFromHostFunction(
1611
+ rt,
1612
+ jsi::PropNameID::forAscii(rt, "--ForeignFutureCompleteRustBuffer"),
1613
+ 2,
1614
+ [rsCallback, callInvoker](
1615
+ jsi::Runtime &rt,
1616
+ const jsi::Value &thisValue,
1617
+ const jsi::Value *arguments,
1618
+ size_t count) -> jsi::Value
1619
+ {
1620
+ return intoRust(rt, callInvoker, thisValue, arguments, count, rsCallback);
1621
+ }
1622
+ );
1623
+ }
1624
+
1625
+ static jsi::Value intoRust(
1626
+ jsi::Runtime &rt,
1627
+ std::shared_ptr<CallInvoker> callInvoker,
1628
+ const jsi::Value &thisValue,
1629
+ const jsi::Value *args,
1630
+ size_t count,
1631
+ UniffiForeignFutureCompleteRustBuffer func) {
1632
+ // Convert the arguments into the Rust, with Bridging<T>::fromJs,
1633
+ // then call the rs_callback with those arguments.
1634
+ func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_common::Bridging<UniffiForeignFutureResultRustBuffer>::fromJs(rt, callInvoker, args[1])
1635
+ );
1636
+
1637
+
1638
+ return jsi::Value::undefined();
1639
+ }
1640
+ };
1641
+ } // namespace uniffi::zcam1_common
1642
+ namespace uniffi::zcam1_common {
1643
+ using namespace facebook;
1644
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1645
+
1646
+ template <> struct Bridging<UniffiForeignFutureResultVoid> {
1647
+ static UniffiForeignFutureResultVoid fromJs(jsi::Runtime &rt,
1648
+ std::shared_ptr<CallInvoker> callInvoker,
1649
+ const jsi::Value &jsValue
1650
+ ) {
1651
+ // Check if the input is an object
1652
+ if (!jsValue.isObject()) {
1653
+ throw jsi::JSError(rt, "Expected an object for UniffiForeignFutureResultVoid");
1654
+ }
1655
+
1656
+ // Get the object from the jsi::Value
1657
+ auto jsObject = jsValue.getObject(rt);
1658
+
1659
+ // Create the vtable struct
1660
+ UniffiForeignFutureResultVoid rsObject;
1661
+
1662
+ // Create the vtable from the js callbacks.
1663
+ rsObject.call_status = uniffi::zcam1_common::Bridging<RustCallStatus>::fromJs(
1664
+ rt, callInvoker,
1665
+ jsObject.getProperty(rt, "callStatus")
1666
+ );
1667
+
1668
+ return rsObject;
1669
+ }
1670
+ };
1671
+
1672
+ } // namespace uniffi::zcam1_common
1673
+ // Implementation of callback function calling from JS to Rust ForeignFutureCompleteVoid,
1674
+ // passed from Rust to JS as part of async callbacks.
1675
+ namespace uniffi::zcam1_common {
1676
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1677
+
1678
+ template <> struct Bridging<UniffiForeignFutureCompleteVoid> {
1679
+ static jsi::Value toJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker, UniffiForeignFutureCompleteVoid rsCallback) {
1680
+ return jsi::Function::createFromHostFunction(
1681
+ rt,
1682
+ jsi::PropNameID::forAscii(rt, "--ForeignFutureCompleteVoid"),
1683
+ 2,
1684
+ [rsCallback, callInvoker](
1685
+ jsi::Runtime &rt,
1686
+ const jsi::Value &thisValue,
1687
+ const jsi::Value *arguments,
1688
+ size_t count) -> jsi::Value
1689
+ {
1690
+ return intoRust(rt, callInvoker, thisValue, arguments, count, rsCallback);
1691
+ }
1692
+ );
1693
+ }
1694
+
1695
+ static jsi::Value intoRust(
1696
+ jsi::Runtime &rt,
1697
+ std::shared_ptr<CallInvoker> callInvoker,
1698
+ const jsi::Value &thisValue,
1699
+ const jsi::Value *args,
1700
+ size_t count,
1701
+ UniffiForeignFutureCompleteVoid func) {
1702
+ // Convert the arguments into the Rust, with Bridging<T>::fromJs,
1703
+ // then call the rs_callback with those arguments.
1704
+ func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::zcam1_common::Bridging<UniffiForeignFutureResultVoid>::fromJs(rt, callInvoker, args[1])
1705
+ );
1706
+
1707
+
1708
+ return jsi::Value::undefined();
1709
+ }
1710
+ };
1711
+ } // namespace uniffi::zcam1_common
1712
+
1713
+
1714
+ namespace uniffi::zcam1_common {
1715
+ using namespace facebook;
1716
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1717
+
1718
+ template <> struct Bridging<UniffiRustFutureContinuationCallback> {
1719
+ static UniffiRustFutureContinuationCallback fromJs(
1720
+ jsi::Runtime &rt,
1721
+ std::shared_ptr<CallInvoker> callInvoker,
1722
+ const jsi::Value &value
1723
+ ) {
1724
+ try {
1725
+ return uniffi::zcam1_common::cb::rustfuturecontinuationcallback::makeCallbackFunction(
1726
+ rt,
1727
+ callInvoker,
1728
+ value
1729
+ );
1730
+ } catch (const std::logic_error &e) {
1731
+ throw jsi::JSError(rt, e.what());
1732
+ }
1733
+ }
1734
+ };
1735
+
1736
+ } // namespace uniffi::zcam1_common
1737
+
1738
+ NativeZcam1Common::NativeZcam1Common(
1739
+ jsi::Runtime &rt,
1740
+ std::shared_ptr<uniffi_runtime::UniffiCallInvoker> invoker
1741
+ ) : callInvoker(invoker), props() {
1742
+ // Map from Javascript names to the cpp names
1743
+ props["ubrn_uniffi_internal_fn_func_ffi__string_to_byte_length"] = jsi::Function::createFromHostFunction(
1744
+ rt,
1745
+ jsi::PropNameID::forAscii(rt, "ubrn_uniffi_internal_fn_func_ffi__string_to_byte_length"),
1746
+ 1,
1747
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
1748
+ return this->cpp_uniffi_internal_fn_func_ffi__string_to_byte_length(rt, thisVal, args, count);
1749
+ }
1750
+ );
1751
+ props["ubrn_uniffi_internal_fn_func_ffi__string_to_arraybuffer"] = jsi::Function::createFromHostFunction(
1752
+ rt,
1753
+ jsi::PropNameID::forAscii(rt, "ubrn_uniffi_internal_fn_func_ffi__string_to_arraybuffer"),
1754
+ 1,
1755
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
1756
+ return this->cpp_uniffi_internal_fn_func_ffi__string_to_arraybuffer(rt, thisVal, args, count);
1757
+ }
1758
+ );
1759
+ props["ubrn_uniffi_internal_fn_func_ffi__arraybuffer_to_string"] = jsi::Function::createFromHostFunction(
1760
+ rt,
1761
+ jsi::PropNameID::forAscii(rt, "ubrn_uniffi_internal_fn_func_ffi__arraybuffer_to_string"),
1762
+ 1,
1763
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
1764
+ return this->cpp_uniffi_internal_fn_func_ffi__arraybuffer_to_string(rt, thisVal, args, count);
1765
+ }
1766
+ );
1767
+ props["ubrn_uniffi_zcam1_common_fn_func_root_certs"] = jsi::Function::createFromHostFunction(
1768
+ rt,
1769
+ jsi::PropNameID::forAscii(rt, "ubrn_uniffi_zcam1_common_fn_func_root_certs"),
1770
+ 1,
1771
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
1772
+ return this->cpp_uniffi_zcam1_common_fn_func_root_certs(rt, thisVal, args, count);
1773
+ }
1774
+ );
1775
+ props["ubrn_uniffi_zcam1_common_checksum_func_root_certs"] = jsi::Function::createFromHostFunction(
1776
+ rt,
1777
+ jsi::PropNameID::forAscii(rt, "ubrn_uniffi_zcam1_common_checksum_func_root_certs"),
1778
+ 0,
1779
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
1780
+ return this->cpp_uniffi_zcam1_common_checksum_func_root_certs(rt, thisVal, args, count);
1781
+ }
1782
+ );
1783
+ props["ubrn_ffi_zcam1_common_uniffi_contract_version"] = jsi::Function::createFromHostFunction(
1784
+ rt,
1785
+ jsi::PropNameID::forAscii(rt, "ubrn_ffi_zcam1_common_uniffi_contract_version"),
1786
+ 0,
1787
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
1788
+ return this->cpp_ffi_zcam1_common_uniffi_contract_version(rt, thisVal, args, count);
1789
+ }
1790
+ );
1791
+ }
1792
+
1793
+ void NativeZcam1Common::registerModule(jsi::Runtime &rt, std::shared_ptr<react::CallInvoker> callInvoker) {
1794
+ auto invoker = std::make_shared<uniffi_runtime::UniffiCallInvoker>(callInvoker);
1795
+ auto tm = std::make_shared<NativeZcam1Common>(rt, invoker);
1796
+ auto obj = rt.global().createFromHostObject(rt, tm);
1797
+ rt.global().setProperty(rt, "NativeZcam1Common", obj);
1798
+ }
1799
+
1800
+ void NativeZcam1Common::unregisterModule(jsi::Runtime &rt) {
1801
+ uniffi::zcam1_common::registry::clearRegistry();
1802
+ }
1803
+
1804
+ jsi::Value NativeZcam1Common::get(jsi::Runtime& rt, const jsi::PropNameID& name) {
1805
+ try {
1806
+ return jsi::Value(rt, props.at(name.utf8(rt)));
1807
+ }
1808
+ catch (std::out_of_range &e) {
1809
+ return jsi::Value::undefined();
1810
+ }
1811
+ }
1812
+
1813
+ std::vector<jsi::PropNameID> NativeZcam1Common::getPropertyNames(jsi::Runtime& rt) {
1814
+ std::vector<jsi::PropNameID> rval;
1815
+ for (auto& [key, value] : props) {
1816
+ rval.push_back(jsi::PropNameID::forUtf8(rt, key));
1817
+ }
1818
+ return rval;
1819
+ }
1820
+
1821
+ void NativeZcam1Common::set(jsi::Runtime& rt, const jsi::PropNameID& name, const jsi::Value& value) {
1822
+ props.insert_or_assign(name.utf8(rt), &value);
1823
+ }
1824
+
1825
+ NativeZcam1Common::~NativeZcam1Common() {
1826
+ // Cleanup for callback function RustFutureContinuationCallback
1827
+ uniffi::zcam1_common::cb::rustfuturecontinuationcallback::cleanup();
1828
+ // Cleanup for callback function ForeignFutureDroppedCallback
1829
+ uniffi::zcam1_common::cb::foreignfuturedroppedcallback::cleanup();
1830
+ // Cleanup for "free" callback function CallbackInterfaceFree
1831
+
1832
+ }
1833
+
1834
+ // Utility functions for serialization/deserialization of strings.
1835
+ jsi::Value NativeZcam1Common::cpp_uniffi_internal_fn_func_ffi__string_to_byte_length(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
1836
+ return uniffi_jsi::Bridging<std::string>::string_to_bytelength(rt, args[0]);
1837
+ }
1838
+
1839
+ jsi::Value NativeZcam1Common::cpp_uniffi_internal_fn_func_ffi__string_to_arraybuffer(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
1840
+ return uniffi_jsi::Bridging<std::string>::string_to_arraybuffer(rt, args[0]);
1841
+ }
1842
+
1843
+ jsi::Value NativeZcam1Common::cpp_uniffi_internal_fn_func_ffi__arraybuffer_to_string(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
1844
+ return uniffi_jsi::Bridging<std::string>::arraybuffer_to_string(rt, args[0]);
1845
+ }
1846
+
1847
+ // Methods calling directly into the uniffi generated C API of the Rust crate.
1848
+ jsi::Value NativeZcam1Common::cpp_uniffi_zcam1_common_fn_func_root_certs(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
1849
+ RustCallStatus status = uniffi::zcam1_common::Bridging<RustCallStatus>::rustSuccess(rt);
1850
+ auto value = uniffi_zcam1_common_fn_func_root_certs(uniffi::zcam1_common::Bridging<RustBuffer>::fromJs(rt, callInvoker, args[0]),
1851
+ &status
1852
+ );
1853
+ uniffi::zcam1_common::Bridging<RustCallStatus>::copyIntoJs(rt, callInvoker, status, args[count - 1]);
1854
+
1855
+
1856
+ return uniffi::zcam1_common::Bridging<RustBuffer>::toJs(rt, callInvoker, value);
1857
+ }
1858
+ jsi::Value NativeZcam1Common::cpp_uniffi_zcam1_common_checksum_func_root_certs(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
1859
+ auto value = uniffi_zcam1_common_checksum_func_root_certs(
1860
+ );
1861
+
1862
+
1863
+ return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
1864
+ }
1865
+ jsi::Value NativeZcam1Common::cpp_ffi_zcam1_common_uniffi_contract_version(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
1866
+ auto value = ffi_zcam1_common_uniffi_contract_version(
1867
+ );
1868
+
1869
+
1870
+ return uniffi_jsi::Bridging<uint32_t>::toJs(rt, callInvoker, value);
1871
+ }