@iternio/react-native-auto-play 0.1.2 → 0.1.4

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 (126) hide show
  1. package/lib/hooks/useFocusedEffect.d.ts +9 -0
  2. package/lib/hooks/useFocusedEffect.js +32 -0
  3. package/lib/hooks/useIsAutoPlayFocused.d.ts +7 -0
  4. package/lib/hooks/useIsAutoPlayFocused.js +20 -0
  5. package/lib/index.d.ts +1 -0
  6. package/lib/index.js +1 -0
  7. package/nitrogen/generated/android/c++/JFunc_void.hpp +2 -1
  8. package/nitrogen/generated/android/c++/JFunc_void_AlertDismissalReason.hpp +2 -1
  9. package/nitrogen/generated/android/c++/JFunc_void_ColorScheme.hpp +2 -1
  10. package/nitrogen/generated/android/c++/JFunc_void_Point.hpp +2 -1
  11. package/nitrogen/generated/android/c++/JFunc_void_Point_double.hpp +2 -1
  12. package/nitrogen/generated/android/c++/JFunc_void_Point_std__optional_Point_.hpp +2 -1
  13. package/nitrogen/generated/android/c++/JFunc_void_SafeAreaInsets.hpp +2 -1
  14. package/nitrogen/generated/android/c++/JFunc_void_VisibilityState.hpp +2 -1
  15. package/nitrogen/generated/android/c++/JFunc_void_bool.hpp +2 -1
  16. package/nitrogen/generated/android/c++/JFunc_void_std__optional_Location__std__optional_std__string_.hpp +2 -1
  17. package/nitrogen/generated/android/c++/JFunc_void_std__optional_Telemetry__std__optional_std__string_.hpp +2 -1
  18. package/nitrogen/generated/android/c++/JFunc_void_std__optional_bool_.hpp +2 -1
  19. package/nitrogen/generated/android/c++/JFunc_void_std__string.hpp +2 -1
  20. package/nitrogen/generated/android/c++/JFunc_void_std__string_ColorScheme.hpp +2 -1
  21. package/nitrogen/generated/android/c++/JFunc_void_std__string_ZoomEvent.hpp +2 -1
  22. package/nitrogen/generated/android/c++/JFunc_void_std__string_bool.hpp +2 -1
  23. package/nitrogen/generated/android/c++/JFunc_void_std__string_std__string.hpp +2 -1
  24. package/nitrogen/generated/android/c++/JGridTemplateConfig.hpp +6 -15
  25. package/nitrogen/generated/android/c++/JHybridAndroidAutoTelemetrySpec.cpp +2 -3
  26. package/nitrogen/generated/android/c++/JHybridAutoPlaySpec.cpp +5 -12
  27. package/nitrogen/generated/android/c++/JHybridClusterSpec.cpp +6 -15
  28. package/nitrogen/generated/android/c++/JHybridGridTemplateSpec.cpp +1 -0
  29. package/nitrogen/generated/android/c++/JHybridInformationTemplateSpec.cpp +1 -0
  30. package/nitrogen/generated/android/c++/JHybridListTemplateSpec.cpp +1 -0
  31. package/nitrogen/generated/android/c++/JHybridMapTemplateSpec.cpp +1 -0
  32. package/nitrogen/generated/android/c++/JHybridMessageTemplateSpec.cpp +1 -0
  33. package/nitrogen/generated/android/c++/JHybridSearchTemplateSpec.cpp +1 -0
  34. package/nitrogen/generated/android/c++/JInformationTemplateConfig.hpp +6 -15
  35. package/nitrogen/generated/android/c++/JListTemplateConfig.hpp +6 -15
  36. package/nitrogen/generated/android/c++/JMapTemplateConfig.hpp +14 -39
  37. package/nitrogen/generated/android/c++/JMessageTemplateConfig.hpp +6 -15
  38. package/nitrogen/generated/android/c++/JNavigationAlertAction.hpp +2 -3
  39. package/nitrogen/generated/android/c++/JNitroAction.hpp +2 -3
  40. package/nitrogen/generated/android/c++/JNitroBaseMapTemplateConfig.hpp +7 -18
  41. package/nitrogen/generated/android/c++/JNitroGridButton.hpp +2 -3
  42. package/nitrogen/generated/android/c++/JNitroManeuver.cpp +9 -9
  43. package/nitrogen/generated/android/c++/JNitroMapButton.hpp +2 -3
  44. package/nitrogen/generated/android/c++/JNitroNavigationAlert.hpp +3 -6
  45. package/nitrogen/generated/android/c++/JNitroRow.hpp +2 -3
  46. package/nitrogen/generated/android/c++/JNitroSection.hpp +1 -0
  47. package/nitrogen/generated/android/c++/JSearchTemplateConfig.hpp +8 -21
  48. package/nitrogen/generated/android/c++/JTripSelectorCallback.hpp +2 -3
  49. package/nitrogen/generated/ios/ReactNativeAutoPlay-Swift-Cxx-Bridge.cpp +1 -0
  50. package/nitrogen/generated/ios/swift/AssetImage.swift +1 -0
  51. package/nitrogen/generated/ios/swift/AutoText.swift +1 -0
  52. package/nitrogen/generated/ios/swift/Distance.swift +1 -0
  53. package/nitrogen/generated/ios/swift/DurationWithTimeZone.swift +1 -0
  54. package/nitrogen/generated/ios/swift/Func_void.swift +1 -1
  55. package/nitrogen/generated/ios/swift/Func_void_AlertDismissalReason.swift +1 -1
  56. package/nitrogen/generated/ios/swift/Func_void_ColorScheme.swift +1 -1
  57. package/nitrogen/generated/ios/swift/Func_void_Point.swift +1 -1
  58. package/nitrogen/generated/ios/swift/Func_void_Point_double.swift +1 -1
  59. package/nitrogen/generated/ios/swift/Func_void_Point_std__optional_Point_.swift +1 -1
  60. package/nitrogen/generated/ios/swift/Func_void_SafeAreaInsets.swift +1 -1
  61. package/nitrogen/generated/ios/swift/Func_void_VisibilityState.swift +1 -1
  62. package/nitrogen/generated/ios/swift/Func_void_bool.swift +1 -1
  63. package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +1 -1
  64. package/nitrogen/generated/ios/swift/Func_void_std__optional_Location__std__optional_std__string_.swift +1 -1
  65. package/nitrogen/generated/ios/swift/Func_void_std__optional_bool_.swift +1 -1
  66. package/nitrogen/generated/ios/swift/Func_void_std__string.swift +1 -1
  67. package/nitrogen/generated/ios/swift/Func_void_std__string_ColorScheme.swift +1 -1
  68. package/nitrogen/generated/ios/swift/Func_void_std__string_ZoomEvent.swift +1 -1
  69. package/nitrogen/generated/ios/swift/Func_void_std__string_bool.swift +1 -1
  70. package/nitrogen/generated/ios/swift/Func_void_std__string_std__string.swift +1 -1
  71. package/nitrogen/generated/ios/swift/GlyphImage.swift +1 -0
  72. package/nitrogen/generated/ios/swift/GridTemplateConfig.swift +1 -0
  73. package/nitrogen/generated/ios/swift/HybridAutoPlaySpec.swift +0 -1
  74. package/nitrogen/generated/ios/swift/HybridAutoPlaySpec_cxx.swift +0 -1
  75. package/nitrogen/generated/ios/swift/HybridCarPlayDashboardSpec.swift +0 -1
  76. package/nitrogen/generated/ios/swift/HybridCarPlayDashboardSpec_cxx.swift +0 -1
  77. package/nitrogen/generated/ios/swift/HybridClusterSpec.swift +0 -1
  78. package/nitrogen/generated/ios/swift/HybridClusterSpec_cxx.swift +0 -1
  79. package/nitrogen/generated/ios/swift/HybridGridTemplateSpec.swift +0 -1
  80. package/nitrogen/generated/ios/swift/HybridGridTemplateSpec_cxx.swift +0 -1
  81. package/nitrogen/generated/ios/swift/HybridInformationTemplateSpec.swift +0 -1
  82. package/nitrogen/generated/ios/swift/HybridInformationTemplateSpec_cxx.swift +0 -1
  83. package/nitrogen/generated/ios/swift/HybridListTemplateSpec.swift +0 -1
  84. package/nitrogen/generated/ios/swift/HybridListTemplateSpec_cxx.swift +0 -1
  85. package/nitrogen/generated/ios/swift/HybridMapTemplateSpec.swift +0 -1
  86. package/nitrogen/generated/ios/swift/HybridMapTemplateSpec_cxx.swift +0 -1
  87. package/nitrogen/generated/ios/swift/HybridSearchTemplateSpec.swift +0 -1
  88. package/nitrogen/generated/ios/swift/HybridSearchTemplateSpec_cxx.swift +0 -1
  89. package/nitrogen/generated/ios/swift/ImageLane.swift +1 -0
  90. package/nitrogen/generated/ios/swift/InformationTemplateConfig.swift +1 -0
  91. package/nitrogen/generated/ios/swift/LaneGuidance.swift +1 -0
  92. package/nitrogen/generated/ios/swift/ListTemplateConfig.swift +1 -0
  93. package/nitrogen/generated/ios/swift/Location.swift +1 -0
  94. package/nitrogen/generated/ios/swift/MapTemplateConfig.swift +1 -0
  95. package/nitrogen/generated/ios/swift/MessageTemplateConfig.swift +1 -0
  96. package/nitrogen/generated/ios/swift/NavigationAlertAction.swift +1 -0
  97. package/nitrogen/generated/ios/swift/NitroAction.swift +1 -0
  98. package/nitrogen/generated/ios/swift/NitroAttributedString.swift +1 -0
  99. package/nitrogen/generated/ios/swift/NitroAttributedStringImage.swift +1 -0
  100. package/nitrogen/generated/ios/swift/NitroBaseMapTemplateConfig.swift +1 -0
  101. package/nitrogen/generated/ios/swift/NitroCarPlayDashboardButton.swift +1 -0
  102. package/nitrogen/generated/ios/swift/NitroColor.swift +1 -0
  103. package/nitrogen/generated/ios/swift/NitroGridButton.swift +1 -0
  104. package/nitrogen/generated/ios/swift/NitroLoadingManeuver.swift +1 -0
  105. package/nitrogen/generated/ios/swift/NitroMapButton.swift +1 -0
  106. package/nitrogen/generated/ios/swift/NitroMessageManeuver.swift +1 -0
  107. package/nitrogen/generated/ios/swift/NitroNavigationAlert.swift +1 -0
  108. package/nitrogen/generated/ios/swift/NitroRoutingManeuver.swift +1 -0
  109. package/nitrogen/generated/ios/swift/NitroRow.swift +1 -0
  110. package/nitrogen/generated/ios/swift/NitroSection.swift +1 -0
  111. package/nitrogen/generated/ios/swift/Point.swift +1 -0
  112. package/nitrogen/generated/ios/swift/PreferredImageLane.swift +1 -0
  113. package/nitrogen/generated/ios/swift/RouteChoice.swift +1 -0
  114. package/nitrogen/generated/ios/swift/SafeAreaInsets.swift +1 -0
  115. package/nitrogen/generated/ios/swift/SearchTemplateConfig.swift +1 -0
  116. package/nitrogen/generated/ios/swift/TravelEstimates.swift +1 -0
  117. package/nitrogen/generated/ios/swift/TripConfig.swift +1 -0
  118. package/nitrogen/generated/ios/swift/TripPoint.swift +1 -0
  119. package/nitrogen/generated/ios/swift/TripPreviewTextConfiguration.swift +1 -0
  120. package/nitrogen/generated/ios/swift/TripSelectorCallback.swift +1 -0
  121. package/nitrogen/generated/ios/swift/TripsConfig.swift +1 -0
  122. package/package.json +2 -2
  123. package/src/hooks/useFocusedEffect.ts +42 -0
  124. package/src/index.ts +1 -0
  125. package/lib/specs/VoiceInput.nitro.d.ts +0 -8
  126. package/lib/specs/VoiceInput.nitro.js +0 -1
