@iternio/react-native-auto-play 0.4.11 → 0.4.12

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 (77) hide show
  1. package/README.md +26 -0
  2. package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridAutoPlay.kt +0 -89
  3. package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridVoice.kt +97 -0
  4. package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/VoiceInputManager.kt +286 -20
  5. package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/utils/ThreadUtil.kt +6 -13
  6. package/ios/hybrid/HybridAutoPlay.swift +2 -47
  7. package/ios/hybrid/HybridVoice.swift +65 -0
  8. package/ios/utils/VoiceInputManager.swift +144 -40
  9. package/lib/HybridAutoPlay.d.ts +2 -0
  10. package/lib/HybridAutoPlay.js +2 -0
  11. package/lib/components/OnAppearedChildRenderer.d.ts +10 -0
  12. package/lib/components/OnAppearedChildRenderer.js +26 -0
  13. package/lib/hooks/useIsAutoPlayFocused.d.ts +7 -0
  14. package/lib/hooks/useIsAutoPlayFocused.js +20 -0
  15. package/lib/hybrid/HybridVoice.d.ts +52 -0
  16. package/lib/hybrid/HybridVoice.js +52 -0
  17. package/lib/hybrid.d.ts +2 -0
  18. package/lib/hybrid.js +2 -0
  19. package/lib/index.d.ts +3 -1
  20. package/lib/index.js +2 -1
  21. package/lib/specs/AutoPlay.nitro.d.ts +0 -29
  22. package/lib/specs/AutomotivePermissionRequestTemplate.d.ts +11 -0
  23. package/lib/specs/AutomotivePermissionRequestTemplate.js +1 -0
  24. package/lib/specs/AutomotivePermissionRequestTemplate.nitro.d.ts +11 -0
  25. package/lib/specs/AutomotivePermissionRequestTemplate.nitro.js +1 -0
  26. package/lib/specs/Voice.nitro.d.ts +11 -0
  27. package/lib/specs/Voice.nitro.js +1 -0
  28. package/lib/templates/AutomotivePermissionRequestTemplate.d.ts +23 -0
  29. package/lib/templates/AutomotivePermissionRequestTemplate.js +18 -0
  30. package/lib/types/Glyphmap.d.ts +4105 -0
  31. package/lib/types/Glyphmap.js +4105 -0
  32. package/lib/types/Voice.d.ts +16 -0
  33. package/lib/types/Voice.js +1 -0
  34. package/nitro.json +10 -0
  35. package/nitrogen/generated/android/ReactNativeAutoPlay+autolinking.cmake +2 -0
  36. package/nitrogen/generated/android/ReactNativeAutoPlayOnLoad.cpp +18 -0
  37. package/nitrogen/generated/android/c++/JFunc_void_VoiceInputChunk.hpp +81 -0
  38. package/nitrogen/generated/android/c++/JHybridAutoPlaySpec.cpp +0 -43
  39. package/nitrogen/generated/android/c++/JHybridAutoPlaySpec.hpp +0 -4
  40. package/nitrogen/generated/android/c++/JHybridVoiceSpec.cpp +104 -0
  41. package/nitrogen/generated/android/c++/JHybridVoiceSpec.hpp +66 -0
  42. package/nitrogen/generated/android/c++/JVoiceInputChunk.hpp +64 -0
  43. package/nitrogen/generated/android/c++/JVoiceInputResult.hpp +64 -0
  44. package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/Func_void_VoiceInputChunk.kt +80 -0
  45. package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridAutoPlaySpec.kt +0 -17
  46. package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridVoiceSpec.kt +72 -0
  47. package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/VoiceInputChunk.kt +56 -0
  48. package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/VoiceInputResult.kt +56 -0
  49. package/nitrogen/generated/ios/ReactNativeAutoPlay-Swift-Cxx-Bridge.cpp +41 -16
  50. package/nitrogen/generated/ios/ReactNativeAutoPlay-Swift-Cxx-Bridge.hpp +201 -126
  51. package/nitrogen/generated/ios/ReactNativeAutoPlay-Swift-Cxx-Umbrella.hpp +11 -0
  52. package/nitrogen/generated/ios/ReactNativeAutoPlayAutolinking.mm +8 -0
  53. package/nitrogen/generated/ios/ReactNativeAutoPlayAutolinking.swift +12 -0
  54. package/nitrogen/generated/ios/c++/HybridAutoPlaySpecSwift.hpp +0 -34
  55. package/nitrogen/generated/ios/c++/HybridVoiceSpecSwift.cpp +11 -0
  56. package/nitrogen/generated/ios/c++/HybridVoiceSpecSwift.hpp +116 -0
  57. package/nitrogen/generated/ios/swift/Func_void_VoiceInputChunk.swift +46 -0
  58. package/nitrogen/generated/ios/swift/{Func_void_std__shared_ptr_ArrayBuffer_.swift → Func_void_VoiceInputResult.swift} +10 -10
  59. package/nitrogen/generated/ios/swift/Func_void_bool.swift +5 -5
  60. package/nitrogen/generated/ios/swift/HybridAutoPlaySpec.swift +0 -4
  61. package/nitrogen/generated/ios/swift/HybridAutoPlaySpec_cxx.swift +0 -82
  62. package/nitrogen/generated/ios/swift/HybridVoiceSpec.swift +58 -0
  63. package/nitrogen/generated/ios/swift/HybridVoiceSpec_cxx.swift +234 -0
  64. package/nitrogen/generated/ios/swift/VoiceInputChunk.swift +60 -0
  65. package/nitrogen/generated/ios/swift/VoiceInputResult.swift +60 -0
  66. package/nitrogen/generated/shared/c++/HybridAutoPlaySpec.cpp +0 -4
  67. package/nitrogen/generated/shared/c++/HybridAutoPlaySpec.hpp +0 -5
  68. package/nitrogen/generated/shared/c++/HybridVoiceSpec.cpp +24 -0
  69. package/nitrogen/generated/shared/c++/HybridVoiceSpec.hpp +73 -0
  70. package/nitrogen/generated/shared/c++/VoiceInputChunk.hpp +89 -0
  71. package/nitrogen/generated/shared/c++/VoiceInputResult.hpp +89 -0
  72. package/package.json +1 -1
  73. package/src/hybrid/HybridVoice.ts +79 -0
  74. package/src/index.ts +3 -1
  75. package/src/specs/AutoPlay.nitro.ts +0 -37
  76. package/src/specs/Voice.nitro.ts +16 -0
  77. package/src/types/Voice.ts +18 -0
