react-native-ariel 0.1.0-dev.5 → 0.1.0-dev.50

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 (28) hide show
  1. package/Ariel.podspec +2 -2
  2. package/README.md +10 -65
  3. package/android/CMakeLists.txt +12 -12
  4. package/android/build.gradle +11 -9
  5. package/android/generated/{android/app/build/generated/source/codegen/java/com/facebook/fbreact/specs → java/com/ariel}/NativeArielSpec.java +1 -1
  6. package/android/generated/{android/app/build/generated/source/codegen/jni → jni}/CMakeLists.txt +9 -1
  7. package/android/generated/jni/react/renderer/components/ArielSpec/ArielSpecJSI-generated.cpp +32 -0
  8. package/android/generated/jni/react/renderer/components/ArielSpec/ArielSpecJSI.h +80 -0
  9. package/android/proguard-rules.pro +4 -0
  10. package/android/src/main/java/com/ariel/ArielModule.kt +11 -1
  11. package/cpp/generated/mermaid_wrapper.cpp +2369 -0
  12. package/cpp/generated/mermaid_wrapper.hpp +77 -0
  13. package/cpp/mermaid_wrapper.cpp +1 -0
  14. package/ios/generated/ArielSpecJSI-generated.cpp +32 -0
  15. package/ios/generated/ArielSpecJSI.h +80 -0
  16. package/lib/module/index.web.js +4 -6
  17. package/lib/module/index.web.js.map +1 -2
  18. package/package.json +31 -25
  19. package/react-native.config.js +0 -1
  20. package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/ArielSpec/ArielSpecJSI.h +0 -45
  21. package/ios/generated/build/generated/ios/ReactCodegen/ArielSpecJSI.h +0 -45
  22. package/lib/typescript/src/index.web.d.ts +0 -8
  23. package/lib/typescript/src/index.web.d.ts.map +0 -1
  24. package/src/generated/web/wasm-bindgen/package.json +0 -15
  25. /package/android/generated/{android/app/build/generated/source/codegen/jni → jni}/ArielSpec-generated.cpp +0 -0
  26. /package/android/generated/{android/app/build/generated/source/codegen/jni → jni}/ArielSpec.h +0 -0
  27. /package/ios/generated/{build/generated/ios/ReactCodegen/ArielSpec → ArielSpec}/ArielSpec-generated.mm +0 -0
  28. /package/ios/generated/{build/generated/ios/ReactCodegen/ArielSpec → ArielSpec}/ArielSpec.h +0 -0
