@iternio/react-native-auto-play 0.3.11 → 0.3.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +103 -3
- package/ReactNativeAutoPlay.podspec +0 -4
- package/android/src/automotive/AndroidManifest.xml +1 -0
- package/android/src/main/AndroidManifest.xml +1 -0
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridAutoPlay.kt +91 -0
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/VoiceInputManager.kt +214 -0
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/template/MapTemplate.kt +2 -5
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/template/Parser.kt +117 -38
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/utils/BitmapCache.kt +14 -0
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/utils/SymbolFont.kt +29 -30
- package/ios/extensions/NitroImageExtensions.swift +10 -1
- package/ios/hybrid/HybridAutoPlay.swift +51 -4
- package/ios/templates/GridTemplate.swift +7 -0
- package/ios/templates/MapTemplate.swift +14 -0
- package/ios/templates/Parser.swift +91 -4
- package/ios/utils/SymbolFont.swift +44 -44
- package/ios/utils/VoiceInputManager.swift +233 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/specs/AutoPlay.nitro.d.ts +31 -1
- package/lib/templates/MapTemplate.d.ts +4 -1
- package/lib/types/Image.d.ts +46 -4
- package/lib/types/Maneuver.d.ts +2 -10
- package/lib/utils/NitroImage.d.ts +29 -3
- package/lib/utils/NitroImage.js +64 -3
- package/nitrogen/generated/android/ReactNativeAutoPlay+autolinking.cmake +1 -1
- package/nitrogen/generated/android/c++/JGlyphImage.hpp +6 -1
- package/nitrogen/generated/android/c++/JGridTemplateConfig.hpp +3 -1
- package/nitrogen/generated/android/c++/JHybridAutoPlaySpec.cpp +48 -1
- package/nitrogen/generated/android/c++/JHybridAutoPlaySpec.hpp +4 -0
- package/nitrogen/generated/android/c++/JHybridClusterSpec.cpp +4 -0
- package/nitrogen/generated/android/c++/JHybridGridTemplateSpec.cpp +5 -1
- package/nitrogen/generated/android/c++/JHybridInformationTemplateSpec.cpp +5 -1
- package/nitrogen/generated/android/c++/JHybridListTemplateSpec.cpp +5 -1
- package/nitrogen/generated/android/c++/JHybridMapTemplateSpec.cpp +5 -1
- package/nitrogen/generated/android/c++/JHybridMessageTemplateSpec.cpp +5 -1
- package/nitrogen/generated/android/c++/JHybridSearchTemplateSpec.cpp +5 -1
- package/nitrogen/generated/android/c++/JHybridSignInTemplateSpec.cpp +5 -1
- package/nitrogen/generated/android/c++/JImageLane.hpp +2 -0
- package/nitrogen/generated/android/c++/JInformationTemplateConfig.hpp +3 -1
- package/nitrogen/generated/android/c++/JLaneGuidance.hpp +2 -0
- package/nitrogen/generated/android/c++/JListTemplateConfig.hpp +3 -1
- package/nitrogen/generated/android/c++/JMapTemplateConfig.hpp +3 -1
- package/nitrogen/generated/android/c++/JMessageTemplateConfig.hpp +7 -5
- package/nitrogen/generated/android/c++/JNitroAction.hpp +7 -5
- package/nitrogen/generated/android/c++/JNitroAttributedString.hpp +2 -0
- package/nitrogen/generated/android/c++/JNitroAttributedStringImage.hpp +2 -0
- package/nitrogen/generated/android/c++/JNitroBaseMapTemplateConfig.hpp +3 -1
- package/nitrogen/generated/android/c++/JNitroGridButton.hpp +2 -0
- package/nitrogen/generated/android/c++/JNitroImage.cpp +6 -2
- package/nitrogen/generated/android/c++/JNitroImage.hpp +20 -3
- package/nitrogen/generated/android/c++/JNitroManeuver.hpp +3 -1
- package/nitrogen/generated/android/c++/JNitroMapButton.hpp +2 -0
- package/nitrogen/generated/android/c++/JNitroMessageManeuver.hpp +7 -5
- package/nitrogen/generated/android/c++/JNitroNavigationAlert.hpp +7 -5
- package/nitrogen/generated/android/c++/JNitroRoutingManeuver.hpp +7 -5
- package/nitrogen/generated/android/c++/JNitroRow.hpp +7 -5
- package/nitrogen/generated/android/c++/JNitroSection.hpp +3 -1
- package/nitrogen/generated/android/c++/JPreferredImageLane.hpp +2 -0
- package/nitrogen/generated/android/c++/JRemoteImage.hpp +68 -0
- package/nitrogen/generated/android/c++/JSearchTemplateConfig.hpp +3 -1
- package/nitrogen/generated/android/c++/JSignInTemplateConfig.hpp +3 -1
- package/nitrogen/generated/android/c++/JVariant_GlyphImage_AssetImage_RemoteImage.cpp +30 -0
- package/nitrogen/generated/android/c++/JVariant_GlyphImage_AssetImage_RemoteImage.hpp +92 -0
- package/nitrogen/generated/android/c++/JVariant_PreferredImageLane_ImageLane.hpp +3 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/GlyphImage.kt +5 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridAutoPlaySpec.kt +17 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/MessageTemplateConfig.kt +3 -3
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/NitroAction.kt +3 -3
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/NitroImage.kt +14 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/NitroMessageManeuver.kt +2 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/NitroNavigationAlert.kt +3 -3
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/NitroRoutingManeuver.kt +2 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/NitroRow.kt +3 -3
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/RemoteImage.kt +44 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/{Variant_GlyphImage_AssetImage.kt → Variant_GlyphImage_AssetImage_RemoteImage.kt} +20 -8
- package/nitrogen/generated/ios/ReactNativeAutoPlay-Swift-Cxx-Bridge.cpp +16 -8
- package/nitrogen/generated/ios/ReactNativeAutoPlay-Swift-Cxx-Bridge.hpp +156 -79
- package/nitrogen/generated/ios/ReactNativeAutoPlay-Swift-Cxx-Umbrella.hpp +4 -0
- package/nitrogen/generated/ios/c++/HybridAutoPlaySpecSwift.hpp +37 -0
- package/nitrogen/generated/ios/c++/HybridCarPlayDashboardSpecSwift.hpp +4 -1
- package/nitrogen/generated/ios/c++/HybridClusterSpecSwift.hpp +3 -0
- package/nitrogen/generated/ios/c++/HybridGridTemplateSpecSwift.hpp +3 -0
- package/nitrogen/generated/ios/c++/HybridInformationTemplateSpecSwift.hpp +3 -0
- package/nitrogen/generated/ios/c++/HybridListTemplateSpecSwift.hpp +3 -0
- package/nitrogen/generated/ios/c++/HybridMapTemplateSpecSwift.hpp +3 -0
- package/nitrogen/generated/ios/c++/HybridMessageTemplateSpecSwift.hpp +3 -0
- package/nitrogen/generated/ios/c++/HybridSearchTemplateSpecSwift.hpp +3 -0
- package/nitrogen/generated/ios/swift/Func_void_std__shared_ptr_ArrayBuffer_.swift +46 -0
- package/nitrogen/generated/ios/swift/GlyphImage.swift +7 -2
- package/nitrogen/generated/ios/swift/HybridAutoPlaySpec.swift +4 -0
- package/nitrogen/generated/ios/swift/HybridAutoPlaySpec_cxx.swift +82 -0
- package/nitrogen/generated/ios/swift/ImageLane.swift +9 -4
- package/nitrogen/generated/ios/swift/MessageTemplateConfig.swift +16 -11
- package/nitrogen/generated/ios/swift/NitroAction.swift +16 -11
- package/nitrogen/generated/ios/swift/NitroAttributedStringImage.swift +9 -4
- package/nitrogen/generated/ios/swift/NitroCarPlayDashboardButton.swift +9 -4
- package/nitrogen/generated/ios/swift/NitroGridButton.swift +9 -4
- package/nitrogen/generated/ios/swift/NitroImage.swift +2 -1
- package/nitrogen/generated/ios/swift/NitroMapButton.swift +9 -4
- package/nitrogen/generated/ios/swift/NitroMessageManeuver.swift +16 -11
- package/nitrogen/generated/ios/swift/NitroNavigationAlert.swift +16 -11
- package/nitrogen/generated/ios/swift/NitroRoutingManeuver.swift +25 -15
- package/nitrogen/generated/ios/swift/NitroRow.swift +16 -11
- package/nitrogen/generated/ios/swift/PreferredImageLane.swift +9 -4
- package/nitrogen/generated/ios/swift/RemoteImage.swift +58 -0
- package/nitrogen/generated/ios/swift/{Variant_GlyphImage_AssetImage.swift → Variant_GlyphImage_AssetImage_RemoteImage.swift} +4 -3
- package/nitrogen/generated/shared/c++/GlyphImage.hpp +6 -1
- package/nitrogen/generated/shared/c++/HybridAutoPlaySpec.cpp +4 -0
- package/nitrogen/generated/shared/c++/HybridAutoPlaySpec.hpp +5 -0
- package/nitrogen/generated/shared/c++/ImageLane.hpp +8 -5
- package/nitrogen/generated/shared/c++/MessageTemplateConfig.hpp +8 -5
- package/nitrogen/generated/shared/c++/NitroAction.hpp +8 -5
- package/nitrogen/generated/shared/c++/NitroAttributedStringImage.hpp +8 -5
- package/nitrogen/generated/shared/c++/NitroCarPlayDashboardButton.hpp +8 -5
- package/nitrogen/generated/shared/c++/NitroGridButton.hpp +8 -5
- package/nitrogen/generated/shared/c++/NitroMapButton.hpp +8 -5
- package/nitrogen/generated/shared/c++/NitroMessageManeuver.hpp +8 -5
- package/nitrogen/generated/shared/c++/NitroNavigationAlert.hpp +8 -5
- package/nitrogen/generated/shared/c++/NitroRoutingManeuver.hpp +12 -9
- package/nitrogen/generated/shared/c++/NitroRow.hpp +8 -5
- package/nitrogen/generated/shared/c++/PreferredImageLane.hpp +8 -5
- package/nitrogen/generated/shared/c++/RemoteImage.hpp +94 -0
- package/package.json +2 -3
- package/src/index.ts +1 -0
- package/src/specs/AutoPlay.nitro.ts +39 -1
- package/src/templates/MapTemplate.ts +4 -1
- package/src/types/Image.ts +65 -16
- package/src/types/Maneuver.ts +3 -10
- package/src/utils/NitroImage.ts +81 -6
- package/android/src/main/res/font/materialsymbolsoutlined_regular.ttf +0 -0
- package/ios/Assets/MaterialSymbolsOutlined-Regular.ttf +0 -0
- package/lib/types/Glyphmap.d.ts +0 -4105
- package/lib/types/Glyphmap.js +0 -4105
- package/nitrogen/generated/android/c++/JVariant_GlyphImage_AssetImage.cpp +0 -26
- package/nitrogen/generated/android/c++/JVariant_GlyphImage_AssetImage.hpp +0 -75
- package/src/types/Glyphmap.ts +0 -4107
|
@@ -34,10 +34,13 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay { enum class NitroMa
|
|
|
34
34
|
namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct GlyphImage; }
|
|
35
35
|
// Forward declaration of `AssetImage` to properly resolve imports.
|
|
36
36
|
namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct AssetImage; }
|
|
37
|
+
// Forward declaration of `RemoteImage` to properly resolve imports.
|
|
38
|
+
namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct RemoteImage; }
|
|
37
39
|
|
|
38
40
|
#include "NitroMapButtonType.hpp"
|
|
39
41
|
#include "GlyphImage.hpp"
|
|
40
42
|
#include "AssetImage.hpp"
|
|
43
|
+
#include "RemoteImage.hpp"
|
|
41
44
|
#include <variant>
|
|
42
45
|
#include <functional>
|
|
43
46
|
#include <optional>
|
|
@@ -50,12 +53,12 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
|
50
53
|
struct NitroMapButton final {
|
|
51
54
|
public:
|
|
52
55
|
NitroMapButtonType type SWIFT_PRIVATE;
|
|
53
|
-
std::variant<GlyphImage, AssetImage> image SWIFT_PRIVATE;
|
|
56
|
+
std::variant<GlyphImage, AssetImage, RemoteImage> image SWIFT_PRIVATE;
|
|
54
57
|
std::optional<std::function<void()>> onPress SWIFT_PRIVATE;
|
|
55
58
|
|
|
56
59
|
public:
|
|
57
60
|
NitroMapButton() = default;
|
|
58
|
-
explicit NitroMapButton(NitroMapButtonType type, std::variant<GlyphImage, AssetImage> image, std::optional<std::function<void()>> onPress): type(type), image(image), onPress(onPress) {}
|
|
61
|
+
explicit NitroMapButton(NitroMapButtonType type, std::variant<GlyphImage, AssetImage, RemoteImage> image, std::optional<std::function<void()>> onPress): type(type), image(image), onPress(onPress) {}
|
|
59
62
|
|
|
60
63
|
public:
|
|
61
64
|
// NitroMapButton is not equatable because these properties are not equatable: onPress
|
|
@@ -72,14 +75,14 @@ namespace margelo::nitro {
|
|
|
72
75
|
jsi::Object obj = arg.asObject(runtime);
|
|
73
76
|
return margelo::nitro::swe::iternio::reactnativeautoplay::NitroMapButton(
|
|
74
77
|
JSIConverter<margelo::nitro::swe::iternio::reactnativeautoplay::NitroMapButtonType>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "type"))),
|
|
75
|
-
JSIConverter<std::variant<margelo::nitro::swe::iternio::reactnativeautoplay::GlyphImage, margelo::nitro::swe::iternio::reactnativeautoplay::AssetImage>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "image"))),
|
|
78
|
+
JSIConverter<std::variant<margelo::nitro::swe::iternio::reactnativeautoplay::GlyphImage, margelo::nitro::swe::iternio::reactnativeautoplay::AssetImage, margelo::nitro::swe::iternio::reactnativeautoplay::RemoteImage>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "image"))),
|
|
76
79
|
JSIConverter<std::optional<std::function<void()>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "onPress")))
|
|
77
80
|
);
|
|
78
81
|
}
|
|
79
82
|
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::swe::iternio::reactnativeautoplay::NitroMapButton& arg) {
|
|
80
83
|
jsi::Object obj(runtime);
|
|
81
84
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "type"), JSIConverter<margelo::nitro::swe::iternio::reactnativeautoplay::NitroMapButtonType>::toJSI(runtime, arg.type));
|
|
82
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "image"), JSIConverter<std::variant<margelo::nitro::swe::iternio::reactnativeautoplay::GlyphImage, margelo::nitro::swe::iternio::reactnativeautoplay::AssetImage>>::toJSI(runtime, arg.image));
|
|
85
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "image"), JSIConverter<std::variant<margelo::nitro::swe::iternio::reactnativeautoplay::GlyphImage, margelo::nitro::swe::iternio::reactnativeautoplay::AssetImage, margelo::nitro::swe::iternio::reactnativeautoplay::RemoteImage>>::toJSI(runtime, arg.image));
|
|
83
86
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "onPress"), JSIConverter<std::optional<std::function<void()>>>::toJSI(runtime, arg.onPress));
|
|
84
87
|
return obj;
|
|
85
88
|
}
|
|
@@ -92,7 +95,7 @@ namespace margelo::nitro {
|
|
|
92
95
|
return false;
|
|
93
96
|
}
|
|
94
97
|
if (!JSIConverter<margelo::nitro::swe::iternio::reactnativeautoplay::NitroMapButtonType>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "type")))) return false;
|
|
95
|
-
if (!JSIConverter<std::variant<margelo::nitro::swe::iternio::reactnativeautoplay::GlyphImage, margelo::nitro::swe::iternio::reactnativeautoplay::AssetImage>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "image")))) return false;
|
|
98
|
+
if (!JSIConverter<std::variant<margelo::nitro::swe::iternio::reactnativeautoplay::GlyphImage, margelo::nitro::swe::iternio::reactnativeautoplay::AssetImage, margelo::nitro::swe::iternio::reactnativeautoplay::RemoteImage>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "image")))) return false;
|
|
96
99
|
if (!JSIConverter<std::optional<std::function<void()>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "onPress")))) return false;
|
|
97
100
|
return true;
|
|
98
101
|
}
|
|
@@ -32,6 +32,8 @@
|
|
|
32
32
|
namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct GlyphImage; }
|
|
33
33
|
// Forward declaration of `AssetImage` to properly resolve imports.
|
|
34
34
|
namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct AssetImage; }
|
|
35
|
+
// Forward declaration of `RemoteImage` to properly resolve imports.
|
|
36
|
+
namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct RemoteImage; }
|
|
35
37
|
// Forward declaration of `NitroColor` to properly resolve imports.
|
|
36
38
|
namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct NitroColor; }
|
|
37
39
|
|
|
@@ -39,6 +41,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct NitroColor;
|
|
|
39
41
|
#include <optional>
|
|
40
42
|
#include "GlyphImage.hpp"
|
|
41
43
|
#include "AssetImage.hpp"
|
|
44
|
+
#include "RemoteImage.hpp"
|
|
42
45
|
#include <variant>
|
|
43
46
|
#include "NitroColor.hpp"
|
|
44
47
|
|
|
@@ -51,12 +54,12 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
|
51
54
|
public:
|
|
52
55
|
std::string title SWIFT_PRIVATE;
|
|
53
56
|
std::optional<std::string> text SWIFT_PRIVATE;
|
|
54
|
-
std::optional<std::variant<GlyphImage, AssetImage>> image SWIFT_PRIVATE;
|
|
57
|
+
std::optional<std::variant<GlyphImage, AssetImage, RemoteImage>> image SWIFT_PRIVATE;
|
|
55
58
|
NitroColor cardBackgroundColor SWIFT_PRIVATE;
|
|
56
59
|
|
|
57
60
|
public:
|
|
58
61
|
NitroMessageManeuver() = default;
|
|
59
|
-
explicit NitroMessageManeuver(std::string title, std::optional<std::string> text, std::optional<std::variant<GlyphImage, AssetImage>> image, NitroColor cardBackgroundColor): title(title), text(text), image(image), cardBackgroundColor(cardBackgroundColor) {}
|
|
62
|
+
explicit NitroMessageManeuver(std::string title, std::optional<std::string> text, std::optional<std::variant<GlyphImage, AssetImage, RemoteImage>> image, NitroColor cardBackgroundColor): title(title), text(text), image(image), cardBackgroundColor(cardBackgroundColor) {}
|
|
60
63
|
|
|
61
64
|
public:
|
|
62
65
|
friend bool operator==(const NitroMessageManeuver& lhs, const NitroMessageManeuver& rhs) = default;
|
|
@@ -74,7 +77,7 @@ namespace margelo::nitro {
|
|
|
74
77
|
return margelo::nitro::swe::iternio::reactnativeautoplay::NitroMessageManeuver(
|
|
75
78
|
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "title"))),
|
|
76
79
|
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "text"))),
|
|
77
|
-
JSIConverter<std::optional<std::variant<margelo::nitro::swe::iternio::reactnativeautoplay::GlyphImage, margelo::nitro::swe::iternio::reactnativeautoplay::AssetImage>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "image"))),
|
|
80
|
+
JSIConverter<std::optional<std::variant<margelo::nitro::swe::iternio::reactnativeautoplay::GlyphImage, margelo::nitro::swe::iternio::reactnativeautoplay::AssetImage, margelo::nitro::swe::iternio::reactnativeautoplay::RemoteImage>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "image"))),
|
|
78
81
|
JSIConverter<margelo::nitro::swe::iternio::reactnativeautoplay::NitroColor>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "cardBackgroundColor")))
|
|
79
82
|
);
|
|
80
83
|
}
|
|
@@ -82,7 +85,7 @@ namespace margelo::nitro {
|
|
|
82
85
|
jsi::Object obj(runtime);
|
|
83
86
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "title"), JSIConverter<std::string>::toJSI(runtime, arg.title));
|
|
84
87
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "text"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.text));
|
|
85
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "image"), JSIConverter<std::optional<std::variant<margelo::nitro::swe::iternio::reactnativeautoplay::GlyphImage, margelo::nitro::swe::iternio::reactnativeautoplay::AssetImage>>>::toJSI(runtime, arg.image));
|
|
88
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "image"), JSIConverter<std::optional<std::variant<margelo::nitro::swe::iternio::reactnativeautoplay::GlyphImage, margelo::nitro::swe::iternio::reactnativeautoplay::AssetImage, margelo::nitro::swe::iternio::reactnativeautoplay::RemoteImage>>>::toJSI(runtime, arg.image));
|
|
86
89
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "cardBackgroundColor"), JSIConverter<margelo::nitro::swe::iternio::reactnativeautoplay::NitroColor>::toJSI(runtime, arg.cardBackgroundColor));
|
|
87
90
|
return obj;
|
|
88
91
|
}
|
|
@@ -96,7 +99,7 @@ namespace margelo::nitro {
|
|
|
96
99
|
}
|
|
97
100
|
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "title")))) return false;
|
|
98
101
|
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "text")))) return false;
|
|
99
|
-
if (!JSIConverter<std::optional<std::variant<margelo::nitro::swe::iternio::reactnativeautoplay::GlyphImage, margelo::nitro::swe::iternio::reactnativeautoplay::AssetImage>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "image")))) return false;
|
|
102
|
+
if (!JSIConverter<std::optional<std::variant<margelo::nitro::swe::iternio::reactnativeautoplay::GlyphImage, margelo::nitro::swe::iternio::reactnativeautoplay::AssetImage, margelo::nitro::swe::iternio::reactnativeautoplay::RemoteImage>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "image")))) return false;
|
|
100
103
|
if (!JSIConverter<margelo::nitro::swe::iternio::reactnativeautoplay::NitroColor>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "cardBackgroundColor")))) return false;
|
|
101
104
|
return true;
|
|
102
105
|
}
|
|
@@ -34,6 +34,8 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct AutoText; }
|
|
|
34
34
|
namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct GlyphImage; }
|
|
35
35
|
// Forward declaration of `AssetImage` to properly resolve imports.
|
|
36
36
|
namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct AssetImage; }
|
|
37
|
+
// Forward declaration of `RemoteImage` to properly resolve imports.
|
|
38
|
+
namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct RemoteImage; }
|
|
37
39
|
// Forward declaration of `NavigationAlertAction` to properly resolve imports.
|
|
38
40
|
namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct NavigationAlertAction; }
|
|
39
41
|
// Forward declaration of `AlertDismissalReason` to properly resolve imports.
|
|
@@ -43,6 +45,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay { enum class AlertDi
|
|
|
43
45
|
#include <optional>
|
|
44
46
|
#include "GlyphImage.hpp"
|
|
45
47
|
#include "AssetImage.hpp"
|
|
48
|
+
#include "RemoteImage.hpp"
|
|
46
49
|
#include <variant>
|
|
47
50
|
#include "NavigationAlertAction.hpp"
|
|
48
51
|
#include <functional>
|
|
@@ -58,7 +61,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
|
58
61
|
double id SWIFT_PRIVATE;
|
|
59
62
|
AutoText title SWIFT_PRIVATE;
|
|
60
63
|
std::optional<AutoText> subtitle SWIFT_PRIVATE;
|
|
61
|
-
std::optional<std::variant<GlyphImage, AssetImage>> image SWIFT_PRIVATE;
|
|
64
|
+
std::optional<std::variant<GlyphImage, AssetImage, RemoteImage>> image SWIFT_PRIVATE;
|
|
62
65
|
NavigationAlertAction primaryAction SWIFT_PRIVATE;
|
|
63
66
|
std::optional<NavigationAlertAction> secondaryAction SWIFT_PRIVATE;
|
|
64
67
|
double durationMs SWIFT_PRIVATE;
|
|
@@ -68,7 +71,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
|
68
71
|
|
|
69
72
|
public:
|
|
70
73
|
NitroNavigationAlert() = default;
|
|
71
|
-
explicit NitroNavigationAlert(double id, AutoText title, std::optional<AutoText> subtitle, std::optional<std::variant<GlyphImage, AssetImage>> image, NavigationAlertAction primaryAction, std::optional<NavigationAlertAction> secondaryAction, double durationMs, std::optional<std::function<void()>> onWillShow, std::optional<std::function<void(AlertDismissalReason /* reason */)>> onDidDismiss, double priority): id(id), title(title), subtitle(subtitle), image(image), primaryAction(primaryAction), secondaryAction(secondaryAction), durationMs(durationMs), onWillShow(onWillShow), onDidDismiss(onDidDismiss), priority(priority) {}
|
|
74
|
+
explicit NitroNavigationAlert(double id, AutoText title, std::optional<AutoText> subtitle, std::optional<std::variant<GlyphImage, AssetImage, RemoteImage>> image, NavigationAlertAction primaryAction, std::optional<NavigationAlertAction> secondaryAction, double durationMs, std::optional<std::function<void()>> onWillShow, std::optional<std::function<void(AlertDismissalReason /* reason */)>> onDidDismiss, double priority): id(id), title(title), subtitle(subtitle), image(image), primaryAction(primaryAction), secondaryAction(secondaryAction), durationMs(durationMs), onWillShow(onWillShow), onDidDismiss(onDidDismiss), priority(priority) {}
|
|
72
75
|
|
|
73
76
|
public:
|
|
74
77
|
// NitroNavigationAlert is not equatable because these properties are not equatable: primaryAction, secondaryAction, onWillShow, onDidDismiss
|
|
@@ -87,7 +90,7 @@ namespace margelo::nitro {
|
|
|
87
90
|
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "id"))),
|
|
88
91
|
JSIConverter<margelo::nitro::swe::iternio::reactnativeautoplay::AutoText>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "title"))),
|
|
89
92
|
JSIConverter<std::optional<margelo::nitro::swe::iternio::reactnativeautoplay::AutoText>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "subtitle"))),
|
|
90
|
-
JSIConverter<std::optional<std::variant<margelo::nitro::swe::iternio::reactnativeautoplay::GlyphImage, margelo::nitro::swe::iternio::reactnativeautoplay::AssetImage>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "image"))),
|
|
93
|
+
JSIConverter<std::optional<std::variant<margelo::nitro::swe::iternio::reactnativeautoplay::GlyphImage, margelo::nitro::swe::iternio::reactnativeautoplay::AssetImage, margelo::nitro::swe::iternio::reactnativeautoplay::RemoteImage>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "image"))),
|
|
91
94
|
JSIConverter<margelo::nitro::swe::iternio::reactnativeautoplay::NavigationAlertAction>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "primaryAction"))),
|
|
92
95
|
JSIConverter<std::optional<margelo::nitro::swe::iternio::reactnativeautoplay::NavigationAlertAction>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "secondaryAction"))),
|
|
93
96
|
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "durationMs"))),
|
|
@@ -101,7 +104,7 @@ namespace margelo::nitro {
|
|
|
101
104
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "id"), JSIConverter<double>::toJSI(runtime, arg.id));
|
|
102
105
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "title"), JSIConverter<margelo::nitro::swe::iternio::reactnativeautoplay::AutoText>::toJSI(runtime, arg.title));
|
|
103
106
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "subtitle"), JSIConverter<std::optional<margelo::nitro::swe::iternio::reactnativeautoplay::AutoText>>::toJSI(runtime, arg.subtitle));
|
|
104
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "image"), JSIConverter<std::optional<std::variant<margelo::nitro::swe::iternio::reactnativeautoplay::GlyphImage, margelo::nitro::swe::iternio::reactnativeautoplay::AssetImage>>>::toJSI(runtime, arg.image));
|
|
107
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "image"), JSIConverter<std::optional<std::variant<margelo::nitro::swe::iternio::reactnativeautoplay::GlyphImage, margelo::nitro::swe::iternio::reactnativeautoplay::AssetImage, margelo::nitro::swe::iternio::reactnativeautoplay::RemoteImage>>>::toJSI(runtime, arg.image));
|
|
105
108
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "primaryAction"), JSIConverter<margelo::nitro::swe::iternio::reactnativeautoplay::NavigationAlertAction>::toJSI(runtime, arg.primaryAction));
|
|
106
109
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "secondaryAction"), JSIConverter<std::optional<margelo::nitro::swe::iternio::reactnativeautoplay::NavigationAlertAction>>::toJSI(runtime, arg.secondaryAction));
|
|
107
110
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "durationMs"), JSIConverter<double>::toJSI(runtime, arg.durationMs));
|
|
@@ -121,7 +124,7 @@ namespace margelo::nitro {
|
|
|
121
124
|
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "id")))) return false;
|
|
122
125
|
if (!JSIConverter<margelo::nitro::swe::iternio::reactnativeautoplay::AutoText>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "title")))) return false;
|
|
123
126
|
if (!JSIConverter<std::optional<margelo::nitro::swe::iternio::reactnativeautoplay::AutoText>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "subtitle")))) return false;
|
|
124
|
-
if (!JSIConverter<std::optional<std::variant<margelo::nitro::swe::iternio::reactnativeautoplay::GlyphImage, margelo::nitro::swe::iternio::reactnativeautoplay::AssetImage>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "image")))) return false;
|
|
127
|
+
if (!JSIConverter<std::optional<std::variant<margelo::nitro::swe::iternio::reactnativeautoplay::GlyphImage, margelo::nitro::swe::iternio::reactnativeautoplay::AssetImage, margelo::nitro::swe::iternio::reactnativeautoplay::RemoteImage>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "image")))) return false;
|
|
125
128
|
if (!JSIConverter<margelo::nitro::swe::iternio::reactnativeautoplay::NavigationAlertAction>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "primaryAction")))) return false;
|
|
126
129
|
if (!JSIConverter<std::optional<margelo::nitro::swe::iternio::reactnativeautoplay::NavigationAlertAction>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "secondaryAction")))) return false;
|
|
127
130
|
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "durationMs")))) return false;
|
|
@@ -34,6 +34,8 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct NitroAttrib
|
|
|
34
34
|
namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct GlyphImage; }
|
|
35
35
|
// Forward declaration of `AssetImage` to properly resolve imports.
|
|
36
36
|
namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct AssetImage; }
|
|
37
|
+
// Forward declaration of `RemoteImage` to properly resolve imports.
|
|
38
|
+
namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct RemoteImage; }
|
|
37
39
|
// Forward declaration of `TurnType` to properly resolve imports.
|
|
38
40
|
namespace margelo::nitro::swe::iternio::reactnativeautoplay { enum class TurnType; }
|
|
39
41
|
// Forward declaration of `OffRampType` to properly resolve imports.
|
|
@@ -59,6 +61,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay { enum class Maneuve
|
|
|
59
61
|
#include <vector>
|
|
60
62
|
#include "GlyphImage.hpp"
|
|
61
63
|
#include "AssetImage.hpp"
|
|
64
|
+
#include "RemoteImage.hpp"
|
|
62
65
|
#include <variant>
|
|
63
66
|
#include <optional>
|
|
64
67
|
#include "TurnType.hpp"
|
|
@@ -81,8 +84,8 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
|
81
84
|
struct NitroRoutingManeuver final {
|
|
82
85
|
public:
|
|
83
86
|
std::vector<NitroAttributedString> attributedInstructionVariants SWIFT_PRIVATE;
|
|
84
|
-
std::variant<GlyphImage, AssetImage> symbolImage SWIFT_PRIVATE;
|
|
85
|
-
std::optional<std::variant<GlyphImage, AssetImage>> junctionImage SWIFT_PRIVATE;
|
|
87
|
+
std::variant<GlyphImage, AssetImage, RemoteImage> symbolImage SWIFT_PRIVATE;
|
|
88
|
+
std::optional<std::variant<GlyphImage, AssetImage, RemoteImage>> junctionImage SWIFT_PRIVATE;
|
|
86
89
|
std::optional<TurnType> turnType SWIFT_PRIVATE;
|
|
87
90
|
std::optional<double> angle SWIFT_PRIVATE;
|
|
88
91
|
std::optional<std::vector<double>> elementAngles SWIFT_PRIVATE;
|
|
@@ -102,7 +105,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
|
102
105
|
|
|
103
106
|
public:
|
|
104
107
|
NitroRoutingManeuver() = default;
|
|
105
|
-
explicit NitroRoutingManeuver(std::vector<NitroAttributedString> attributedInstructionVariants, std::variant<GlyphImage, AssetImage> symbolImage, std::optional<std::variant<GlyphImage, AssetImage>> junctionImage, std::optional<TurnType> turnType, std::optional<double> angle, std::optional<std::vector<double>> elementAngles, std::optional<double> exitNumber, std::optional<OffRampType> offRampType, std::optional<OnRampType> onRampType, std::optional<ForkType> forkType, std::optional<KeepType> keepType, std::optional<LaneGuidance> linkedLaneGuidance, NitroColor cardBackgroundColor, std::string id, TravelEstimates travelEstimates, TrafficSide trafficSide, ManeuverType maneuverType, std::optional<std::vector<std::string>> roadName, std::optional<std::string> highwayExitLabel): attributedInstructionVariants(attributedInstructionVariants), symbolImage(symbolImage), junctionImage(junctionImage), turnType(turnType), angle(angle), elementAngles(elementAngles), exitNumber(exitNumber), offRampType(offRampType), onRampType(onRampType), forkType(forkType), keepType(keepType), linkedLaneGuidance(linkedLaneGuidance), cardBackgroundColor(cardBackgroundColor), id(id), travelEstimates(travelEstimates), trafficSide(trafficSide), maneuverType(maneuverType), roadName(roadName), highwayExitLabel(highwayExitLabel) {}
|
|
108
|
+
explicit NitroRoutingManeuver(std::vector<NitroAttributedString> attributedInstructionVariants, std::variant<GlyphImage, AssetImage, RemoteImage> symbolImage, std::optional<std::variant<GlyphImage, AssetImage, RemoteImage>> junctionImage, std::optional<TurnType> turnType, std::optional<double> angle, std::optional<std::vector<double>> elementAngles, std::optional<double> exitNumber, std::optional<OffRampType> offRampType, std::optional<OnRampType> onRampType, std::optional<ForkType> forkType, std::optional<KeepType> keepType, std::optional<LaneGuidance> linkedLaneGuidance, NitroColor cardBackgroundColor, std::string id, TravelEstimates travelEstimates, TrafficSide trafficSide, ManeuverType maneuverType, std::optional<std::vector<std::string>> roadName, std::optional<std::string> highwayExitLabel): attributedInstructionVariants(attributedInstructionVariants), symbolImage(symbolImage), junctionImage(junctionImage), turnType(turnType), angle(angle), elementAngles(elementAngles), exitNumber(exitNumber), offRampType(offRampType), onRampType(onRampType), forkType(forkType), keepType(keepType), linkedLaneGuidance(linkedLaneGuidance), cardBackgroundColor(cardBackgroundColor), id(id), travelEstimates(travelEstimates), trafficSide(trafficSide), maneuverType(maneuverType), roadName(roadName), highwayExitLabel(highwayExitLabel) {}
|
|
106
109
|
|
|
107
110
|
public:
|
|
108
111
|
// NitroRoutingManeuver is not equatable because these properties are not equatable: travelEstimates
|
|
@@ -119,8 +122,8 @@ namespace margelo::nitro {
|
|
|
119
122
|
jsi::Object obj = arg.asObject(runtime);
|
|
120
123
|
return margelo::nitro::swe::iternio::reactnativeautoplay::NitroRoutingManeuver(
|
|
121
124
|
JSIConverter<std::vector<margelo::nitro::swe::iternio::reactnativeautoplay::NitroAttributedString>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "attributedInstructionVariants"))),
|
|
122
|
-
JSIConverter<std::variant<margelo::nitro::swe::iternio::reactnativeautoplay::GlyphImage, margelo::nitro::swe::iternio::reactnativeautoplay::AssetImage>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "symbolImage"))),
|
|
123
|
-
JSIConverter<std::optional<std::variant<margelo::nitro::swe::iternio::reactnativeautoplay::GlyphImage, margelo::nitro::swe::iternio::reactnativeautoplay::AssetImage>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "junctionImage"))),
|
|
125
|
+
JSIConverter<std::variant<margelo::nitro::swe::iternio::reactnativeautoplay::GlyphImage, margelo::nitro::swe::iternio::reactnativeautoplay::AssetImage, margelo::nitro::swe::iternio::reactnativeautoplay::RemoteImage>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "symbolImage"))),
|
|
126
|
+
JSIConverter<std::optional<std::variant<margelo::nitro::swe::iternio::reactnativeautoplay::GlyphImage, margelo::nitro::swe::iternio::reactnativeautoplay::AssetImage, margelo::nitro::swe::iternio::reactnativeautoplay::RemoteImage>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "junctionImage"))),
|
|
124
127
|
JSIConverter<std::optional<margelo::nitro::swe::iternio::reactnativeautoplay::TurnType>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "turnType"))),
|
|
125
128
|
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "angle"))),
|
|
126
129
|
JSIConverter<std::optional<std::vector<double>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "elementAngles"))),
|
|
@@ -142,8 +145,8 @@ namespace margelo::nitro {
|
|
|
142
145
|
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::swe::iternio::reactnativeautoplay::NitroRoutingManeuver& arg) {
|
|
143
146
|
jsi::Object obj(runtime);
|
|
144
147
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "attributedInstructionVariants"), JSIConverter<std::vector<margelo::nitro::swe::iternio::reactnativeautoplay::NitroAttributedString>>::toJSI(runtime, arg.attributedInstructionVariants));
|
|
145
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "symbolImage"), JSIConverter<std::variant<margelo::nitro::swe::iternio::reactnativeautoplay::GlyphImage, margelo::nitro::swe::iternio::reactnativeautoplay::AssetImage>>::toJSI(runtime, arg.symbolImage));
|
|
146
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "junctionImage"), JSIConverter<std::optional<std::variant<margelo::nitro::swe::iternio::reactnativeautoplay::GlyphImage, margelo::nitro::swe::iternio::reactnativeautoplay::AssetImage>>>::toJSI(runtime, arg.junctionImage));
|
|
148
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "symbolImage"), JSIConverter<std::variant<margelo::nitro::swe::iternio::reactnativeautoplay::GlyphImage, margelo::nitro::swe::iternio::reactnativeautoplay::AssetImage, margelo::nitro::swe::iternio::reactnativeautoplay::RemoteImage>>::toJSI(runtime, arg.symbolImage));
|
|
149
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "junctionImage"), JSIConverter<std::optional<std::variant<margelo::nitro::swe::iternio::reactnativeautoplay::GlyphImage, margelo::nitro::swe::iternio::reactnativeautoplay::AssetImage, margelo::nitro::swe::iternio::reactnativeautoplay::RemoteImage>>>::toJSI(runtime, arg.junctionImage));
|
|
147
150
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "turnType"), JSIConverter<std::optional<margelo::nitro::swe::iternio::reactnativeautoplay::TurnType>>::toJSI(runtime, arg.turnType));
|
|
148
151
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "angle"), JSIConverter<std::optional<double>>::toJSI(runtime, arg.angle));
|
|
149
152
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "elementAngles"), JSIConverter<std::optional<std::vector<double>>>::toJSI(runtime, arg.elementAngles));
|
|
@@ -171,8 +174,8 @@ namespace margelo::nitro {
|
|
|
171
174
|
return false;
|
|
172
175
|
}
|
|
173
176
|
if (!JSIConverter<std::vector<margelo::nitro::swe::iternio::reactnativeautoplay::NitroAttributedString>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "attributedInstructionVariants")))) return false;
|
|
174
|
-
if (!JSIConverter<std::variant<margelo::nitro::swe::iternio::reactnativeautoplay::GlyphImage, margelo::nitro::swe::iternio::reactnativeautoplay::AssetImage>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "symbolImage")))) return false;
|
|
175
|
-
if (!JSIConverter<std::optional<std::variant<margelo::nitro::swe::iternio::reactnativeautoplay::GlyphImage, margelo::nitro::swe::iternio::reactnativeautoplay::AssetImage>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "junctionImage")))) return false;
|
|
177
|
+
if (!JSIConverter<std::variant<margelo::nitro::swe::iternio::reactnativeautoplay::GlyphImage, margelo::nitro::swe::iternio::reactnativeautoplay::AssetImage, margelo::nitro::swe::iternio::reactnativeautoplay::RemoteImage>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "symbolImage")))) return false;
|
|
178
|
+
if (!JSIConverter<std::optional<std::variant<margelo::nitro::swe::iternio::reactnativeautoplay::GlyphImage, margelo::nitro::swe::iternio::reactnativeautoplay::AssetImage, margelo::nitro::swe::iternio::reactnativeautoplay::RemoteImage>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "junctionImage")))) return false;
|
|
176
179
|
if (!JSIConverter<std::optional<margelo::nitro::swe::iternio::reactnativeautoplay::TurnType>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "turnType")))) return false;
|
|
177
180
|
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "angle")))) return false;
|
|
178
181
|
if (!JSIConverter<std::optional<std::vector<double>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "elementAngles")))) return false;
|
|
@@ -34,11 +34,14 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct AutoText; }
|
|
|
34
34
|
namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct GlyphImage; }
|
|
35
35
|
// Forward declaration of `AssetImage` to properly resolve imports.
|
|
36
36
|
namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct AssetImage; }
|
|
37
|
+
// Forward declaration of `RemoteImage` to properly resolve imports.
|
|
38
|
+
namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct RemoteImage; }
|
|
37
39
|
|
|
38
40
|
#include "AutoText.hpp"
|
|
39
41
|
#include <optional>
|
|
40
42
|
#include "GlyphImage.hpp"
|
|
41
43
|
#include "AssetImage.hpp"
|
|
44
|
+
#include "RemoteImage.hpp"
|
|
42
45
|
#include <variant>
|
|
43
46
|
#include <functional>
|
|
44
47
|
|
|
@@ -53,14 +56,14 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
|
53
56
|
std::optional<AutoText> detailedText SWIFT_PRIVATE;
|
|
54
57
|
std::optional<bool> browsable SWIFT_PRIVATE;
|
|
55
58
|
bool enabled SWIFT_PRIVATE;
|
|
56
|
-
std::optional<std::variant<GlyphImage, AssetImage>> image SWIFT_PRIVATE;
|
|
59
|
+
std::optional<std::variant<GlyphImage, AssetImage, RemoteImage>> image SWIFT_PRIVATE;
|
|
57
60
|
std::optional<bool> checked SWIFT_PRIVATE;
|
|
58
61
|
std::optional<std::function<void(std::optional<bool> /* checked */)>> onPress SWIFT_PRIVATE;
|
|
59
62
|
std::optional<bool> selected SWIFT_PRIVATE;
|
|
60
63
|
|
|
61
64
|
public:
|
|
62
65
|
NitroRow() = default;
|
|
63
|
-
explicit NitroRow(AutoText title, std::optional<AutoText> detailedText, std::optional<bool> browsable, bool enabled, std::optional<std::variant<GlyphImage, AssetImage>> image, std::optional<bool> checked, std::optional<std::function<void(std::optional<bool> /* checked */)>> onPress, std::optional<bool> selected): title(title), detailedText(detailedText), browsable(browsable), enabled(enabled), image(image), checked(checked), onPress(onPress), selected(selected) {}
|
|
66
|
+
explicit NitroRow(AutoText title, std::optional<AutoText> detailedText, std::optional<bool> browsable, bool enabled, std::optional<std::variant<GlyphImage, AssetImage, RemoteImage>> image, std::optional<bool> checked, std::optional<std::function<void(std::optional<bool> /* checked */)>> onPress, std::optional<bool> selected): title(title), detailedText(detailedText), browsable(browsable), enabled(enabled), image(image), checked(checked), onPress(onPress), selected(selected) {}
|
|
64
67
|
|
|
65
68
|
public:
|
|
66
69
|
// NitroRow is not equatable because these properties are not equatable: onPress
|
|
@@ -80,7 +83,7 @@ namespace margelo::nitro {
|
|
|
80
83
|
JSIConverter<std::optional<margelo::nitro::swe::iternio::reactnativeautoplay::AutoText>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "detailedText"))),
|
|
81
84
|
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "browsable"))),
|
|
82
85
|
JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "enabled"))),
|
|
83
|
-
JSIConverter<std::optional<std::variant<margelo::nitro::swe::iternio::reactnativeautoplay::GlyphImage, margelo::nitro::swe::iternio::reactnativeautoplay::AssetImage>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "image"))),
|
|
86
|
+
JSIConverter<std::optional<std::variant<margelo::nitro::swe::iternio::reactnativeautoplay::GlyphImage, margelo::nitro::swe::iternio::reactnativeautoplay::AssetImage, margelo::nitro::swe::iternio::reactnativeautoplay::RemoteImage>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "image"))),
|
|
84
87
|
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "checked"))),
|
|
85
88
|
JSIConverter<std::optional<std::function<void(std::optional<bool>)>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "onPress"))),
|
|
86
89
|
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "selected")))
|
|
@@ -92,7 +95,7 @@ namespace margelo::nitro {
|
|
|
92
95
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "detailedText"), JSIConverter<std::optional<margelo::nitro::swe::iternio::reactnativeautoplay::AutoText>>::toJSI(runtime, arg.detailedText));
|
|
93
96
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "browsable"), JSIConverter<std::optional<bool>>::toJSI(runtime, arg.browsable));
|
|
94
97
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "enabled"), JSIConverter<bool>::toJSI(runtime, arg.enabled));
|
|
95
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "image"), JSIConverter<std::optional<std::variant<margelo::nitro::swe::iternio::reactnativeautoplay::GlyphImage, margelo::nitro::swe::iternio::reactnativeautoplay::AssetImage>>>::toJSI(runtime, arg.image));
|
|
98
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "image"), JSIConverter<std::optional<std::variant<margelo::nitro::swe::iternio::reactnativeautoplay::GlyphImage, margelo::nitro::swe::iternio::reactnativeautoplay::AssetImage, margelo::nitro::swe::iternio::reactnativeautoplay::RemoteImage>>>::toJSI(runtime, arg.image));
|
|
96
99
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "checked"), JSIConverter<std::optional<bool>>::toJSI(runtime, arg.checked));
|
|
97
100
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "onPress"), JSIConverter<std::optional<std::function<void(std::optional<bool>)>>>::toJSI(runtime, arg.onPress));
|
|
98
101
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "selected"), JSIConverter<std::optional<bool>>::toJSI(runtime, arg.selected));
|
|
@@ -110,7 +113,7 @@ namespace margelo::nitro {
|
|
|
110
113
|
if (!JSIConverter<std::optional<margelo::nitro::swe::iternio::reactnativeautoplay::AutoText>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "detailedText")))) return false;
|
|
111
114
|
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "browsable")))) return false;
|
|
112
115
|
if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "enabled")))) return false;
|
|
113
|
-
if (!JSIConverter<std::optional<std::variant<margelo::nitro::swe::iternio::reactnativeautoplay::GlyphImage, margelo::nitro::swe::iternio::reactnativeautoplay::AssetImage>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "image")))) return false;
|
|
116
|
+
if (!JSIConverter<std::optional<std::variant<margelo::nitro::swe::iternio::reactnativeautoplay::GlyphImage, margelo::nitro::swe::iternio::reactnativeautoplay::AssetImage, margelo::nitro::swe::iternio::reactnativeautoplay::RemoteImage>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "image")))) return false;
|
|
114
117
|
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "checked")))) return false;
|
|
115
118
|
if (!JSIConverter<std::optional<std::function<void(std::optional<bool>)>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "onPress")))) return false;
|
|
116
119
|
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "selected")))) return false;
|
|
@@ -32,9 +32,12 @@
|
|
|
32
32
|
namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct GlyphImage; }
|
|
33
33
|
// Forward declaration of `AssetImage` to properly resolve imports.
|
|
34
34
|
namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct AssetImage; }
|
|
35
|
+
// Forward declaration of `RemoteImage` to properly resolve imports.
|
|
36
|
+
namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct RemoteImage; }
|
|
35
37
|
|
|
36
38
|
#include "GlyphImage.hpp"
|
|
37
39
|
#include "AssetImage.hpp"
|
|
40
|
+
#include "RemoteImage.hpp"
|
|
38
41
|
#include <variant>
|
|
39
42
|
#include <vector>
|
|
40
43
|
|
|
@@ -45,14 +48,14 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
|
45
48
|
*/
|
|
46
49
|
struct PreferredImageLane final {
|
|
47
50
|
public:
|
|
48
|
-
std::variant<GlyphImage, AssetImage> image SWIFT_PRIVATE;
|
|
51
|
+
std::variant<GlyphImage, AssetImage, RemoteImage> image SWIFT_PRIVATE;
|
|
49
52
|
double highlightedAngle SWIFT_PRIVATE;
|
|
50
53
|
bool isPreferred SWIFT_PRIVATE;
|
|
51
54
|
std::vector<double> angles SWIFT_PRIVATE;
|
|
52
55
|
|
|
53
56
|
public:
|
|
54
57
|
PreferredImageLane() = default;
|
|
55
|
-
explicit PreferredImageLane(std::variant<GlyphImage, AssetImage> image, double highlightedAngle, bool isPreferred, std::vector<double> angles): image(image), highlightedAngle(highlightedAngle), isPreferred(isPreferred), angles(angles) {}
|
|
58
|
+
explicit PreferredImageLane(std::variant<GlyphImage, AssetImage, RemoteImage> image, double highlightedAngle, bool isPreferred, std::vector<double> angles): image(image), highlightedAngle(highlightedAngle), isPreferred(isPreferred), angles(angles) {}
|
|
56
59
|
|
|
57
60
|
public:
|
|
58
61
|
friend bool operator==(const PreferredImageLane& lhs, const PreferredImageLane& rhs) = default;
|
|
@@ -68,7 +71,7 @@ namespace margelo::nitro {
|
|
|
68
71
|
static inline margelo::nitro::swe::iternio::reactnativeautoplay::PreferredImageLane fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
69
72
|
jsi::Object obj = arg.asObject(runtime);
|
|
70
73
|
return margelo::nitro::swe::iternio::reactnativeautoplay::PreferredImageLane(
|
|
71
|
-
JSIConverter<std::variant<margelo::nitro::swe::iternio::reactnativeautoplay::GlyphImage, margelo::nitro::swe::iternio::reactnativeautoplay::AssetImage>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "image"))),
|
|
74
|
+
JSIConverter<std::variant<margelo::nitro::swe::iternio::reactnativeautoplay::GlyphImage, margelo::nitro::swe::iternio::reactnativeautoplay::AssetImage, margelo::nitro::swe::iternio::reactnativeautoplay::RemoteImage>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "image"))),
|
|
72
75
|
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "highlightedAngle"))),
|
|
73
76
|
JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "isPreferred"))),
|
|
74
77
|
JSIConverter<std::vector<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "angles")))
|
|
@@ -76,7 +79,7 @@ namespace margelo::nitro {
|
|
|
76
79
|
}
|
|
77
80
|
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::swe::iternio::reactnativeautoplay::PreferredImageLane& arg) {
|
|
78
81
|
jsi::Object obj(runtime);
|
|
79
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "image"), JSIConverter<std::variant<margelo::nitro::swe::iternio::reactnativeautoplay::GlyphImage, margelo::nitro::swe::iternio::reactnativeautoplay::AssetImage>>::toJSI(runtime, arg.image));
|
|
82
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "image"), JSIConverter<std::variant<margelo::nitro::swe::iternio::reactnativeautoplay::GlyphImage, margelo::nitro::swe::iternio::reactnativeautoplay::AssetImage, margelo::nitro::swe::iternio::reactnativeautoplay::RemoteImage>>::toJSI(runtime, arg.image));
|
|
80
83
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "highlightedAngle"), JSIConverter<double>::toJSI(runtime, arg.highlightedAngle));
|
|
81
84
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "isPreferred"), JSIConverter<bool>::toJSI(runtime, arg.isPreferred));
|
|
82
85
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "angles"), JSIConverter<std::vector<double>>::toJSI(runtime, arg.angles));
|
|
@@ -90,7 +93,7 @@ namespace margelo::nitro {
|
|
|
90
93
|
if (!nitro::isPlainObject(runtime, obj)) {
|
|
91
94
|
return false;
|
|
92
95
|
}
|
|
93
|
-
if (!JSIConverter<std::variant<margelo::nitro::swe::iternio::reactnativeautoplay::GlyphImage, margelo::nitro::swe::iternio::reactnativeautoplay::AssetImage>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "image")))) return false;
|
|
96
|
+
if (!JSIConverter<std::variant<margelo::nitro::swe::iternio::reactnativeautoplay::GlyphImage, margelo::nitro::swe::iternio::reactnativeautoplay::AssetImage, margelo::nitro::swe::iternio::reactnativeautoplay::RemoteImage>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "image")))) return false;
|
|
94
97
|
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "highlightedAngle")))) return false;
|
|
95
98
|
if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "isPreferred")))) return false;
|
|
96
99
|
if (!JSIConverter<std::vector<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "angles")))) return false;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// RemoteImage.hpp
|
|
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
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
#if __has_include(<NitroModules/JSIHelpers.hpp>)
|
|
21
|
+
#include <NitroModules/JSIHelpers.hpp>
|
|
22
|
+
#else
|
|
23
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
|
+
#endif
|
|
25
|
+
#if __has_include(<NitroModules/PropNameIDCache.hpp>)
|
|
26
|
+
#include <NitroModules/PropNameIDCache.hpp>
|
|
27
|
+
#else
|
|
28
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
29
|
+
#endif
|
|
30
|
+
|
|
31
|
+
// Forward declaration of `NitroColor` to properly resolve imports.
|
|
32
|
+
namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct NitroColor; }
|
|
33
|
+
|
|
34
|
+
#include <string>
|
|
35
|
+
#include "NitroColor.hpp"
|
|
36
|
+
#include <optional>
|
|
37
|
+
|
|
38
|
+
namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* A struct which can be represented as a JavaScript object (RemoteImage).
|
|
42
|
+
*/
|
|
43
|
+
struct RemoteImage final {
|
|
44
|
+
public:
|
|
45
|
+
std::string uri SWIFT_PRIVATE;
|
|
46
|
+
std::optional<NitroColor> color SWIFT_PRIVATE;
|
|
47
|
+
std::optional<double> timeoutMs SWIFT_PRIVATE;
|
|
48
|
+
|
|
49
|
+
public:
|
|
50
|
+
RemoteImage() = default;
|
|
51
|
+
explicit RemoteImage(std::string uri, std::optional<NitroColor> color, std::optional<double> timeoutMs): uri(uri), color(color), timeoutMs(timeoutMs) {}
|
|
52
|
+
|
|
53
|
+
public:
|
|
54
|
+
friend bool operator==(const RemoteImage& lhs, const RemoteImage& rhs) = default;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
} // namespace margelo::nitro::swe::iternio::reactnativeautoplay
|
|
58
|
+
|
|
59
|
+
namespace margelo::nitro {
|
|
60
|
+
|
|
61
|
+
// C++ RemoteImage <> JS RemoteImage (object)
|
|
62
|
+
template <>
|
|
63
|
+
struct JSIConverter<margelo::nitro::swe::iternio::reactnativeautoplay::RemoteImage> final {
|
|
64
|
+
static inline margelo::nitro::swe::iternio::reactnativeautoplay::RemoteImage fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
65
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
66
|
+
return margelo::nitro::swe::iternio::reactnativeautoplay::RemoteImage(
|
|
67
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "uri"))),
|
|
68
|
+
JSIConverter<std::optional<margelo::nitro::swe::iternio::reactnativeautoplay::NitroColor>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "color"))),
|
|
69
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "timeoutMs")))
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::swe::iternio::reactnativeautoplay::RemoteImage& arg) {
|
|
73
|
+
jsi::Object obj(runtime);
|
|
74
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "uri"), JSIConverter<std::string>::toJSI(runtime, arg.uri));
|
|
75
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "color"), JSIConverter<std::optional<margelo::nitro::swe::iternio::reactnativeautoplay::NitroColor>>::toJSI(runtime, arg.color));
|
|
76
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "timeoutMs"), JSIConverter<std::optional<double>>::toJSI(runtime, arg.timeoutMs));
|
|
77
|
+
return obj;
|
|
78
|
+
}
|
|
79
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
80
|
+
if (!value.isObject()) {
|
|
81
|
+
return false;
|
|
82
|
+
}
|
|
83
|
+
jsi::Object obj = value.getObject(runtime);
|
|
84
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
85
|
+
return false;
|
|
86
|
+
}
|
|
87
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "uri")))) return false;
|
|
88
|
+
if (!JSIConverter<std::optional<margelo::nitro::swe::iternio::reactnativeautoplay::NitroColor>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "color")))) return false;
|
|
89
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "timeoutMs")))) return false;
|
|
90
|
+
return true;
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
} // namespace margelo::nitro
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iternio/react-native-auto-play",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.13",
|
|
4
4
|
"description": "Android Auto and Apple CarPlay for react-native",
|
|
5
5
|
"main": "lib/index",
|
|
6
6
|
"module": "lib/index",
|
|
@@ -34,9 +34,8 @@
|
|
|
34
34
|
"lint": "biome check src",
|
|
35
35
|
"lint-ci": "biome ci src --reporter=summary",
|
|
36
36
|
"typescript": "tsc",
|
|
37
|
-
"generate:fonts": "node ./assets/symbolFont/bundleAsset.js",
|
|
38
37
|
"specs": "nitrogen --logLevel=\"debug\"",
|
|
39
|
-
"prepare": "yarn circular && tsc && nitrogen
|
|
38
|
+
"prepare": "yarn circular && tsc && nitrogen",
|
|
40
39
|
"swift:format": "swift-format format ./ios --in-place --recursive",
|
|
41
40
|
"circular": "dpdm ./src/* --circular --exit-code circular:1 --no-tree --warning=false --transform"
|
|
42
41
|
},
|
package/src/index.ts
CHANGED
|
@@ -34,7 +34,8 @@ export interface AutoPlay extends HybridObject<{ android: 'kotlin'; ios: 'swift'
|
|
|
34
34
|
): CleanupCallback;
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
|
-
* Adds a listener for voice input events
|
|
37
|
+
* Adds a listener for voice input events fired by the OS (Android Auto only).
|
|
38
|
+
* On iOS this is a no-op — use startVoiceInput instead.
|
|
38
39
|
* @param callback the callback to receive the voice input
|
|
39
40
|
* @returns callback to remove the listener
|
|
40
41
|
* @namespace Android
|
|
@@ -43,6 +44,43 @@ export interface AutoPlay extends HybridObject<{ android: 'kotlin'; ios: 'swift'
|
|
|
43
44
|
callback: (coordinates: Location | undefined, query: string | undefined) => void
|
|
44
45
|
): CleanupCallback;
|
|
45
46
|
|
|
47
|
+
/**
|
|
48
|
+
* Returns true if microphone permission has already been granted.
|
|
49
|
+
*/
|
|
50
|
+
hasVoiceInputPermission(): boolean;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Request microphone permission from the user.
|
|
54
|
+
* On Android: uses the car context when Android Auto is connected, otherwise
|
|
55
|
+
* falls back to the React Native application context.
|
|
56
|
+
* On iOS: uses AVAudioApplication (iOS 17+) or AVAudioSession (iOS 15–16).
|
|
57
|
+
* Returns true if permission was granted, false if denied.
|
|
58
|
+
*/
|
|
59
|
+
requestVoiceInputPermission(): Promise<boolean>;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Start an in-app voice recording session.
|
|
63
|
+
* On Android: acquires audio focus and captures via CarAudioRecord when
|
|
64
|
+
* Android Auto is connected, otherwise uses standard AudioRecord.
|
|
65
|
+
* On iOS: presents CPVoiceControlTemplate (when a car is connected) and
|
|
66
|
+
* captures audio via AVAudioEngine.
|
|
67
|
+
* Resolves with the complete raw PCM buffer (16 kHz, 16-bit, mono) when
|
|
68
|
+
* silence is detected, the max duration is reached, or stopVoiceInput() is called.
|
|
69
|
+
* Rejects if microphone permission has not been granted or recording fails to start.
|
|
70
|
+
*/
|
|
71
|
+
startVoiceInput(
|
|
72
|
+
silenceThresholdMs?: number,
|
|
73
|
+
maxDurationMs?: number,
|
|
74
|
+
listeningText?: string
|
|
75
|
+
): Promise<ArrayBuffer>;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Stop the active voice recording session early. Causes the Promise returned
|
|
79
|
+
* by startVoiceInput() to resolve with the audio captured so far.
|
|
80
|
+
* No-op if no recording is in progress.
|
|
81
|
+
*/
|
|
82
|
+
stopVoiceInput(): void;
|
|
83
|
+
|
|
46
84
|
/**
|
|
47
85
|
* sets the specified template as root template, initializes a new stack
|
|
48
86
|
* Promise might contain an error message in case setting root template failed
|
|
@@ -159,7 +159,10 @@ export type MapTemplateConfig = Omit<
|
|
|
159
159
|
onAutoDriveEnabled?: (template: MapTemplate) => void;
|
|
160
160
|
|
|
161
161
|
/**
|
|
162
|
-
*
|
|
162
|
+
* Use this to set the default maneuver background color on iOS.
|
|
163
|
+
* Only used when starting navigation and not providing any maneuvers yet,
|
|
164
|
+
* visible on the system provided loading maneuver then.
|
|
165
|
+
* @namespace iOS
|
|
163
166
|
*/
|
|
164
167
|
defaultGuidanceBackgroundColor?: ThemedColor | string;
|
|
165
168
|
};
|