@@ -48,6 +48,8 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay { class HybridMapTem
48
48
  namespace margelo::nitro::swe::iternio::reactnativeautoplay { class HybridMessageTemplateSpec; }
49
49
  // Forward declaration of `HybridSearchTemplateSpec` to properly resolve imports.
50
50
  namespace margelo::nitro::swe::iternio::reactnativeautoplay { class HybridSearchTemplateSpec; }
51
+ // Forward declaration of `HybridVoiceSpec` to properly resolve imports.
52
+ namespace margelo::nitro::swe::iternio::reactnativeautoplay { class HybridVoiceSpec; }
51
53
  // Forward declaration of `ImageLane` to properly resolve imports.
52
54
  namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct ImageLane; }
53
55
  // Forward declaration of `KeepType` to properly resolve imports.
@@ -126,6 +128,10 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay { enum class TurnTyp
126
128
  namespace margelo::nitro::swe::iternio::reactnativeautoplay { enum class VisibilityState; }
127
129
  // Forward declaration of `VisibleTravelEstimate` to properly resolve imports.
128
130
  namespace margelo::nitro::swe::iternio::reactnativeautoplay { enum class VisibleTravelEstimate; }
131
+ // Forward declaration of `VoiceInputChunk` to properly resolve imports.
132
+ namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct VoiceInputChunk; }
133
+ // Forward declaration of `VoiceInputResult` to properly resolve imports.
134
+ namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct VoiceInputResult; }
129
135
  // Forward declaration of `ZoomEvent` to properly resolve imports.
130
136
  namespace margelo::nitro::swe::iternio::reactnativeautoplay { enum class ZoomEvent; }
131
137
 
@@ -148,6 +154,8 @@ namespace ReactNativeAutoPlay { class HybridMapTemplateSpec_cxx; }
148
154
  namespace ReactNativeAutoPlay { class HybridMessageTemplateSpec_cxx; }
149
155
  // Forward declaration of `HybridSearchTemplateSpec_cxx` to properly resolve imports.
150
156
  namespace ReactNativeAutoPlay { class HybridSearchTemplateSpec_cxx; }
157
+ // Forward declaration of `HybridVoiceSpec_cxx` to properly resolve imports.
158
+ namespace ReactNativeAutoPlay { class HybridVoiceSpec_cxx; }
151
159
 
152
160
  // Include C++ defined types
153
161
  #include "AlertActionStyle.hpp"
@@ -169,6 +177,7 @@ namespace ReactNativeAutoPlay { class HybridSearchTemplateSpec_cxx; }
169
177
  #include "HybridMapTemplateSpec.hpp"
170
178
  #include "HybridMessageTemplateSpec.hpp"
171
179
  #include "HybridSearchTemplateSpec.hpp"
180
+ #include "HybridVoiceSpec.hpp"
172
181
  #include "ImageLane.hpp"
173
182
  #include "KeepType.hpp"
174
183
  #include "LaneGuidance.hpp"
@@ -208,6 +217,8 @@ namespace ReactNativeAutoPlay { class HybridSearchTemplateSpec_cxx; }
208
217
  #include "TurnType.hpp"
209
218
  #include "VisibilityState.hpp"
210
219
  #include "VisibleTravelEstimate.hpp"
220
+ #include "VoiceInputChunk.hpp"
221
+ #include "VoiceInputResult.hpp"
211
222
  #include "ZoomEvent.hpp"
212
223
  #include <NitroModules/ArrayBuffer.hpp>
213
224
  #include <NitroModules/ArrayBufferHolder.hpp>
@@ -324,38 +335,16 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay::bridge::swift {
324
335
  return Func_void_std__optional_Location__std__optional_std__string__Wrapper(std::move(value));
325
336
  }
326
337
 
327
- // pragma MARK: std::shared_ptr<Promise<bool>>
338
+ // pragma MARK: std::shared_ptr<Promise<void>>
328
339
  /**
329
- * Specialized version of `std::shared_ptr<Promise<bool>>`.
340
+ * Specialized version of `std::shared_ptr<Promise<void>>`.
330
341
  */