@@ -0,0 +1,2369 @@
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 "mermaid_wrapper.hpp"
4
+
5
+ #include "UniffiJsiTypes.h"
6
+ #include <stdexcept>
7
+ #include <map>
8
+ #include <unordered_map>
9
+ #include <utility>
10
+ #include <iostream>
11
+ #include <thread>
12
+
13
+ namespace react = facebook::react;
14
+ namespace jsi = facebook::jsi;
15
+
16
+ // Calling into Rust.
17
+ extern "C" {
18
+ typedef void
19
+ (*UniffiRustFutureContinuationCallback)(
20
+ uint64_t data,
21
+ int8_t poll_result
22
+ );
23
+ typedef void
24
+ (*UniffiForeignFutureDroppedCallback)(
25
+ uint64_t handle
26
+ );
27
+ typedef void
28
+ (*UniffiCallbackInterfaceFree)(
29
+ uint64_t handle
30
+ );
31
+ typedef uint64_t
32
+ (*UniffiCallbackInterfaceClone)(
33
+ uint64_t handle
34
+ );typedef struct UniffiForeignFutureDroppedCallbackStruct {
35
+ uint64_t handle;
36
+ UniffiForeignFutureDroppedCallback free;
37
+ } UniffiForeignFutureDroppedCallbackStruct;typedef struct UniffiForeignFutureResultU8 {
38
+ uint8_t return_value;
39
+ RustCallStatus call_status;
40
+ } UniffiForeignFutureResultU8;
41
+ typedef void
42
+ (*UniffiForeignFutureCompleteU8)(
43
+ uint64_t callback_data,
44
+ UniffiForeignFutureResultU8 result
45
+ );typedef struct UniffiForeignFutureResultI8 {
46
+ int8_t return_value;
47
+ RustCallStatus call_status;
48
+ } UniffiForeignFutureResultI8;
49
+ typedef void
50
+ (*UniffiForeignFutureCompleteI8)(
51
+ uint64_t callback_data,
52
+ UniffiForeignFutureResultI8 result
53
+ );typedef struct UniffiForeignFutureResultU16 {
54
+ uint16_t return_value;
55
+ RustCallStatus call_status;
56
+ } UniffiForeignFutureResultU16;
57
+ typedef void
58
+ (*UniffiForeignFutureCompleteU16)(
59
+ uint64_t callback_data,
60
+ UniffiForeignFutureResultU16 result
61
+ );typedef struct UniffiForeignFutureResultI16 {
62
+ int16_t return_value;
63
+ RustCallStatus call_status;
64
+ } UniffiForeignFutureResultI16;
65
+ typedef void
66
+ (*UniffiForeignFutureCompleteI16)(
67
+ uint64_t callback_data,
68
+ UniffiForeignFutureResultI16 result
69
+ );typedef struct UniffiForeignFutureResultU32 {
70
+ uint32_t return_value;
71
+ RustCallStatus call_status;
72
+ } UniffiForeignFutureResultU32;
73
+ typedef void
74
+ (*UniffiForeignFutureCompleteU32)(
75
+ uint64_t callback_data,
76
+ UniffiForeignFutureResultU32 result
77
+ );typedef struct UniffiForeignFutureResultI32 {
78
+ int32_t return_value;
79
+ RustCallStatus call_status;
80
+ } UniffiForeignFutureResultI32;
81
+ typedef void
82
+ (*UniffiForeignFutureCompleteI32)(
83
+ uint64_t callback_data,
84
+ UniffiForeignFutureResultI32 result
85
+ );typedef struct UniffiForeignFutureResultU64 {
86
+ uint64_t return_value;
87
+ RustCallStatus call_status;
88
+ } UniffiForeignFutureResultU64;
89
+ typedef void
90
+ (*UniffiForeignFutureCompleteU64)(
91
+ uint64_t callback_data,
92
+ UniffiForeignFutureResultU64 result
93
+ );typedef struct UniffiForeignFutureResultI64 {
94
+ int64_t return_value;
95
+ RustCallStatus call_status;
96
+ } UniffiForeignFutureResultI64;
97
+ typedef void
98
+ (*UniffiForeignFutureCompleteI64)(
99
+ uint64_t callback_data,
100
+ UniffiForeignFutureResultI64 result
101
+ );typedef struct UniffiForeignFutureResultF32 {
102
+ float return_value;
103
+ RustCallStatus call_status;
104
+ } UniffiForeignFutureResultF32;
105
+ typedef void
106
+ (*UniffiForeignFutureCompleteF32)(
107
+ uint64_t callback_data,
108
+ UniffiForeignFutureResultF32 result
109
+ );typedef struct UniffiForeignFutureResultF64 {
110
+ double return_value;
111
+ RustCallStatus call_status;
112
+ } UniffiForeignFutureResultF64;
113
+ typedef void
114
+ (*UniffiForeignFutureCompleteF64)(
115
+ uint64_t callback_data,
116
+ UniffiForeignFutureResultF64 result
117
+ );typedef struct UniffiForeignFutureResultRustBuffer {
118
+ RustBuffer return_value;
119
+ RustCallStatus call_status;
120
+ } UniffiForeignFutureResultRustBuffer;
121
+ typedef void
122
+ (*UniffiForeignFutureCompleteRustBuffer)(
123
+ uint64_t callback_data,
124
+ UniffiForeignFutureResultRustBuffer result
125
+ );typedef struct UniffiForeignFutureResultVoid {
126
+ RustCallStatus call_status;
127
+ } UniffiForeignFutureResultVoid;
128
+ typedef void
129
+ (*UniffiForeignFutureCompleteVoid)(
130
+ uint64_t callback_data,
131
+ UniffiForeignFutureResultVoid result
132
+ );
133
+ /*handle*/ uint64_t uniffi_mermaid_wrapper_fn_clone_ariellayout(
134
+ /*handle*/ uint64_t handle,
135
+ RustCallStatus *uniffi_out_err
136
+ );
137
+ void uniffi_mermaid_wrapper_fn_free_ariellayout(
138
+ /*handle*/ uint64_t handle,
139
+ RustCallStatus *uniffi_out_err
140
+ );
141
+ /*handle*/ uint64_t uniffi_mermaid_wrapper_fn_clone_arielparseddiagram(
142
+ /*handle*/ uint64_t handle,
143
+ RustCallStatus *uniffi_out_err
144
+ );
145
+ void uniffi_mermaid_wrapper_fn_free_arielparseddiagram(
146
+ /*handle*/ uint64_t handle,
147
+ RustCallStatus *uniffi_out_err
148
+ );
149
+ /*handle*/ uint64_t uniffi_mermaid_wrapper_fn_clone_arieltheme(
150
+ /*handle*/ uint64_t handle,
151
+ RustCallStatus *uniffi_out_err
152
+ );
153
+ void uniffi_mermaid_wrapper_fn_free_arieltheme(
154
+ /*handle*/ uint64_t handle,
155
+ RustCallStatus *uniffi_out_err
156
+ );
157
+ /*handle*/ uint64_t uniffi_mermaid_wrapper_fn_constructor_arieltheme_mermaid_default(RustCallStatus *uniffi_out_err
158
+ );
159
+ /*handle*/ uint64_t uniffi_mermaid_wrapper_fn_constructor_arieltheme_modern(RustCallStatus *uniffi_out_err
160
+ );
161
+ /*handle*/ uint64_t uniffi_mermaid_wrapper_fn_func_compute_diagram_layout(
162
+ /*handle*/ uint64_t parsed,
163
+ /*handle*/ uint64_t theme,
164
+ RustBuffer config,
165
+ RustCallStatus *uniffi_out_err
166
+ );
167
+ /*handle*/ uint64_t uniffi_mermaid_wrapper_fn_func_parse_diagram(
168
+ RustBuffer input,
169
+ RustCallStatus *uniffi_out_err
170
+ );
171
+ RustBuffer uniffi_mermaid_wrapper_fn_func_render_mermaid(
172
+ RustBuffer input,
173
+ RustCallStatus *uniffi_out_err
174
+ );
175
+ RustBuffer uniffi_mermaid_wrapper_fn_func_render_mermaid_with_options(
176
+ RustBuffer input,
177
+ /*handle*/ uint64_t _theme,
178
+ RustBuffer _config,
179
+ RustCallStatus *uniffi_out_err
180
+ );
181
+ RustBuffer uniffi_mermaid_wrapper_fn_func_render_mermaid_with_timing(
182
+ RustBuffer input,
183
+ /*handle*/ uint64_t _theme,
184
+ RustBuffer _config,
185
+ RustCallStatus *uniffi_out_err
186
+ );
187
+ RustBuffer uniffi_mermaid_wrapper_fn_func_render_svg_from_layout(
188
+ /*handle*/ uint64_t layout,
189
+ /*handle*/ uint64_t theme,
190
+ RustBuffer config,
191
+ RustCallStatus *uniffi_out_err
192
+ );
193
+ void uniffi_mermaid_wrapper_fn_func_set_timing_logs(
194
+ int8_t enabled,
195
+ RustCallStatus *uniffi_out_err
196
+ );
197
+ RustBuffer ffi_mermaid_wrapper_rustbuffer_alloc(
198
+ uint64_t size,
199
+ RustCallStatus *uniffi_out_err
200
+ );
201
+ RustBuffer ffi_mermaid_wrapper_rustbuffer_from_bytes(
202
+ ForeignBytes bytes,
203
+ RustCallStatus *uniffi_out_err
204
+ );
205
+ void ffi_mermaid_wrapper_rustbuffer_free(
206
+ RustBuffer buf,
207
+ RustCallStatus *uniffi_out_err
208
+ );
209
+ RustBuffer ffi_mermaid_wrapper_rustbuffer_reserve(
210
+ RustBuffer buf,
211
+ uint64_t additional,
212
+ RustCallStatus *uniffi_out_err
213
+ );
214
+ void ffi_mermaid_wrapper_rust_future_poll_u8(
215
+ /*handle*/ uint64_t handle,
216
+ UniffiRustFutureContinuationCallback callback,
217
+ /*handle*/ uint64_t callback_data
218
+ );
219
+ void ffi_mermaid_wrapper_rust_future_cancel_u8(
220
+ /*handle*/ uint64_t handle
221
+ );
222
+ void ffi_mermaid_wrapper_rust_future_free_u8(
223
+ /*handle*/ uint64_t handle
224
+ );
225
+ uint8_t ffi_mermaid_wrapper_rust_future_complete_u8(
226
+ /*handle*/ uint64_t handle,
227
+ RustCallStatus *uniffi_out_err
228
+ );
229
+ void ffi_mermaid_wrapper_rust_future_poll_i8(
230
+ /*handle*/ uint64_t handle,
231
+ UniffiRustFutureContinuationCallback callback,
232
+ /*handle*/ uint64_t callback_data
233
+ );
234
+ void ffi_mermaid_wrapper_rust_future_cancel_i8(
235
+ /*handle*/ uint64_t handle
236
+ );
237
+ void ffi_mermaid_wrapper_rust_future_free_i8(
238
+ /*handle*/ uint64_t handle
239
+ );
240
+ int8_t ffi_mermaid_wrapper_rust_future_complete_i8(
241
+ /*handle*/ uint64_t handle,
242
+ RustCallStatus *uniffi_out_err
243
+ );
244
+ void ffi_mermaid_wrapper_rust_future_poll_u16(
245
+ /*handle*/ uint64_t handle,
246
+ UniffiRustFutureContinuationCallback callback,
247
+ /*handle*/ uint64_t callback_data
248
+ );
249
+ void ffi_mermaid_wrapper_rust_future_cancel_u16(
250
+ /*handle*/ uint64_t handle
251
+ );
252
+ void ffi_mermaid_wrapper_rust_future_free_u16(
253
+ /*handle*/ uint64_t handle
254
+ );
255
+ uint16_t ffi_mermaid_wrapper_rust_future_complete_u16(
256
+ /*handle*/ uint64_t handle,
257
+ RustCallStatus *uniffi_out_err
258
+ );
259
+ void ffi_mermaid_wrapper_rust_future_poll_i16(
260
+ /*handle*/ uint64_t handle,
261
+ UniffiRustFutureContinuationCallback callback,
262
+ /*handle*/ uint64_t callback_data
263
+ );
264
+ void ffi_mermaid_wrapper_rust_future_cancel_i16(
265
+ /*handle*/ uint64_t handle
266
+ );
267
+ void ffi_mermaid_wrapper_rust_future_free_i16(
268
+ /*handle*/ uint64_t handle
269
+ );
270
+ int16_t ffi_mermaid_wrapper_rust_future_complete_i16(
271
+ /*handle*/ uint64_t handle,
272
+ RustCallStatus *uniffi_out_err
273
+ );
274
+ void ffi_mermaid_wrapper_rust_future_poll_u32(
275
+ /*handle*/ uint64_t handle,
276
+ UniffiRustFutureContinuationCallback callback,
277
+ /*handle*/ uint64_t callback_data
278
+ );
279
+ void ffi_mermaid_wrapper_rust_future_cancel_u32(
280
+ /*handle*/ uint64_t handle
281
+ );
282
+ void ffi_mermaid_wrapper_rust_future_free_u32(
283
+ /*handle*/ uint64_t handle
284
+ );
285
+ uint32_t ffi_mermaid_wrapper_rust_future_complete_u32(
286
+ /*handle*/ uint64_t handle,
287
+ RustCallStatus *uniffi_out_err
288
+ );
289
+ void ffi_mermaid_wrapper_rust_future_poll_i32(
290
+ /*handle*/ uint64_t handle,
291
+ UniffiRustFutureContinuationCallback callback,
292
+ /*handle*/ uint64_t callback_data
293
+ );
294
+ void ffi_mermaid_wrapper_rust_future_cancel_i32(
295
+ /*handle*/ uint64_t handle
296
+ );
297
+ void ffi_mermaid_wrapper_rust_future_free_i32(
298
+ /*handle*/ uint64_t handle
299
+ );
300
+ int32_t ffi_mermaid_wrapper_rust_future_complete_i32(
301
+ /*handle*/ uint64_t handle,
302
+ RustCallStatus *uniffi_out_err
303
+ );
304
+ void ffi_mermaid_wrapper_rust_future_poll_u64(
305
+ /*handle*/ uint64_t handle,
306
+ UniffiRustFutureContinuationCallback callback,
307
+ /*handle*/ uint64_t callback_data
308
+ );
309
+ void ffi_mermaid_wrapper_rust_future_cancel_u64(
310
+ /*handle*/ uint64_t handle
311
+ );
312
+ void ffi_mermaid_wrapper_rust_future_free_u64(
313
+ /*handle*/ uint64_t handle
314
+ );
315
+ uint64_t ffi_mermaid_wrapper_rust_future_complete_u64(
316
+ /*handle*/ uint64_t handle,
317
+ RustCallStatus *uniffi_out_err
318
+ );
319
+ void ffi_mermaid_wrapper_rust_future_poll_i64(
320
+ /*handle*/ uint64_t handle,
321
+ UniffiRustFutureContinuationCallback callback,
322
+ /*handle*/ uint64_t callback_data
323
+ );
324
+ void ffi_mermaid_wrapper_rust_future_cancel_i64(
325
+ /*handle*/ uint64_t handle
326
+ );
327
+ void ffi_mermaid_wrapper_rust_future_free_i64(
328
+ /*handle*/ uint64_t handle
329
+ );
330
+ int64_t ffi_mermaid_wrapper_rust_future_complete_i64(
331
+ /*handle*/ uint64_t handle,
332
+ RustCallStatus *uniffi_out_err
333
+ );
334
+ void ffi_mermaid_wrapper_rust_future_poll_f32(
335
+ /*handle*/ uint64_t handle,
336
+ UniffiRustFutureContinuationCallback callback,
337
+ /*handle*/ uint64_t callback_data
338
+ );
339
+ void ffi_mermaid_wrapper_rust_future_cancel_f32(
340
+ /*handle*/ uint64_t handle
341
+ );
342
+ void ffi_mermaid_wrapper_rust_future_free_f32(
343
+ /*handle*/ uint64_t handle
344
+ );
345
+ float ffi_mermaid_wrapper_rust_future_complete_f32(
346
+ /*handle*/ uint64_t handle,
347
+ RustCallStatus *uniffi_out_err
348
+ );
349
+ void ffi_mermaid_wrapper_rust_future_poll_f64(
350
+ /*handle*/ uint64_t handle,
351
+ UniffiRustFutureContinuationCallback callback,
352
+ /*handle*/ uint64_t callback_data
353
+ );
354
+ void ffi_mermaid_wrapper_rust_future_cancel_f64(
355
+ /*handle*/ uint64_t handle
356
+ );
357
+ void ffi_mermaid_wrapper_rust_future_free_f64(
358
+ /*handle*/ uint64_t handle
359
+ );
360
+ double ffi_mermaid_wrapper_rust_future_complete_f64(
361
+ /*handle*/ uint64_t handle,
362
+ RustCallStatus *uniffi_out_err
363
+ );
364
+ void ffi_mermaid_wrapper_rust_future_poll_rust_buffer(
365
+ /*handle*/ uint64_t handle,
366
+ UniffiRustFutureContinuationCallback callback,
367
+ /*handle*/ uint64_t callback_data
368
+ );
369
+ void ffi_mermaid_wrapper_rust_future_cancel_rust_buffer(
370
+ /*handle*/ uint64_t handle
371
+ );
372
+ void ffi_mermaid_wrapper_rust_future_free_rust_buffer(
373
+ /*handle*/ uint64_t handle
374
+ );
375
+ RustBuffer ffi_mermaid_wrapper_rust_future_complete_rust_buffer(
376
+ /*handle*/ uint64_t handle,
377
+ RustCallStatus *uniffi_out_err
378
+ );
379
+ void ffi_mermaid_wrapper_rust_future_poll_void(
380
+ /*handle*/ uint64_t handle,
381
+ UniffiRustFutureContinuationCallback callback,
382
+ /*handle*/ uint64_t callback_data
383
+ );
384
+ void ffi_mermaid_wrapper_rust_future_cancel_void(
385
+ /*handle*/ uint64_t handle
386
+ );
387
+ void ffi_mermaid_wrapper_rust_future_free_void(
388
+ /*handle*/ uint64_t handle
389
+ );
390
+ void ffi_mermaid_wrapper_rust_future_complete_void(
391
+ /*handle*/ uint64_t handle,
392
+ RustCallStatus *uniffi_out_err
393
+ );
394
+ uint16_t uniffi_mermaid_wrapper_checksum_func_compute_diagram_layout(
395
+ );
396
+ uint16_t uniffi_mermaid_wrapper_checksum_func_parse_diagram(
397
+ );
398
+ uint16_t uniffi_mermaid_wrapper_checksum_func_render_mermaid(
399
+ );
400
+ uint16_t uniffi_mermaid_wrapper_checksum_func_render_mermaid_with_options(
401
+ );
402
+ uint16_t uniffi_mermaid_wrapper_checksum_func_render_mermaid_with_timing(
403
+ );
404
+ uint16_t uniffi_mermaid_wrapper_checksum_func_render_svg_from_layout(
405
+ );
406
+ uint16_t uniffi_mermaid_wrapper_checksum_func_set_timing_logs(
407
+ );
408
+ uint16_t uniffi_mermaid_wrapper_checksum_constructor_arieltheme_mermaid_default(
409
+ );
410
+ uint16_t uniffi_mermaid_wrapper_checksum_constructor_arieltheme_modern(
411
+ );
412
+ uint32_t ffi_mermaid_wrapper_uniffi_contract_version(
413
+ );
414
+ }
415
+
416
+
417
+ namespace uniffi::mermaid_wrapper {
418
+ template <typename T> struct Bridging;
419
+
420
+ using namespace facebook;
421
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
422
+
423
+ template <typename T> struct Bridging<ReferenceHolder<T>> {
424
+ static jsi::Value jsNew(jsi::Runtime &rt) {
425
+ auto holder = jsi::Object(rt);
426
+ return holder;
427
+ }
428
+ static T fromJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker,
429
+ const jsi::Value &value) {
430
+ auto obj = value.asObject(rt);
431
+ if (obj.hasProperty(rt, "pointee")) {
432
+ auto pointee = obj.getProperty(rt, "pointee");
433
+ return uniffi::mermaid_wrapper::Bridging<T>::fromJs(rt, callInvoker, pointee);
434
+ }
435
+ throw jsi::JSError(
436
+ rt,
437
+ "Expected ReferenceHolder to have a pointee property. This is likely a bug in uniffi-bindgen-react-native"
438
+ );
439
+ }
440
+ };
441
+ } // namespace uniffi::mermaid_wrapper
442
+ namespace uniffi::mermaid_wrapper {
443
+ using namespace facebook;
444
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
445
+
446
+ template <> struct Bridging<RustBuffer> {
447
+ static RustBuffer rustbuffer_alloc(int32_t size) {
448
+ RustCallStatus status = { UNIFFI_CALL_STATUS_OK };
449
+ return ffi_mermaid_wrapper_rustbuffer_alloc(
450
+ size,
451
+ &status
452
+ );
453
+ }
454
+
455
+ static void rustbuffer_free(RustBuffer buf) {
456
+ RustCallStatus status = { UNIFFI_CALL_STATUS_OK };
457
+ ffi_mermaid_wrapper_rustbuffer_free(
458
+ buf,
459
+ &status
460
+ );
461
+ }
462
+
463
+ static RustBuffer rustbuffer_from_bytes(ForeignBytes bytes) {
464
+ RustCallStatus status = { UNIFFI_CALL_STATUS_OK };
465
+ return ffi_mermaid_wrapper_rustbuffer_from_bytes(
466
+ bytes,
467
+ &status
468
+ );
469
+ }
470
+
471
+ static RustBuffer fromJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker>,
472
+ const jsi::Value &value) {
473
+ try {
474
+ auto buffer = uniffi_jsi::Bridging<jsi::ArrayBuffer>::value_to_arraybuffer(rt, value);
475
+ auto bytes = ForeignBytes{
476
+ .len = static_cast<int32_t>(buffer.length(rt)),
477
+ .data = buffer.data(rt),
478
+ };
479
+
480
+ // This buffer is constructed from foreign bytes. Rust scaffolding copies
481
+ // the bytes, to make the RustBuffer.
482
+ auto buf = rustbuffer_from_bytes(bytes);
483
+ // Once it leaves this function, the buffer is immediately passed back
484
+ // into Rust, where it's used to deserialize into the Rust versions of the
485
+ // arguments. At that point, the copy is destroyed.
486
+ return buf;
487
+ } catch (const std::logic_error &e) {
488
+ throw jsi::JSError(rt, e.what());
489
+ }
490
+ }
491
+
492
+ static jsi::Value toJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker>,
493
+ RustBuffer buf) {
494
+ // We need to make a copy of the bytes from Rust's memory space into
495
+ // Javascripts memory space. We need to do this because the two languages
496
+ // manages memory very differently: a garbage collector needs to track all
497
+ // the memory at runtime, Rust is doing it all closer to compile time.
498
+ uint8_t *bytes = new uint8_t[buf.len];
499
+ std::memcpy(bytes, buf.data, buf.len);
500
+
501
+ // Construct an ArrayBuffer with copy of the bytes from the RustBuffer.
502
+ auto payload = std::make_shared<uniffi_jsi::CMutableBuffer>(
503
+ uniffi_jsi::CMutableBuffer((uint8_t *)bytes, buf.len));
504
+ auto arrayBuffer = jsi::ArrayBuffer(rt, payload);
505
+
506
+ // Once we have a Javascript version, we no longer need the Rust version, so
507
+ // we can call into Rust to tell it it's okay to free that memory.
508
+ rustbuffer_free(buf);
509
+
510
+ // Finally, return the ArrayBuffer.
511
+ return uniffi_jsi::Bridging<jsi::ArrayBuffer>::arraybuffer_to_value(rt, arrayBuffer);;
512
+ }
513
+ };
514
+
515
+ } // namespace uniffi::mermaid_wrapper
516
+
517
+ namespace uniffi::mermaid_wrapper {
518
+ using namespace facebook;
519
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
520
+
521
+ template <> struct Bridging<RustCallStatus> {
522
+ static jsi::Value jsSuccess(jsi::Runtime &rt) {
523
+ auto statusObject = jsi::Object(rt);
524
+ statusObject.setProperty(rt, "code", jsi::Value(rt, UNIFFI_CALL_STATUS_OK));
525
+ return statusObject;
526
+ }
527
+ static RustCallStatus rustSuccess(jsi::Runtime &rt) {
528
+ return {UNIFFI_CALL_STATUS_OK};
529
+ }
530
+ static void copyIntoJs(jsi::Runtime &rt,
531
+ std::shared_ptr<CallInvoker> callInvoker,
532
+ const RustCallStatus status,
533
+ const jsi::Value &jsStatus) {
534
+ auto statusObject = jsStatus.asObject(rt);
535
+ if (status.error_buf.data != nullptr) {
536
+ auto rbuf = Bridging<RustBuffer>::toJs(rt, callInvoker,
537
+ status.error_buf);
538
+ statusObject.setProperty(rt, "errorBuf", rbuf);
539
+ }
540
+ if (status.code != UNIFFI_CALL_STATUS_OK) {
541
+ auto code =
542
+ uniffi_jsi::Bridging<uint8_t>::toJs(rt, callInvoker, status.code);
543
+ statusObject.setProperty(rt, "code", code);
544
+ }
545
+ }
546
+
547
+ static RustCallStatus fromJs(jsi::Runtime &rt,
548
+ std::shared_ptr<CallInvoker> invoker,
549
+ const jsi::Value &jsStatus) {
550
+ RustCallStatus status;
551
+ auto statusObject = jsStatus.asObject(rt);
552
+ if (statusObject.hasProperty(rt, "errorBuf")) {
553
+ auto rbuf = statusObject.getProperty(rt, "errorBuf");
554
+ status.error_buf =
555
+ Bridging<RustBuffer>::fromJs(rt, invoker, rbuf);
556
+ }
557
+ if (statusObject.hasProperty(rt, "code")) {
558
+ auto code = statusObject.getProperty(rt, "code");
559
+ status.code = uniffi_jsi::Bridging<uint8_t>::fromJs(rt, invoker, code);
560
+ }
561
+ return status;
562
+ }
563
+
564
+ static void copyFromJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> invoker,
565
+ const jsi::Value &jsStatus, RustCallStatus *status) {
566
+ auto statusObject = jsStatus.asObject(rt);
567
+ if (statusObject.hasProperty(rt, "errorBuf")) {
568
+ auto rbuf = statusObject.getProperty(rt, "errorBuf");
569
+ status->error_buf =
570
+ Bridging<RustBuffer>::fromJs(rt, invoker, rbuf);
571
+ }
572
+ if (statusObject.hasProperty(rt, "code")) {
573
+ auto code = statusObject.getProperty(rt, "code");
574
+ status->code = uniffi_jsi::Bridging<uint8_t>::fromJs(rt, invoker, code);
575
+ }
576
+ }
577
+ };
578
+
579
+ } // namespace uniffi::mermaid_wrapper
580
+ // In other uniffi bindings, it is assumed that the foreign language holds on
581
+ // to the vtable, which the Rust just gets a pointer to.
582
+ // Here, we need to hold on to them, but also be able to clear them at just the
583
+ // right time so we can support hot-reloading.
584
+ namespace uniffi::mermaid_wrapper::registry {
585
+ template <typename T>
586
+ class VTableHolder {
587
+ public:
588
+ T vtable;
589
+ VTableHolder(T v) : vtable(v) {}
590
+ };
591
+
592
+ // Mutex to bind the storage and setting of vtable together.
593
+ // We declare it here, but the lock is taken by callers of the putTable
594
+ // method who are also sending a pointer to Rust.
595
+ static std::mutex vtableMutex;
596
+
597
+ // Registry to hold all vtables so they persist even when JS objects are GC'd.
598
+ // The only reason this exists is to prevent a dangling pointer in the
599
+ // Rust machinery: i.e. we don't need to access or write to this registry
600
+ // after startup.
601
+ // Registry to hold all vtables so they persist even when JS objects are GC'd.
602
+ // Maps string identifiers to vtable holders using type erasure
603
+ static std::unordered_map<std::string, std::shared_ptr<void>> vtableRegistry;
604
+
605
+ // Add a vtable to the registry with an identifier
606
+ template <typename T>
607
+ static T* putTable(std::string_view identifier, T vtable) {
608
+ auto holder = std::make_shared<VTableHolder<T>>(vtable);
609
+ // Store the raw pointer to the vtable before type erasure
610
+ T* rawPtr = &(holder->vtable);
611
+ // Store the holder using type erasure with the string identifier
612
+ vtableRegistry[std::string(identifier)] = std::shared_ptr<void>(holder);
613
+ return rawPtr;
614
+ }
615
+
616
+ // Clear the registry.
617
+ //
618
+ // Conceptually, this is called after teardown of the module (i.e. after
619
+ // teardown of the jsi::Runtime). However, because Rust is dropping callbacks
620
+ // because the Runtime is being torn down, we must keep the registry intact
621
+ // until after the runtime goes away.
622
+ //
623
+ // Therefore, in practice we should call this when the next runtime is
624
+ // being stood up.
625
+ static void clearRegistry() {
626
+ std::lock_guard<std::mutex> lock(vtableMutex);
627
+ vtableRegistry.clear();
628
+ }
629
+ } // namespace uniffi::mermaid_wrapper::registry
630
+
631
+ // This calls into Rust.
632
+ // Implementation of callback function calling from Rust to JS RustFutureContinuationCallback
633
+
634
+ // Callback function: uniffi::mermaid_wrapper::cb::rustfuturecontinuationcallback::UniffiRustFutureContinuationCallback
635
+ //
636
+ // We have the following constraints:
637
+ // - we need to pass a function pointer to Rust.
638
+ // - we need a jsi::Runtime and jsi::Function to call into JS.
639
+ // - function pointers can't store state, so we can't use a lamda.
640
+ //
641
+ // For this, we store a lambda as a global, as `rsLambda`. The `callback` function calls
642
+ // the lambda, which itself calls the `body` which then calls into JS.
643
+ //
644
+ // We then give the `callback` function pointer to Rust which will call the lambda sometime in the
645
+ // future.
646
+ namespace uniffi::mermaid_wrapper::cb::rustfuturecontinuationcallback {
647
+ using namespace facebook;
648
+
649
+ // We need to store a lambda in a global so we can call it from
650
+ // a function pointer. The function pointer is passed to Rust.
651
+ static std::function<void(uint64_t, int8_t)> rsLambda = nullptr;
652
+
653
+ // This is the main body of the callback. It's called from the lambda,
654
+ // which itself is called from the callback function which is passed to Rust.
655
+ static void body(jsi::Runtime &rt,
656
+ std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
657
+ std::shared_ptr<jsi::Value> callbackValue
658
+ ,uint64_t rs_data
659
+ ,int8_t rs_pollResult) {
660
+
661
+ // Convert the arguments from Rust, into jsi::Values.
662
+ // We'll use the Bridging class to do this…
663
+ auto js_data = uniffi_jsi::Bridging<uint64_t>::toJs(rt, callInvoker, rs_data);
664
+ auto js_pollResult = uniffi_jsi::Bridging<int8_t>::toJs(rt, callInvoker, rs_pollResult);
665
+
666
+ // Now we are ready to call the callback.
667
+ // We are already on the JS thread, because this `body` function was
668
+ // invoked from the CallInvoker.
669
+ try {
670
+ // Getting the callback function
671
+ auto cb = callbackValue->asObject(rt).asFunction(rt);
672
+ auto uniffiResult = cb.call(rt, js_data, js_pollResult
673
+ );
674
+
675
+
676
+
677
+
678
+ } catch (const jsi::JSError &error) {
679
+ std::cout << "Error in callback UniffiRustFutureContinuationCallback: "
680
+ << error.what() << std::endl;
681
+ throw error;
682
+ }
683
+ }
684
+
685
+ static void callback(uint64_t rs_data, int8_t rs_pollResult) {
686
+ // If the runtime has shutdown, then there is no point in trying to
687
+ // call into Javascript. BUT how do we tell if the runtime has shutdown?
688
+ //
689
+ // Answer: the module destructor calls into callback `cleanup` method,
690
+ // which nulls out the rsLamda.
691
+ //
692
+ // If rsLamda is null, then there is no runtime to call into.
693
+ if (rsLambda == nullptr) {
694
+ // This only occurs when destructors are calling into Rust free/drop,
695
+ // which causes the JS callback to be dropped.
696
+ return;
697
+ }
698
+
699
+ // The runtime, the actual callback jsi::funtion, and the callInvoker
700
+ // are all in the lambda.
701
+ rsLambda(
702
+ rs_data,
703
+ rs_pollResult);
704
+ }
705
+
706
+ [[maybe_unused]] static UniffiRustFutureContinuationCallback
707
+ makeCallbackFunction( // uniffi::mermaid_wrapper::cb::rustfuturecontinuationcallback
708
+ jsi::Runtime &rt,
709
+ std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
710
+ const jsi::Value &value) {
711
+ if (rsLambda != nullptr) {
712
+ // `makeCallbackFunction` is called in two circumstances:
713
+ //
714
+ // 1. at startup, when initializing callback interface vtables.
715
+ // 2. when polling futures. This happens at least once per future that is
716
+ // exposed to Javascript. We know that this is always the same function,
717
+ // `uniffiFutureContinuationCallback` in `async-rust-calls.ts`.
718
+ //
719
+ // We can therefore return the callback function without making anything
720
+ // new if we've been initialized already.
721
+ return callback;
722
+ }
723
+ auto callbackFunction = value.asObject(rt).asFunction(rt);
724
+ auto callbackValue = std::make_shared<jsi::Value>(rt, callbackFunction);
725
+ rsLambda = [&rt, callInvoker, callbackValue](uint64_t rs_data, int8_t rs_pollResult) {
726
+ // We immediately make a lambda which will do the work of transforming the
727
+ // arguments into JSI values and calling the callback.
728
+ uniffi_runtime::UniffiCallFunc jsLambda = [
729
+ callInvoker,
730
+ callbackValue
731
+ , rs_data
732
+ , rs_pollResult](jsi::Runtime &rt) mutable {
733
+ body(rt, callInvoker, callbackValue
734
+ , rs_data
735
+ , rs_pollResult);
736
+ };
737
+ // We'll then call that lambda from the callInvoker which will
738
+ // look after calling it on the correct thread.
739
+
740
+ callInvoker->invokeNonBlocking(rt, jsLambda);
741
+ };
742
+ return callback;
743
+ }
744
+
745
+ // This method is called from the destructor of NativeMermaidWrapper, which only happens
746
+ // when the jsi::Runtime is being destroyed.
747
+ static void cleanup() {
748
+ // The lambda holds a reference to the the Runtime, so when this is nulled out,
749
+ // then the pointer will no longer be left dangling.
750
+ rsLambda = nullptr;
751
+ }
752
+ } // namespace uniffi::mermaid_wrapper::cb::rustfuturecontinuationcallback
753
+ // Implementation of callback function calling from Rust to JS ForeignFutureDroppedCallback
754
+
755
+ // Callback function: uniffi::mermaid_wrapper::cb::foreignfuturedroppedcallback::UniffiForeignFutureDroppedCallback
756
+ //
757
+ // We have the following constraints:
758
+ // - we need to pass a function pointer to Rust.
759
+ // - we need a jsi::Runtime and jsi::Function to call into JS.
760
+ // - function pointers can't store state, so we can't use a lamda.
761
+ //
762
+ // For this, we store a lambda as a global, as `rsLambda`. The `callback` function calls
763
+ // the lambda, which itself calls the `body` which then calls into JS.
764
+ //
765
+ // We then give the `callback` function pointer to Rust which will call the lambda sometime in the
766
+ // future.
767
+ namespace uniffi::mermaid_wrapper::cb::foreignfuturedroppedcallback {
768
+ using namespace facebook;
769
+
770
+ // We need to store a lambda in a global so we can call it from
771
+ // a function pointer. The function pointer is passed to Rust.
772
+ static std::function<void(uint64_t)> rsLambda = nullptr;
773
+
774
+ // This is the main body of the callback. It's called from the lambda,
775
+ // which itself is called from the callback function which is passed to Rust.
776
+ static void body(jsi::Runtime &rt,
777
+ std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
778
+ std::shared_ptr<jsi::Value> callbackValue
779
+ ,uint64_t rs_handle) {
780
+
781
+ // Convert the arguments from Rust, into jsi::Values.
782
+ // We'll use the Bridging class to do this…
783
+ auto js_handle = uniffi_jsi::Bridging<uint64_t>::toJs(rt, callInvoker, rs_handle);
784
+
785
+ // Now we are ready to call the callback.
786
+ // We are already on the JS thread, because this `body` function was
787
+ // invoked from the CallInvoker.
788
+ try {
789
+ // Getting the callback function
790
+ auto cb = callbackValue->asObject(rt).asFunction(rt);
791
+ auto uniffiResult = cb.call(rt, js_handle
792
+ );
793
+
794
+
795
+
796
+
797
+ } catch (const jsi::JSError &error) {
798
+ std::cout << "Error in callback UniffiForeignFutureDroppedCallback: "
799
+ << error.what() << std::endl;
800
+ throw error;
801
+ }
802
+ }
803
+
804
+ static void callback(uint64_t rs_handle) {
805
+ // If the runtime has shutdown, then there is no point in trying to
806
+ // call into Javascript. BUT how do we tell if the runtime has shutdown?
807
+ //
808
+ // Answer: the module destructor calls into callback `cleanup` method,
809
+ // which nulls out the rsLamda.
810
+ //
811
+ // If rsLamda is null, then there is no runtime to call into.
812
+ if (rsLambda == nullptr) {
813
+ // This only occurs when destructors are calling into Rust free/drop,
814
+ // which causes the JS callback to be dropped.
815
+ return;
816
+ }
817
+
818
+ // The runtime, the actual callback jsi::funtion, and the callInvoker
819
+ // are all in the lambda.
820
+ rsLambda(
821
+ rs_handle);
822
+ }
823
+
824
+ [[maybe_unused]] static UniffiForeignFutureDroppedCallback
825
+ makeCallbackFunction( // uniffi::mermaid_wrapper::cb::foreignfuturedroppedcallback
826
+ jsi::Runtime &rt,
827
+ std::shared_ptr<uniffi_runtime::UniffiCallInvoker> callInvoker,
828
+ const jsi::Value &value) {
829
+ if (rsLambda != nullptr) {
830
+ // `makeCallbackFunction` is called in two circumstances:
831
+ //
832
+ // 1. at startup, when initializing callback interface vtables.
833
+ // 2. when polling futures. This happens at least once per future that is
834
+ // exposed to Javascript. We know that this is always the same function,
835
+ // `uniffiFutureContinuationCallback` in `async-rust-calls.ts`.
836
+ //
837
+ // We can therefore return the callback function without making anything
838
+ // new if we've been initialized already.
839
+ return callback;
840
+ }
841
+ auto callbackFunction = value.asObject(rt).asFunction(rt);
842
+ auto callbackValue = std::make_shared<jsi::Value>(rt, callbackFunction);
843
+ rsLambda = [&rt, callInvoker, callbackValue](uint64_t rs_handle) {
844
+ // We immediately make a lambda which will do the work of transforming the
845
+ // arguments into JSI values and calling the callback.
846
+ uniffi_runtime::UniffiCallFunc jsLambda = [
847
+ callInvoker,
848
+ callbackValue
849
+ , rs_handle](jsi::Runtime &rt) mutable {
850
+ body(rt, callInvoker, callbackValue
851
+ , rs_handle);
852
+ };
853
+ // We'll then call that lambda from the callInvoker which will
854
+ // look after calling it on the correct thread.
855
+
856
+ callInvoker->invokeNonBlocking(rt, jsLambda);
857
+ };
858
+ return callback;
859
+ }
860
+
861
+ // This method is called from the destructor of NativeMermaidWrapper, which only happens
862
+ // when the jsi::Runtime is being destroyed.
863
+ static void cleanup() {
864
+ // The lambda holds a reference to the the Runtime, so when this is nulled out,
865
+ // then the pointer will no longer be left dangling.
866
+ rsLambda = nullptr;
867
+ }
868
+ } // namespace uniffi::mermaid_wrapper::cb::foreignfuturedroppedcallback
869
+ // Implementation of free callback function CallbackInterfaceFree
870
+
871
+ namespace uniffi::mermaid_wrapper {
872
+ using namespace facebook;
873
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
874
+
875
+ template <> struct Bridging<UniffiForeignFutureDroppedCallbackStruct> {
876
+ static UniffiForeignFutureDroppedCallbackStruct fromJs(jsi::Runtime &rt,
877
+ std::shared_ptr<CallInvoker> callInvoker,
878
+ const jsi::Value &jsValue
879
+ ) {
880
+ // Check if the input is an object
881
+ if (!jsValue.isObject()) {
882
+ throw jsi::JSError(rt, "Expected an object for UniffiForeignFutureDroppedCallbackStruct");
883
+ }
884
+
885
+ // Get the object from the jsi::Value
886
+ auto jsObject = jsValue.getObject(rt);
887
+
888
+ // Create the vtable struct
889
+ UniffiForeignFutureDroppedCallbackStruct rsObject;
890
+
891
+ // Create the vtable from the js callbacks.
892
+ rsObject.handle = uniffi_jsi::Bridging<uint64_t>::fromJs(
893
+ rt, callInvoker,
894
+ jsObject.getProperty(rt, "handle")
895
+ );
896
+ rsObject.free = uniffi::mermaid_wrapper::cb::foreignfuturedroppedcallback::makeCallbackFunction(
897
+ rt, callInvoker, jsObject.getProperty(rt, "free")
898
+ );
899
+
900
+ return rsObject;
901
+ }
902
+ };
903
+
904
+ } // namespace uniffi::mermaid_wrapper
905
+ namespace uniffi::mermaid_wrapper {
906
+ using namespace facebook;
907
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
908
+
909
+ template <> struct Bridging<UniffiForeignFutureResultU8> {
910
+ static UniffiForeignFutureResultU8 fromJs(jsi::Runtime &rt,
911
+ std::shared_ptr<CallInvoker> callInvoker,
912
+ const jsi::Value &jsValue
913
+ ) {
914
+ // Check if the input is an object
915
+ if (!jsValue.isObject()) {
916
+ throw jsi::JSError(rt, "Expected an object for UniffiForeignFutureResultU8");
917
+ }
918
+
919
+ // Get the object from the jsi::Value
920
+ auto jsObject = jsValue.getObject(rt);
921
+
922
+ // Create the vtable struct
923
+ UniffiForeignFutureResultU8 rsObject;
924
+
925
+ // Create the vtable from the js callbacks.
926
+ rsObject.return_value = uniffi_jsi::Bridging<uint8_t>::fromJs(
927
+ rt, callInvoker,
928
+ jsObject.getProperty(rt, "returnValue")
929
+ );
930
+ rsObject.call_status = uniffi::mermaid_wrapper::Bridging<RustCallStatus>::fromJs(
931
+ rt, callInvoker,
932
+ jsObject.getProperty(rt, "callStatus")
933
+ );
934
+
935
+ return rsObject;
936
+ }
937
+ };
938
+
939
+ } // namespace uniffi::mermaid_wrapper
940
+ // Implementation of callback function calling from JS to Rust ForeignFutureCompleteU8,
941
+ // passed from Rust to JS as part of async callbacks.
942
+ namespace uniffi::mermaid_wrapper {
943
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
944
+
945
+ template <> struct Bridging<UniffiForeignFutureCompleteU8> {
946
+ static jsi::Value toJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker, UniffiForeignFutureCompleteU8 rsCallback) {
947
+ return jsi::Function::createFromHostFunction(
948
+ rt,
949
+ jsi::PropNameID::forAscii(rt, "--ForeignFutureCompleteU8"),
950
+ 2,
951
+ [rsCallback, callInvoker](
952
+ jsi::Runtime &rt,
953
+ const jsi::Value &thisValue,
954
+ const jsi::Value *arguments,
955
+ size_t count) -> jsi::Value
956
+ {
957
+ return intoRust(rt, callInvoker, thisValue, arguments, count, rsCallback);
958
+ }
959
+ );
960
+ }
961
+
962
+ static jsi::Value intoRust(
963
+ jsi::Runtime &rt,
964
+ std::shared_ptr<CallInvoker> callInvoker,
965
+ const jsi::Value &thisValue,
966
+ const jsi::Value *args,
967
+ size_t count,
968
+ UniffiForeignFutureCompleteU8 func) {
969
+ // Convert the arguments into the Rust, with Bridging<T>::fromJs,
970
+ // then call the rs_callback with those arguments.
971
+ func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::mermaid_wrapper::Bridging<UniffiForeignFutureResultU8>::fromJs(rt, callInvoker, args[1])
972
+ );
973
+
974
+
975
+ return jsi::Value::undefined();
976
+ }
977
+ };
978
+ } // namespace uniffi::mermaid_wrapper
979
+ namespace uniffi::mermaid_wrapper {
980
+ using namespace facebook;
981
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
982
+
983
+ template <> struct Bridging<UniffiForeignFutureResultI8> {
984
+ static UniffiForeignFutureResultI8 fromJs(jsi::Runtime &rt,
985
+ std::shared_ptr<CallInvoker> callInvoker,
986
+ const jsi::Value &jsValue
987
+ ) {
988
+ // Check if the input is an object
989
+ if (!jsValue.isObject()) {
990
+ throw jsi::JSError(rt, "Expected an object for UniffiForeignFutureResultI8");
991
+ }
992
+
993
+ // Get the object from the jsi::Value
994
+ auto jsObject = jsValue.getObject(rt);
995
+
996
+ // Create the vtable struct
997
+ UniffiForeignFutureResultI8 rsObject;
998
+
999
+ // Create the vtable from the js callbacks.
1000
+ rsObject.return_value = uniffi_jsi::Bridging<int8_t>::fromJs(
1001
+ rt, callInvoker,
1002
+ jsObject.getProperty(rt, "returnValue")
1003
+ );
1004
+ rsObject.call_status = uniffi::mermaid_wrapper::Bridging<RustCallStatus>::fromJs(
1005
+ rt, callInvoker,
1006
+ jsObject.getProperty(rt, "callStatus")
1007
+ );
1008
+
1009
+ return rsObject;
1010
+ }
1011
+ };
1012
+
1013
+ } // namespace uniffi::mermaid_wrapper
1014
+ // Implementation of callback function calling from JS to Rust ForeignFutureCompleteI8,
1015
+ // passed from Rust to JS as part of async callbacks.
1016
+ namespace uniffi::mermaid_wrapper {
1017
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1018
+
1019
+ template <> struct Bridging<UniffiForeignFutureCompleteI8> {
1020
+ static jsi::Value toJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker, UniffiForeignFutureCompleteI8 rsCallback) {
1021
+ return jsi::Function::createFromHostFunction(
1022
+ rt,
1023
+ jsi::PropNameID::forAscii(rt, "--ForeignFutureCompleteI8"),
1024
+ 2,
1025
+ [rsCallback, callInvoker](
1026
+ jsi::Runtime &rt,
1027
+ const jsi::Value &thisValue,
1028
+ const jsi::Value *arguments,
1029
+ size_t count) -> jsi::Value
1030
+ {
1031
+ return intoRust(rt, callInvoker, thisValue, arguments, count, rsCallback);
1032
+ }
1033
+ );
1034
+ }
1035
+
1036
+ static jsi::Value intoRust(
1037
+ jsi::Runtime &rt,
1038
+ std::shared_ptr<CallInvoker> callInvoker,
1039
+ const jsi::Value &thisValue,
1040
+ const jsi::Value *args,
1041
+ size_t count,
1042
+ UniffiForeignFutureCompleteI8 func) {
1043
+ // Convert the arguments into the Rust, with Bridging<T>::fromJs,
1044
+ // then call the rs_callback with those arguments.
1045
+ func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::mermaid_wrapper::Bridging<UniffiForeignFutureResultI8>::fromJs(rt, callInvoker, args[1])
1046
+ );
1047
+
1048
+
1049
+ return jsi::Value::undefined();
1050
+ }
1051
+ };
1052
+ } // namespace uniffi::mermaid_wrapper
1053
+ namespace uniffi::mermaid_wrapper {
1054
+ using namespace facebook;
1055
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1056
+
1057
+ template <> struct Bridging<UniffiForeignFutureResultU16> {
1058
+ static UniffiForeignFutureResultU16 fromJs(jsi::Runtime &rt,
1059
+ std::shared_ptr<CallInvoker> callInvoker,
1060
+ const jsi::Value &jsValue
1061
+ ) {
1062
+ // Check if the input is an object
1063
+ if (!jsValue.isObject()) {
1064
+ throw jsi::JSError(rt, "Expected an object for UniffiForeignFutureResultU16");
1065
+ }
1066
+
1067
+ // Get the object from the jsi::Value
1068
+ auto jsObject = jsValue.getObject(rt);
1069
+
1070
+ // Create the vtable struct
1071
+ UniffiForeignFutureResultU16 rsObject;
1072
+
1073
+ // Create the vtable from the js callbacks.
1074
+ rsObject.return_value = uniffi_jsi::Bridging<uint16_t>::fromJs(
1075
+ rt, callInvoker,
1076
+ jsObject.getProperty(rt, "returnValue")
1077
+ );
1078
+ rsObject.call_status = uniffi::mermaid_wrapper::Bridging<RustCallStatus>::fromJs(
1079
+ rt, callInvoker,
1080
+ jsObject.getProperty(rt, "callStatus")
1081
+ );
1082
+
1083
+ return rsObject;
1084
+ }
1085
+ };
1086
+
1087
+ } // namespace uniffi::mermaid_wrapper
1088
+ // Implementation of callback function calling from JS to Rust ForeignFutureCompleteU16,
1089
+ // passed from Rust to JS as part of async callbacks.
1090
+ namespace uniffi::mermaid_wrapper {
1091
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1092
+
1093
+ template <> struct Bridging<UniffiForeignFutureCompleteU16> {
1094
+ static jsi::Value toJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker, UniffiForeignFutureCompleteU16 rsCallback) {
1095
+ return jsi::Function::createFromHostFunction(
1096
+ rt,
1097
+ jsi::PropNameID::forAscii(rt, "--ForeignFutureCompleteU16"),
1098
+ 2,
1099
+ [rsCallback, callInvoker](
1100
+ jsi::Runtime &rt,
1101
+ const jsi::Value &thisValue,
1102
+ const jsi::Value *arguments,
1103
+ size_t count) -> jsi::Value
1104
+ {
1105
+ return intoRust(rt, callInvoker, thisValue, arguments, count, rsCallback);
1106
+ }
1107
+ );
1108
+ }
1109
+
1110
+ static jsi::Value intoRust(
1111
+ jsi::Runtime &rt,
1112
+ std::shared_ptr<CallInvoker> callInvoker,
1113
+ const jsi::Value &thisValue,
1114
+ const jsi::Value *args,
1115
+ size_t count,
1116
+ UniffiForeignFutureCompleteU16 func) {
1117
+ // Convert the arguments into the Rust, with Bridging<T>::fromJs,
1118
+ // then call the rs_callback with those arguments.
1119
+ func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::mermaid_wrapper::Bridging<UniffiForeignFutureResultU16>::fromJs(rt, callInvoker, args[1])
1120
+ );
1121
+
1122
+
1123
+ return jsi::Value::undefined();
1124
+ }
1125
+ };
1126
+ } // namespace uniffi::mermaid_wrapper
1127
+ namespace uniffi::mermaid_wrapper {
1128
+ using namespace facebook;
1129
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1130
+
1131
+ template <> struct Bridging<UniffiForeignFutureResultI16> {
1132
+ static UniffiForeignFutureResultI16 fromJs(jsi::Runtime &rt,
1133
+ std::shared_ptr<CallInvoker> callInvoker,
1134
+ const jsi::Value &jsValue
1135
+ ) {
1136
+ // Check if the input is an object
1137
+ if (!jsValue.isObject()) {
1138
+ throw jsi::JSError(rt, "Expected an object for UniffiForeignFutureResultI16");
1139
+ }
1140
+
1141
+ // Get the object from the jsi::Value
1142
+ auto jsObject = jsValue.getObject(rt);
1143
+
1144
+ // Create the vtable struct
1145
+ UniffiForeignFutureResultI16 rsObject;
1146
+
1147
+ // Create the vtable from the js callbacks.
1148
+ rsObject.return_value = uniffi_jsi::Bridging<int16_t>::fromJs(
1149
+ rt, callInvoker,
1150
+ jsObject.getProperty(rt, "returnValue")
1151
+ );
1152
+ rsObject.call_status = uniffi::mermaid_wrapper::Bridging<RustCallStatus>::fromJs(
1153
+ rt, callInvoker,
1154
+ jsObject.getProperty(rt, "callStatus")
1155
+ );
1156
+
1157
+ return rsObject;
1158
+ }
1159
+ };
1160
+
1161
+ } // namespace uniffi::mermaid_wrapper
1162
+ // Implementation of callback function calling from JS to Rust ForeignFutureCompleteI16,
1163
+ // passed from Rust to JS as part of async callbacks.
1164
+ namespace uniffi::mermaid_wrapper {
1165
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1166
+
1167
+ template <> struct Bridging<UniffiForeignFutureCompleteI16> {
1168
+ static jsi::Value toJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker, UniffiForeignFutureCompleteI16 rsCallback) {
1169
+ return jsi::Function::createFromHostFunction(
1170
+ rt,
1171
+ jsi::PropNameID::forAscii(rt, "--ForeignFutureCompleteI16"),
1172
+ 2,
1173
+ [rsCallback, callInvoker](
1174
+ jsi::Runtime &rt,
1175
+ const jsi::Value &thisValue,
1176
+ const jsi::Value *arguments,
1177
+ size_t count) -> jsi::Value
1178
+ {
1179
+ return intoRust(rt, callInvoker, thisValue, arguments, count, rsCallback);
1180
+ }
1181
+ );
1182
+ }
1183
+
1184
+ static jsi::Value intoRust(
1185
+ jsi::Runtime &rt,
1186
+ std::shared_ptr<CallInvoker> callInvoker,
1187
+ const jsi::Value &thisValue,
1188
+ const jsi::Value *args,
1189
+ size_t count,
1190
+ UniffiForeignFutureCompleteI16 func) {
1191
+ // Convert the arguments into the Rust, with Bridging<T>::fromJs,
1192
+ // then call the rs_callback with those arguments.
1193
+ func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::mermaid_wrapper::Bridging<UniffiForeignFutureResultI16>::fromJs(rt, callInvoker, args[1])
1194
+ );
1195
+
1196
+
1197
+ return jsi::Value::undefined();
1198
+ }
1199
+ };
1200
+ } // namespace uniffi::mermaid_wrapper
1201
+ namespace uniffi::mermaid_wrapper {
1202
+ using namespace facebook;
1203
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1204
+
1205
+ template <> struct Bridging<UniffiForeignFutureResultU32> {
1206
+ static UniffiForeignFutureResultU32 fromJs(jsi::Runtime &rt,
1207
+ std::shared_ptr<CallInvoker> callInvoker,
1208
+ const jsi::Value &jsValue
1209
+ ) {
1210
+ // Check if the input is an object
1211
+ if (!jsValue.isObject()) {
1212
+ throw jsi::JSError(rt, "Expected an object for UniffiForeignFutureResultU32");
1213
+ }
1214
+
1215
+ // Get the object from the jsi::Value
1216
+ auto jsObject = jsValue.getObject(rt);
1217
+
1218
+ // Create the vtable struct
1219
+ UniffiForeignFutureResultU32 rsObject;
1220
+
1221
+ // Create the vtable from the js callbacks.
1222
+ rsObject.return_value = uniffi_jsi::Bridging<uint32_t>::fromJs(
1223
+ rt, callInvoker,
1224
+ jsObject.getProperty(rt, "returnValue")
1225
+ );
1226
+ rsObject.call_status = uniffi::mermaid_wrapper::Bridging<RustCallStatus>::fromJs(
1227
+ rt, callInvoker,
1228
+ jsObject.getProperty(rt, "callStatus")
1229
+ );
1230
+
1231
+ return rsObject;
1232
+ }
1233
+ };
1234
+
1235
+ } // namespace uniffi::mermaid_wrapper
1236
+ // Implementation of callback function calling from JS to Rust ForeignFutureCompleteU32,
1237
+ // passed from Rust to JS as part of async callbacks.
1238
+ namespace uniffi::mermaid_wrapper {
1239
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1240
+
1241
+ template <> struct Bridging<UniffiForeignFutureCompleteU32> {
1242
+ static jsi::Value toJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker, UniffiForeignFutureCompleteU32 rsCallback) {
1243
+ return jsi::Function::createFromHostFunction(
1244
+ rt,
1245
+ jsi::PropNameID::forAscii(rt, "--ForeignFutureCompleteU32"),
1246
+ 2,
1247
+ [rsCallback, callInvoker](
1248
+ jsi::Runtime &rt,
1249
+ const jsi::Value &thisValue,
1250
+ const jsi::Value *arguments,
1251
+ size_t count) -> jsi::Value
1252
+ {
1253
+ return intoRust(rt, callInvoker, thisValue, arguments, count, rsCallback);
1254
+ }
1255
+ );
1256
+ }
1257
+
1258
+ static jsi::Value intoRust(
1259
+ jsi::Runtime &rt,
1260
+ std::shared_ptr<CallInvoker> callInvoker,
1261
+ const jsi::Value &thisValue,
1262
+ const jsi::Value *args,
1263
+ size_t count,
1264
+ UniffiForeignFutureCompleteU32 func) {
1265
+ // Convert the arguments into the Rust, with Bridging<T>::fromJs,
1266
+ // then call the rs_callback with those arguments.
1267
+ func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::mermaid_wrapper::Bridging<UniffiForeignFutureResultU32>::fromJs(rt, callInvoker, args[1])
1268
+ );
1269
+
1270
+
1271
+ return jsi::Value::undefined();
1272
+ }
1273
+ };
1274
+ } // namespace uniffi::mermaid_wrapper
1275
+ namespace uniffi::mermaid_wrapper {
1276
+ using namespace facebook;
1277
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1278
+
1279
+ template <> struct Bridging<UniffiForeignFutureResultI32> {
1280
+ static UniffiForeignFutureResultI32 fromJs(jsi::Runtime &rt,
1281
+ std::shared_ptr<CallInvoker> callInvoker,
1282
+ const jsi::Value &jsValue
1283
+ ) {
1284
+ // Check if the input is an object
1285
+ if (!jsValue.isObject()) {
1286
+ throw jsi::JSError(rt, "Expected an object for UniffiForeignFutureResultI32");
1287
+ }
1288
+
1289
+ // Get the object from the jsi::Value
1290
+ auto jsObject = jsValue.getObject(rt);
1291
+
1292
+ // Create the vtable struct
1293
+ UniffiForeignFutureResultI32 rsObject;
1294
+
1295
+ // Create the vtable from the js callbacks.
1296
+ rsObject.return_value = uniffi_jsi::Bridging<int32_t>::fromJs(
1297
+ rt, callInvoker,
1298
+ jsObject.getProperty(rt, "returnValue")
1299
+ );
1300
+ rsObject.call_status = uniffi::mermaid_wrapper::Bridging<RustCallStatus>::fromJs(
1301
+ rt, callInvoker,
1302
+ jsObject.getProperty(rt, "callStatus")
1303
+ );
1304
+
1305
+ return rsObject;
1306
+ }
1307
+ };
1308
+
1309
+ } // namespace uniffi::mermaid_wrapper
1310
+ // Implementation of callback function calling from JS to Rust ForeignFutureCompleteI32,
1311
+ // passed from Rust to JS as part of async callbacks.
1312
+ namespace uniffi::mermaid_wrapper {
1313
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1314
+
1315
+ template <> struct Bridging<UniffiForeignFutureCompleteI32> {
1316
+ static jsi::Value toJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker, UniffiForeignFutureCompleteI32 rsCallback) {
1317
+ return jsi::Function::createFromHostFunction(
1318
+ rt,
1319
+ jsi::PropNameID::forAscii(rt, "--ForeignFutureCompleteI32"),
1320
+ 2,
1321
+ [rsCallback, callInvoker](
1322
+ jsi::Runtime &rt,
1323
+ const jsi::Value &thisValue,
1324
+ const jsi::Value *arguments,
1325
+ size_t count) -> jsi::Value
1326
+ {
1327
+ return intoRust(rt, callInvoker, thisValue, arguments, count, rsCallback);
1328
+ }
1329
+ );
1330
+ }
1331
+
1332
+ static jsi::Value intoRust(
1333
+ jsi::Runtime &rt,
1334
+ std::shared_ptr<CallInvoker> callInvoker,
1335
+ const jsi::Value &thisValue,
1336
+ const jsi::Value *args,
1337
+ size_t count,
1338
+ UniffiForeignFutureCompleteI32 func) {
1339
+ // Convert the arguments into the Rust, with Bridging<T>::fromJs,
1340
+ // then call the rs_callback with those arguments.
1341
+ func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::mermaid_wrapper::Bridging<UniffiForeignFutureResultI32>::fromJs(rt, callInvoker, args[1])
1342
+ );
1343
+
1344
+
1345
+ return jsi::Value::undefined();
1346
+ }
1347
+ };
1348
+ } // namespace uniffi::mermaid_wrapper
1349
+ namespace uniffi::mermaid_wrapper {
1350
+ using namespace facebook;
1351
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1352
+
1353
+ template <> struct Bridging<UniffiForeignFutureResultU64> {
1354
+ static UniffiForeignFutureResultU64 fromJs(jsi::Runtime &rt,
1355
+ std::shared_ptr<CallInvoker> callInvoker,
1356
+ const jsi::Value &jsValue
1357
+ ) {
1358
+ // Check if the input is an object
1359
+ if (!jsValue.isObject()) {
1360
+ throw jsi::JSError(rt, "Expected an object for UniffiForeignFutureResultU64");
1361
+ }
1362
+
1363
+ // Get the object from the jsi::Value
1364
+ auto jsObject = jsValue.getObject(rt);
1365
+
1366
+ // Create the vtable struct
1367
+ UniffiForeignFutureResultU64 rsObject;
1368
+
1369
+ // Create the vtable from the js callbacks.
1370
+ rsObject.return_value = uniffi_jsi::Bridging<uint64_t>::fromJs(
1371
+ rt, callInvoker,
1372
+ jsObject.getProperty(rt, "returnValue")
1373
+ );
1374
+ rsObject.call_status = uniffi::mermaid_wrapper::Bridging<RustCallStatus>::fromJs(
1375
+ rt, callInvoker,
1376
+ jsObject.getProperty(rt, "callStatus")
1377
+ );
1378
+
1379
+ return rsObject;
1380
+ }
1381
+ };
1382
+
1383
+ } // namespace uniffi::mermaid_wrapper
1384
+ // Implementation of callback function calling from JS to Rust ForeignFutureCompleteU64,
1385
+ // passed from Rust to JS as part of async callbacks.
1386
+ namespace uniffi::mermaid_wrapper {
1387
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1388
+
1389
+ template <> struct Bridging<UniffiForeignFutureCompleteU64> {
1390
+ static jsi::Value toJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker, UniffiForeignFutureCompleteU64 rsCallback) {
1391
+ return jsi::Function::createFromHostFunction(
1392
+ rt,
1393
+ jsi::PropNameID::forAscii(rt, "--ForeignFutureCompleteU64"),
1394
+ 2,
1395
+ [rsCallback, callInvoker](
1396
+ jsi::Runtime &rt,
1397
+ const jsi::Value &thisValue,
1398
+ const jsi::Value *arguments,
1399
+ size_t count) -> jsi::Value
1400
+ {
1401
+ return intoRust(rt, callInvoker, thisValue, arguments, count, rsCallback);
1402
+ }
1403
+ );
1404
+ }
1405
+
1406
+ static jsi::Value intoRust(
1407
+ jsi::Runtime &rt,
1408
+ std::shared_ptr<CallInvoker> callInvoker,
1409
+ const jsi::Value &thisValue,
1410
+ const jsi::Value *args,
1411
+ size_t count,
1412
+ UniffiForeignFutureCompleteU64 func) {
1413
+ // Convert the arguments into the Rust, with Bridging<T>::fromJs,
1414
+ // then call the rs_callback with those arguments.
1415
+ func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::mermaid_wrapper::Bridging<UniffiForeignFutureResultU64>::fromJs(rt, callInvoker, args[1])
1416
+ );
1417
+
1418
+
1419
+ return jsi::Value::undefined();
1420
+ }
1421
+ };
1422
+ } // namespace uniffi::mermaid_wrapper
1423
+ namespace uniffi::mermaid_wrapper {
1424
+ using namespace facebook;
1425
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1426
+
1427
+ template <> struct Bridging<UniffiForeignFutureResultI64> {
1428
+ static UniffiForeignFutureResultI64 fromJs(jsi::Runtime &rt,
1429
+ std::shared_ptr<CallInvoker> callInvoker,
1430
+ const jsi::Value &jsValue
1431
+ ) {
1432
+ // Check if the input is an object
1433
+ if (!jsValue.isObject()) {
1434
+ throw jsi::JSError(rt, "Expected an object for UniffiForeignFutureResultI64");
1435
+ }
1436
+
1437
+ // Get the object from the jsi::Value
1438
+ auto jsObject = jsValue.getObject(rt);
1439
+
1440
+ // Create the vtable struct
1441
+ UniffiForeignFutureResultI64 rsObject;
1442
+
1443
+ // Create the vtable from the js callbacks.
1444
+ rsObject.return_value = uniffi_jsi::Bridging<int64_t>::fromJs(
1445
+ rt, callInvoker,
1446
+ jsObject.getProperty(rt, "returnValue")
1447
+ );
1448
+ rsObject.call_status = uniffi::mermaid_wrapper::Bridging<RustCallStatus>::fromJs(
1449
+ rt, callInvoker,
1450
+ jsObject.getProperty(rt, "callStatus")
1451
+ );
1452
+
1453
+ return rsObject;
1454
+ }
1455
+ };
1456
+
1457
+ } // namespace uniffi::mermaid_wrapper
1458
+ // Implementation of callback function calling from JS to Rust ForeignFutureCompleteI64,
1459
+ // passed from Rust to JS as part of async callbacks.
1460
+ namespace uniffi::mermaid_wrapper {
1461
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1462
+
1463
+ template <> struct Bridging<UniffiForeignFutureCompleteI64> {
1464
+ static jsi::Value toJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker, UniffiForeignFutureCompleteI64 rsCallback) {
1465
+ return jsi::Function::createFromHostFunction(
1466
+ rt,
1467
+ jsi::PropNameID::forAscii(rt, "--ForeignFutureCompleteI64"),
1468
+ 2,
1469
+ [rsCallback, callInvoker](
1470
+ jsi::Runtime &rt,
1471
+ const jsi::Value &thisValue,
1472
+ const jsi::Value *arguments,
1473
+ size_t count) -> jsi::Value
1474
+ {
1475
+ return intoRust(rt, callInvoker, thisValue, arguments, count, rsCallback);
1476
+ }
1477
+ );
1478
+ }
1479
+
1480
+ static jsi::Value intoRust(
1481
+ jsi::Runtime &rt,
1482
+ std::shared_ptr<CallInvoker> callInvoker,
1483
+ const jsi::Value &thisValue,
1484
+ const jsi::Value *args,
1485
+ size_t count,
1486
+ UniffiForeignFutureCompleteI64 func) {
1487
+ // Convert the arguments into the Rust, with Bridging<T>::fromJs,
1488
+ // then call the rs_callback with those arguments.
1489
+ func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::mermaid_wrapper::Bridging<UniffiForeignFutureResultI64>::fromJs(rt, callInvoker, args[1])
1490
+ );
1491
+
1492
+
1493
+ return jsi::Value::undefined();
1494
+ }
1495
+ };
1496
+ } // namespace uniffi::mermaid_wrapper
1497
+ namespace uniffi::mermaid_wrapper {
1498
+ using namespace facebook;
1499
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1500
+
1501
+ template <> struct Bridging<UniffiForeignFutureResultF32> {
1502
+ static UniffiForeignFutureResultF32 fromJs(jsi::Runtime &rt,
1503
+ std::shared_ptr<CallInvoker> callInvoker,
1504
+ const jsi::Value &jsValue
1505
+ ) {
1506
+ // Check if the input is an object
1507
+ if (!jsValue.isObject()) {
1508
+ throw jsi::JSError(rt, "Expected an object for UniffiForeignFutureResultF32");
1509
+ }
1510
+
1511
+ // Get the object from the jsi::Value
1512
+ auto jsObject = jsValue.getObject(rt);
1513
+
1514
+ // Create the vtable struct
1515
+ UniffiForeignFutureResultF32 rsObject;
1516
+
1517
+ // Create the vtable from the js callbacks.
1518
+ rsObject.return_value = uniffi_jsi::Bridging<float>::fromJs(
1519
+ rt, callInvoker,
1520
+ jsObject.getProperty(rt, "returnValue")
1521
+ );
1522
+ rsObject.call_status = uniffi::mermaid_wrapper::Bridging<RustCallStatus>::fromJs(
1523
+ rt, callInvoker,
1524
+ jsObject.getProperty(rt, "callStatus")
1525
+ );
1526
+
1527
+ return rsObject;
1528
+ }
1529
+ };
1530
+
1531
+ } // namespace uniffi::mermaid_wrapper
1532
+ // Implementation of callback function calling from JS to Rust ForeignFutureCompleteF32,
1533
+ // passed from Rust to JS as part of async callbacks.
1534
+ namespace uniffi::mermaid_wrapper {
1535
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1536
+
1537
+ template <> struct Bridging<UniffiForeignFutureCompleteF32> {
1538
+ static jsi::Value toJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker, UniffiForeignFutureCompleteF32 rsCallback) {
1539
+ return jsi::Function::createFromHostFunction(
1540
+ rt,
1541
+ jsi::PropNameID::forAscii(rt, "--ForeignFutureCompleteF32"),
1542
+ 2,
1543
+ [rsCallback, callInvoker](
1544
+ jsi::Runtime &rt,
1545
+ const jsi::Value &thisValue,
1546
+ const jsi::Value *arguments,
1547
+ size_t count) -> jsi::Value
1548
+ {
1549
+ return intoRust(rt, callInvoker, thisValue, arguments, count, rsCallback);
1550
+ }
1551
+ );
1552
+ }
1553
+
1554
+ static jsi::Value intoRust(
1555
+ jsi::Runtime &rt,
1556
+ std::shared_ptr<CallInvoker> callInvoker,
1557
+ const jsi::Value &thisValue,
1558
+ const jsi::Value *args,
1559
+ size_t count,
1560
+ UniffiForeignFutureCompleteF32 func) {
1561
+ // Convert the arguments into the Rust, with Bridging<T>::fromJs,
1562
+ // then call the rs_callback with those arguments.
1563
+ func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::mermaid_wrapper::Bridging<UniffiForeignFutureResultF32>::fromJs(rt, callInvoker, args[1])
1564
+ );
1565
+
1566
+
1567
+ return jsi::Value::undefined();
1568
+ }
1569
+ };
1570
+ } // namespace uniffi::mermaid_wrapper
1571
+ namespace uniffi::mermaid_wrapper {
1572
+ using namespace facebook;
1573
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1574
+
1575
+ template <> struct Bridging<UniffiForeignFutureResultF64> {
1576
+ static UniffiForeignFutureResultF64 fromJs(jsi::Runtime &rt,
1577
+ std::shared_ptr<CallInvoker> callInvoker,
1578
+ const jsi::Value &jsValue
1579
+ ) {
1580
+ // Check if the input is an object
1581
+ if (!jsValue.isObject()) {
1582
+ throw jsi::JSError(rt, "Expected an object for UniffiForeignFutureResultF64");
1583
+ }
1584
+
1585
+ // Get the object from the jsi::Value
1586
+ auto jsObject = jsValue.getObject(rt);
1587
+
1588
+ // Create the vtable struct
1589
+ UniffiForeignFutureResultF64 rsObject;
1590
+
1591
+ // Create the vtable from the js callbacks.
1592
+ rsObject.return_value = uniffi_jsi::Bridging<double>::fromJs(
1593
+ rt, callInvoker,
1594
+ jsObject.getProperty(rt, "returnValue")
1595
+ );
1596
+ rsObject.call_status = uniffi::mermaid_wrapper::Bridging<RustCallStatus>::fromJs(
1597
+ rt, callInvoker,
1598
+ jsObject.getProperty(rt, "callStatus")
1599
+ );
1600
+
1601
+ return rsObject;
1602
+ }
1603
+ };
1604
+
1605
+ } // namespace uniffi::mermaid_wrapper
1606
+ // Implementation of callback function calling from JS to Rust ForeignFutureCompleteF64,
1607
+ // passed from Rust to JS as part of async callbacks.
1608
+ namespace uniffi::mermaid_wrapper {
1609
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1610
+
1611
+ template <> struct Bridging<UniffiForeignFutureCompleteF64> {
1612
+ static jsi::Value toJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker, UniffiForeignFutureCompleteF64 rsCallback) {
1613
+ return jsi::Function::createFromHostFunction(
1614
+ rt,
1615
+ jsi::PropNameID::forAscii(rt, "--ForeignFutureCompleteF64"),
1616
+ 2,
1617
+ [rsCallback, callInvoker](
1618
+ jsi::Runtime &rt,
1619
+ const jsi::Value &thisValue,
1620
+ const jsi::Value *arguments,
1621
+ size_t count) -> jsi::Value
1622
+ {
1623
+ return intoRust(rt, callInvoker, thisValue, arguments, count, rsCallback);
1624
+ }
1625
+ );
1626
+ }
1627
+
1628
+ static jsi::Value intoRust(
1629
+ jsi::Runtime &rt,
1630
+ std::shared_ptr<CallInvoker> callInvoker,
1631
+ const jsi::Value &thisValue,
1632
+ const jsi::Value *args,
1633
+ size_t count,
1634
+ UniffiForeignFutureCompleteF64 func) {
1635
+ // Convert the arguments into the Rust, with Bridging<T>::fromJs,
1636
+ // then call the rs_callback with those arguments.
1637
+ func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::mermaid_wrapper::Bridging<UniffiForeignFutureResultF64>::fromJs(rt, callInvoker, args[1])
1638
+ );
1639
+
1640
+
1641
+ return jsi::Value::undefined();
1642
+ }
1643
+ };
1644
+ } // namespace uniffi::mermaid_wrapper
1645
+ namespace uniffi::mermaid_wrapper {
1646
+ using namespace facebook;
1647
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1648
+
1649
+ template <> struct Bridging<UniffiForeignFutureResultRustBuffer> {
1650
+ static UniffiForeignFutureResultRustBuffer fromJs(jsi::Runtime &rt,
1651
+ std::shared_ptr<CallInvoker> callInvoker,
1652
+ const jsi::Value &jsValue
1653
+ ) {
1654
+ // Check if the input is an object
1655
+ if (!jsValue.isObject()) {
1656
+ throw jsi::JSError(rt, "Expected an object for UniffiForeignFutureResultRustBuffer");
1657
+ }
1658
+
1659
+ // Get the object from the jsi::Value
1660
+ auto jsObject = jsValue.getObject(rt);
1661
+
1662
+ // Create the vtable struct
1663
+ UniffiForeignFutureResultRustBuffer rsObject;
1664
+
1665
+ // Create the vtable from the js callbacks.
1666
+ rsObject.return_value = uniffi::mermaid_wrapper::Bridging<RustBuffer>::fromJs(
1667
+ rt, callInvoker,
1668
+ jsObject.getProperty(rt, "returnValue")
1669
+ );
1670
+ rsObject.call_status = uniffi::mermaid_wrapper::Bridging<RustCallStatus>::fromJs(
1671
+ rt, callInvoker,
1672
+ jsObject.getProperty(rt, "callStatus")
1673
+ );
1674
+
1675
+ return rsObject;
1676
+ }
1677
+ };
1678
+
1679
+ } // namespace uniffi::mermaid_wrapper
1680
+ // Implementation of callback function calling from JS to Rust ForeignFutureCompleteRustBuffer,
1681
+ // passed from Rust to JS as part of async callbacks.
1682
+ namespace uniffi::mermaid_wrapper {
1683
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1684
+
1685
+ template <> struct Bridging<UniffiForeignFutureCompleteRustBuffer> {
1686
+ static jsi::Value toJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker, UniffiForeignFutureCompleteRustBuffer rsCallback) {
1687
+ return jsi::Function::createFromHostFunction(
1688
+ rt,
1689
+ jsi::PropNameID::forAscii(rt, "--ForeignFutureCompleteRustBuffer"),
1690
+ 2,
1691
+ [rsCallback, callInvoker](
1692
+ jsi::Runtime &rt,
1693
+ const jsi::Value &thisValue,
1694
+ const jsi::Value *arguments,
1695
+ size_t count) -> jsi::Value
1696
+ {
1697
+ return intoRust(rt, callInvoker, thisValue, arguments, count, rsCallback);
1698
+ }
1699
+ );
1700
+ }
1701
+
1702
+ static jsi::Value intoRust(
1703
+ jsi::Runtime &rt,
1704
+ std::shared_ptr<CallInvoker> callInvoker,
1705
+ const jsi::Value &thisValue,
1706
+ const jsi::Value *args,
1707
+ size_t count,
1708
+ UniffiForeignFutureCompleteRustBuffer func) {
1709
+ // Convert the arguments into the Rust, with Bridging<T>::fromJs,
1710
+ // then call the rs_callback with those arguments.
1711
+ func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::mermaid_wrapper::Bridging<UniffiForeignFutureResultRustBuffer>::fromJs(rt, callInvoker, args[1])
1712
+ );
1713
+
1714
+
1715
+ return jsi::Value::undefined();
1716
+ }
1717
+ };
1718
+ } // namespace uniffi::mermaid_wrapper
1719
+ namespace uniffi::mermaid_wrapper {
1720
+ using namespace facebook;
1721
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1722
+
1723
+ template <> struct Bridging<UniffiForeignFutureResultVoid> {
1724
+ static UniffiForeignFutureResultVoid fromJs(jsi::Runtime &rt,
1725
+ std::shared_ptr<CallInvoker> callInvoker,
1726
+ const jsi::Value &jsValue
1727
+ ) {
1728
+ // Check if the input is an object
1729
+ if (!jsValue.isObject()) {
1730
+ throw jsi::JSError(rt, "Expected an object for UniffiForeignFutureResultVoid");
1731
+ }
1732
+
1733
+ // Get the object from the jsi::Value
1734
+ auto jsObject = jsValue.getObject(rt);
1735
+
1736
+ // Create the vtable struct
1737
+ UniffiForeignFutureResultVoid rsObject;
1738
+
1739
+ // Create the vtable from the js callbacks.
1740
+ rsObject.call_status = uniffi::mermaid_wrapper::Bridging<RustCallStatus>::fromJs(
1741
+ rt, callInvoker,
1742
+ jsObject.getProperty(rt, "callStatus")
1743
+ );
1744
+
1745
+ return rsObject;
1746
+ }
1747
+ };
1748
+
1749
+ } // namespace uniffi::mermaid_wrapper
1750
+ // Implementation of callback function calling from JS to Rust ForeignFutureCompleteVoid,
1751
+ // passed from Rust to JS as part of async callbacks.
1752
+ namespace uniffi::mermaid_wrapper {
1753
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1754
+
1755
+ template <> struct Bridging<UniffiForeignFutureCompleteVoid> {
1756
+ static jsi::Value toJs(jsi::Runtime &rt, std::shared_ptr<CallInvoker> callInvoker, UniffiForeignFutureCompleteVoid rsCallback) {
1757
+ return jsi::Function::createFromHostFunction(
1758
+ rt,
1759
+ jsi::PropNameID::forAscii(rt, "--ForeignFutureCompleteVoid"),
1760
+ 2,
1761
+ [rsCallback, callInvoker](
1762
+ jsi::Runtime &rt,
1763
+ const jsi::Value &thisValue,
1764
+ const jsi::Value *arguments,
1765
+ size_t count) -> jsi::Value
1766
+ {
1767
+ return intoRust(rt, callInvoker, thisValue, arguments, count, rsCallback);
1768
+ }
1769
+ );
1770
+ }
1771
+
1772
+ static jsi::Value intoRust(
1773
+ jsi::Runtime &rt,
1774
+ std::shared_ptr<CallInvoker> callInvoker,
1775
+ const jsi::Value &thisValue,
1776
+ const jsi::Value *args,
1777
+ size_t count,
1778
+ UniffiForeignFutureCompleteVoid func) {
1779
+ // Convert the arguments into the Rust, with Bridging<T>::fromJs,
1780
+ // then call the rs_callback with those arguments.
1781
+ func(uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi::mermaid_wrapper::Bridging<UniffiForeignFutureResultVoid>::fromJs(rt, callInvoker, args[1])
1782
+ );
1783
+
1784
+
1785
+ return jsi::Value::undefined();
1786
+ }
1787
+ };
1788
+ } // namespace uniffi::mermaid_wrapper
1789
+
1790
+
1791
+ namespace uniffi::mermaid_wrapper {
1792
+ using namespace facebook;
1793
+ using CallInvoker = uniffi_runtime::UniffiCallInvoker;
1794
+
1795
+ template <> struct Bridging<UniffiRustFutureContinuationCallback> {
1796
+ static UniffiRustFutureContinuationCallback fromJs(
1797
+ jsi::Runtime &rt,
1798
+ std::shared_ptr<CallInvoker> callInvoker,
1799
+ const jsi::Value &value
1800
+ ) {
1801
+ try {
1802
+ return uniffi::mermaid_wrapper::cb::rustfuturecontinuationcallback::makeCallbackFunction(
1803
+ rt,
1804
+ callInvoker,
1805
+ value
1806
+ );
1807
+ } catch (const std::logic_error &e) {
1808
+ throw jsi::JSError(rt, e.what());
1809
+ }
1810
+ }
1811
+ };
1812
+
1813
+ } // namespace uniffi::mermaid_wrapper
1814
+
1815
+ NativeMermaidWrapper::NativeMermaidWrapper(
1816
+ jsi::Runtime &rt,
1817
+ std::shared_ptr<uniffi_runtime::UniffiCallInvoker> invoker
1818
+ ) : callInvoker(invoker), props() {
1819
+ // Map from Javascript names to the cpp names
1820
+ props["ubrn_uniffi_internal_fn_func_ffi__string_to_byte_length"] = jsi::Function::createFromHostFunction(
1821
+ rt,
1822
+ jsi::PropNameID::forAscii(rt, "ubrn_uniffi_internal_fn_func_ffi__string_to_byte_length"),
1823
+ 1,
1824
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
1825
+ return this->cpp_uniffi_internal_fn_func_ffi__string_to_byte_length(rt, thisVal, args, count);
1826
+ }
1827
+ );
1828
+ props["ubrn_uniffi_internal_fn_func_ffi__string_to_arraybuffer"] = jsi::Function::createFromHostFunction(
1829
+ rt,
1830
+ jsi::PropNameID::forAscii(rt, "ubrn_uniffi_internal_fn_func_ffi__string_to_arraybuffer"),
1831
+ 1,
1832
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
1833
+ return this->cpp_uniffi_internal_fn_func_ffi__string_to_arraybuffer(rt, thisVal, args, count);
1834
+ }
1835
+ );
1836
+ props["ubrn_uniffi_internal_fn_func_ffi__arraybuffer_to_string"] = jsi::Function::createFromHostFunction(
1837
+ rt,
1838
+ jsi::PropNameID::forAscii(rt, "ubrn_uniffi_internal_fn_func_ffi__arraybuffer_to_string"),
1839
+ 1,
1840
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
1841
+ return this->cpp_uniffi_internal_fn_func_ffi__arraybuffer_to_string(rt, thisVal, args, count);
1842
+ }
1843
+ );
1844
+ props["ubrn_uniffi_mermaid_wrapper_fn_clone_ariellayout"] = jsi::Function::createFromHostFunction(
1845
+ rt,
1846
+ jsi::PropNameID::forAscii(rt, "ubrn_uniffi_mermaid_wrapper_fn_clone_ariellayout"),
1847
+ 1,
1848
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
1849
+ return this->cpp_uniffi_mermaid_wrapper_fn_clone_ariellayout(rt, thisVal, args, count);
1850
+ }
1851
+ );
1852
+ props["ubrn_uniffi_mermaid_wrapper_fn_free_ariellayout"] = jsi::Function::createFromHostFunction(
1853
+ rt,
1854
+ jsi::PropNameID::forAscii(rt, "ubrn_uniffi_mermaid_wrapper_fn_free_ariellayout"),
1855
+ 1,
1856
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
1857
+ return this->cpp_uniffi_mermaid_wrapper_fn_free_ariellayout(rt, thisVal, args, count);
1858
+ }
1859
+ );
1860
+ props["ubrn_uniffi_mermaid_wrapper_fn_clone_arielparseddiagram"] = jsi::Function::createFromHostFunction(
1861
+ rt,
1862
+ jsi::PropNameID::forAscii(rt, "ubrn_uniffi_mermaid_wrapper_fn_clone_arielparseddiagram"),
1863
+ 1,
1864
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
1865
+ return this->cpp_uniffi_mermaid_wrapper_fn_clone_arielparseddiagram(rt, thisVal, args, count);
1866
+ }
1867
+ );
1868
+ props["ubrn_uniffi_mermaid_wrapper_fn_free_arielparseddiagram"] = jsi::Function::createFromHostFunction(
1869
+ rt,
1870
+ jsi::PropNameID::forAscii(rt, "ubrn_uniffi_mermaid_wrapper_fn_free_arielparseddiagram"),
1871
+ 1,
1872
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
1873
+ return this->cpp_uniffi_mermaid_wrapper_fn_free_arielparseddiagram(rt, thisVal, args, count);
1874
+ }
1875
+ );
1876
+ props["ubrn_uniffi_mermaid_wrapper_fn_clone_arieltheme"] = jsi::Function::createFromHostFunction(
1877
+ rt,
1878
+ jsi::PropNameID::forAscii(rt, "ubrn_uniffi_mermaid_wrapper_fn_clone_arieltheme"),
1879
+ 1,
1880
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
1881
+ return this->cpp_uniffi_mermaid_wrapper_fn_clone_arieltheme(rt, thisVal, args, count);
1882
+ }
1883
+ );
1884
+ props["ubrn_uniffi_mermaid_wrapper_fn_free_arieltheme"] = jsi::Function::createFromHostFunction(
1885
+ rt,
1886
+ jsi::PropNameID::forAscii(rt, "ubrn_uniffi_mermaid_wrapper_fn_free_arieltheme"),
1887
+ 1,
1888
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
1889
+ return this->cpp_uniffi_mermaid_wrapper_fn_free_arieltheme(rt, thisVal, args, count);
1890
+ }
1891
+ );
1892
+ props["ubrn_uniffi_mermaid_wrapper_fn_constructor_arieltheme_mermaid_default"] = jsi::Function::createFromHostFunction(
1893
+ rt,
1894
+ jsi::PropNameID::forAscii(rt, "ubrn_uniffi_mermaid_wrapper_fn_constructor_arieltheme_mermaid_default"),
1895
+ 0,
1896
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
1897
+ return this->cpp_uniffi_mermaid_wrapper_fn_constructor_arieltheme_mermaid_default(rt, thisVal, args, count);
1898
+ }
1899
+ );
1900
+ props["ubrn_uniffi_mermaid_wrapper_fn_constructor_arieltheme_modern"] = jsi::Function::createFromHostFunction(
1901
+ rt,
1902
+ jsi::PropNameID::forAscii(rt, "ubrn_uniffi_mermaid_wrapper_fn_constructor_arieltheme_modern"),
1903
+ 0,
1904
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
1905
+ return this->cpp_uniffi_mermaid_wrapper_fn_constructor_arieltheme_modern(rt, thisVal, args, count);
1906
+ }
1907
+ );
1908
+ props["ubrn_uniffi_mermaid_wrapper_fn_func_compute_diagram_layout"] = jsi::Function::createFromHostFunction(
1909
+ rt,
1910
+ jsi::PropNameID::forAscii(rt, "ubrn_uniffi_mermaid_wrapper_fn_func_compute_diagram_layout"),
1911
+ 3,
1912
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
1913
+ return this->cpp_uniffi_mermaid_wrapper_fn_func_compute_diagram_layout(rt, thisVal, args, count);
1914
+ }
1915
+ );
1916
+ props["ubrn_uniffi_mermaid_wrapper_fn_func_parse_diagram"] = jsi::Function::createFromHostFunction(
1917
+ rt,
1918
+ jsi::PropNameID::forAscii(rt, "ubrn_uniffi_mermaid_wrapper_fn_func_parse_diagram"),
1919
+ 1,
1920
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
1921
+ return this->cpp_uniffi_mermaid_wrapper_fn_func_parse_diagram(rt, thisVal, args, count);
1922
+ }
1923
+ );
1924
+ props["ubrn_uniffi_mermaid_wrapper_fn_func_render_mermaid"] = jsi::Function::createFromHostFunction(
1925
+ rt,
1926
+ jsi::PropNameID::forAscii(rt, "ubrn_uniffi_mermaid_wrapper_fn_func_render_mermaid"),
1927
+ 1,
1928
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
1929
+ return this->cpp_uniffi_mermaid_wrapper_fn_func_render_mermaid(rt, thisVal, args, count);
1930
+ }
1931
+ );
1932
+ props["ubrn_uniffi_mermaid_wrapper_fn_func_render_mermaid_with_options"] = jsi::Function::createFromHostFunction(
1933
+ rt,
1934
+ jsi::PropNameID::forAscii(rt, "ubrn_uniffi_mermaid_wrapper_fn_func_render_mermaid_with_options"),
1935
+ 3,
1936
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
1937
+ return this->cpp_uniffi_mermaid_wrapper_fn_func_render_mermaid_with_options(rt, thisVal, args, count);
1938
+ }
1939
+ );
1940
+ props["ubrn_uniffi_mermaid_wrapper_fn_func_render_mermaid_with_timing"] = jsi::Function::createFromHostFunction(
1941
+ rt,
1942
+ jsi::PropNameID::forAscii(rt, "ubrn_uniffi_mermaid_wrapper_fn_func_render_mermaid_with_timing"),
1943
+ 3,
1944
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
1945
+ return this->cpp_uniffi_mermaid_wrapper_fn_func_render_mermaid_with_timing(rt, thisVal, args, count);
1946
+ }
1947
+ );
1948
+ props["ubrn_uniffi_mermaid_wrapper_fn_func_render_svg_from_layout"] = jsi::Function::createFromHostFunction(
1949
+ rt,
1950
+ jsi::PropNameID::forAscii(rt, "ubrn_uniffi_mermaid_wrapper_fn_func_render_svg_from_layout"),
1951
+ 3,
1952
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
1953
+ return this->cpp_uniffi_mermaid_wrapper_fn_func_render_svg_from_layout(rt, thisVal, args, count);
1954
+ }
1955
+ );
1956
+ props["ubrn_uniffi_mermaid_wrapper_fn_func_set_timing_logs"] = jsi::Function::createFromHostFunction(
1957
+ rt,
1958
+ jsi::PropNameID::forAscii(rt, "ubrn_uniffi_mermaid_wrapper_fn_func_set_timing_logs"),
1959
+ 1,
1960
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
1961
+ return this->cpp_uniffi_mermaid_wrapper_fn_func_set_timing_logs(rt, thisVal, args, count);
1962
+ }
1963
+ );
1964
+ props["ubrn_uniffi_mermaid_wrapper_checksum_func_compute_diagram_layout"] = jsi::Function::createFromHostFunction(
1965
+ rt,
1966
+ jsi::PropNameID::forAscii(rt, "ubrn_uniffi_mermaid_wrapper_checksum_func_compute_diagram_layout"),
1967
+ 0,
1968
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
1969
+ return this->cpp_uniffi_mermaid_wrapper_checksum_func_compute_diagram_layout(rt, thisVal, args, count);
1970
+ }
1971
+ );
1972
+ props["ubrn_uniffi_mermaid_wrapper_checksum_func_parse_diagram"] = jsi::Function::createFromHostFunction(
1973
+ rt,
1974
+ jsi::PropNameID::forAscii(rt, "ubrn_uniffi_mermaid_wrapper_checksum_func_parse_diagram"),
1975
+ 0,
1976
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
1977
+ return this->cpp_uniffi_mermaid_wrapper_checksum_func_parse_diagram(rt, thisVal, args, count);
1978
+ }
1979
+ );
1980
+ props["ubrn_uniffi_mermaid_wrapper_checksum_func_render_mermaid"] = jsi::Function::createFromHostFunction(
1981
+ rt,
1982
+ jsi::PropNameID::forAscii(rt, "ubrn_uniffi_mermaid_wrapper_checksum_func_render_mermaid"),
1983
+ 0,
1984
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
1985
+ return this->cpp_uniffi_mermaid_wrapper_checksum_func_render_mermaid(rt, thisVal, args, count);
1986
+ }
1987
+ );
1988
+ props["ubrn_uniffi_mermaid_wrapper_checksum_func_render_mermaid_with_options"] = jsi::Function::createFromHostFunction(
1989
+ rt,
1990
+ jsi::PropNameID::forAscii(rt, "ubrn_uniffi_mermaid_wrapper_checksum_func_render_mermaid_with_options"),
1991
+ 0,
1992
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
1993
+ return this->cpp_uniffi_mermaid_wrapper_checksum_func_render_mermaid_with_options(rt, thisVal, args, count);
1994
+ }
1995
+ );
1996
+ props["ubrn_uniffi_mermaid_wrapper_checksum_func_render_mermaid_with_timing"] = jsi::Function::createFromHostFunction(
1997
+ rt,
1998
+ jsi::PropNameID::forAscii(rt, "ubrn_uniffi_mermaid_wrapper_checksum_func_render_mermaid_with_timing"),
1999
+ 0,
2000
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
2001
+ return this->cpp_uniffi_mermaid_wrapper_checksum_func_render_mermaid_with_timing(rt, thisVal, args, count);
2002
+ }
2003
+ );
2004
+ props["ubrn_uniffi_mermaid_wrapper_checksum_func_render_svg_from_layout"] = jsi::Function::createFromHostFunction(
2005
+ rt,
2006
+ jsi::PropNameID::forAscii(rt, "ubrn_uniffi_mermaid_wrapper_checksum_func_render_svg_from_layout"),
2007
+ 0,
2008
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
2009
+ return this->cpp_uniffi_mermaid_wrapper_checksum_func_render_svg_from_layout(rt, thisVal, args, count);
2010
+ }
2011
+ );
2012
+ props["ubrn_uniffi_mermaid_wrapper_checksum_func_set_timing_logs"] = jsi::Function::createFromHostFunction(
2013
+ rt,
2014
+ jsi::PropNameID::forAscii(rt, "ubrn_uniffi_mermaid_wrapper_checksum_func_set_timing_logs"),
2015
+ 0,
2016
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
2017
+ return this->cpp_uniffi_mermaid_wrapper_checksum_func_set_timing_logs(rt, thisVal, args, count);
2018
+ }
2019
+ );
2020
+ props["ubrn_uniffi_mermaid_wrapper_checksum_constructor_arieltheme_mermaid_default"] = jsi::Function::createFromHostFunction(
2021
+ rt,
2022
+ jsi::PropNameID::forAscii(rt, "ubrn_uniffi_mermaid_wrapper_checksum_constructor_arieltheme_mermaid_default"),
2023
+ 0,
2024
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
2025
+ return this->cpp_uniffi_mermaid_wrapper_checksum_constructor_arieltheme_mermaid_default(rt, thisVal, args, count);
2026
+ }
2027
+ );
2028
+ props["ubrn_uniffi_mermaid_wrapper_checksum_constructor_arieltheme_modern"] = jsi::Function::createFromHostFunction(
2029
+ rt,
2030
+ jsi::PropNameID::forAscii(rt, "ubrn_uniffi_mermaid_wrapper_checksum_constructor_arieltheme_modern"),
2031
+ 0,
2032
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
2033
+ return this->cpp_uniffi_mermaid_wrapper_checksum_constructor_arieltheme_modern(rt, thisVal, args, count);
2034
+ }
2035
+ );
2036
+ props["ubrn_ffi_mermaid_wrapper_uniffi_contract_version"] = jsi::Function::createFromHostFunction(
2037
+ rt,
2038
+ jsi::PropNameID::forAscii(rt, "ubrn_ffi_mermaid_wrapper_uniffi_contract_version"),
2039
+ 0,
2040
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
2041
+ return this->cpp_ffi_mermaid_wrapper_uniffi_contract_version(rt, thisVal, args, count);
2042
+ }
2043
+ );
2044
+ props["ubrn_uniffi_internal_fn_method_ariellayout_ffi__bless_pointer"] = jsi::Function::createFromHostFunction(
2045
+ rt,
2046
+ jsi::PropNameID::forAscii(rt, "ubrn_uniffi_internal_fn_method_ariellayout_ffi__bless_pointer"),
2047
+ 1,
2048
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
2049
+ return this->cpp_uniffi_internal_fn_method_ariellayout_ffi__bless_pointer(rt, thisVal, args, count);
2050
+ }
2051
+ );
2052
+ props["ubrn_uniffi_internal_fn_method_arielparseddiagram_ffi__bless_pointer"] = jsi::Function::createFromHostFunction(
2053
+ rt,
2054
+ jsi::PropNameID::forAscii(rt, "ubrn_uniffi_internal_fn_method_arielparseddiagram_ffi__bless_pointer"),
2055
+ 1,
2056
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
2057
+ return this->cpp_uniffi_internal_fn_method_arielparseddiagram_ffi__bless_pointer(rt, thisVal, args, count);
2058
+ }
2059
+ );
2060
+ props["ubrn_uniffi_internal_fn_method_arieltheme_ffi__bless_pointer"] = jsi::Function::createFromHostFunction(
2061
+ rt,
2062
+ jsi::PropNameID::forAscii(rt, "ubrn_uniffi_internal_fn_method_arieltheme_ffi__bless_pointer"),
2063
+ 1,
2064
+ [this](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
2065
+ return this->cpp_uniffi_internal_fn_method_arieltheme_ffi__bless_pointer(rt, thisVal, args, count);
2066
+ }
2067
+ );
2068
+ }
2069
+
2070
+ void NativeMermaidWrapper::registerModule(jsi::Runtime &rt, std::shared_ptr<react::CallInvoker> callInvoker) {
2071
+ auto invoker = std::make_shared<uniffi_runtime::UniffiCallInvoker>(callInvoker);
2072
+ auto tm = std::make_shared<NativeMermaidWrapper>(rt, invoker);
2073
+ auto obj = rt.global().createFromHostObject(rt, tm);
2074
+ rt.global().setProperty(rt, "NativeMermaidWrapper", obj);
2075
+ }
2076
+
2077
+ void NativeMermaidWrapper::unregisterModule(jsi::Runtime &rt) {
2078
+ uniffi::mermaid_wrapper::registry::clearRegistry();
2079
+ }
2080
+
2081
+ jsi::Value NativeMermaidWrapper::get(jsi::Runtime& rt, const jsi::PropNameID& name) {
2082
+ try {
2083
+ return jsi::Value(rt, props.at(name.utf8(rt)));
2084
+ }
2085
+ catch (std::out_of_range &e) {
2086
+ return jsi::Value::undefined();
2087
+ }
2088
+ }
2089
+
2090
+ std::vector<jsi::PropNameID> NativeMermaidWrapper::getPropertyNames(jsi::Runtime& rt) {
2091
+ std::vector<jsi::PropNameID> rval;
2092
+ for (auto& [key, value] : props) {
2093
+ rval.push_back(jsi::PropNameID::forUtf8(rt, key));
2094
+ }
2095
+ return rval;
2096
+ }
2097
+
2098
+ void NativeMermaidWrapper::set(jsi::Runtime& rt, const jsi::PropNameID& name, const jsi::Value& value) {
2099
+ props.insert_or_assign(name.utf8(rt), &value);
2100
+ }
2101
+
2102
+ NativeMermaidWrapper::~NativeMermaidWrapper() {
2103
+ // Cleanup for callback function RustFutureContinuationCallback
2104
+ uniffi::mermaid_wrapper::cb::rustfuturecontinuationcallback::cleanup();
2105
+ // Cleanup for callback function ForeignFutureDroppedCallback
2106
+ uniffi::mermaid_wrapper::cb::foreignfuturedroppedcallback::cleanup();
2107
+ // Cleanup for "free" callback function CallbackInterfaceFree
2108
+
2109
+ }
2110
+
2111
+ // Utility functions for serialization/deserialization of strings.
2112
+ jsi::Value NativeMermaidWrapper::cpp_uniffi_internal_fn_func_ffi__string_to_byte_length(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
2113
+ return uniffi_jsi::Bridging<std::string>::string_to_bytelength(rt, args[0]);
2114
+ }
2115
+
2116
+ jsi::Value NativeMermaidWrapper::cpp_uniffi_internal_fn_func_ffi__string_to_arraybuffer(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
2117
+ return uniffi_jsi::Bridging<std::string>::string_to_arraybuffer(rt, args[0]);
2118
+ }
2119
+
2120
+ jsi::Value NativeMermaidWrapper::cpp_uniffi_internal_fn_func_ffi__arraybuffer_to_string(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
2121
+ return uniffi_jsi::Bridging<std::string>::arraybuffer_to_string(rt, args[0]);
2122
+ }jsi::Value NativeMermaidWrapper::cpp_uniffi_internal_fn_method_ariellayout_ffi__bless_pointer(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
2123
+ auto pointer = uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]);
2124
+ auto static destructor = [](uint64_t p) {
2125
+ RustCallStatus status = {0};
2126
+ uniffi_mermaid_wrapper_fn_free_ariellayout(p, &status);
2127
+ };
2128
+ auto ptrObj = std::make_shared<uniffi_jsi::DestructibleObject>(pointer, destructor);
2129
+ auto obj = jsi::Object::createFromHostObject(rt, ptrObj);
2130
+ return jsi::Value(rt, obj);
2131
+ }jsi::Value NativeMermaidWrapper::cpp_uniffi_internal_fn_method_arielparseddiagram_ffi__bless_pointer(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
2132
+ auto pointer = uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]);
2133
+ auto static destructor = [](uint64_t p) {
2134
+ RustCallStatus status = {0};
2135
+ uniffi_mermaid_wrapper_fn_free_arielparseddiagram(p, &status);
2136
+ };
2137
+ auto ptrObj = std::make_shared<uniffi_jsi::DestructibleObject>(pointer, destructor);
2138
+ auto obj = jsi::Object::createFromHostObject(rt, ptrObj);
2139
+ return jsi::Value(rt, obj);
2140
+ }jsi::Value NativeMermaidWrapper::cpp_uniffi_internal_fn_method_arieltheme_ffi__bless_pointer(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
2141
+ auto pointer = uniffi_jsi::Bridging<uint64_t>::fromJs(rt, callInvoker, args[0]);
2142
+ auto static destructor = [](uint64_t p) {
2143
+ RustCallStatus status = {0};
2144
+ uniffi_mermaid_wrapper_fn_free_arieltheme(p, &status);
2145
+ };
2146
+ auto ptrObj = std::make_shared<uniffi_jsi::DestructibleObject>(pointer, destructor);
2147
+ auto obj = jsi::Object::createFromHostObject(rt, ptrObj);
2148
+ return jsi::Value(rt, obj);
2149
+ }
2150
+
2151
+ // Methods calling directly into the uniffi generated C API of the Rust crate.
2152
+ jsi::Value NativeMermaidWrapper::cpp_uniffi_mermaid_wrapper_fn_clone_ariellayout(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
2153
+ RustCallStatus status = uniffi::mermaid_wrapper::Bridging<RustCallStatus>::rustSuccess(rt);
2154
+ auto value = uniffi_mermaid_wrapper_fn_clone_ariellayout(uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker, args[0]),
2155
+ &status
2156
+ );
2157
+ uniffi::mermaid_wrapper::Bridging<RustCallStatus>::copyIntoJs(rt, callInvoker, status, args[count - 1]);
2158
+
2159
+
2160
+ return uniffi_jsi::Bridging</*handle*/ uint64_t>::toJs(rt, callInvoker, value);
2161
+ }
2162
+ jsi::Value NativeMermaidWrapper::cpp_uniffi_mermaid_wrapper_fn_free_ariellayout(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
2163
+ RustCallStatus status = uniffi::mermaid_wrapper::Bridging<RustCallStatus>::rustSuccess(rt);
2164
+ uniffi_mermaid_wrapper_fn_free_ariellayout(uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker, args[0]),
2165
+ &status
2166
+ );
2167
+ uniffi::mermaid_wrapper::Bridging<RustCallStatus>::copyIntoJs(rt, callInvoker, status, args[count - 1]);
2168
+
2169
+
2170
+ return jsi::Value::undefined();
2171
+ }
2172
+ jsi::Value NativeMermaidWrapper::cpp_uniffi_mermaid_wrapper_fn_clone_arielparseddiagram(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
2173
+ RustCallStatus status = uniffi::mermaid_wrapper::Bridging<RustCallStatus>::rustSuccess(rt);
2174
+ auto value = uniffi_mermaid_wrapper_fn_clone_arielparseddiagram(uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker, args[0]),
2175
+ &status
2176
+ );
2177
+ uniffi::mermaid_wrapper::Bridging<RustCallStatus>::copyIntoJs(rt, callInvoker, status, args[count - 1]);
2178
+
2179
+
2180
+ return uniffi_jsi::Bridging</*handle*/ uint64_t>::toJs(rt, callInvoker, value);
2181
+ }
2182
+ jsi::Value NativeMermaidWrapper::cpp_uniffi_mermaid_wrapper_fn_free_arielparseddiagram(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
2183
+ RustCallStatus status = uniffi::mermaid_wrapper::Bridging<RustCallStatus>::rustSuccess(rt);
2184
+ uniffi_mermaid_wrapper_fn_free_arielparseddiagram(uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker, args[0]),
2185
+ &status
2186
+ );
2187
+ uniffi::mermaid_wrapper::Bridging<RustCallStatus>::copyIntoJs(rt, callInvoker, status, args[count - 1]);
2188
+
2189
+
2190
+ return jsi::Value::undefined();
2191
+ }
2192
+ jsi::Value NativeMermaidWrapper::cpp_uniffi_mermaid_wrapper_fn_clone_arieltheme(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
2193
+ RustCallStatus status = uniffi::mermaid_wrapper::Bridging<RustCallStatus>::rustSuccess(rt);
2194
+ auto value = uniffi_mermaid_wrapper_fn_clone_arieltheme(uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker, args[0]),
2195
+ &status
2196
+ );
2197
+ uniffi::mermaid_wrapper::Bridging<RustCallStatus>::copyIntoJs(rt, callInvoker, status, args[count - 1]);
2198
+
2199
+
2200
+ return uniffi_jsi::Bridging</*handle*/ uint64_t>::toJs(rt, callInvoker, value);
2201
+ }
2202
+ jsi::Value NativeMermaidWrapper::cpp_uniffi_mermaid_wrapper_fn_free_arieltheme(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
2203
+ RustCallStatus status = uniffi::mermaid_wrapper::Bridging<RustCallStatus>::rustSuccess(rt);
2204
+ uniffi_mermaid_wrapper_fn_free_arieltheme(uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker, args[0]),
2205
+ &status
2206
+ );
2207
+ uniffi::mermaid_wrapper::Bridging<RustCallStatus>::copyIntoJs(rt, callInvoker, status, args[count - 1]);
2208
+
2209
+
2210
+ return jsi::Value::undefined();
2211
+ }
2212
+ jsi::Value NativeMermaidWrapper::cpp_uniffi_mermaid_wrapper_fn_constructor_arieltheme_mermaid_default(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
2213
+ RustCallStatus status = uniffi::mermaid_wrapper::Bridging<RustCallStatus>::rustSuccess(rt);
2214
+ auto value = uniffi_mermaid_wrapper_fn_constructor_arieltheme_mermaid_default(&status
2215
+ );
2216
+ uniffi::mermaid_wrapper::Bridging<RustCallStatus>::copyIntoJs(rt, callInvoker, status, args[count - 1]);
2217
+
2218
+
2219
+ return uniffi_jsi::Bridging</*handle*/ uint64_t>::toJs(rt, callInvoker, value);
2220
+ }
2221
+ jsi::Value NativeMermaidWrapper::cpp_uniffi_mermaid_wrapper_fn_constructor_arieltheme_modern(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
2222
+ RustCallStatus status = uniffi::mermaid_wrapper::Bridging<RustCallStatus>::rustSuccess(rt);
2223
+ auto value = uniffi_mermaid_wrapper_fn_constructor_arieltheme_modern(&status
2224
+ );
2225
+ uniffi::mermaid_wrapper::Bridging<RustCallStatus>::copyIntoJs(rt, callInvoker, status, args[count - 1]);
2226
+
2227
+
2228
+ return uniffi_jsi::Bridging</*handle*/ uint64_t>::toJs(rt, callInvoker, value);
2229
+ }
2230
+ jsi::Value NativeMermaidWrapper::cpp_uniffi_mermaid_wrapper_fn_func_compute_diagram_layout(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
2231
+ RustCallStatus status = uniffi::mermaid_wrapper::Bridging<RustCallStatus>::rustSuccess(rt);
2232
+ auto value = uniffi_mermaid_wrapper_fn_func_compute_diagram_layout(uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker, args[1]), uniffi::mermaid_wrapper::Bridging<RustBuffer>::fromJs(rt, callInvoker, args[2]),
2233
+ &status
2234
+ );
2235
+ uniffi::mermaid_wrapper::Bridging<RustCallStatus>::copyIntoJs(rt, callInvoker, status, args[count - 1]);
2236
+
2237
+
2238
+ return uniffi_jsi::Bridging</*handle*/ uint64_t>::toJs(rt, callInvoker, value);
2239
+ }
2240
+ jsi::Value NativeMermaidWrapper::cpp_uniffi_mermaid_wrapper_fn_func_parse_diagram(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
2241
+ RustCallStatus status = uniffi::mermaid_wrapper::Bridging<RustCallStatus>::rustSuccess(rt);
2242
+ auto value = uniffi_mermaid_wrapper_fn_func_parse_diagram(uniffi::mermaid_wrapper::Bridging<RustBuffer>::fromJs(rt, callInvoker, args[0]),
2243
+ &status
2244
+ );
2245
+ uniffi::mermaid_wrapper::Bridging<RustCallStatus>::copyIntoJs(rt, callInvoker, status, args[count - 1]);
2246
+
2247
+
2248
+ return uniffi_jsi::Bridging</*handle*/ uint64_t>::toJs(rt, callInvoker, value);
2249
+ }
2250
+ jsi::Value NativeMermaidWrapper::cpp_uniffi_mermaid_wrapper_fn_func_render_mermaid(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
2251
+ RustCallStatus status = uniffi::mermaid_wrapper::Bridging<RustCallStatus>::rustSuccess(rt);
2252
+ auto value = uniffi_mermaid_wrapper_fn_func_render_mermaid(uniffi::mermaid_wrapper::Bridging<RustBuffer>::fromJs(rt, callInvoker, args[0]),
2253
+ &status
2254
+ );
2255
+ uniffi::mermaid_wrapper::Bridging<RustCallStatus>::copyIntoJs(rt, callInvoker, status, args[count - 1]);
2256
+
2257
+
2258
+ return uniffi::mermaid_wrapper::Bridging<RustBuffer>::toJs(rt, callInvoker, value);
2259
+ }
2260
+ jsi::Value NativeMermaidWrapper::cpp_uniffi_mermaid_wrapper_fn_func_render_mermaid_with_options(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
2261
+ RustCallStatus status = uniffi::mermaid_wrapper::Bridging<RustCallStatus>::rustSuccess(rt);
2262
+ auto value = uniffi_mermaid_wrapper_fn_func_render_mermaid_with_options(uniffi::mermaid_wrapper::Bridging<RustBuffer>::fromJs(rt, callInvoker, args[0]), uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker, args[1]), uniffi::mermaid_wrapper::Bridging<RustBuffer>::fromJs(rt, callInvoker, args[2]),
2263
+ &status
2264
+ );
2265
+ uniffi::mermaid_wrapper::Bridging<RustCallStatus>::copyIntoJs(rt, callInvoker, status, args[count - 1]);
2266
+
2267
+
2268
+ return uniffi::mermaid_wrapper::Bridging<RustBuffer>::toJs(rt, callInvoker, value);
2269
+ }
2270
+ jsi::Value NativeMermaidWrapper::cpp_uniffi_mermaid_wrapper_fn_func_render_mermaid_with_timing(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
2271
+ RustCallStatus status = uniffi::mermaid_wrapper::Bridging<RustCallStatus>::rustSuccess(rt);
2272
+ auto value = uniffi_mermaid_wrapper_fn_func_render_mermaid_with_timing(uniffi::mermaid_wrapper::Bridging<RustBuffer>::fromJs(rt, callInvoker, args[0]), uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker, args[1]), uniffi::mermaid_wrapper::Bridging<RustBuffer>::fromJs(rt, callInvoker, args[2]),
2273
+ &status
2274
+ );
2275
+ uniffi::mermaid_wrapper::Bridging<RustCallStatus>::copyIntoJs(rt, callInvoker, status, args[count - 1]);
2276
+
2277
+
2278
+ return uniffi::mermaid_wrapper::Bridging<RustBuffer>::toJs(rt, callInvoker, value);
2279
+ }
2280
+ jsi::Value NativeMermaidWrapper::cpp_uniffi_mermaid_wrapper_fn_func_render_svg_from_layout(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
2281
+ RustCallStatus status = uniffi::mermaid_wrapper::Bridging<RustCallStatus>::rustSuccess(rt);
2282
+ auto value = uniffi_mermaid_wrapper_fn_func_render_svg_from_layout(uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker, args[0]), uniffi_jsi::Bridging</*handle*/ uint64_t>::fromJs(rt, callInvoker, args[1]), uniffi::mermaid_wrapper::Bridging<RustBuffer>::fromJs(rt, callInvoker, args[2]),
2283
+ &status
2284
+ );
2285
+ uniffi::mermaid_wrapper::Bridging<RustCallStatus>::copyIntoJs(rt, callInvoker, status, args[count - 1]);
2286
+
2287
+
2288
+ return uniffi::mermaid_wrapper::Bridging<RustBuffer>::toJs(rt, callInvoker, value);
2289
+ }
2290
+ jsi::Value NativeMermaidWrapper::cpp_uniffi_mermaid_wrapper_fn_func_set_timing_logs(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
2291
+ RustCallStatus status = uniffi::mermaid_wrapper::Bridging<RustCallStatus>::rustSuccess(rt);
2292
+ uniffi_mermaid_wrapper_fn_func_set_timing_logs(uniffi_jsi::Bridging<int8_t>::fromJs(rt, callInvoker, args[0]),
2293
+ &status
2294
+ );
2295
+ uniffi::mermaid_wrapper::Bridging<RustCallStatus>::copyIntoJs(rt, callInvoker, status, args[count - 1]);
2296
+
2297
+
2298
+ return jsi::Value::undefined();
2299
+ }
2300
+ jsi::Value NativeMermaidWrapper::cpp_uniffi_mermaid_wrapper_checksum_func_compute_diagram_layout(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
2301
+ auto value = uniffi_mermaid_wrapper_checksum_func_compute_diagram_layout(
2302
+ );
2303
+
2304
+
2305
+ return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
2306
+ }
2307
+ jsi::Value NativeMermaidWrapper::cpp_uniffi_mermaid_wrapper_checksum_func_parse_diagram(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
2308
+ auto value = uniffi_mermaid_wrapper_checksum_func_parse_diagram(
2309
+ );
2310
+
2311
+
2312
+ return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
2313
+ }
2314
+ jsi::Value NativeMermaidWrapper::cpp_uniffi_mermaid_wrapper_checksum_func_render_mermaid(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
2315
+ auto value = uniffi_mermaid_wrapper_checksum_func_render_mermaid(
2316
+ );
2317
+
2318
+
2319
+ return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
2320
+ }
2321
+ jsi::Value NativeMermaidWrapper::cpp_uniffi_mermaid_wrapper_checksum_func_render_mermaid_with_options(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
2322
+ auto value = uniffi_mermaid_wrapper_checksum_func_render_mermaid_with_options(
2323
+ );
2324
+
2325
+
2326
+ return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
2327
+ }
2328
+ jsi::Value NativeMermaidWrapper::cpp_uniffi_mermaid_wrapper_checksum_func_render_mermaid_with_timing(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
2329
+ auto value = uniffi_mermaid_wrapper_checksum_func_render_mermaid_with_timing(
2330
+ );
2331
+
2332
+
2333
+ return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
2334
+ }
2335
+ jsi::Value NativeMermaidWrapper::cpp_uniffi_mermaid_wrapper_checksum_func_render_svg_from_layout(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
2336
+ auto value = uniffi_mermaid_wrapper_checksum_func_render_svg_from_layout(
2337
+ );
2338
+
2339
+
2340
+ return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
2341
+ }
2342
+ jsi::Value NativeMermaidWrapper::cpp_uniffi_mermaid_wrapper_checksum_func_set_timing_logs(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
2343
+ auto value = uniffi_mermaid_wrapper_checksum_func_set_timing_logs(
2344
+ );
2345
+
2346
+
2347
+ return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
2348
+ }
2349
+ jsi::Value NativeMermaidWrapper::cpp_uniffi_mermaid_wrapper_checksum_constructor_arieltheme_mermaid_default(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
2350
+ auto value = uniffi_mermaid_wrapper_checksum_constructor_arieltheme_mermaid_default(
2351
+ );
2352
+
2353
+
2354
+ return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
2355
+ }
2356
+ jsi::Value NativeMermaidWrapper::cpp_uniffi_mermaid_wrapper_checksum_constructor_arieltheme_modern(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
2357
+ auto value = uniffi_mermaid_wrapper_checksum_constructor_arieltheme_modern(
2358
+ );
2359
+
2360
+
2361
+ return uniffi_jsi::Bridging<uint16_t>::toJs(rt, callInvoker, value);
2362
+ }
2363
+ jsi::Value NativeMermaidWrapper::cpp_ffi_mermaid_wrapper_uniffi_contract_version(jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
2364
+ auto value = ffi_mermaid_wrapper_uniffi_contract_version(
2365
+ );
2366
+
2367
+
2368
+ return uniffi_jsi::Bridging<uint32_t>::toJs(rt, callInvoker, value);
2369
+ }