@@ -0,0 +1,9 @@
1
+ /**
2
+ * An effect hook that only runs when the CarPlay/Android Auto screen is visible to the user and dependencies have changed.
3
+ * It behaves like `useEffect`, but the effect function is only executed if the screen is visible.
4
+ *
5
+ * @param moduleName The name of the root module to listen to for focus changes - one of AutoPlayModules or a cluster uuid.
6
+ * @param effect The effect function to run.
7
+ * @param deps An array of dependencies for the effect.
8
+ */
9
+ export declare function useFocusedEffect(moduleName: string, effect: () => void | (() => void), deps: readonly unknown[]): void;
@@ -0,0 +1,32 @@
1
+ import { useEffect, useRef, useState } from 'react';
2
+ import { HybridAutoPlay } from '..';
3
+ /**
4
+ * An effect hook that only runs when the CarPlay/Android Auto screen is visible to the user and dependencies have changed.
5
+ * It behaves like `useEffect`, but the effect function is only executed if the screen is visible.
6
+ *
7
+ * @param moduleName The name of the root module to listen to for focus changes - one of AutoPlayModules or a cluster uuid.
8
+ * @param effect The effect function to run.
9
+ * @param deps An array of dependencies for the effect.
10
+ */
11
+ export function useFocusedEffect(moduleName, effect, deps) {
12
+ const [isFocused, setIsFocused] = useState(false);
13
+ const effectRef = useRef(effect);
14
+ useEffect(() => {
15
+ effectRef.current = effect;
16
+ }, [effect]);
17
+ useEffect(() => {
18
+ return HybridAutoPlay.addListenerRenderState(moduleName, (state) => {
19
+ if (state === 'willAppear' || state === 'willDisappear') {
20
+ // react on actual visibility changes only
21
+ return;
22
+ }
23
+ setIsFocused(state === 'didAppear');
24
+ });
25
+ }, [moduleName]);
26
+ useEffect(() => {
27
+ if (!isFocused) {
28
+ return;
29
+ }
30
+ return effectRef.current();
31
+ }, [isFocused, ...deps]);
32
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * A hook to determine if the CarPlay/Android Auto screen is currently focused (visible).
3
+ *
4
+ * @param moduleName The name of the module to listen to.
5
+ * @returns `true` if the screen is focused, `false` otherwise.
6
+ */
7
+ export declare function useIsAutoPlayFocused(moduleName: string): boolean;
@@ -0,0 +1,20 @@
1
+ import { useEffect, useState } from 'react';
2
+ import { HybridAutoPlay } from '..';
3
+ /**
4
+ * A hook to determine if the CarPlay/Android Auto screen is currently focused (visible).
5
+ *
6
+ * @param moduleName The name of the module to listen to.
7
+ * @returns `true` if the screen is focused, `false` otherwise.
8
+ */
9
+ export function useIsAutoPlayFocused(moduleName) {
10
+ const [isFocused, setIsFocused] = useState(false);
11
+ useEffect(() => {
12
+ const remove = HybridAutoPlay.addListenerRenderState(moduleName, (state) => {
13
+ setIsFocused(state === 'didAppear');
14
+ });
15
+ return () => {
16
+ remove();
17
+ };
18
+ }, [moduleName]);
19
+ return isFocused;
20
+ }
package/lib/index.d.ts CHANGED
@@ -13,6 +13,7 @@ export declare enum AutoPlayModules {
13
13
  }
14
14
  export * from './components/SafeAreaView';
15
15
  export * from './hooks/useAndroidAutoTelemetry';
16
+ export * from './hooks/useFocusedEffect';
16
17
  export * from './hooks/useMapTemplate';
17
18
  export * from './hooks/useSafeAreaInsets';
18
19
  export * from './hooks/useVoiceInput';
package/lib/index.js CHANGED
@@ -18,6 +18,7 @@ export var AutoPlayModules;
18
18
  })(AutoPlayModules || (AutoPlayModules = {}));