331
- using std__shared_ptr_Promise_bool__ = std::shared_ptr<Promise<bool>>;
332
- inline std::shared_ptr<Promise<bool>> create_std__shared_ptr_Promise_bool__() noexcept {
333
- return Promise<bool>::create();
334
- }
335
- inline PromiseHolder<bool> wrap_std__shared_ptr_Promise_bool__(std::shared_ptr<Promise<bool>> promise) noexcept {
336
- return PromiseHolder<bool>(std::move(promise));
342
+ using std__shared_ptr_Promise_void__ = std::shared_ptr<Promise<void>>;
343
+ inline std::shared_ptr<Promise<void>> create_std__shared_ptr_Promise_void__() noexcept {
344
+ return Promise<void>::create();
337
345
  }
338
-
339
- // pragma MARK: std::function<void(bool /* result */)>
340
- /**
341
- * Specialized version of `std::function<void(bool)>`.
342
- */
343
- using Func_void_bool = std::function<void(bool /* result */)>;
344
- /**
345
- * Wrapper class for a `std::function<void(bool / * result * /)>`, this can be used from Swift.
346
- */
347
- class Func_void_bool_Wrapper final {
348
- public:
349
- explicit Func_void_bool_Wrapper(std::function<void(bool /* result */)>&& func): _function(std::make_unique<std::function<void(bool /* result */)>>(std::move(func))) {}
350
- inline void call(bool result) const noexcept {
351
- _function->operator()(result);
352
- }
353
- private:
354
- std::unique_ptr<std::function<void(bool /* result */)>> _function;
355
- } SWIFT_NONCOPYABLE;
356
- Func_void_bool create_Func_void_bool(void* NON_NULL swiftClosureWrapper) noexcept;
357
- inline Func_void_bool_Wrapper wrap_Func_void_bool(Func_void_bool value) noexcept {
358
- return Func_void_bool_Wrapper(std::move(value));
346
+ inline PromiseHolder<void> wrap_std__shared_ptr_Promise_void__(std::shared_ptr<Promise<void>> promise) noexcept {
347
+ return PromiseHolder<void>(std::move(promise));
359
348
  }
360
349
 
361
350
  // pragma MARK: std::function<void(const std::exception_ptr& /* error */)>
@@ -380,67 +369,6 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay::bridge::swift {
380
369
  return Func_void_std__exception_ptr_Wrapper(std::move(value));
381
370
  }
382
371
 
383
- // pragma MARK: std::shared_ptr<Promise<std::shared_ptr<ArrayBuffer>>>
384
- /**
385
- * Specialized version of `std::shared_ptr<Promise<std::shared_ptr<ArrayBuffer>>>`.
386
- */
387
- using std__shared_ptr_Promise_std__shared_ptr_ArrayBuffer___ = std::shared_ptr<Promise<std::shared_ptr<ArrayBuffer>>>;
388
- inline std::shared_ptr<Promise<std::shared_ptr<ArrayBuffer>>> create_std__shared_ptr_Promise_std__shared_ptr_ArrayBuffer___() noexcept {
389
- return Promise<std::shared_ptr<ArrayBuffer>>::create();
390
- }
391
- inline PromiseHolder<std::shared_ptr<ArrayBuffer>> wrap_std__shared_ptr_Promise_std__shared_ptr_ArrayBuffer___(std::shared_ptr<Promise<std::shared_ptr<ArrayBuffer>>> promise) noexcept {
392
- return PromiseHolder<std::shared_ptr<ArrayBuffer>>(std::move(promise));
393
- }
394
-
395
- // pragma MARK: std::function<void(const std::shared_ptr<ArrayBuffer>& /* result */)>
396
- /**
397
- * Specialized version of `std::function<void(const std::shared_ptr<ArrayBuffer>&)>`.
398
- */
399
- using Func_void_std__shared_ptr_ArrayBuffer_ = std::function<void(const std::shared_ptr<ArrayBuffer>& /* result */)>;
400
- /**
401
- * Wrapper class for a `std::function<void(const std::shared_ptr<ArrayBuffer>& / * result * /)>`, this can be used from Swift.
402
- */
403
- class Func_void_std__shared_ptr_ArrayBuffer__Wrapper final {
404
- public:
405
- explicit Func_void_std__shared_ptr_ArrayBuffer__Wrapper(std::function<void(const std::shared_ptr<ArrayBuffer>& /* result */)>&& func): _function(std::make_unique<std::function<void(const std::shared_ptr<ArrayBuffer>& /* result */)>>(std::move(func))) {}
406
- inline void call(ArrayBufferHolder result) const noexcept {
407
- _function->operator()(result.getArrayBuffer());
408
- }
409
- private:
410
- std::unique_ptr<std::function<void(const std::shared_ptr<ArrayBuffer>& /* result */)>> _function;
411
- } SWIFT_NONCOPYABLE;
412
- Func_void_std__shared_ptr_ArrayBuffer_ create_Func_void_std__shared_ptr_ArrayBuffer_(void* NON_NULL swiftClosureWrapper) noexcept;
413
- inline Func_void_std__shared_ptr_ArrayBuffer__Wrapper wrap_Func_void_std__shared_ptr_ArrayBuffer_(Func_void_std__shared_ptr_ArrayBuffer_ value) noexcept {
414
- return Func_void_std__shared_ptr_ArrayBuffer__Wrapper(std::move(value));
415
- }
416
-
417
- // pragma MARK: std::optional<double>
418
- /**
419
- * Specialized version of `std::optional<double>`.
420
- */
421
- using std__optional_double_ = std::optional<double>;
422
- inline std::optional<double> create_std__optional_double_(const double& value) noexcept {
423
- return std::optional<double>(value);
424
- }
425
- inline bool has_value_std__optional_double_(const std::optional<double>& optional) noexcept {
426
- return optional.has_value();
427
- }
428
- inline double get_std__optional_double_(const std::optional<double>& optional) noexcept {
429
- return optional.value();
430
- }
431
-
432
- // pragma MARK: std::shared_ptr<Promise<void>>
433
- /**
434
- * Specialized version of `std::shared_ptr<Promise<void>>`.
435
- */
436
- using std__shared_ptr_Promise_void__ = std::shared_ptr<Promise<void>>;
437
- inline std::shared_ptr<Promise<void>> create_std__shared_ptr_Promise_void__() noexcept {
438
- return Promise<void>::create();
439
- }
440
- inline PromiseHolder<void> wrap_std__shared_ptr_Promise_void__(std::shared_ptr<Promise<void>> promise) noexcept {
441
- return PromiseHolder<void>(std::move(promise));
442
- }
443
-
444
372
  // pragma MARK: std::optional<bool>
445
373
  /**
446
374
  * Specialized version of `std::optional<bool>`.
@@ -478,6 +406,21 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay::bridge::swift {
478
406
  return Func_void_SafeAreaInsets_Wrapper(std::move(value));
479
407
  }
480
408
 
409
+ // pragma MARK: std::optional<double>
410
+ /**
411
+ * Specialized version of `std::optional<double>`.
412
+ */
413
+ using std__optional_double_ = std::optional<double>;
414
+ inline std::optional<double> create_std__optional_double_(const double& value) noexcept {
415
+ return std::optional<double>(value);
416
+ }
417
+ inline bool has_value_std__optional_double_(const std::optional<double>& optional) noexcept {
418
+ return optional.has_value();
419
+ }
420
+ inline double get_std__optional_double_(const std::optional<double>& optional) noexcept {
421
+ return optional.value();
422
+ }
423
+
481
424
  // pragma MARK: std::optional<NitroColor>
482
425
  /**
483
426
  * Specialized version of `std::optional<NitroColor>`.
@@ -620,42 +563,6 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay::bridge::swift {
620
563
  return Result<std::function<void()>>::withError(error);
621
564
  }
622
565
 
623
- // pragma MARK: Result<bool>
624
- using Result_bool_ = Result<bool>;
625
- inline Result_bool_ create_Result_bool_(bool value) noexcept {
626
- return Result<bool>::withValue(std::move(value));
627
- }
628
- inline Result_bool_ create_Result_bool_(const std::exception_ptr& error) noexcept {
629
- return Result<bool>::withError(error);
630
- }
631
-
632
- // pragma MARK: Result<std::shared_ptr<Promise<bool>>>
633
- using Result_std__shared_ptr_Promise_bool___ = Result<std::shared_ptr<Promise<bool>>>;
634
- inline Result_std__shared_ptr_Promise_bool___ create_Result_std__shared_ptr_Promise_bool___(const std::shared_ptr<Promise<bool>>& value) noexcept {
635
- return Result<std::shared_ptr<Promise<bool>>>::withValue(value);
636
- }
637
- inline Result_std__shared_ptr_Promise_bool___ create_Result_std__shared_ptr_Promise_bool___(const std::exception_ptr& error) noexcept {
638
- return Result<std::shared_ptr<Promise<bool>>>::withError(error);
639
- }
640
-
641
- // pragma MARK: Result<std::shared_ptr<Promise<std::shared_ptr<ArrayBuffer>>>>
642
- using Result_std__shared_ptr_Promise_std__shared_ptr_ArrayBuffer____ = Result<std::shared_ptr<Promise<std::shared_ptr<ArrayBuffer>>>>;
643
- inline Result_std__shared_ptr_Promise_std__shared_ptr_ArrayBuffer____ create_Result_std__shared_ptr_Promise_std__shared_ptr_ArrayBuffer____(const std::shared_ptr<Promise<std::shared_ptr<ArrayBuffer>>>& value) noexcept {
644
- return Result<std::shared_ptr<Promise<std::shared_ptr<ArrayBuffer>>>>::withValue(value);
645
- }
646
- inline Result_std__shared_ptr_Promise_std__shared_ptr_ArrayBuffer____ create_Result_std__shared_ptr_Promise_std__shared_ptr_ArrayBuffer____(const std::exception_ptr& error) noexcept {
647
- return Result<std::shared_ptr<Promise<std::shared_ptr<ArrayBuffer>>>>::withError(error);
648
- }
649
-
650
- // pragma MARK: Result<void>
651
- using Result_void_ = Result<void>;
652
- inline Result_void_ create_Result_void_() noexcept {
653
- return Result<void>::withValue();
654
- }
655
- inline Result_void_ create_Result_void_(const std::exception_ptr& error) noexcept {
656
- return Result<void>::withError(error);
657
- }
658
-
659
566
  // pragma MARK: Result<std::shared_ptr<Promise<void>>>
660
567
  using Result_std__shared_ptr_Promise_void___ = Result<std::shared_ptr<Promise<void>>>;
661
568
  inline Result_std__shared_ptr_Promise_void___ create_Result_std__shared_ptr_Promise_void___(const std::shared_ptr<Promise<void>>& value) noexcept {
@@ -665,6 +572,15 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay::bridge::swift {
665
572
  return Result<std::shared_ptr<Promise<void>>>::withError(error);
666
573
  }
667
574
 
575
+ // pragma MARK: Result<bool>
576
+ using Result_bool_ = Result<bool>;
577
+ inline Result_bool_ create_Result_bool_(bool value) noexcept {
578
+ return Result<bool>::withValue(std::move(value));
579
+ }
580
+ inline Result_bool_ create_Result_bool_(const std::exception_ptr& error) noexcept {
581
+ return Result<bool>::withError(error);
582
+ }
583
+
668
584
  // pragma MARK: std::vector<std::string>
669
585
  /**
670
586
  * Specialized version of `std::vector<std::string>`.
@@ -858,6 +774,15 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay::bridge::swift {
858
774
  using std__weak_ptr_HybridClusterSpec_ = std::weak_ptr<HybridClusterSpec>;
859
775
  inline std__weak_ptr_HybridClusterSpec_ weakify_std__shared_ptr_HybridClusterSpec_(const std::shared_ptr<HybridClusterSpec>& strong) noexcept { return strong; }
860
776
 
777
+ // pragma MARK: Result<void>
778
+ using Result_void_ = Result<void>;
779
+ inline Result_void_ create_Result_void_() noexcept {
780
+ return Result<void>::withValue();
781
+ }
782
+ inline Result_void_ create_Result_void_(const std::exception_ptr& error) noexcept {
783
+ return Result<void>::withError(error);
784
+ }
785
+
861
786
  // pragma MARK: std::function<void(std::optional<bool> /* animated */)>
862
787
  /**
863
788
  * Specialized version of `std::function<void(std::optional<bool>)>`.
@@ -962,6 +887,28 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay::bridge::swift {
962
887
  return optional.value();
963
888
  }
964
889
 
890
+ // pragma MARK: std::function<void(bool /* isPanningInterfaceVisible */)>
891
+ /**
892
+ * Specialized version of `std::function<void(bool)>`.
893
+ */
894
+ using Func_void_bool = std::function<void(bool /* isPanningInterfaceVisible */)>;
895
+ /**
896
+ * Wrapper class for a `std::function<void(bool / * isPanningInterfaceVisible * /)>`, this can be used from Swift.
897
+ */
898
+ class Func_void_bool_Wrapper final {
899
+ public:
900
+ explicit Func_void_bool_Wrapper(std::function<void(bool /* isPanningInterfaceVisible */)>&& func): _function(std::make_unique<std::function<void(bool /* isPanningInterfaceVisible */)>>(std::move(func))) {}
901
+ inline void call(bool isPanningInterfaceVisible) const noexcept {
902
+ _function->operator()(isPanningInterfaceVisible);
903
+ }
904
+ private:
905
+ std::unique_ptr<std::function<void(bool /* isPanningInterfaceVisible */)>> _function;
906
+ } SWIFT_NONCOPYABLE;
907
+ Func_void_bool create_Func_void_bool(void* NON_NULL swiftClosureWrapper) noexcept;
908
+ inline Func_void_bool_Wrapper wrap_Func_void_bool(Func_void_bool value) noexcept {
909
+ return Func_void_bool_Wrapper(std::move(value));
910
+ }
911
+
965
912
  // pragma MARK: std::optional<std::function<void(bool /* isPanningInterfaceVisible */)>>
