@iternio/react-native-auto-play 0.3.11 → 0.3.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +60 -2
- 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 -1
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/template/Parser.kt +108 -38
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/utils/BitmapCache.kt +14 -0
- 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/VoiceInputManager.swift +233 -0
- package/lib/specs/AutoPlay.nitro.d.ts +31 -1
- package/lib/types/Image.d.ts +13 -0
- package/lib/utils/NitroImage.d.ts +6 -1
- package/lib/utils/NitroImage.js +7 -0
- package/nitrogen/generated/android/ReactNativeAutoPlay+autolinking.cmake +1 -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 +19 -2
- 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 +2 -0
- 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 +3 -0
- 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/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++/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 +1 -1
- package/src/specs/AutoPlay.nitro.ts +39 -1
- package/src/types/Image.ts +14 -0
- package/src/utils/NitroImage.ts +15 -1
- package/nitrogen/generated/android/c++/JVariant_GlyphImage_AssetImage.cpp +0 -26
- package/nitrogen/generated/android/c++/JVariant_GlyphImage_AssetImage.hpp +0 -75
|
@@ -18,21 +18,23 @@ public extension NitroNavigationAlert {
|
|
|
18
18
|
/**
|
|
19
19
|
* Create a new instance of `NitroNavigationAlert`.
|
|
20
20
|
*/
|
|
21
|
-
init(id: Double, title: AutoText, subtitle: AutoText?, image:
|
|
21
|
+
init(id: Double, title: AutoText, subtitle: AutoText?, image: Variant_GlyphImage_AssetImage_RemoteImage?, primaryAction: NavigationAlertAction, secondaryAction: NavigationAlertAction?, durationMs: Double, onWillShow: (() -> Void)?, onDidDismiss: ((_ reason: AlertDismissalReason) -> Void)?, priority: Double) {
|
|
22
22
|
self.init(id, title, { () -> bridge.std__optional_AutoText_ in
|
|
23
23
|
if let __unwrappedValue = subtitle {
|
|
24
24
|
return bridge.create_std__optional_AutoText_(__unwrappedValue)
|
|
25
25
|
} else {
|
|
26
26
|
return .init()
|
|
27
27
|
}
|
|
28
|
-
}(), { () -> bridge.
|
|
28
|
+
}(), { () -> bridge.std__optional_std__variant_GlyphImage__AssetImage__RemoteImage__ in
|
|
29
29
|
if let __unwrappedValue = image {
|
|
30
|
-
return bridge.
|
|
30
|
+
return bridge.create_std__optional_std__variant_GlyphImage__AssetImage__RemoteImage__({ () -> bridge.std__variant_GlyphImage__AssetImage__RemoteImage_ in
|
|
31
31
|
switch __unwrappedValue {
|
|
32
32
|
case .first(let __value):
|
|
33
|
-
return bridge.
|
|
33
|
+
return bridge.create_std__variant_GlyphImage__AssetImage__RemoteImage_(__value)
|
|
34
34
|
case .second(let __value):
|
|
35
|
-
return bridge.
|
|
35
|
+
return bridge.create_std__variant_GlyphImage__AssetImage__RemoteImage_(__value)
|
|
36
|
+
case .third(let __value):
|
|
37
|
+
return bridge.create_std__variant_GlyphImage__AssetImage__RemoteImage_(__value)
|
|
36
38
|
}
|
|
37
39
|
}().variant)
|
|
38
40
|
} else {
|
|
@@ -81,12 +83,12 @@ public extension NitroNavigationAlert {
|
|
|
81
83
|
}
|
|
82
84
|
|
|
83
85
|
@inline(__always)
|
|
84
|
-
var image:
|
|
85
|
-
return { () ->
|
|
86
|
-
if bridge.
|
|
87
|
-
let __unwrapped = bridge.
|
|
88
|
-
return { () ->
|
|
89
|
-
let __variant = bridge.
|
|
86
|
+
var image: Variant_GlyphImage_AssetImage_RemoteImage? {
|
|
87
|
+
return { () -> Variant_GlyphImage_AssetImage_RemoteImage? in
|
|
88
|
+
if bridge.has_value_std__optional_std__variant_GlyphImage__AssetImage__RemoteImage__(self.__image) {
|
|
89
|
+
let __unwrapped = bridge.get_std__optional_std__variant_GlyphImage__AssetImage__RemoteImage__(self.__image)
|
|
90
|
+
return { () -> Variant_GlyphImage_AssetImage_RemoteImage in
|
|
91
|
+
let __variant = bridge.std__variant_GlyphImage__AssetImage__RemoteImage_(__unwrapped)
|
|
90
92
|
switch __variant.index() {
|
|
91
93
|
case 0:
|
|
92
94
|
let __actual = __variant.get_0()
|
|
@@ -94,6 +96,9 @@ public extension NitroNavigationAlert {
|
|
|
94
96
|
case 1:
|
|
95
97
|
let __actual = __variant.get_1()
|
|
96
98
|
return .second(__actual)
|
|
99
|
+
case 2:
|
|
100
|
+
let __actual = __variant.get_2()
|
|
101
|
+
return .third(__actual)
|
|
97
102
|
default:
|
|
98
103
|
fatalError("Variant can never have index \(__variant.index())!")
|
|
99
104
|
}
|
|
@@ -18,28 +18,32 @@ public extension NitroRoutingManeuver {
|
|
|
18
18
|
/**
|
|
19
19
|
* Create a new instance of `NitroRoutingManeuver`.
|
|
20
20
|
*/
|
|
21
|
-
init(attributedInstructionVariants: [NitroAttributedString], symbolImage: NitroImage, junctionImage:
|
|
21
|
+
init(attributedInstructionVariants: [NitroAttributedString], symbolImage: NitroImage, junctionImage: Variant_GlyphImage_AssetImage_RemoteImage?, turnType: TurnType?, angle: Double?, elementAngles: [Double]?, exitNumber: Double?, offRampType: OffRampType?, onRampType: OnRampType?, forkType: ForkType?, keepType: KeepType?, linkedLaneGuidance: LaneGuidance?, cardBackgroundColor: NitroColor, id: String, travelEstimates: TravelEstimates, trafficSide: TrafficSide, maneuverType: ManeuverType, roadName: [String]?, highwayExitLabel: String?) {
|
|
22
22
|
self.init({ () -> bridge.std__vector_NitroAttributedString_ in
|
|
23
23
|
var __vector = bridge.create_std__vector_NitroAttributedString_(attributedInstructionVariants.count)
|
|
24
24
|
for __item in attributedInstructionVariants {
|
|
25
25
|
__vector.push_back(__item)
|
|
26
26
|
}
|
|
27
27
|
return __vector
|
|
28
|
-
}(), { () -> bridge.
|
|
28
|
+
}(), { () -> bridge.std__variant_GlyphImage__AssetImage__RemoteImage_ in
|
|
29
29
|
switch symbolImage {
|
|
30
30
|
case .first(let __value):
|
|
31
|
-
return bridge.
|
|
31
|
+
return bridge.create_std__variant_GlyphImage__AssetImage__RemoteImage_(__value)
|
|
32
32
|
case .second(let __value):
|
|
33
|
-
return bridge.
|
|
33
|
+
return bridge.create_std__variant_GlyphImage__AssetImage__RemoteImage_(__value)
|
|
34
|
+
case .third(let __value):
|
|
35
|
+
return bridge.create_std__variant_GlyphImage__AssetImage__RemoteImage_(__value)
|
|
34
36
|
}
|
|
35
|
-
}().variant, { () -> bridge.
|
|
37
|
+
}().variant, { () -> bridge.std__optional_std__variant_GlyphImage__AssetImage__RemoteImage__ in
|
|
36
38
|
if let __unwrappedValue = junctionImage {
|
|
37
|
-
return bridge.
|
|
39
|
+
return bridge.create_std__optional_std__variant_GlyphImage__AssetImage__RemoteImage__({ () -> bridge.std__variant_GlyphImage__AssetImage__RemoteImage_ in
|
|
38
40
|
switch __unwrappedValue {
|
|
39
41
|
case .first(let __value):
|
|
40
|
-
return bridge.
|
|
42
|
+
return bridge.create_std__variant_GlyphImage__AssetImage__RemoteImage_(__value)
|
|
41
43
|
case .second(let __value):
|
|
42
|
-
return bridge.
|
|
44
|
+
return bridge.create_std__variant_GlyphImage__AssetImage__RemoteImage_(__value)
|
|
45
|
+
case .third(let __value):
|
|
46
|
+
return bridge.create_std__variant_GlyphImage__AssetImage__RemoteImage_(__value)
|
|
43
47
|
}
|
|
44
48
|
}().variant)
|
|
45
49
|
} else {
|
|
@@ -134,7 +138,7 @@ public extension NitroRoutingManeuver {
|
|
|
134
138
|
@inline(__always)
|
|
135
139
|
var symbolImage: NitroImage {
|
|
136
140
|
return { () -> NitroImage in
|
|
137
|
-
let __variant = bridge.
|
|
141
|
+
let __variant = bridge.std__variant_GlyphImage__AssetImage__RemoteImage_(self.__symbolImage)
|
|
138
142
|
switch __variant.index() {
|
|
139
143
|
case 0:
|
|
140
144
|
let __actual = __variant.get_0()
|
|
@@ -142,6 +146,9 @@ public extension NitroRoutingManeuver {
|
|
|
142
146
|
case 1:
|
|
143
147
|
let __actual = __variant.get_1()
|
|
144
148
|
return .second(__actual)
|
|
149
|
+
case 2:
|
|
150
|
+
let __actual = __variant.get_2()
|
|
151
|
+
return .third(__actual)
|
|
145
152
|
default:
|
|
146
153
|
fatalError("Variant can never have index \(__variant.index())!")
|
|
147
154
|
}
|
|
@@ -149,12 +156,12 @@ public extension NitroRoutingManeuver {
|
|
|
149
156
|
}
|
|
150
157
|
|
|
151
158
|
@inline(__always)
|
|
152
|
-
var junctionImage:
|
|
153
|
-
return { () ->
|
|
154
|
-
if bridge.
|
|
155
|
-
let __unwrapped = bridge.
|
|
156
|
-
return { () ->
|
|
157
|
-
let __variant = bridge.
|
|
159
|
+
var junctionImage: Variant_GlyphImage_AssetImage_RemoteImage? {
|
|
160
|
+
return { () -> Variant_GlyphImage_AssetImage_RemoteImage? in
|
|
161
|
+
if bridge.has_value_std__optional_std__variant_GlyphImage__AssetImage__RemoteImage__(self.__junctionImage) {
|
|
162
|
+
let __unwrapped = bridge.get_std__optional_std__variant_GlyphImage__AssetImage__RemoteImage__(self.__junctionImage)
|
|
163
|
+
return { () -> Variant_GlyphImage_AssetImage_RemoteImage in
|
|
164
|
+
let __variant = bridge.std__variant_GlyphImage__AssetImage__RemoteImage_(__unwrapped)
|
|
158
165
|
switch __variant.index() {
|
|
159
166
|
case 0:
|
|
160
167
|
let __actual = __variant.get_0()
|
|
@@ -162,6 +169,9 @@ public extension NitroRoutingManeuver {
|
|
|
162
169
|
case 1:
|
|
163
170
|
let __actual = __variant.get_1()
|
|
164
171
|
return .second(__actual)
|
|
172
|
+
case 2:
|
|
173
|
+
let __actual = __variant.get_2()
|
|
174
|
+
return .third(__actual)
|
|
165
175
|
default:
|
|
166
176
|
fatalError("Variant can never have index \(__variant.index())!")
|
|
167
177
|
}
|
|
@@ -18,7 +18,7 @@ public extension NitroRow {
|
|
|
18
18
|
/**
|
|
19
19
|
* Create a new instance of `NitroRow`.
|
|
20
20
|
*/
|
|
21
|
-
init(title: AutoText, detailedText: AutoText?, browsable: Bool?, enabled: Bool, image:
|
|
21
|
+
init(title: AutoText, detailedText: AutoText?, browsable: Bool?, enabled: Bool, image: Variant_GlyphImage_AssetImage_RemoteImage?, checked: Bool?, onPress: ((_ checked: Bool?) -> Void)?, selected: Bool?) {
|
|
22
22
|
self.init(title, { () -> bridge.std__optional_AutoText_ in
|
|
23
23
|
if let __unwrappedValue = detailedText {
|
|
24
24
|
return bridge.create_std__optional_AutoText_(__unwrappedValue)
|
|
@@ -31,14 +31,16 @@ public extension NitroRow {
|
|
|
31
31
|
} else {
|
|
32
32
|
return .init()
|
|
33
33
|
}
|
|
34
|
-
}(), enabled, { () -> bridge.
|
|
34
|
+
}(), enabled, { () -> bridge.std__optional_std__variant_GlyphImage__AssetImage__RemoteImage__ in
|
|
35
35
|
if let __unwrappedValue = image {
|
|
36
|
-
return bridge.
|
|
36
|
+
return bridge.create_std__optional_std__variant_GlyphImage__AssetImage__RemoteImage__({ () -> bridge.std__variant_GlyphImage__AssetImage__RemoteImage_ in
|
|
37
37
|
switch __unwrappedValue {
|
|
38
38
|
case .first(let __value):
|
|
39
|
-
return bridge.
|
|
39
|
+
return bridge.create_std__variant_GlyphImage__AssetImage__RemoteImage_(__value)
|
|
40
40
|
case .second(let __value):
|
|
41
|
-
return bridge.
|
|
41
|
+
return bridge.create_std__variant_GlyphImage__AssetImage__RemoteImage_(__value)
|
|
42
|
+
case .third(let __value):
|
|
43
|
+
return bridge.create_std__variant_GlyphImage__AssetImage__RemoteImage_(__value)
|
|
42
44
|
}
|
|
43
45
|
}().variant)
|
|
44
46
|
} else {
|
|
@@ -96,12 +98,12 @@ public extension NitroRow {
|
|
|
96
98
|
}
|
|
97
99
|
|
|
98
100
|
@inline(__always)
|
|
99
|
-
var image:
|
|
100
|
-
return { () ->
|
|
101
|
-
if bridge.
|
|
102
|
-
let __unwrapped = bridge.
|
|
103
|
-
return { () ->
|
|
104
|
-
let __variant = bridge.
|
|
101
|
+
var image: Variant_GlyphImage_AssetImage_RemoteImage? {
|
|
102
|
+
return { () -> Variant_GlyphImage_AssetImage_RemoteImage? in
|
|
103
|
+
if bridge.has_value_std__optional_std__variant_GlyphImage__AssetImage__RemoteImage__(self.__image) {
|
|
104
|
+
let __unwrapped = bridge.get_std__optional_std__variant_GlyphImage__AssetImage__RemoteImage__(self.__image)
|
|
105
|
+
return { () -> Variant_GlyphImage_AssetImage_RemoteImage in
|
|
106
|
+
let __variant = bridge.std__variant_GlyphImage__AssetImage__RemoteImage_(__unwrapped)
|
|
105
107
|
switch __variant.index() {
|
|
106
108
|
case 0:
|
|
107
109
|
let __actual = __variant.get_0()
|
|
@@ -109,6 +111,9 @@ public extension NitroRow {
|
|
|
109
111
|
case 1:
|
|
110
112
|
let __actual = __variant.get_1()
|
|
111
113
|
return .second(__actual)
|
|
114
|
+
case 2:
|
|
115
|
+
let __actual = __variant.get_2()
|
|
116
|
+
return .third(__actual)
|
|
112
117
|
default:
|
|
113
118
|
fatalError("Variant can never have index \(__variant.index())!")
|
|
114
119
|
}
|
|
@@ -19,12 +19,14 @@ public extension PreferredImageLane {
|
|
|
19
19
|
* Create a new instance of `PreferredImageLane`.
|
|
20
20
|
*/
|
|
21
21
|
init(image: NitroImage, highlightedAngle: Double, isPreferred: Bool, angles: [Double]) {
|
|
22
|
-
self.init({ () -> bridge.
|
|
22
|
+
self.init({ () -> bridge.std__variant_GlyphImage__AssetImage__RemoteImage_ in
|
|
23
23
|
switch image {
|
|
24
24
|
case .first(let __value):
|
|
25
|
-
return bridge.
|
|
25
|
+
return bridge.create_std__variant_GlyphImage__AssetImage__RemoteImage_(__value)
|
|
26
26
|
case .second(let __value):
|
|
27
|
-
return bridge.
|
|
27
|
+
return bridge.create_std__variant_GlyphImage__AssetImage__RemoteImage_(__value)
|
|
28
|
+
case .third(let __value):
|
|
29
|
+
return bridge.create_std__variant_GlyphImage__AssetImage__RemoteImage_(__value)
|
|
28
30
|
}
|
|
29
31
|
}().variant, highlightedAngle, isPreferred, { () -> bridge.std__vector_double_ in
|
|
30
32
|
var __vector = bridge.create_std__vector_double_(angles.count)
|
|
@@ -38,7 +40,7 @@ public extension PreferredImageLane {
|
|
|
38
40
|
@inline(__always)
|
|
39
41
|
var image: NitroImage {
|
|
40
42
|
return { () -> NitroImage in
|
|
41
|
-
let __variant = bridge.
|
|
43
|
+
let __variant = bridge.std__variant_GlyphImage__AssetImage__RemoteImage_(self.__image)
|
|
42
44
|
switch __variant.index() {
|
|
43
45
|
case 0:
|
|
44
46
|
let __actual = __variant.get_0()
|
|
@@ -46,6 +48,9 @@ public extension PreferredImageLane {
|
|
|
46
48
|
case 1:
|
|
47
49
|
let __actual = __variant.get_1()
|
|
48
50
|
return .second(__actual)
|
|
51
|
+
case 2:
|
|
52
|
+
let __actual = __variant.get_2()
|
|
53
|
+
return .third(__actual)
|
|
49
54
|
default:
|
|
50
55
|
fatalError("Variant can never have index \(__variant.index())!")
|
|
51
56
|
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// RemoteImage.swift
|
|
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
|
+
import NitroModules
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Represents an instance of `RemoteImage`, backed by a C++ struct.
|
|
12
|
+
*/
|
|
13
|
+
public typealias RemoteImage = margelo.nitro.swe.iternio.reactnativeautoplay.RemoteImage
|
|
14
|
+
|
|
15
|
+
public extension RemoteImage {
|
|
16
|
+
private typealias bridge = margelo.nitro.swe.iternio.reactnativeautoplay.bridge.swift
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Create a new instance of `RemoteImage`.
|
|
20
|
+
*/
|
|
21
|
+
init(uri: String, color: NitroColor?, timeoutMs: Double?) {
|
|
22
|
+
self.init(std.string(uri), { () -> bridge.std__optional_NitroColor_ in
|
|
23
|
+
if let __unwrappedValue = color {
|
|
24
|
+
return bridge.create_std__optional_NitroColor_(__unwrappedValue)
|
|
25
|
+
} else {
|
|
26
|
+
return .init()
|
|
27
|
+
}
|
|
28
|
+
}(), { () -> bridge.std__optional_double_ in
|
|
29
|
+
if let __unwrappedValue = timeoutMs {
|
|
30
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
31
|
+
} else {
|
|
32
|
+
return .init()
|
|
33
|
+
}
|
|
34
|
+
}())
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@inline(__always)
|
|
38
|
+
var uri: String {
|
|
39
|
+
return String(self.__uri)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@inline(__always)
|
|
43
|
+
var color: NitroColor? {
|
|
44
|
+
return self.__color.value
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@inline(__always)
|
|
48
|
+
var timeoutMs: Double? {
|
|
49
|
+
return { () -> Double? in
|
|
50
|
+
if bridge.has_value_std__optional_double_(self.__timeoutMs) {
|
|
51
|
+
let __unwrapped = bridge.get_std__optional_double_(self.__timeoutMs)
|
|
52
|
+
return __unwrapped
|
|
53
|
+
} else {
|
|
54
|
+
return nil
|
|
55
|
+
}
|
|
56
|
+
}()
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
///
|
|
2
|
-
///
|
|
2
|
+
/// Variant_GlyphImage_AssetImage_RemoteImage.swift
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
5
|
/// Copyright © Marc Rousavy @ Margelo
|
|
@@ -9,10 +9,11 @@
|
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* An Swift enum with associated values representing a Variant/Union type.
|
|
12
|
-
* JS type: `struct | struct`
|
|
12
|
+
* JS type: `struct | struct | struct`
|
|
13
13
|
*/
|
|
14
14
|
@frozen
|
|
15
|
-
public indirect enum
|
|
15
|
+
public indirect enum Variant_GlyphImage_AssetImage_RemoteImage {
|
|
16
16
|
case first(GlyphImage)
|
|
17
17
|
case second(AssetImage)
|
|
18
|
+
case third(RemoteImage)
|
|
18
19
|
}
|
|
@@ -17,6 +17,10 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
|
17
17
|
prototype.registerHybridMethod("addListener", &HybridAutoPlaySpec::addListener);
|
|
18
18
|
prototype.registerHybridMethod("addListenerRenderState", &HybridAutoPlaySpec::addListenerRenderState);
|
|
19
19
|
prototype.registerHybridMethod("addListenerVoiceInput", &HybridAutoPlaySpec::addListenerVoiceInput);
|
|
20
|
+
prototype.registerHybridMethod("hasVoiceInputPermission", &HybridAutoPlaySpec::hasVoiceInputPermission);
|
|
21
|
+
prototype.registerHybridMethod("requestVoiceInputPermission", &HybridAutoPlaySpec::requestVoiceInputPermission);
|
|
22
|
+
prototype.registerHybridMethod("startVoiceInput", &HybridAutoPlaySpec::startVoiceInput);
|
|
23
|
+
prototype.registerHybridMethod("stopVoiceInput", &HybridAutoPlaySpec::stopVoiceInput);
|
|
20
24
|
prototype.registerHybridMethod("setRootTemplate", &HybridAutoPlaySpec::setRootTemplate);
|
|
21
25
|
prototype.registerHybridMethod("pushTemplate", &HybridAutoPlaySpec::pushTemplate);
|
|
22
26
|
prototype.registerHybridMethod("popTemplate", &HybridAutoPlaySpec::popTemplate);
|
|
@@ -31,6 +31,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct NitroAction
|
|
|
31
31
|
#include "Location.hpp"
|
|
32
32
|
#include <optional>
|
|
33
33
|
#include <NitroModules/Promise.hpp>
|
|
34
|
+
#include <NitroModules/ArrayBuffer.hpp>
|
|
34
35
|
#include "SafeAreaInsets.hpp"
|
|
35
36
|
#include "NitroAction.hpp"
|
|
36
37
|
#include <vector>
|
|
@@ -69,6 +70,10 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
|
69
70
|
virtual std::function<void()> addListener(EventName eventType, const std::function<void()>& callback) = 0;
|
|
70
71
|
virtual std::function<void()> addListenerRenderState(const std::string& moduleName, const std::function<void(VisibilityState /* payload */)>& callback) = 0;
|
|
71
72
|
virtual std::function<void()> addListenerVoiceInput(const std::function<void(const std::optional<Location>& /* coordinates */, const std::optional<std::string>& /* query */)>& callback) = 0;
|
|
73
|
+
virtual bool hasVoiceInputPermission() = 0;
|
|
74
|
+
virtual std::shared_ptr<Promise<bool>> requestVoiceInputPermission() = 0;
|
|
75
|
+
virtual std::shared_ptr<Promise<std::shared_ptr<ArrayBuffer>>> startVoiceInput(std::optional<double> silenceThresholdMs, std::optional<double> maxDurationMs, const std::optional<std::string>& listeningText) = 0;
|
|
76
|
+
virtual void stopVoiceInput() = 0;
|
|
72
77
|
virtual std::shared_ptr<Promise<void>> setRootTemplate(const std::string& templateId) = 0;
|
|
73
78
|
virtual std::shared_ptr<Promise<void>> pushTemplate(const std::string& templateId) = 0;
|
|
74
79
|
virtual std::shared_ptr<Promise<void>> popTemplate(std::optional<bool> animate) = 0;
|
|
@@ -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,12 +48,12 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
|
45
48
|
*/
|
|
46
49
|
struct ImageLane final {
|
|
47
50
|
public:
|
|
48
|
-
std::variant<GlyphImage, AssetImage> image SWIFT_PRIVATE;
|
|
51
|
+
std::variant<GlyphImage, AssetImage, RemoteImage> image SWIFT_PRIVATE;
|
|
49
52
|
std::vector<double> angles SWIFT_PRIVATE;
|
|
50
53
|
|
|
51
54
|
public:
|
|
52
55
|
ImageLane() = default;
|
|
53
|
-
explicit ImageLane(std::variant<GlyphImage, AssetImage> image, std::vector<double> angles): image(image), angles(angles) {}
|
|
56
|
+
explicit ImageLane(std::variant<GlyphImage, AssetImage, RemoteImage> image, std::vector<double> angles): image(image), angles(angles) {}
|
|
54
57
|
|
|
55
58
|
public:
|
|
56
59
|
friend bool operator==(const ImageLane& lhs, const ImageLane& rhs) = default;
|
|
@@ -66,13 +69,13 @@ namespace margelo::nitro {
|
|
|
66
69
|
static inline margelo::nitro::swe::iternio::reactnativeautoplay::ImageLane fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
67
70
|
jsi::Object obj = arg.asObject(runtime);
|
|
68
71
|
return margelo::nitro::swe::iternio::reactnativeautoplay::ImageLane(
|
|
69
|
-
JSIConverter<std::variant<margelo::nitro::swe::iternio::reactnativeautoplay::GlyphImage, margelo::nitro::swe::iternio::reactnativeautoplay::AssetImage>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "image"))),
|
|
72
|
+
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"))),
|
|
70
73
|
JSIConverter<std::vector<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "angles")))
|
|
71
74
|
);
|
|
72
75
|
}
|
|
73
76
|
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::swe::iternio::reactnativeautoplay::ImageLane& arg) {
|
|
74
77
|
jsi::Object obj(runtime);
|
|
75
|
-
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));
|
|
78
|
+
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));
|
|
76
79
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "angles"), JSIConverter<std::vector<double>>::toJSI(runtime, arg.angles));
|
|
77
80
|
return obj;
|
|
78
81
|
}
|
|
@@ -84,7 +87,7 @@ namespace margelo::nitro {
|
|
|
84
87
|
if (!nitro::isPlainObject(runtime, obj)) {
|
|
85
88
|
return false;
|
|
86
89
|
}
|
|
87
|
-
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;
|
|
90
|
+
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;
|
|
88
91
|
if (!JSIConverter<std::vector<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "angles")))) return false;
|
|
89
92
|
return true;
|
|
90
93
|
}
|
|
@@ -36,6 +36,8 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct AutoText; }
|
|
|
36
36
|
namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct GlyphImage; }
|
|
37
37
|
// Forward declaration of `AssetImage` to properly resolve imports.
|
|
38
38
|
namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct AssetImage; }
|
|
39
|
+
// Forward declaration of `RemoteImage` to properly resolve imports.
|
|
40
|
+
namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct RemoteImage; }
|
|
39
41
|
// Forward declaration of `NitroBaseMapTemplateConfig` to properly resolve imports.
|
|
40
42
|
namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct NitroBaseMapTemplateConfig; }
|
|
41
43
|
|
|
@@ -47,6 +49,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct NitroBaseMa
|
|
|
47
49
|
#include "AutoText.hpp"
|
|
48
50
|
#include "GlyphImage.hpp"
|
|
49
51
|
#include "AssetImage.hpp"
|
|
52
|
+
#include "RemoteImage.hpp"
|
|
50
53
|
#include <variant>
|
|
51
54
|
#include "NitroBaseMapTemplateConfig.hpp"
|
|
52
55
|
|
|
@@ -68,12 +71,12 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
|
68
71
|
std::optional<AutoText> title SWIFT_PRIVATE;
|
|
69
72
|
AutoText message SWIFT_PRIVATE;
|
|
70
73
|
std::optional<std::vector<NitroAction>> actions SWIFT_PRIVATE;
|
|
71
|
-
std::optional<std::variant<GlyphImage, AssetImage>> image SWIFT_PRIVATE;
|
|
74
|
+
std::optional<std::variant<GlyphImage, AssetImage, RemoteImage>> image SWIFT_PRIVATE;
|
|
72
75
|
std::optional<NitroBaseMapTemplateConfig> mapConfig SWIFT_PRIVATE;
|
|
73
76
|
|
|
74
77
|
public:
|
|
75
78
|
MessageTemplateConfig() = default;
|
|
76
|
-
explicit MessageTemplateConfig(std::string id, std::optional<std::function<void(std::optional<bool> /* animated */)>> onWillAppear, std::optional<std::function<void(std::optional<bool> /* animated */)>> onWillDisappear, std::optional<std::function<void(std::optional<bool> /* animated */)>> onDidAppear, std::optional<std::function<void(std::optional<bool> /* animated */)>> onDidDisappear, std::optional<std::function<void()>> onPopped, std::optional<double> autoDismissMs, std::optional<std::vector<NitroAction>> headerActions, std::optional<AutoText> title, AutoText message, std::optional<std::vector<NitroAction>> actions, std::optional<std::variant<GlyphImage, AssetImage>> image, std::optional<NitroBaseMapTemplateConfig> mapConfig): id(id), onWillAppear(onWillAppear), onWillDisappear(onWillDisappear), onDidAppear(onDidAppear), onDidDisappear(onDidDisappear), onPopped(onPopped), autoDismissMs(autoDismissMs), headerActions(headerActions), title(title), message(message), actions(actions), image(image), mapConfig(mapConfig) {}
|
|
79
|
+
explicit MessageTemplateConfig(std::string id, std::optional<std::function<void(std::optional<bool> /* animated */)>> onWillAppear, std::optional<std::function<void(std::optional<bool> /* animated */)>> onWillDisappear, std::optional<std::function<void(std::optional<bool> /* animated */)>> onDidAppear, std::optional<std::function<void(std::optional<bool> /* animated */)>> onDidDisappear, std::optional<std::function<void()>> onPopped, std::optional<double> autoDismissMs, std::optional<std::vector<NitroAction>> headerActions, std::optional<AutoText> title, AutoText message, std::optional<std::vector<NitroAction>> actions, std::optional<std::variant<GlyphImage, AssetImage, RemoteImage>> image, std::optional<NitroBaseMapTemplateConfig> mapConfig): id(id), onWillAppear(onWillAppear), onWillDisappear(onWillDisappear), onDidAppear(onDidAppear), onDidDisappear(onDidDisappear), onPopped(onPopped), autoDismissMs(autoDismissMs), headerActions(headerActions), title(title), message(message), actions(actions), image(image), mapConfig(mapConfig) {}
|
|
77
80
|
|
|
78
81
|
public:
|
|
79
82
|
// MessageTemplateConfig is not equatable because these properties are not equatable: onWillAppear, onWillDisappear, onDidAppear, onDidDisappear, onPopped, headerActions, actions, mapConfig
|
|
@@ -100,7 +103,7 @@ namespace margelo::nitro {
|
|
|
100
103
|
JSIConverter<std::optional<margelo::nitro::swe::iternio::reactnativeautoplay::AutoText>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "title"))),
|
|
101
104
|
JSIConverter<margelo::nitro::swe::iternio::reactnativeautoplay::AutoText>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "message"))),
|
|
102
105
|
JSIConverter<std::optional<std::vector<margelo::nitro::swe::iternio::reactnativeautoplay::NitroAction>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "actions"))),
|
|
103
|
-
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"))),
|
|
106
|
+
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"))),
|
|
104
107
|
JSIConverter<std::optional<margelo::nitro::swe::iternio::reactnativeautoplay::NitroBaseMapTemplateConfig>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "mapConfig")))
|
|
105
108
|
);
|
|
106
109
|
}
|
|
@@ -117,7 +120,7 @@ namespace margelo::nitro {
|
|
|
117
120
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "title"), JSIConverter<std::optional<margelo::nitro::swe::iternio::reactnativeautoplay::AutoText>>::toJSI(runtime, arg.title));
|
|
118
121
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "message"), JSIConverter<margelo::nitro::swe::iternio::reactnativeautoplay::AutoText>::toJSI(runtime, arg.message));
|
|
119
122
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "actions"), JSIConverter<std::optional<std::vector<margelo::nitro::swe::iternio::reactnativeautoplay::NitroAction>>>::toJSI(runtime, arg.actions));
|
|
120
|
-
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));
|
|
123
|
+
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));
|
|
121
124
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "mapConfig"), JSIConverter<std::optional<margelo::nitro::swe::iternio::reactnativeautoplay::NitroBaseMapTemplateConfig>>::toJSI(runtime, arg.mapConfig));
|
|
122
125
|
return obj;
|
|
123
126
|
}
|
|
@@ -140,7 +143,7 @@ namespace margelo::nitro {
|
|
|
140
143
|
if (!JSIConverter<std::optional<margelo::nitro::swe::iternio::reactnativeautoplay::AutoText>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "title")))) return false;
|
|
141
144
|
if (!JSIConverter<margelo::nitro::swe::iternio::reactnativeautoplay::AutoText>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "message")))) return false;
|
|
142
145
|
if (!JSIConverter<std::optional<std::vector<margelo::nitro::swe::iternio::reactnativeautoplay::NitroAction>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "actions")))) return false;
|
|
143
|
-
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;
|
|
146
|
+
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;
|
|
144
147
|
if (!JSIConverter<std::optional<margelo::nitro::swe::iternio::reactnativeautoplay::NitroBaseMapTemplateConfig>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "mapConfig")))) return false;
|
|
145
148
|
return true;
|
|
146
149
|
}
|
|
@@ -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 `NitroActionType` to properly resolve imports.
|
|
36
38
|
namespace margelo::nitro::swe::iternio::reactnativeautoplay { enum class NitroActionType; }
|
|
37
39
|
// Forward declaration of `NitroAlignment` to properly resolve imports.
|
|
@@ -43,6 +45,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay { enum class NitroBu
|
|
|
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 <functional>
|
|
48
51
|
#include "NitroActionType.hpp"
|
|
@@ -57,7 +60,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
|
57
60
|
struct NitroAction final {
|
|
58
61
|
public:
|
|
59
62
|
std::optional<std::string> title SWIFT_PRIVATE;
|
|
60
|
-
std::optional<std::variant<GlyphImage, AssetImage>> image SWIFT_PRIVATE;
|
|
63
|
+
std::optional<std::variant<GlyphImage, AssetImage, RemoteImage>> image SWIFT_PRIVATE;
|
|
61
64
|
std::optional<bool> enabled SWIFT_PRIVATE;
|
|
62
65
|
std::function<void()> onPress SWIFT_PRIVATE;
|
|
63
66
|
NitroActionType type SWIFT_PRIVATE;
|
|
@@ -67,7 +70,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
|
67
70
|
|
|
68
71
|
public:
|
|
69
72
|
NitroAction() = default;
|
|
70
|
-
explicit NitroAction(std::optional<std::string> title, std::optional<std::variant<GlyphImage, AssetImage>> image, std::optional<bool> enabled, std::function<void()> onPress, NitroActionType type, std::optional<NitroAlignment> alignment, std::optional<double> flags, std::optional<NitroButtonStyle> style): title(title), image(image), enabled(enabled), onPress(onPress), type(type), alignment(alignment), flags(flags), style(style) {}
|
|
73
|
+
explicit NitroAction(std::optional<std::string> title, std::optional<std::variant<GlyphImage, AssetImage, RemoteImage>> image, std::optional<bool> enabled, std::function<void()> onPress, NitroActionType type, std::optional<NitroAlignment> alignment, std::optional<double> flags, std::optional<NitroButtonStyle> style): title(title), image(image), enabled(enabled), onPress(onPress), type(type), alignment(alignment), flags(flags), style(style) {}
|
|
71
74
|
|
|
72
75
|
public:
|
|
73
76
|
// NitroAction is not equatable because these properties are not equatable: onPress
|
|
@@ -84,7 +87,7 @@ namespace margelo::nitro {
|
|
|
84
87
|
jsi::Object obj = arg.asObject(runtime);
|
|
85
88
|
return margelo::nitro::swe::iternio::reactnativeautoplay::NitroAction(
|
|
86
89
|
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "title"))),
|
|
87
|
-
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"))),
|
|
90
|
+
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"))),
|
|
88
91
|
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "enabled"))),
|
|
89
92
|
JSIConverter<std::function<void()>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "onPress"))),
|
|
90
93
|
JSIConverter<margelo::nitro::swe::iternio::reactnativeautoplay::NitroActionType>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "type"))),
|
|
@@ -96,7 +99,7 @@ namespace margelo::nitro {
|
|
|
96
99
|
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::swe::iternio::reactnativeautoplay::NitroAction& arg) {
|
|
97
100
|
jsi::Object obj(runtime);
|
|
98
101
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "title"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.title));
|
|
99
|
-
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));
|
|
102
|
+
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));
|
|
100
103
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "enabled"), JSIConverter<std::optional<bool>>::toJSI(runtime, arg.enabled));
|
|
101
104
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "onPress"), JSIConverter<std::function<void()>>::toJSI(runtime, arg.onPress));
|
|
102
105
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "type"), JSIConverter<margelo::nitro::swe::iternio::reactnativeautoplay::NitroActionType>::toJSI(runtime, arg.type));
|
|
@@ -114,7 +117,7 @@ namespace margelo::nitro {
|
|
|
114
117
|
return false;
|
|
115
118
|
}
|
|
116
119
|
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "title")))) return false;
|
|
117
|
-
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;
|
|
120
|
+
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;
|
|
118
121
|
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "enabled")))) return false;
|
|
119
122
|
if (!JSIConverter<std::function<void()>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "onPress")))) return false;
|
|
120
123
|
if (!JSIConverter<margelo::nitro::swe::iternio::reactnativeautoplay::NitroActionType>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "type")))) 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
|
|
|
40
43
|
namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
@@ -44,12 +47,12 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
|
44
47
|
*/
|
|
45
48
|
struct NitroAttributedStringImage final {
|
|
46
49
|
public:
|
|
47
|
-
std::variant<GlyphImage, AssetImage> image SWIFT_PRIVATE;
|
|
50
|
+
std::variant<GlyphImage, AssetImage, RemoteImage> image SWIFT_PRIVATE;
|
|
48
51
|
double position SWIFT_PRIVATE;
|
|
49
52
|
|
|
50
53
|
public:
|
|
51
54
|
NitroAttributedStringImage() = default;
|
|
52
|
-
explicit NitroAttributedStringImage(std::variant<GlyphImage, AssetImage> image, double position): image(image), position(position) {}
|
|
55
|
+
explicit NitroAttributedStringImage(std::variant<GlyphImage, AssetImage, RemoteImage> image, double position): image(image), position(position) {}
|
|
53
56
|
|
|
54
57
|
public:
|
|
55
58
|
friend bool operator==(const NitroAttributedStringImage& lhs, const NitroAttributedStringImage& rhs) = default;
|
|
@@ -65,13 +68,13 @@ namespace margelo::nitro {
|
|
|
65
68
|
static inline margelo::nitro::swe::iternio::reactnativeautoplay::NitroAttributedStringImage fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
66
69
|
jsi::Object obj = arg.asObject(runtime);
|
|
67
70
|
return margelo::nitro::swe::iternio::reactnativeautoplay::NitroAttributedStringImage(
|
|
68
|
-
JSIConverter<std::variant<margelo::nitro::swe::iternio::reactnativeautoplay::GlyphImage, margelo::nitro::swe::iternio::reactnativeautoplay::AssetImage>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "image"))),
|
|
71
|
+
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"))),
|
|
69
72
|
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "position")))
|
|
70
73
|
);
|
|
71
74
|
}
|
|
72
75
|
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::swe::iternio::reactnativeautoplay::NitroAttributedStringImage& arg) {
|
|
73
76
|
jsi::Object obj(runtime);
|
|
74
|
-
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));
|
|
77
|
+
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));
|
|
75
78
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "position"), JSIConverter<double>::toJSI(runtime, arg.position));
|
|
76
79
|
return obj;
|
|
77
80
|
}
|
|
@@ -83,7 +86,7 @@ namespace margelo::nitro {
|
|
|
83
86
|
if (!nitro::isPlainObject(runtime, obj)) {
|
|
84
87
|
return false;
|
|
85
88
|
}
|
|
86
|
-
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;
|
|
89
|
+
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;
|
|
87
90
|
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "position")))) return false;
|
|
88
91
|
return true;
|
|
89
92
|
}
|