19
19
  export * from './components/SafeAreaView';
20
20
  export * from './hooks/useAndroidAutoTelemetry';
21
+ export * from './hooks/useFocusedEffect';
21
22
  export * from './hooks/useMapTemplate';
22
23
  export * from './hooks/useSafeAreaInsets';
23
24
  export * from './hooks/useVoiceInput';
@@ -11,6 +11,7 @@
11
11
  #include <functional>
12
12
 
13
13
  #include <functional>
14
+ #include <NitroModules/JNICallable.hpp>
14
15
 
15
16
  namespace margelo::nitro::swe::iternio::reactnativeautoplay {
16
17
 
@@ -37,7 +38,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
37
38
  /**
38
39
  * An implementation of Func_void that is backed by a C++ implementation (using `std::function<...>`)
39
40
  */
40
- struct JFunc_void_cxx final: public jni::HybridClass<JFunc_void_cxx, JFunc_void> {
41
+ class JFunc_void_cxx final: public jni::HybridClass<JFunc_void_cxx, JFunc_void> {
41
42
  public:
42
43
  static jni::local_ref<JFunc_void::javaobject> fromCpp(const std::function<void()>& func) {
43
44
  return JFunc_void_cxx::newObjectCxxArgs(func);
@@ -12,6 +12,7 @@
12
12
 
13
13
  #include "AlertDismissalReason.hpp"
14
14
  #include <functional>
15
+ #include <NitroModules/JNICallable.hpp>
15
16
  #include "JAlertDismissalReason.hpp"
16
17
 
17
18
  namespace margelo::nitro::swe::iternio::reactnativeautoplay {
@@ -39,7 +40,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
39
40
  /**
40
41
  * An implementation of Func_void_AlertDismissalReason that is backed by a C++ implementation (using `std::function<...>`)
41
42
  */
42
- struct JFunc_void_AlertDismissalReason_cxx final: public jni::HybridClass<JFunc_void_AlertDismissalReason_cxx, JFunc_void_AlertDismissalReason> {
43
+ class JFunc_void_AlertDismissalReason_cxx final: public jni::HybridClass<JFunc_void_AlertDismissalReason_cxx, JFunc_void_AlertDismissalReason> {
43
44
  public:
44
45
  static jni::local_ref<JFunc_void_AlertDismissalReason::javaobject> fromCpp(const std::function<void(AlertDismissalReason /* reason */)>& func) {
45
46
  return JFunc_void_AlertDismissalReason_cxx::newObjectCxxArgs(func);
@@ -12,6 +12,7 @@
12
12
 
13
13
  #include "ColorScheme.hpp"
14
14
  #include <functional>
15
+ #include <NitroModules/JNICallable.hpp>
15
16
  #include "JColorScheme.hpp"
16
17
 
17
18
  namespace margelo::nitro::swe::iternio::reactnativeautoplay {
@@ -39,7 +40,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
39
40
  /**
40
41
  * An implementation of Func_void_ColorScheme that is backed by a C++ implementation (using `std::function<...>`)
41
42
  */
42
- struct JFunc_void_ColorScheme_cxx final: public jni::HybridClass<JFunc_void_ColorScheme_cxx, JFunc_void_ColorScheme> {
43
+ class JFunc_void_ColorScheme_cxx final: public jni::HybridClass<JFunc_void_ColorScheme_cxx, JFunc_void_ColorScheme> {
43
44
  public:
44
45
  static jni::local_ref<JFunc_void_ColorScheme::javaobject> fromCpp(const std::function<void(ColorScheme /* colorScheme */)>& func) {
45
46
  return JFunc_void_ColorScheme_cxx::newObjectCxxArgs(func);
@@ -12,6 +12,7 @@
12
12
 
13
13
  #include "Point.hpp"
14
14
  #include <functional>
15
+ #include <NitroModules/JNICallable.hpp>
15
16
  #include "JPoint.hpp"
16
17
 
17
18
  namespace margelo::nitro::swe::iternio::reactnativeautoplay {
@@ -39,7 +40,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
39
40
  /**
40
41
  * An implementation of Func_void_Point that is backed by a C++ implementation (using `std::function<...>`)
41
42
  */
42
- struct JFunc_void_Point_cxx final: public jni::HybridClass<JFunc_void_Point_cxx, JFunc_void_Point> {
43
+ class JFunc_void_Point_cxx final: public jni::HybridClass<JFunc_void_Point_cxx, JFunc_void_Point> {
43
44
  public:
44
45
  static jni::local_ref<JFunc_void_Point::javaobject> fromCpp(const std::function<void(const Point& /* center */)>& func) {
45
46
  return JFunc_void_Point_cxx::newObjectCxxArgs(func);
@@ -12,6 +12,7 @@
12
12
 
13
13
  #include "Point.hpp"
14
14
  #include <functional>
15
+ #include <NitroModules/JNICallable.hpp>
15
16
  #include "JPoint.hpp"
16
17
 
17
18
  namespace margelo::nitro::swe::iternio::reactnativeautoplay {
@@ -39,7 +40,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
39
40
  /**
40
41
  * An implementation of Func_void_Point_double that is backed by a C++ implementation (using `std::function<...>`)
41
42
  */
42
- struct JFunc_void_Point_double_cxx final: public jni::HybridClass<JFunc_void_Point_double_cxx, JFunc_void_Point_double> {
43
+ class JFunc_void_Point_double_cxx final: public jni::HybridClass<JFunc_void_Point_double_cxx, JFunc_void_Point_double> {
43
44
  public:
44
45
  static jni::local_ref<JFunc_void_Point_double::javaobject> fromCpp(const std::function<void(const Point& /* center */, double /* scale */)>& func) {
45
46
  return JFunc_void_Point_double_cxx::newObjectCxxArgs(func);
@@ -13,6 +13,7 @@
13
13
  #include "Point.hpp"
14
14
  #include <optional>
15
15
  #include <functional>
16
+ #include <NitroModules/JNICallable.hpp>
16
17
  #include "JPoint.hpp"
17
18
 
18
19
  namespace margelo::nitro::swe::iternio::reactnativeautoplay {
@@ -40,7 +41,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
40
41
  /**
41
42
  * An implementation of Func_void_Point_std__optional_Point_ that is backed by a C++ implementation (using `std::function<...>`)
42
43
  */
43
- struct JFunc_void_Point_std__optional_Point__cxx final: public jni::HybridClass<JFunc_void_Point_std__optional_Point__cxx, JFunc_void_Point_std__optional_Point_> {
44
+ class JFunc_void_Point_std__optional_Point__cxx final: public jni::HybridClass<JFunc_void_Point_std__optional_Point__cxx, JFunc_void_Point_std__optional_Point_> {
44
45
  public:
45
46
  static jni::local_ref<JFunc_void_Point_std__optional_Point_::javaobject> fromCpp(const std::function<void(const Point& /* translation */, const std::optional<Point>& /* velocity */)>& func) {
46
47
  return JFunc_void_Point_std__optional_Point__cxx::newObjectCxxArgs(func);
@@ -12,6 +12,7 @@
12
12
 
13
13
  #include "SafeAreaInsets.hpp"
14
14
  #include <functional>
15
+ #include <NitroModules/JNICallable.hpp>
15
16
  #include "JSafeAreaInsets.hpp"
16
17
  #include <optional>
17
18
 
@@ -40,7 +41,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
40
41
  /**
41
42
  * An implementation of Func_void_SafeAreaInsets that is backed by a C++ implementation (using `std::function<...>`)
42
43
  */
43
- struct JFunc_void_SafeAreaInsets_cxx final: public jni::HybridClass<JFunc_void_SafeAreaInsets_cxx, JFunc_void_SafeAreaInsets> {
44
+ class JFunc_void_SafeAreaInsets_cxx final: public jni::HybridClass<JFunc_void_SafeAreaInsets_cxx, JFunc_void_SafeAreaInsets> {
44
45
  public:
45
46
  static jni::local_ref<JFunc_void_SafeAreaInsets::javaobject> fromCpp(const std::function<void(const SafeAreaInsets& /* insets */)>& func) {
46
47
  return JFunc_void_SafeAreaInsets_cxx::newObjectCxxArgs(func);
@@ -12,6 +12,7 @@
12
12
 
13
13
  #include "VisibilityState.hpp"
14
14
  #include <functional>
15
+ #include <NitroModules/JNICallable.hpp>
15
16
  #include "JVisibilityState.hpp"
16
17
 
17
18
  namespace margelo::nitro::swe::iternio::reactnativeautoplay {
@@ -39,7 +40,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
39
40
  /**
40
41
  * An implementation of Func_void_VisibilityState that is backed by a C++ implementation (using `std::function<...>`)
41
42
  */
42
- struct JFunc_void_VisibilityState_cxx final: public jni::HybridClass<JFunc_void_VisibilityState_cxx, JFunc_void_VisibilityState> {
43
+ class JFunc_void_VisibilityState_cxx final: public jni::HybridClass<JFunc_void_VisibilityState_cxx, JFunc_void_VisibilityState> {
43
44
  public:
44
45
  static jni::local_ref<JFunc_void_VisibilityState::javaobject> fromCpp(const std::function<void(VisibilityState /* payload */)>& func) {
45
46
  return JFunc_void_VisibilityState_cxx::newObjectCxxArgs(func);
@@ -11,6 +11,7 @@
11
11
  #include <functional>
12
12
 
13
13
  #include <functional>
14
+ #include <NitroModules/JNICallable.hpp>
14
15
 
15
16
  namespace margelo::nitro::swe::iternio::reactnativeautoplay {
16
17
 
@@ -37,7 +38,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
37
38
  /**
38
39
  * An implementation of Func_void_bool that is backed by a C++ implementation (using `std::function<...>`)
39
40
  */
40
- struct JFunc_void_bool_cxx final: public jni::HybridClass<JFunc_void_bool_cxx, JFunc_void_bool> {
41
+ class JFunc_void_bool_cxx final: public jni::HybridClass<JFunc_void_bool_cxx, JFunc_void_bool> {
41
42
  public:
42
43
  static jni::local_ref<JFunc_void_bool::javaobject> fromCpp(const std::function<void(bool /* isPanningInterfaceVisible */)>& func) {
43
44
  return JFunc_void_bool_cxx::newObjectCxxArgs(func);
@@ -14,6 +14,7 @@
14
14
  #include <optional>
15
15
  #include <string>
16
16
  #include <functional>
17
+ #include <NitroModules/JNICallable.hpp>
17
18
  #include "JLocation.hpp"
18
19
 
19
20
  namespace margelo::nitro::swe::iternio::reactnativeautoplay {
@@ -41,7 +42,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
41
42
  /**
42
43
  * An implementation of Func_void_std__optional_Location__std__optional_std__string_ that is backed by a C++ implementation (using `std::function<...>`)
43
44
  */
44
- struct JFunc_void_std__optional_Location__std__optional_std__string__cxx final: public jni::HybridClass<JFunc_void_std__optional_Location__std__optional_std__string__cxx, JFunc_void_std__optional_Location__std__optional_std__string_> {
45
+ class JFunc_void_std__optional_Location__std__optional_std__string__cxx final: public jni::HybridClass<JFunc_void_std__optional_Location__std__optional_std__string__cxx, JFunc_void_std__optional_Location__std__optional_std__string_> {
45
46
  public:
46
47
  static jni::local_ref<JFunc_void_std__optional_Location__std__optional_std__string_::javaobject> fromCpp(const std::function<void(const std::optional<Location>& /* coordinates */, const std::optional<std::string>& /* query */)>& func) {
47
48
  return JFunc_void_std__optional_Location__std__optional_std__string__cxx::newObjectCxxArgs(func);
@@ -14,6 +14,7 @@
14
14
  #include <optional>
15
15
  #include <string>
16
16
  #include <functional>
17
+ #include <NitroModules/JNICallable.hpp>
17
18
  #include "JTelemetry.hpp"
18
19
  #include "NumericTelemetryItem.hpp"
19
20
  #include "JNumericTelemetryItem.hpp"
@@ -47,7 +48,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
47
48
  /**
48
49
  * An implementation of Func_void_std__optional_Telemetry__std__optional_std__string_ that is backed by a C++ implementation (using `std::function<...>`)
49
50
  */
50
- struct JFunc_void_std__optional_Telemetry__std__optional_std__string__cxx final: public jni::HybridClass<JFunc_void_std__optional_Telemetry__std__optional_std__string__cxx, JFunc_void_std__optional_Telemetry__std__optional_std__string_> {
51
+ class JFunc_void_std__optional_Telemetry__std__optional_std__string__cxx final: public jni::HybridClass<JFunc_void_std__optional_Telemetry__std__optional_std__string__cxx, JFunc_void_std__optional_Telemetry__std__optional_std__string_> {
51
52
  public:
52
53
  static jni::local_ref<JFunc_void_std__optional_Telemetry__std__optional_std__string_::javaobject> fromCpp(const std::function<void(const std::optional<Telemetry>& /* tlm */, const std::optional<std::string>& /* error */)>& func) {
53
54
  return JFunc_void_std__optional_Telemetry__std__optional_std__string__cxx::newObjectCxxArgs(func);
@@ -12,6 +12,7 @@
12
12
 
13
13
  #include <optional>
14
14
  #include <functional>
15
+ #include <NitroModules/JNICallable.hpp>
15
16
 
16
17
  namespace margelo::nitro::swe::iternio::reactnativeautoplay {
17
18
 
@@ -38,7 +39,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
38
39
  /**
39
40
  * An implementation of Func_void_std__optional_bool_ that is backed by a C++ implementation (using `std::function<...>`)
40
41
  */
41
- struct JFunc_void_std__optional_bool__cxx final: public jni::HybridClass<JFunc_void_std__optional_bool__cxx, JFunc_void_std__optional_bool_> {
42
+ class JFunc_void_std__optional_bool__cxx final: public jni::HybridClass<JFunc_void_std__optional_bool__cxx, JFunc_void_std__optional_bool_> {
42
43
  public:
43
44
  static jni::local_ref<JFunc_void_std__optional_bool_::javaobject> fromCpp(const std::function<void(std::optional<bool> /* animated */)>& func) {
44
45
  return JFunc_void_std__optional_bool__cxx::newObjectCxxArgs(func);
@@ -12,6 +12,7 @@
12
12
 
13
13
  #include <string>
14
14
  #include <functional>
15
+ #include <NitroModules/JNICallable.hpp>
15
16
 
16
17
  namespace margelo::nitro::swe::iternio::reactnativeautoplay {
17
18
 
@@ -38,7 +39,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
38
39
  /**
39
40
  * An implementation of Func_void_std__string that is backed by a C++ implementation (using `std::function<...>`)
40
41
  */
41
- struct JFunc_void_std__string_cxx final: public jni::HybridClass<JFunc_void_std__string_cxx, JFunc_void_std__string> {
42
+ class JFunc_void_std__string_cxx final: public jni::HybridClass<JFunc_void_std__string_cxx, JFunc_void_std__string> {
42
43
  public:
43
44
  static jni::local_ref<JFunc_void_std__string::javaobject> fromCpp(const std::function<void(const std::string& /* searchText */)>& func) {
44
45
  return JFunc_void_std__string_cxx::newObjectCxxArgs(func);
@@ -13,6 +13,7 @@
13
13
  #include <string>
14
14
  #include "ColorScheme.hpp"
15
15
  #include <functional>
16
+ #include <NitroModules/JNICallable.hpp>
16
17
  #include "JColorScheme.hpp"
17
18
 
18
19
  namespace margelo::nitro::swe::iternio::reactnativeautoplay {
@@ -40,7 +41,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
40
41
  /**
41
42
  * An implementation of Func_void_std__string_ColorScheme that is backed by a C++ implementation (using `std::function<...>`)
42
43
  */
43
- struct JFunc_void_std__string_ColorScheme_cxx final: public jni::HybridClass<JFunc_void_std__string_ColorScheme_cxx, JFunc_void_std__string_ColorScheme> {
44
+ class JFunc_void_std__string_ColorScheme_cxx final: public jni::HybridClass<JFunc_void_std__string_ColorScheme_cxx, JFunc_void_std__string_ColorScheme> {
44
45
  public:
45
46
  static jni::local_ref<JFunc_void_std__string_ColorScheme::javaobject> fromCpp(const std::function<void(const std::string& /* clusterId */, ColorScheme /* payload */)>& func) {
46
47
  return JFunc_void_std__string_ColorScheme_cxx::newObjectCxxArgs(func);
@@ -13,6 +13,7 @@
13
13
  #include <string>
14
14
  #include "ZoomEvent.hpp"
15
15
  #include <functional>
16
+ #include <NitroModules/JNICallable.hpp>
16
17
  #include "JZoomEvent.hpp"
17
18
 
18
19
  namespace margelo::nitro::swe::iternio::reactnativeautoplay {
@@ -40,7 +41,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
40
41
  /**
41
42
  * An implementation of Func_void_std__string_ZoomEvent that is backed by a C++ implementation (using `std::function<...>`)
42
43
  */
43
- struct JFunc_void_std__string_ZoomEvent_cxx final: public jni::HybridClass<JFunc_void_std__string_ZoomEvent_cxx, JFunc_void_std__string_ZoomEvent> {
44
+ class JFunc_void_std__string_ZoomEvent_cxx final: public jni::HybridClass<JFunc_void_std__string_ZoomEvent_cxx, JFunc_void_std__string_ZoomEvent> {
44
45
  public:
45
46
  static jni::local_ref<JFunc_void_std__string_ZoomEvent::javaobject> fromCpp(const std::function<void(const std::string& /* clusterId */, ZoomEvent /* payload */)>& func) {
46
47
  return JFunc_void_std__string_ZoomEvent_cxx::newObjectCxxArgs(func);
@@ -12,6 +12,7 @@
12
12
 
13
13
  #include <string>
14
14
  #include <functional>
15
+ #include <NitroModules/JNICallable.hpp>
15
16
 
16
17
  namespace margelo::nitro::swe::iternio::reactnativeautoplay {
17
18
 
@@ -38,7 +39,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
38
39
  /**
39
40
  * An implementation of Func_void_std__string_bool that is backed by a C++ implementation (using `std::function<...>`)
40
41
  */
41
- struct JFunc_void_std__string_bool_cxx final: public jni::HybridClass<JFunc_void_std__string_bool_cxx, JFunc_void_std__string_bool> {
42
+ class JFunc_void_std__string_bool_cxx final: public jni::HybridClass<JFunc_void_std__string_bool_cxx, JFunc_void_std__string_bool> {
42
43
  public:
43
44
  static jni::local_ref<JFunc_void_std__string_bool::javaobject> fromCpp(const std::function<void(const std::string& /* clusterId */, bool /* payload */)>& func) {
44
45
  return JFunc_void_std__string_bool_cxx::newObjectCxxArgs(func);
@@ -12,6 +12,7 @@
12
12
 
13
13
  #include <string>
14
14
  #include <functional>
15
+ #include <NitroModules/JNICallable.hpp>
15
16
 
16
17
  namespace margelo::nitro::swe::iternio::reactnativeautoplay {
17
18
 
@@ -38,7 +39,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
38
39
  /**
39
40
  * An implementation of Func_void_std__string_std__string that is backed by a C++ implementation (using `std::function<...>`)
40
41
  */
41
- struct JFunc_void_std__string_std__string_cxx final: public jni::HybridClass<JFunc_void_std__string_std__string_cxx, JFunc_void_std__string_std__string> {
42
+ class JFunc_void_std__string_std__string_cxx final: public jni::HybridClass<JFunc_void_std__string_std__string_cxx, JFunc_void_std__string_std__string> {
42
43
  public:
43
44
  static jni::local_ref<JFunc_void_std__string_std__string::javaobject> fromCpp(const std::function<void(const std::string& /* tripId */, const std::string& /* routeId */)>& func) {
44
45
  return JFunc_void_std__string_std__string_cxx::newObjectCxxArgs(func);
@@ -43,6 +43,7 @@
43
43
  #include "NitroGridButton.hpp"
44
44
  #include "NitroMapButton.hpp"
45
45
  #include "NitroMapButtonType.hpp"
46
+ #include <NitroModules/JNICallable.hpp>
46
47
  #include <functional>
47
48
  #include <optional>
48
49
  #include <string>
@@ -98,9 +99,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
98
99
  return downcast->cthis()->getFunction();
99
100
  } else {
100
101
  auto onWillAppearRef = jni::make_global(onWillAppear);
101
- return [onWillAppearRef](std::optional<bool> animated) -> void {
102
- return onWillAppearRef->invoke(animated);
103
- };
102
+ return JNICallable<JFunc_void_std__optional_bool_, void(std::optional<bool>)>(std::move(onWillAppearRef));
104
103
  }
105
104
  }()) : std::nullopt,
106
105
  onWillDisappear != nullptr ? std::make_optional([&]() -> std::function<void(std::optional<bool> /* animated */)> {
@@ -109,9 +108,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
109
108
  return downcast->cthis()->getFunction();
110
109
  } else {
111
110
  auto onWillDisappearRef = jni::make_global(onWillDisappear);
112
- return [onWillDisappearRef](std::optional<bool> animated) -> void {
113
- return onWillDisappearRef->invoke(animated);
114
- };
111
+ return JNICallable<JFunc_void_std__optional_bool_, void(std::optional<bool>)>(std::move(onWillDisappearRef));
115
112
  }
116
113
  }()) : std::nullopt,
117
114
  onDidAppear != nullptr ? std::make_optional([&]() -> std::function<void(std::optional<bool> /* animated */)> {
@@ -120,9 +117,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
120
117
  return downcast->cthis()->getFunction();
121
118
  } else {
122
119
  auto onDidAppearRef = jni::make_global(onDidAppear);
123
- return [onDidAppearRef](std::optional<bool> animated) -> void {
124
- return onDidAppearRef->invoke(animated);
125
- };
120
+ return JNICallable<JFunc_void_std__optional_bool_, void(std::optional<bool>)>(std::move(onDidAppearRef));
126
121
  }
127
122
  }()) : std::nullopt,
128
123
  onDidDisappear != nullptr ? std::make_optional([&]() -> std::function<void(std::optional<bool> /* animated */)> {
@@ -131,9 +126,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
131
126
  return downcast->cthis()->getFunction();
132
127
  } else {
133
128
  auto onDidDisappearRef = jni::make_global(onDidDisappear);
134
- return [onDidDisappearRef](std::optional<bool> animated) -> void {
135
- return onDidDisappearRef->invoke(animated);
136
- };
129
+ return JNICallable<JFunc_void_std__optional_bool_, void(std::optional<bool>)>(std::move(onDidDisappearRef));
137
130
  }
138
131
  }()) : std::nullopt,
139
132
  onPopped != nullptr ? std::make_optional([&]() -> std::function<void()> {
@@ -142,9 +135,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
142
135
  return downcast->cthis()->getFunction();
143
136
  } else {
144
137
  auto onPoppedRef = jni::make_global(onPopped);
145
- return [onPoppedRef]() -> void {
146
- return onPoppedRef->invoke();
147
- };
138
+ return JNICallable<JFunc_void, void()>(std::move(onPoppedRef));
148
139
  }
149
140
  }()) : std::nullopt,
150
141
  autoDismissMs != nullptr ? std::make_optional(autoDismissMs->value()) : std::nullopt,
@@ -18,6 +18,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct StringTelem
18
18
 
19
19
  #include <functional>
20
20
  #include "JFunc_void.hpp"
21
+ #include <NitroModules/JNICallable.hpp>
21
22
  #include "Telemetry.hpp"
22
23
  #include <optional>
23
24
  #include <string>
@@ -71,9 +72,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
71
72
  return downcast->cthis()->getFunction();
72
73
  } else {
73
74
  auto __resultRef = jni::make_global(__result);
74
- return [__resultRef]() -> void {
75
- return __resultRef->invoke();
76
- };
75
+ return JNICallable<JFunc_void, void()>(std::move(__resultRef));
77
76
  }
78
77
  }();
79
78
  }
@@ -32,6 +32,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay { enum class NitroBu
32
32
 
33
33
  #include <functional>
34
34
  #include "JFunc_void.hpp"
35
+ #include <NitroModules/JNICallable.hpp>
35
36
  #include <NitroModules/Promise.hpp>
36
37
  #include <NitroModules/JPromise.hpp>
37
38
  #include "EventName.hpp"
@@ -106,9 +107,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
106
107
  return downcast->cthis()->getFunction();
107
108
  } else {
108
109
  auto __resultRef = jni::make_global(__result);
109
- return [__resultRef]() -> void {
110
- return __resultRef->invoke();
111
- };
110
+ return JNICallable<JFunc_void, void()>(std::move(__resultRef));
112
111
  }
113
112
  }();
114
113
  }
@@ -121,9 +120,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
121
120
  return downcast->cthis()->getFunction();
122
121
  } else {
123
122
  auto __resultRef = jni::make_global(__result);
124
- return [__resultRef]() -> void {
125
- return __resultRef->invoke();
126
- };
123
+ return JNICallable<JFunc_void, void()>(std::move(__resultRef));
127
124
  }
128
125
  }();
129
126
  }
@@ -136,9 +133,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
136
133
  return downcast->cthis()->getFunction();
137
134
  } else {
138
135
  auto __resultRef = jni::make_global(__result);
139
- return [__resultRef]() -> void {
140
- return __resultRef->invoke();
141
- };
136
+ return JNICallable<JFunc_void, void()>(std::move(__resultRef));
142
137
  }
143
138
  }();
144
139
  }
@@ -226,9 +221,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
226
221
  return downcast->cthis()->getFunction();
227
222
  } else {
228
223
  auto __resultRef = jni::make_global(__result);
229
- return [__resultRef]() -> void {
230
- return __resultRef->invoke();
231
- };
224
+ return JNICallable<JFunc_void, void()>(std::move(__resultRef));
232
225
  }
233
226
  }();
234
227
  }
@@ -26,6 +26,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay { enum class ZoomEve
26
26
 
27
27
  #include <functional>
28
28
  #include "JFunc_void.hpp"
29
+ #include <NitroModules/JNICallable.hpp>
29
30
  #include <NitroModules/Promise.hpp>
30
31
  #include <NitroModules/JPromise.hpp>
31
32
  #include "ClusterEventName.hpp"
@@ -95,9 +96,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
95
96
  return downcast->cthis()->getFunction();
96
97
  } else {
97
98
  auto __resultRef = jni::make_global(__result);
98
- return [__resultRef]() -> void {
99
- return __resultRef->invoke();
100
- };
99
+ return JNICallable<JFunc_void, void()>(std::move(__resultRef));
101
100
  }
102
101
  }();
103
102
  }
@@ -138,9 +137,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
138
137
  return downcast->cthis()->getFunction();
139
138
  } else {
140
139
  auto __resultRef = jni::make_global(__result);
141
- return [__resultRef]() -> void {
142
- return __resultRef->invoke();
143
- };
140
+ return JNICallable<JFunc_void, void()>(std::move(__resultRef));
144
141
  }
145
142
  }();
146
143
  }
@@ -153,9 +150,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
153
150
  return downcast->cthis()->getFunction();
154
151
  } else {
155
152
  auto __resultRef = jni::make_global(__result);
156
- return [__resultRef]() -> void {
157
- return __resultRef->invoke();
158
- };
153
+ return JNICallable<JFunc_void, void()>(std::move(__resultRef));
159
154
  }
160
155
  }();
161
156
  }
@@ -168,9 +163,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
168
163
  return downcast->cthis()->getFunction();
169
164
  } else {
170
165
  auto __resultRef = jni::make_global(__result);
171
- return [__resultRef]() -> void {
172
- return __resultRef->invoke();
173
- };
166
+ return JNICallable<JFunc_void, void()>(std::move(__resultRef));
174
167
  }
175
168
  }();
176
169
  }
@@ -183,9 +176,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
183
176
  return downcast->cthis()->getFunction();
184
177
  } else {
185
178
  auto __resultRef = jni::make_global(__result);
186
- return [__resultRef]() -> void {
187
- return __resultRef->invoke();
188
- };
179
+ return JNICallable<JFunc_void, void()>(std::move(__resultRef));
189
180
  }
190
181
  }();
191
182
  }
@@ -46,6 +46,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay { enum class NitroMa
46
46
  #include <optional>
47
47
  #include <functional>
48
48
  #include "JFunc_void_std__optional_bool_.hpp"
49
+ #include <NitroModules/JNICallable.hpp>
49
50
  #include "JFunc_void.hpp"
50
51
  #include "NitroAction.hpp"
51
52
  #include <vector>
@@ -50,6 +50,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay { enum class NitroMa
50
50
  #include <optional>
51
51
  #include <functional>
52
52
  #include "JFunc_void_std__optional_bool_.hpp"
53
+ #include <NitroModules/JNICallable.hpp>
53
54
  #include "JFunc_void.hpp"
54
55
  #include "NitroAction.hpp"
55
56
  #include <vector>
@@ -50,6 +50,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay { enum class NitroMa
50
50
  #include <optional>
51
51
  #include <functional>
52
52
  #include "JFunc_void_std__optional_bool_.hpp"
53
+ #include <NitroModules/JNICallable.hpp>
53
54
  #include "JFunc_void.hpp"
54
55
  #include "NitroAction.hpp"
55
56
  #include <vector>
@@ -99,6 +99,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct TripConfig;
99
99
  #include <string>
100
100
  #include <functional>
101
101
  #include "JFunc_void_std__string.hpp"
102
+ #include <NitroModules/JNICallable.hpp>
102
103
  #include <NitroModules/Promise.hpp>
103
104
  #include <NitroModules/JPromise.hpp>
104
105
  #include "MapTemplateConfig.hpp"
@@ -42,6 +42,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay { enum class NitroMa
42
42
  #include <optional>
43
43
  #include <functional>
44
44
  #include "JFunc_void_std__optional_bool_.hpp"
45
+ #include <NitroModules/JNICallable.hpp>
45
46
  #include "JFunc_void.hpp"
46
47
  #include "NitroAction.hpp"
47
48
  #include <vector>