966
913
  /**
967
914
  * Specialized version of `std::optional<std::function<void(bool / * isPanningInterfaceVisible * /)>>`.
@@ -1634,5 +1581,133 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay::bridge::swift {
1634
1581
  // pragma MARK: std::weak_ptr<HybridSearchTemplateSpec>
1635
1582
  using std__weak_ptr_HybridSearchTemplateSpec_ = std::weak_ptr<HybridSearchTemplateSpec>;
1636
1583
  inline std__weak_ptr_HybridSearchTemplateSpec_ weakify_std__shared_ptr_HybridSearchTemplateSpec_(const std::shared_ptr<HybridSearchTemplateSpec>& strong) noexcept { return strong; }
1584
+
1585
+ // pragma MARK: std::shared_ptr<Promise<bool>>
1586
+ /**
1587
+ * Specialized version of `std::shared_ptr<Promise<bool>>`.
1588
+ */
1589
+ using std__shared_ptr_Promise_bool__ = std::shared_ptr<Promise<bool>>;
1590
+ inline std::shared_ptr<Promise<bool>> create_std__shared_ptr_Promise_bool__() noexcept {
1591
+ return Promise<bool>::create();
1592
+ }
1593
+ inline PromiseHolder<bool> wrap_std__shared_ptr_Promise_bool__(std::shared_ptr<Promise<bool>> promise) noexcept {
1594
+ return PromiseHolder<bool>(std::move(promise));
1595
+ }
1596
+
1597
+ // pragma MARK: std::optional<std::shared_ptr<ArrayBuffer>>
1598
+ /**
1599
+ * Specialized version of `std::optional<std::shared_ptr<ArrayBuffer>>`.
1600
+ */
1601
+ using std__optional_std__shared_ptr_ArrayBuffer__ = std::optional<std::shared_ptr<ArrayBuffer>>;
1602
+ inline std::optional<std::shared_ptr<ArrayBuffer>> create_std__optional_std__shared_ptr_ArrayBuffer__(const std::shared_ptr<ArrayBuffer>& value) noexcept {
1603
+ return std::optional<std::shared_ptr<ArrayBuffer>>(value);
1604
+ }
1605
+ inline bool has_value_std__optional_std__shared_ptr_ArrayBuffer__(const std::optional<std::shared_ptr<ArrayBuffer>>& optional) noexcept {
1606
+ return optional.has_value();
1607
+ }
1608
+ inline std::shared_ptr<ArrayBuffer> get_std__optional_std__shared_ptr_ArrayBuffer__(const std::optional<std::shared_ptr<ArrayBuffer>>& optional) noexcept {
1609
+ return optional.value();
1610
+ }
1611
+
1612
+ // pragma MARK: std::shared_ptr<Promise<VoiceInputResult>>
1613
+ /**
1614
+ * Specialized version of `std::shared_ptr<Promise<VoiceInputResult>>`.
1615
+ */
1616
+ using std__shared_ptr_Promise_VoiceInputResult__ = std::shared_ptr<Promise<VoiceInputResult>>;
1617
+ inline std::shared_ptr<Promise<VoiceInputResult>> create_std__shared_ptr_Promise_VoiceInputResult__() noexcept {
1618
+ return Promise<VoiceInputResult>::create();
1619
+ }
1620
+ inline PromiseHolder<VoiceInputResult> wrap_std__shared_ptr_Promise_VoiceInputResult__(std::shared_ptr<Promise<VoiceInputResult>> promise) noexcept {
1621
+ return PromiseHolder<VoiceInputResult>(std::move(promise));
1622
+ }
1623
+
1624
+ // pragma MARK: std::function<void(const VoiceInputResult& /* result */)>
1625
+ /**
1626
+ * Specialized version of `std::function<void(const VoiceInputResult&)>`.
1627
+ */
1628
+ using Func_void_VoiceInputResult = std::function<void(const VoiceInputResult& /* result */)>;
1629
+ /**
1630
+ * Wrapper class for a `std::function<void(const VoiceInputResult& / * result * /)>`, this can be used from Swift.
1631
+ */
1632
+ class Func_void_VoiceInputResult_Wrapper final {
1633
+ public:
1634
+ explicit Func_void_VoiceInputResult_Wrapper(std::function<void(const VoiceInputResult& /* result */)>&& func): _function(std::make_unique<std::function<void(const VoiceInputResult& /* result */)>>(std::move(func))) {}
1635
+ inline void call(VoiceInputResult result) const noexcept {
1636
+ _function->operator()(result);
1637
+ }
1638
+ private:
1639
+ std::unique_ptr<std::function<void(const VoiceInputResult& /* result */)>> _function;
1640
+ } SWIFT_NONCOPYABLE;
1641
+ Func_void_VoiceInputResult create_Func_void_VoiceInputResult(void* NON_NULL swiftClosureWrapper) noexcept;
1642
+ inline Func_void_VoiceInputResult_Wrapper wrap_Func_void_VoiceInputResult(Func_void_VoiceInputResult value) noexcept {
1643
+ return Func_void_VoiceInputResult_Wrapper(std::move(value));
1644
+ }
1645
+
1646
+ // pragma MARK: std::function<void(const VoiceInputChunk& /* chunk */)>
1647
+ /**
1648
+ * Specialized version of `std::function<void(const VoiceInputChunk&)>`.
1649
+ */
1650
+ using Func_void_VoiceInputChunk = std::function<void(const VoiceInputChunk& /* chunk */)>;
1651
+ /**
1652
+ * Wrapper class for a `std::function<void(const VoiceInputChunk& / * chunk * /)>`, this can be used from Swift.
1653
+ */
1654
+ class Func_void_VoiceInputChunk_Wrapper final {
1655
+ public:
1656
+ explicit Func_void_VoiceInputChunk_Wrapper(std::function<void(const VoiceInputChunk& /* chunk */)>&& func): _function(std::make_unique<std::function<void(const VoiceInputChunk& /* chunk */)>>(std::move(func))) {}
1657
+ inline void call(VoiceInputChunk chunk) const noexcept {
1658
+ _function->operator()(chunk);
1659
+ }
1660
+ private:
1661
+ std::unique_ptr<std::function<void(const VoiceInputChunk& /* chunk */)>> _function;
1662
+ } SWIFT_NONCOPYABLE;
1663
+ Func_void_VoiceInputChunk create_Func_void_VoiceInputChunk(void* NON_NULL swiftClosureWrapper) noexcept;
1664
+ inline Func_void_VoiceInputChunk_Wrapper wrap_Func_void_VoiceInputChunk(Func_void_VoiceInputChunk value) noexcept {
1665
+ return Func_void_VoiceInputChunk_Wrapper(std::move(value));
1666
+ }
1667
+
1668
+ // pragma MARK: std::optional<std::function<void(const VoiceInputChunk& /* chunk */)>>
1669
+ /**
1670
+ * Specialized version of `std::optional<std::function<void(const VoiceInputChunk& / * chunk * /)>>`.
1671
+ */
1672
+ using std__optional_std__function_void_const_VoiceInputChunk_____chunk______ = std::optional<std::function<void(const VoiceInputChunk& /* chunk */)>>;
1673
+ inline std::optional<std::function<void(const VoiceInputChunk& /* chunk */)>> create_std__optional_std__function_void_const_VoiceInputChunk_____chunk______(const std::function<void(const VoiceInputChunk& /* chunk */)>& value) noexcept {
1674
+ return std::optional<std::function<void(const VoiceInputChunk& /* chunk */)>>(value);
1675
+ }
1676
+ inline bool has_value_std__optional_std__function_void_const_VoiceInputChunk_____chunk______(const std::optional<std::function<void(const VoiceInputChunk& /* chunk */)>>& optional) noexcept {
1677
+ return optional.has_value();
1678
+ }
1679
+ inline std::function<void(const VoiceInputChunk& /* chunk */)> get_std__optional_std__function_void_const_VoiceInputChunk_____chunk______(const std::optional<std::function<void(const VoiceInputChunk& /* chunk */)>>& optional) noexcept {
1680
+ return optional.value();
1681
+ }
1682
+
1683
+ // pragma MARK: std::shared_ptr<HybridVoiceSpec>
1684
+ /**
1685
+ * Specialized version of `std::shared_ptr<HybridVoiceSpec>`.
1686
+ */
1687
+ using std__shared_ptr_HybridVoiceSpec_ = std::shared_ptr<HybridVoiceSpec>;
1688
+ std::shared_ptr<HybridVoiceSpec> create_std__shared_ptr_HybridVoiceSpec_(void* NON_NULL swiftUnsafePointer) noexcept;
1689
+ void* NON_NULL get_std__shared_ptr_HybridVoiceSpec_(std__shared_ptr_HybridVoiceSpec_ cppType);
1690
+
1691
+ // pragma MARK: std::weak_ptr<HybridVoiceSpec>
1692
+ using std__weak_ptr_HybridVoiceSpec_ = std::weak_ptr<HybridVoiceSpec>;
1693
+ inline std__weak_ptr_HybridVoiceSpec_ weakify_std__shared_ptr_HybridVoiceSpec_(const std::shared_ptr<HybridVoiceSpec>& strong) noexcept { return strong; }
1694
+
1695
+ // pragma MARK: Result<std::shared_ptr<Promise<bool>>>
1696
+ using Result_std__shared_ptr_Promise_bool___ = Result<std::shared_ptr<Promise<bool>>>;
1697
+ inline Result_std__shared_ptr_Promise_bool___ create_Result_std__shared_ptr_Promise_bool___(const std::shared_ptr<Promise<bool>>& value) noexcept {
1698
+ return Result<std::shared_ptr<Promise<bool>>>::withValue(value);
1699
+ }
1700
+ inline Result_std__shared_ptr_Promise_bool___ create_Result_std__shared_ptr_Promise_bool___(const std::exception_ptr& error) noexcept {
1701
+ return Result<std::shared_ptr<Promise<bool>>>::withError(error);
1702
+ }
1703
+
1704
+ // pragma MARK: Result<std::shared_ptr<Promise<VoiceInputResult>>>
1705
+ using Result_std__shared_ptr_Promise_VoiceInputResult___ = Result<std::shared_ptr<Promise<VoiceInputResult>>>;
1706
+ inline Result_std__shared_ptr_Promise_VoiceInputResult___ create_Result_std__shared_ptr_Promise_VoiceInputResult___(const std::shared_ptr<Promise<VoiceInputResult>>& value) noexcept {
1707
+ return Result<std::shared_ptr<Promise<VoiceInputResult>>>::withValue(value);
1708
+ }
1709
+ inline Result_std__shared_ptr_Promise_VoiceInputResult___ create_Result_std__shared_ptr_Promise_VoiceInputResult___(const std::exception_ptr& error) noexcept {
1710
+ return Result<std::shared_ptr<Promise<VoiceInputResult>>>::withError(error);
1711
+ }
1637
1712
 
1638
1713
  } // namespace margelo::nitro::swe::iternio::reactnativeautoplay::bridge::swift
@@ -52,6 +52,8 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay { class HybridMapTem
52
52
  namespace margelo::nitro::swe::iternio::reactnativeautoplay { class HybridMessageTemplateSpec; }
53
53
  // Forward declaration of `HybridSearchTemplateSpec` to properly resolve imports.
54
54
  namespace margelo::nitro::swe::iternio::reactnativeautoplay { class HybridSearchTemplateSpec; }
55
+ // Forward declaration of `HybridVoiceSpec` to properly resolve imports.
56
+ namespace margelo::nitro::swe::iternio::reactnativeautoplay { class HybridVoiceSpec; }
55
57
  // Forward declaration of `ImageLane` to properly resolve imports.
56
58
  namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct ImageLane; }
57
59
  // Forward declaration of `InformationTemplateConfig` to properly resolve imports.
@@ -148,6 +150,10 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay { enum class TurnTyp
148
150
  namespace margelo::nitro::swe::iternio::reactnativeautoplay { enum class VisibilityState; }
149
151
  // Forward declaration of `VisibleTravelEstimate` to properly resolve imports.
150
152
  namespace margelo::nitro::swe::iternio::reactnativeautoplay { enum class VisibleTravelEstimate; }
153
+ // Forward declaration of `VoiceInputChunk` to properly resolve imports.
154
+ namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct VoiceInputChunk; }
155
+ // Forward declaration of `VoiceInputResult` to properly resolve imports.
156
+ namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct VoiceInputResult; }
151
157
  // Forward declaration of `ZoomEvent` to properly resolve imports.
152
158
  namespace margelo::nitro::swe::iternio::reactnativeautoplay { enum class ZoomEvent; }
153
159
 
@@ -174,6 +180,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay { enum class ZoomEve
174
180
  #include "HybridMapTemplateSpec.hpp"
175
181
  #include "HybridMessageTemplateSpec.hpp"
176
182
  #include "HybridSearchTemplateSpec.hpp"
183
+ #include "HybridVoiceSpec.hpp"
177
184
  #include "ImageLane.hpp"
178
185
  #include "InformationTemplateConfig.hpp"
179
186
  #include "KeepType.hpp"
@@ -222,6 +229,8 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay { enum class ZoomEve
222
229
  #include "TurnType.hpp"
223
230
  #include "VisibilityState.hpp"
224
231
  #include "VisibleTravelEstimate.hpp"
232
+ #include "VoiceInputChunk.hpp"
233
+ #include "VoiceInputResult.hpp"
225
234
  #include "ZoomEvent.hpp"
226
235
  #include <NitroModules/ArrayBuffer.hpp>
227
236
  #include <NitroModules/Promise.hpp>
@@ -262,6 +271,8 @@ namespace ReactNativeAutoPlay { class HybridMapTemplateSpec_cxx; }
262
271
  namespace ReactNativeAutoPlay { class HybridMessageTemplateSpec_cxx; }
263
272
  // Forward declaration of `HybridSearchTemplateSpec_cxx` to properly resolve imports.
264
273
  namespace ReactNativeAutoPlay { class HybridSearchTemplateSpec_cxx; }
274
+ // Forward declaration of `HybridVoiceSpec_cxx` to properly resolve imports.
275
+ namespace ReactNativeAutoPlay { class HybridVoiceSpec_cxx; }
265
276
 
266
277
  // Include Swift defined types
267
278
  #if __has_include("ReactNativeAutoPlay-Swift.h")
@@ -10,6 +10,7 @@
10
10
  #import "ReactNativeAutoPlay-Swift-Cxx-Umbrella.hpp"
11
11
  #import <type_traits>
12
12
 
13
+ #include "HybridVoiceSpecSwift.hpp"
13
14
  #include "HybridAutoPlaySpecSwift.hpp"
14
15
  #include "HybridListTemplateSpecSwift.hpp"
15
16
  #include "HybridInformationTemplateSpecSwift.hpp"
@@ -29,6 +30,13 @@
29
30
  using namespace margelo::nitro;
30
31
  using namespace margelo::nitro::swe::iternio::reactnativeautoplay;
31
32
 
33
+ HybridObjectRegistry::registerHybridObjectConstructor(
34
+ "Voice",
35
+ []() -> std::shared_ptr<HybridObject> {
36
+ std::shared_ptr<HybridVoiceSpec> hybridObject = ReactNativeAutoPlay::ReactNativeAutoPlayAutolinking::createVoice();
37
+ return hybridObject;
38
+ }
39
+ );
32
40
  HybridObjectRegistry::registerHybridObjectConstructor(
33
41
  "AutoPlay",
34
42
  []() -> std::shared_ptr<HybridObject> {
@@ -12,6 +12,18 @@ import NitroModules
12
12
  public final class ReactNativeAutoPlayAutolinking {
13
13
  public typealias bridge = margelo.nitro.swe.iternio.reactnativeautoplay.bridge.swift
14
14
 
15
+ public static func createVoice() -> bridge.std__shared_ptr_HybridVoiceSpec_ {
16
+ let hybridObject = HybridVoice()
17
+ return { () -> bridge.std__shared_ptr_HybridVoiceSpec_ in
18
+ let __cxxWrapped = hybridObject.getCxxWrapper()
19
+ return __cxxWrapped.getCxxPart()
20
+ }()
21
+ }
22
+
23
+ public static func isVoiceRecyclable() -> Bool {
24
+ return HybridVoice.self is any RecyclableView.Type
25
+ }
26
+
15
27
  public static func createAutoPlay() -> bridge.std__shared_ptr_HybridAutoPlaySpec_ {
16
28
  let hybridObject = HybridAutoPlay()
17
29
  return { () -> bridge.std__shared_ptr_HybridAutoPlaySpec_ in
@@ -18,8 +18,6 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay { enum class EventNa
18
18
  namespace margelo::nitro::swe::iternio::reactnativeautoplay { enum class VisibilityState; }
19
19
  // Forward declaration of `Location` to properly resolve imports.
20
20
  namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct Location; }
21
- // Forward declaration of `ArrayBufferHolder` to properly resolve imports.
22
- namespace NitroModules { class ArrayBufferHolder; }
23
21
  // Forward declaration of `SafeAreaInsets` to properly resolve imports.
24
22
  namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct SafeAreaInsets; }
25
23
  // Forward declaration of `NitroAction` to properly resolve imports.
@@ -46,8 +44,6 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay { enum class NitroBu
46
44
  #include "Location.hpp"
47
45
  #include <optional>
48
46
  #include <NitroModules/Promise.hpp>
49
- #include <NitroModules/ArrayBuffer.hpp>
50
- #include <NitroModules/ArrayBufferHolder.hpp>
51
47
  #include "SafeAreaInsets.hpp"
52
48
  #include "NitroAction.hpp"
53
49
  #include <vector>
@@ -134,36 +130,6 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
134
130
  auto __value = std::move(__result.value());
135
131
  return __value;
136
132
  }
137
- inline bool hasVoiceInputPermission() override {
138
- auto __result = _swiftPart.hasVoiceInputPermission();
139
- if (__result.hasError()) [[unlikely]] {
140
- std::rethrow_exception(__result.error());
141
- }
142
- auto __value = std::move(__result.value());
143
- return __value;
144
- }
145
- inline std::shared_ptr<Promise<bool>> requestVoiceInputPermission() override {
146
- auto __result = _swiftPart.requestVoiceInputPermission();
147
- if (__result.hasError()) [[unlikely]] {
148
- std::rethrow_exception(__result.error());
149
- }
150
- auto __value = std::move(__result.value());
151
- return __value;
152
- }
153
- inline std::shared_ptr<Promise<std::shared_ptr<ArrayBuffer>>> startVoiceInput(std::optional<double> silenceThresholdMs, std::optional<double> maxDurationMs, const std::optional<std::string>& listeningText) override {
154
- auto __result = _swiftPart.startVoiceInput(silenceThresholdMs, maxDurationMs, listeningText);
155
- if (__result.hasError()) [[unlikely]] {
156
- std::rethrow_exception(__result.error());
157
- }
158
- auto __value = std::move(__result.value());
159
- return __value;
160
- }
161
- inline void stopVoiceInput() override {
162
- auto __result = _swiftPart.stopVoiceInput();
163
- if (__result.hasError()) [[unlikely]] {
164
- std::rethrow_exception(__result.error());
165
- }
166
- }
167
133
  inline std::shared_ptr<Promise<void>> setRootTemplate(const std::string& templateId) override {
168
134
  auto __result = _swiftPart.setRootTemplate(templateId);
169
135
  if (__result.hasError()) [[unlikely]] {
@@ -0,0 +1,11 @@
1
+ ///
2
+ /// HybridVoiceSpecSwift.cpp
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ #include "HybridVoiceSpecSwift.hpp"
9
+
10
+ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
11
+ } // namespace margelo::nitro::swe::iternio::reactnativeautoplay