@iternio/react-native-auto-play 0.5.14-beta.1 → 0.6.1
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 +270 -36
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/AndroidAutoSession.kt +5 -0
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridMapTemplate.kt +9 -2
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/NativeBackdrop.kt +40 -0
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/VirtualRenderer.kt +52 -0
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/template/GridTemplate.kt +47 -13
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/template/Parser.kt +69 -15
- package/ios/Types.swift +3 -0
- package/ios/extensions/UIImage+Toggle.swift +5 -2
- package/ios/hybrid/HybridAutoPlay.swift +28 -16
- package/ios/hybrid/HybridMapTemplate.swift +22 -5
- package/ios/scenes/AutoPlayInterfaceController.swift +261 -72
- package/ios/templates/AutoPlayMapPanelDelegate.swift +190 -0
- package/ios/templates/AutoPlayTemplate.swift +24 -2
- package/ios/templates/GridTemplate.swift +57 -57
- package/ios/templates/InformationTemplate.swift +84 -9
- package/ios/templates/ListTemplate.swift +66 -11
- package/ios/templates/MapTemplate.swift +83 -68
- package/ios/templates/MessageTemplate.swift +72 -6
- package/ios/templates/Parser.swift +564 -69
- package/ios/templates/SearchTemplate.swift +1 -1
- package/ios/templates/TemplateStore.swift +5 -15
- package/ios/utils/SymbolFont.swift +13 -28
- package/jest.js +2 -0
- package/lib/Constants.d.ts +4 -0
- package/lib/Constants.js +6 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/index.web.d.ts +73 -0
- package/lib/index.web.js +72 -1
- package/lib/specs/MapTemplate.nitro.d.ts +3 -1
- package/lib/templates/GridTemplate.d.ts +23 -3
- package/lib/templates/GridTemplate.js +8 -0
- package/lib/templates/InformationTemplate.d.ts +38 -12
- package/lib/templates/ListTemplate.d.ts +16 -47
- package/lib/templates/MapTemplate.d.ts +26 -2
- package/lib/templates/MapTemplate.js +16 -2
- package/lib/templates/MessageTemplate.d.ts +52 -11
- package/lib/templates/MessageTemplate.js +1 -1
- package/lib/types/Image.d.ts +6 -1
- package/lib/utils/NitroColor.d.ts +1 -0
- package/lib/utils/NitroColor.js +8 -0
- package/lib/utils/NitroImage.js +1 -1
- package/lib/utils/NitroManeuver.js +1 -3
- package/lib/utils/NitroOptionsPanel.d.ts +103 -0
- package/lib/utils/NitroOptionsPanel.js +63 -0
- package/lib/utils/NitroSection.d.ts +89 -2
- package/lib/utils/NitroSection.js +49 -2
- package/lib-cjs/AutoPlayHeadlessJsTask.js +16 -0
- package/lib-cjs/Constants.js +9 -0
- package/lib-cjs/components/MapTemplateContext.js +10 -0
- package/lib-cjs/components/SafeAreaInsetsContext.js +21 -0
- package/lib-cjs/components/SafeAreaView.js +22 -0
- package/lib-cjs/components/WindowInformationWrapper.js +20 -0
- package/lib-cjs/hooks/useAndroidAutoTelemetry.js +115 -0
- package/lib-cjs/hooks/useFocusedEffect.js +35 -0
- package/lib-cjs/hooks/useMapTemplate.js +13 -0
- package/lib-cjs/hooks/useSafeAreaInsets.js +9 -0
- package/lib-cjs/hooks/useVoiceInput.js +42 -0
- package/lib-cjs/hybrid/HybridAndroidAutoTelemetry.js +4 -0
- package/lib-cjs/hybrid/HybridAndroidWindowInformation.js +4 -0
- package/lib-cjs/hybrid/HybridAutoPlay.js +5 -0
- package/lib-cjs/hybrid/HybridVoice.js +61 -0
- package/lib-cjs/index.js +76 -0
- package/lib-cjs/index.web.js +98 -0
- package/lib-cjs/scenes/AutoPlayCluster.js +140 -0
- package/lib-cjs/scenes/CarPlayDashboardScene.js +100 -0
- package/lib-cjs/specs/AndroidAutoTelemetry.nitro.js +2 -0
- package/lib-cjs/specs/AndroidAutomotive.nitro.js +16 -0
- package/lib-cjs/specs/AndroidWindowInformation.nitro.js +2 -0
- package/lib-cjs/specs/AutoPlay.nitro.js +2 -0
- package/lib-cjs/specs/CarPlayDashboard.nitro.js +2 -0
- package/lib-cjs/specs/Cluster.nitro.js +2 -0
- package/lib-cjs/specs/GridTemplate.nitro.js +2 -0
- package/lib-cjs/specs/InformationTemplate.nitro.js +2 -0
- package/lib-cjs/specs/ListTemplate.nitro.js +2 -0
- package/lib-cjs/specs/MapTemplate.nitro.js +2 -0
- package/lib-cjs/specs/MessageTemplate.nitro.js +2 -0
- package/lib-cjs/specs/SearchTemplate.nitro.js +2 -0
- package/lib-cjs/specs/SignInTemplate.nitro.js +2 -0
- package/lib-cjs/specs/Voice.nitro.js +2 -0
- package/lib-cjs/templates/GridTemplate.js +41 -0
- package/lib-cjs/templates/InformationTemplate.js +49 -0
- package/lib-cjs/templates/ListTemplate.js +33 -0
- package/lib-cjs/templates/MapTemplate.js +168 -0
- package/lib-cjs/templates/MessageTemplate.js +50 -0
- package/lib-cjs/templates/SearchTemplate.js +32 -0
- package/lib-cjs/templates/SignInTemplate.js +55 -0
- package/lib-cjs/templates/Template.js +40 -0
- package/lib-cjs/types/Button.js +12 -0
- package/lib-cjs/types/Event.js +2 -0
- package/lib-cjs/types/Image.js +2 -0
- package/lib-cjs/types/Maneuver.js +77 -0
- package/lib-cjs/types/RootComponent.js +2 -0
- package/lib-cjs/types/SignInMethod.js +22 -0
- package/lib-cjs/types/Telemetry.js +24 -0
- package/lib-cjs/types/Text.js +8 -0
- package/lib-cjs/types/Trip.js +2 -0
- package/lib-cjs/types/Voice.js +2 -0
- package/lib-cjs/utils/ErrorUtil.js +34 -0
- package/lib-cjs/utils/NitroAction.js +129 -0
- package/lib-cjs/utils/NitroAlert.js +19 -0
- package/lib-cjs/utils/NitroAttributedString.js +14 -0
- package/lib-cjs/utils/NitroColor.js +32 -0
- package/lib-cjs/utils/NitroGrid.js +12 -0
- package/lib-cjs/utils/NitroImage.js +97 -0
- package/lib-cjs/utils/NitroManeuver.js +79 -0
- package/lib-cjs/utils/NitroMapButton.js +33 -0
- package/lib-cjs/utils/NitroOptionsPanel.js +66 -0
- package/lib-cjs/utils/NitroSection.js +112 -0
- package/nitrogen/generated/android/ReactNativeAutoPlay+autolinking.cmake +1 -0
- package/nitrogen/generated/android/c++/JChargingConnector.hpp +79 -0
- package/nitrogen/generated/android/c++/JGridImageSize.hpp +64 -0
- package/nitrogen/generated/android/c++/JGridTemplateConfig.hpp +7 -1
- package/nitrogen/generated/android/c++/JHybridGridTemplateSpec.cpp +4 -0
- package/nitrogen/generated/android/c++/JHybridInformationTemplateSpec.cpp +12 -0
- package/nitrogen/generated/android/c++/JHybridListTemplateSpec.cpp +12 -0
- package/nitrogen/generated/android/c++/JHybridMapTemplateSpec.cpp +78 -3
- package/nitrogen/generated/android/c++/JHybridMapTemplateSpec.hpp +2 -1
- package/nitrogen/generated/android/c++/JHybridSearchTemplateSpec.cpp +12 -0
- package/nitrogen/generated/android/c++/JInformationTemplateConfig.hpp +6 -0
- package/nitrogen/generated/android/c++/JListImageType.hpp +67 -0
- package/nitrogen/generated/android/c++/JListTemplateConfig.hpp +6 -0
- package/nitrogen/generated/android/c++/JNitroChargerLocation.hpp +115 -0
- package/nitrogen/generated/android/c++/JNitroChargerOutlet.hpp +82 -0
- package/nitrogen/generated/android/c++/JNitroColor.hpp +8 -4
- package/nitrogen/generated/android/c++/JNitroOptionsPanelChargerSection.hpp +112 -0
- package/nitrogen/generated/android/c++/JNitroOptionsPanelConfig.hpp +157 -0
- package/nitrogen/generated/android/c++/JNitroOptionsPanelGridSection.hpp +102 -0
- package/nitrogen/generated/android/c++/JNitroOptionsPanelSection.cpp +30 -0
- package/nitrogen/generated/android/c++/JNitroOptionsPanelSection.hpp +129 -0
- package/nitrogen/generated/android/c++/JNitroRow.hpp +33 -3
- package/nitrogen/generated/android/c++/JNitroSection.hpp +6 -0
- package/nitrogen/generated/android/c++/JSearchTemplateConfig.hpp +6 -0
- package/nitrogen/generated/android/c++/JWaypointCoordinate.hpp +65 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/ChargingConnector.kt +30 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/GridImageSize.kt +25 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/GridTemplateConfig.kt +9 -4
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridMapTemplateSpec.kt +5 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/ListImageType.kt +26 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/NitroChargerLocation.kt +90 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/NitroChargerOutlet.kt +70 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/NitroColor.kt +9 -4
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/NitroOptionsPanelChargerSection.kt +61 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/NitroOptionsPanelConfig.kt +61 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/NitroOptionsPanelGridSection.kt +56 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/NitroOptionsPanelSection.kt +75 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/NitroRow.kt +36 -6
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/WaypointCoordinate.kt +61 -0
- package/nitrogen/generated/ios/ReactNativeAutoPlay-Swift-Cxx-Bridge.hpp +174 -0
- package/nitrogen/generated/ios/ReactNativeAutoPlay-Swift-Cxx-Umbrella.hpp +27 -0
- package/nitrogen/generated/ios/c++/HybridGridTemplateSpecSwift.hpp +3 -0
- package/nitrogen/generated/ios/c++/HybridInformationTemplateSpecSwift.hpp +9 -0
- package/nitrogen/generated/ios/c++/HybridListTemplateSpecSwift.hpp +9 -0
- package/nitrogen/generated/ios/c++/HybridMapTemplateSpecSwift.hpp +47 -1
- package/nitrogen/generated/ios/c++/HybridSearchTemplateSpecSwift.hpp +9 -0
- package/nitrogen/generated/ios/swift/ChargingConnector.swift +68 -0
- package/nitrogen/generated/ios/swift/GridImageSize.swift +48 -0
- package/nitrogen/generated/ios/swift/GridTemplateConfig.swift +12 -1
- package/nitrogen/generated/ios/swift/HybridMapTemplateSpec.swift +2 -1
- package/nitrogen/generated/ios/swift/HybridMapTemplateSpec_cxx.swift +31 -4
- package/nitrogen/generated/ios/swift/ListImageType.swift +52 -0
- package/nitrogen/generated/ios/swift/NitroChargerLocation.swift +161 -0
- package/nitrogen/generated/ios/swift/NitroChargerOutlet.swift +65 -0
- package/nitrogen/generated/ios/swift/NitroColor.swift +20 -2
- package/nitrogen/generated/ios/swift/NitroOptionsPanelChargerSection.swift +64 -0
- package/nitrogen/generated/ios/swift/NitroOptionsPanelConfig.swift +94 -0
- package/nitrogen/generated/ios/swift/NitroOptionsPanelGridSection.swift +53 -0
- package/nitrogen/generated/ios/swift/NitroOptionsPanelSection.swift +32 -0
- package/nitrogen/generated/ios/swift/NitroRow.swift +81 -1
- package/nitrogen/generated/ios/swift/WaypointCoordinate.swift +52 -0
- package/nitrogen/generated/shared/c++/ChargingConnector.hpp +104 -0
- package/nitrogen/generated/shared/c++/GridImageSize.hpp +84 -0
- package/nitrogen/generated/shared/c++/GridTemplateConfig.hpp +8 -1
- package/nitrogen/generated/shared/c++/HybridMapTemplateSpec.cpp +1 -0
- package/nitrogen/generated/shared/c++/HybridMapTemplateSpec.hpp +5 -1
- package/nitrogen/generated/shared/c++/ListImageType.hpp +88 -0
- package/nitrogen/generated/shared/c++/NitroChargerLocation.hpp +131 -0
- package/nitrogen/generated/shared/c++/NitroChargerOutlet.hpp +98 -0
- package/nitrogen/generated/shared/c++/NitroColor.hpp +7 -3
- package/nitrogen/generated/shared/c++/NitroOptionsPanelChargerSection.hpp +98 -0
- package/nitrogen/generated/shared/c++/NitroOptionsPanelConfig.hpp +107 -0
- package/nitrogen/generated/shared/c++/NitroOptionsPanelGridSection.hpp +91 -0
- package/nitrogen/generated/shared/c++/NitroRow.hpp +39 -2
- package/nitrogen/generated/shared/c++/WaypointCoordinate.hpp +91 -0
- package/package.json +7 -3
- package/src/Constants.ts +9 -0
- package/src/index.ts +1 -0
- package/src/index.web.ts +166 -0
- package/src/specs/MapTemplate.nitro.ts +3 -1
- package/src/templates/GridTemplate.ts +38 -3
- package/src/templates/InformationTemplate.ts +60 -29
- package/src/templates/ListTemplate.ts +27 -55
- package/src/templates/MapTemplate.ts +60 -2
- package/src/templates/MessageTemplate.ts +71 -24
- package/src/types/Image.ts +6 -1
- package/src/utils/NitroColor.ts +10 -1
- package/src/utils/NitroImage.ts +1 -5
- package/src/utils/NitroManeuver.ts +1 -4
- package/src/utils/NitroOptionsPanel.ts +218 -0
- package/src/utils/NitroSection.ts +160 -5
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NitroOptionsPanelGridSection.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 `NitroOptionsPanelGridSection`, backed by a C++ struct.
|
|
12
|
+
*/
|
|
13
|
+
public typealias NitroOptionsPanelGridSection = margelo.nitro.swe.iternio.reactnativeautoplay.NitroOptionsPanelGridSection
|
|
14
|
+
|
|
15
|
+
public extension NitroOptionsPanelGridSection {
|
|
16
|
+
private typealias bridge = margelo.nitro.swe.iternio.reactnativeautoplay.bridge.swift
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Create a new instance of `NitroOptionsPanelGridSection`.
|
|
20
|
+
*/
|
|
21
|
+
init(title: String?, buttons: [NitroGridButton]) {
|
|
22
|
+
self.init({ () -> bridge.std__optional_std__string_ in
|
|
23
|
+
if let __unwrappedValue = title {
|
|
24
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
25
|
+
} else {
|
|
26
|
+
return .init()
|
|
27
|
+
}
|
|
28
|
+
}(), { () -> bridge.std__vector_NitroGridButton_ in
|
|
29
|
+
var __vector = bridge.create_std__vector_NitroGridButton_(buttons.count)
|
|
30
|
+
for __item in buttons {
|
|
31
|
+
__vector.push_back(__item)
|
|
32
|
+
}
|
|
33
|
+
return __vector
|
|
34
|
+
}())
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@inline(__always)
|
|
38
|
+
var title: String? {
|
|
39
|
+
return { () -> String? in
|
|
40
|
+
if bridge.has_value_std__optional_std__string_(self.__title) {
|
|
41
|
+
let __unwrapped = bridge.get_std__optional_std__string_(self.__title)
|
|
42
|
+
return String(__unwrapped)
|
|
43
|
+
} else {
|
|
44
|
+
return nil
|
|
45
|
+
}
|
|
46
|
+
}()
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
@inline(__always)
|
|
50
|
+
var buttons: [NitroGridButton] {
|
|
51
|
+
return self.__buttons.map({ __item in __item })
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NitroOptionsPanelSection.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
|
+
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* An Swift enum with associated values representing a Variant/Union type.
|
|
12
|
+
* JS type: `struct | struct | struct`
|
|
13
|
+
*/
|
|
14
|
+
@frozen
|
|
15
|
+
public indirect enum NitroOptionsPanelSection {
|
|
16
|
+
case first(NitroSection)
|
|
17
|
+
case second(NitroOptionsPanelGridSection)
|
|
18
|
+
case third(NitroOptionsPanelChargerSection)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
public extension NitroOptionsPanelSection {
|
|
22
|
+
func asType<T>(_ type: T.Type = T.self) -> T? {
|
|
23
|
+
switch self {
|
|
24
|
+
case .first(let value): return value as? T
|
|
25
|
+
case .second(let value): return value as? T
|
|
26
|
+
case .third(let value): return value as? T
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
func isType<T>(_ type: T.Type = T.self) -> Bool {
|
|
30
|
+
return self.asType(type) != nil
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -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: Variant_GlyphImage_AssetImage_RemoteImage?, checked: Bool?, onPress: ((_ checked: Bool?) -> Void)?, selected: Bool?) {
|
|
21
|
+
init(title: AutoText, detailedText: AutoText?, browsable: Bool?, enabled: Bool, image: Variant_GlyphImage_AssetImage_RemoteImage?, imageType: ListImageType?, checked: Bool?, onPress: ((_ checked: Bool?) -> Void)?, selected: Bool?, coordinate: WaypointCoordinate?, distance: Distance?, duration: DurationWithTimeZone?, travelEstimatesVisible: Bool?, address: String?) {
|
|
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)
|
|
@@ -46,6 +46,12 @@ public extension NitroRow {
|
|
|
46
46
|
} else {
|
|
47
47
|
return .init()
|
|
48
48
|
}
|
|
49
|
+
}(), { () -> bridge.std__optional_ListImageType_ in
|
|
50
|
+
if let __unwrappedValue = imageType {
|
|
51
|
+
return bridge.create_std__optional_ListImageType_(__unwrappedValue)
|
|
52
|
+
} else {
|
|
53
|
+
return .init()
|
|
54
|
+
}
|
|
49
55
|
}(), { () -> bridge.std__optional_bool_ in
|
|
50
56
|
if let __unwrappedValue = checked {
|
|
51
57
|
return bridge.create_std__optional_bool_(__unwrappedValue)
|
|
@@ -67,6 +73,36 @@ public extension NitroRow {
|
|
|
67
73
|
} else {
|
|
68
74
|
return .init()
|
|
69
75
|
}
|
|
76
|
+
}(), { () -> bridge.std__optional_WaypointCoordinate_ in
|
|
77
|
+
if let __unwrappedValue = coordinate {
|
|
78
|
+
return bridge.create_std__optional_WaypointCoordinate_(__unwrappedValue)
|
|
79
|
+
} else {
|
|
80
|
+
return .init()
|
|
81
|
+
}
|
|
82
|
+
}(), { () -> bridge.std__optional_Distance_ in
|
|
83
|
+
if let __unwrappedValue = distance {
|
|
84
|
+
return bridge.create_std__optional_Distance_(__unwrappedValue)
|
|
85
|
+
} else {
|
|
86
|
+
return .init()
|
|
87
|
+
}
|
|
88
|
+
}(), { () -> bridge.std__optional_DurationWithTimeZone_ in
|
|
89
|
+
if let __unwrappedValue = duration {
|
|
90
|
+
return bridge.create_std__optional_DurationWithTimeZone_(__unwrappedValue)
|
|
91
|
+
} else {
|
|
92
|
+
return .init()
|
|
93
|
+
}
|
|
94
|
+
}(), { () -> bridge.std__optional_bool_ in
|
|
95
|
+
if let __unwrappedValue = travelEstimatesVisible {
|
|
96
|
+
return bridge.create_std__optional_bool_(__unwrappedValue)
|
|
97
|
+
} else {
|
|
98
|
+
return .init()
|
|
99
|
+
}
|
|
100
|
+
}(), { () -> bridge.std__optional_std__string_ in
|
|
101
|
+
if let __unwrappedValue = address {
|
|
102
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
103
|
+
} else {
|
|
104
|
+
return .init()
|
|
105
|
+
}
|
|
70
106
|
}())
|
|
71
107
|
}
|
|
72
108
|
|
|
@@ -124,6 +160,11 @@ public extension NitroRow {
|
|
|
124
160
|
}()
|
|
125
161
|
}
|
|
126
162
|
|
|
163
|
+
@inline(__always)
|
|
164
|
+
var imageType: ListImageType? {
|
|
165
|
+
return self.__imageType.value
|
|
166
|
+
}
|
|
167
|
+
|
|
127
168
|
@inline(__always)
|
|
128
169
|
var checked: Bool? {
|
|
129
170
|
return { () -> Bool? in
|
|
@@ -170,4 +211,43 @@ public extension NitroRow {
|
|
|
170
211
|
}
|
|
171
212
|
}()
|
|
172
213
|
}
|
|
214
|
+
|
|
215
|
+
@inline(__always)
|
|
216
|
+
var coordinate: WaypointCoordinate? {
|
|
217
|
+
return self.__coordinate.value
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
@inline(__always)
|
|
221
|
+
var distance: Distance? {
|
|
222
|
+
return self.__distance.value
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
@inline(__always)
|
|
226
|
+
var duration: DurationWithTimeZone? {
|
|
227
|
+
return self.__duration.value
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
@inline(__always)
|
|
231
|
+
var travelEstimatesVisible: Bool? {
|
|
232
|
+
return { () -> Bool? in
|
|
233
|
+
if bridge.has_value_std__optional_bool_(self.__travelEstimatesVisible) {
|
|
234
|
+
let __unwrapped = bridge.get_std__optional_bool_(self.__travelEstimatesVisible)
|
|
235
|
+
return __unwrapped
|
|
236
|
+
} else {
|
|
237
|
+
return nil
|
|
238
|
+
}
|
|
239
|
+
}()
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
@inline(__always)
|
|
243
|
+
var address: String? {
|
|
244
|
+
return { () -> String? in
|
|
245
|
+
if bridge.has_value_std__optional_std__string_(self.__address) {
|
|
246
|
+
let __unwrapped = bridge.get_std__optional_std__string_(self.__address)
|
|
247
|
+
return String(__unwrapped)
|
|
248
|
+
} else {
|
|
249
|
+
return nil
|
|
250
|
+
}
|
|
251
|
+
}()
|
|
252
|
+
}
|
|
173
253
|
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// WaypointCoordinate.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 `WaypointCoordinate`, backed by a C++ struct.
|
|
12
|
+
*/
|
|
13
|
+
public typealias WaypointCoordinate = margelo.nitro.swe.iternio.reactnativeautoplay.WaypointCoordinate
|
|
14
|
+
|
|
15
|
+
public extension WaypointCoordinate {
|
|
16
|
+
private typealias bridge = margelo.nitro.swe.iternio.reactnativeautoplay.bridge.swift
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Create a new instance of `WaypointCoordinate`.
|
|
20
|
+
*/
|
|
21
|
+
init(latitude: Double, longitude: Double, altitude: Double?) {
|
|
22
|
+
self.init(latitude, longitude, { () -> bridge.std__optional_double_ in
|
|
23
|
+
if let __unwrappedValue = altitude {
|
|
24
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
25
|
+
} else {
|
|
26
|
+
return .init()
|
|
27
|
+
}
|
|
28
|
+
}())
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@inline(__always)
|
|
32
|
+
var latitude: Double {
|
|
33
|
+
return self.__latitude
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@inline(__always)
|
|
37
|
+
var longitude: Double {
|
|
38
|
+
return self.__longitude
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
@inline(__always)
|
|
42
|
+
var altitude: Double? {
|
|
43
|
+
return { () -> Double? in
|
|
44
|
+
if bridge.has_value_std__optional_double_(self.__altitude) {
|
|
45
|
+
let __unwrapped = bridge.get_std__optional_double_(self.__altitude)
|
|
46
|
+
return __unwrapped
|
|
47
|
+
} else {
|
|
48
|
+
return nil
|
|
49
|
+
}
|
|
50
|
+
}()
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// ChargingConnector.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/NitroHash.hpp>)
|
|
11
|
+
#include <NitroModules/NitroHash.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
16
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
21
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
22
|
+
#else
|
|
23
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
|
+
#endif
|
|
25
|
+
|
|
26
|
+
namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* An enum which can be represented as a JavaScript union (ChargingConnector).
|
|
30
|
+
*/
|
|
31
|
+
enum class ChargingConnector {
|
|
32
|
+
CCS1 SWIFT_NAME(ccs1) = 0,
|
|
33
|
+
CCS2 SWIFT_NAME(ccs2) = 1,
|
|
34
|
+
J1772 SWIFT_NAME(j1772) = 2,
|
|
35
|
+
CHADEMO SWIFT_NAME(chademo) = 3,
|
|
36
|
+
MENNEKES SWIFT_NAME(mennekes) = 4,
|
|
37
|
+
GBTDC SWIFT_NAME(gbtdc) = 5,
|
|
38
|
+
GBTAC SWIFT_NAME(gbtac) = 6,
|
|
39
|
+
NACSDC SWIFT_NAME(nacsdc) = 7,
|
|
40
|
+
NACSAC SWIFT_NAME(nacsac) = 8,
|
|
41
|
+
} CLOSED_ENUM;
|
|
42
|
+
|
|
43
|
+
} // namespace margelo::nitro::swe::iternio::reactnativeautoplay
|
|
44
|
+
|
|
45
|
+
namespace margelo::nitro {
|
|
46
|
+
|
|
47
|
+
// C++ ChargingConnector <> JS ChargingConnector (union)
|
|
48
|
+
template <>
|
|
49
|
+
struct JSIConverter<margelo::nitro::swe::iternio::reactnativeautoplay::ChargingConnector> final {
|
|
50
|
+
static inline margelo::nitro::swe::iternio::reactnativeautoplay::ChargingConnector fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
51
|
+
std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, arg);
|
|
52
|
+
switch (hashString(unionValue.c_str(), unionValue.size())) {
|
|
53
|
+
case hashString("ccs1"): return margelo::nitro::swe::iternio::reactnativeautoplay::ChargingConnector::CCS1;
|
|
54
|
+
case hashString("ccs2"): return margelo::nitro::swe::iternio::reactnativeautoplay::ChargingConnector::CCS2;
|
|
55
|
+
case hashString("j1772"): return margelo::nitro::swe::iternio::reactnativeautoplay::ChargingConnector::J1772;
|
|
56
|
+
case hashString("chaDeMo"): return margelo::nitro::swe::iternio::reactnativeautoplay::ChargingConnector::CHADEMO;
|
|
57
|
+
case hashString("mennekes"): return margelo::nitro::swe::iternio::reactnativeautoplay::ChargingConnector::MENNEKES;
|
|
58
|
+
case hashString("gbtDC"): return margelo::nitro::swe::iternio::reactnativeautoplay::ChargingConnector::GBTDC;
|
|
59
|
+
case hashString("gbtAC"): return margelo::nitro::swe::iternio::reactnativeautoplay::ChargingConnector::GBTAC;
|
|
60
|
+
case hashString("nacsDC"): return margelo::nitro::swe::iternio::reactnativeautoplay::ChargingConnector::NACSDC;
|
|
61
|
+
case hashString("nacsAC"): return margelo::nitro::swe::iternio::reactnativeautoplay::ChargingConnector::NACSAC;
|
|
62
|
+
default: [[unlikely]]
|
|
63
|
+
throw std::invalid_argument("Cannot convert \"" + unionValue + "\" to enum ChargingConnector - invalid value!");
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, margelo::nitro::swe::iternio::reactnativeautoplay::ChargingConnector arg) {
|
|
67
|
+
switch (arg) {
|
|
68
|
+
case margelo::nitro::swe::iternio::reactnativeautoplay::ChargingConnector::CCS1: return JSIConverter<std::string>::toJSI(runtime, "ccs1");
|
|
69
|
+
case margelo::nitro::swe::iternio::reactnativeautoplay::ChargingConnector::CCS2: return JSIConverter<std::string>::toJSI(runtime, "ccs2");
|
|
70
|
+
case margelo::nitro::swe::iternio::reactnativeautoplay::ChargingConnector::J1772: return JSIConverter<std::string>::toJSI(runtime, "j1772");
|
|
71
|
+
case margelo::nitro::swe::iternio::reactnativeautoplay::ChargingConnector::CHADEMO: return JSIConverter<std::string>::toJSI(runtime, "chaDeMo");
|
|
72
|
+
case margelo::nitro::swe::iternio::reactnativeautoplay::ChargingConnector::MENNEKES: return JSIConverter<std::string>::toJSI(runtime, "mennekes");
|
|
73
|
+
case margelo::nitro::swe::iternio::reactnativeautoplay::ChargingConnector::GBTDC: return JSIConverter<std::string>::toJSI(runtime, "gbtDC");
|
|
74
|
+
case margelo::nitro::swe::iternio::reactnativeautoplay::ChargingConnector::GBTAC: return JSIConverter<std::string>::toJSI(runtime, "gbtAC");
|
|
75
|
+
case margelo::nitro::swe::iternio::reactnativeautoplay::ChargingConnector::NACSDC: return JSIConverter<std::string>::toJSI(runtime, "nacsDC");
|
|
76
|
+
case margelo::nitro::swe::iternio::reactnativeautoplay::ChargingConnector::NACSAC: return JSIConverter<std::string>::toJSI(runtime, "nacsAC");
|
|
77
|
+
default: [[unlikely]]
|
|
78
|
+
throw std::invalid_argument("Cannot convert ChargingConnector to JS - invalid value: "
|
|
79
|
+
+ std::to_string(static_cast<int>(arg)) + "!");
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
83
|
+
if (!value.isString()) {
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
86
|
+
std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, value);
|
|
87
|
+
switch (hashString(unionValue.c_str(), unionValue.size())) {
|
|
88
|
+
case hashString("ccs1"):
|
|
89
|
+
case hashString("ccs2"):
|
|
90
|
+
case hashString("j1772"):
|
|
91
|
+
case hashString("chaDeMo"):
|
|
92
|
+
case hashString("mennekes"):
|
|
93
|
+
case hashString("gbtDC"):
|
|
94
|
+
case hashString("gbtAC"):
|
|
95
|
+
case hashString("nacsDC"):
|
|
96
|
+
case hashString("nacsAC"):
|
|
97
|
+
return true;
|
|
98
|
+
default:
|
|
99
|
+
return false;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// GridImageSize.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/NitroHash.hpp>)
|
|
11
|
+
#include <NitroModules/NitroHash.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
16
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
21
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
22
|
+
#else
|
|
23
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
|
+
#endif
|
|
25
|
+
|
|
26
|
+
namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* An enum which can be represented as a JavaScript union (GridImageSize).
|
|
30
|
+
*/
|
|
31
|
+
enum class GridImageSize {
|
|
32
|
+
UNSET SWIFT_NAME(unset) = 0,
|
|
33
|
+
LARGE SWIFT_NAME(large) = 1,
|
|
34
|
+
MEDIUM SWIFT_NAME(medium) = 2,
|
|
35
|
+
SMALL SWIFT_NAME(small) = 3,
|
|
36
|
+
} CLOSED_ENUM;
|
|
37
|
+
|
|
38
|
+
} // namespace margelo::nitro::swe::iternio::reactnativeautoplay
|
|
39
|
+
|
|
40
|
+
namespace margelo::nitro {
|
|
41
|
+
|
|
42
|
+
// C++ GridImageSize <> JS GridImageSize (union)
|
|
43
|
+
template <>
|
|
44
|
+
struct JSIConverter<margelo::nitro::swe::iternio::reactnativeautoplay::GridImageSize> final {
|
|
45
|
+
static inline margelo::nitro::swe::iternio::reactnativeautoplay::GridImageSize fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
46
|
+
std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, arg);
|
|
47
|
+
switch (hashString(unionValue.c_str(), unionValue.size())) {
|
|
48
|
+
case hashString("unset"): return margelo::nitro::swe::iternio::reactnativeautoplay::GridImageSize::UNSET;
|
|
49
|
+
case hashString("large"): return margelo::nitro::swe::iternio::reactnativeautoplay::GridImageSize::LARGE;
|
|
50
|
+
case hashString("medium"): return margelo::nitro::swe::iternio::reactnativeautoplay::GridImageSize::MEDIUM;
|
|
51
|
+
case hashString("small"): return margelo::nitro::swe::iternio::reactnativeautoplay::GridImageSize::SMALL;
|
|
52
|
+
default: [[unlikely]]
|
|
53
|
+
throw std::invalid_argument("Cannot convert \"" + unionValue + "\" to enum GridImageSize - invalid value!");
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, margelo::nitro::swe::iternio::reactnativeautoplay::GridImageSize arg) {
|
|
57
|
+
switch (arg) {
|
|
58
|
+
case margelo::nitro::swe::iternio::reactnativeautoplay::GridImageSize::UNSET: return JSIConverter<std::string>::toJSI(runtime, "unset");
|
|
59
|
+
case margelo::nitro::swe::iternio::reactnativeautoplay::GridImageSize::LARGE: return JSIConverter<std::string>::toJSI(runtime, "large");
|
|
60
|
+
case margelo::nitro::swe::iternio::reactnativeautoplay::GridImageSize::MEDIUM: return JSIConverter<std::string>::toJSI(runtime, "medium");
|
|
61
|
+
case margelo::nitro::swe::iternio::reactnativeautoplay::GridImageSize::SMALL: return JSIConverter<std::string>::toJSI(runtime, "small");
|
|
62
|
+
default: [[unlikely]]
|
|
63
|
+
throw std::invalid_argument("Cannot convert GridImageSize to JS - invalid value: "
|
|
64
|
+
+ std::to_string(static_cast<int>(arg)) + "!");
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
68
|
+
if (!value.isString()) {
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, value);
|
|
72
|
+
switch (hashString(unionValue.c_str(), unionValue.size())) {
|
|
73
|
+
case hashString("unset"):
|
|
74
|
+
case hashString("large"):
|
|
75
|
+
case hashString("medium"):
|
|
76
|
+
case hashString("small"):
|
|
77
|
+
return true;
|
|
78
|
+
default:
|
|
79
|
+
return false;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
} // namespace margelo::nitro
|
|
@@ -34,6 +34,8 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct NitroAction
|
|
|
34
34
|
namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct AutoText; }
|
|
35
35
|
// Forward declaration of `NitroGridButton` to properly resolve imports.
|
|
36
36
|
namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct NitroGridButton; }
|
|
37
|
+
// Forward declaration of `GridImageSize` to properly resolve imports.
|
|
38
|
+
namespace margelo::nitro::swe::iternio::reactnativeautoplay { enum class GridImageSize; }
|
|
37
39
|
// Forward declaration of `NitroBaseMapTemplateConfig` to properly resolve imports.
|
|
38
40
|
namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct NitroBaseMapTemplateConfig; }
|
|
39
41
|
|
|
@@ -44,6 +46,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct NitroBaseMa
|
|
|
44
46
|
#include <vector>
|
|
45
47
|
#include "AutoText.hpp"
|
|
46
48
|
#include "NitroGridButton.hpp"
|
|
49
|
+
#include "GridImageSize.hpp"
|
|
47
50
|
#include "NitroBaseMapTemplateConfig.hpp"
|
|
48
51
|
|
|
49
52
|
namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
@@ -63,11 +66,12 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
|
63
66
|
std::optional<std::vector<NitroAction>> headerActions SWIFT_PRIVATE;
|
|
64
67
|
AutoText title SWIFT_PRIVATE;
|
|
65
68
|
std::vector<NitroGridButton> buttons SWIFT_PRIVATE;
|
|
69
|
+
std::optional<GridImageSize> imageSize SWIFT_PRIVATE;
|
|
66
70
|
std::optional<NitroBaseMapTemplateConfig> mapConfig SWIFT_PRIVATE;
|
|
67
71
|
|
|
68
72
|
public:
|
|
69
73
|
GridTemplateConfig() = default;
|
|
70
|
-
explicit GridTemplateConfig(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, AutoText title, std::vector<NitroGridButton> buttons, std::optional<NitroBaseMapTemplateConfig> mapConfig): id(id), onWillAppear(onWillAppear), onWillDisappear(onWillDisappear), onDidAppear(onDidAppear), onDidDisappear(onDidDisappear), onPopped(onPopped), autoDismissMs(autoDismissMs), headerActions(headerActions), title(title), buttons(buttons), mapConfig(mapConfig) {}
|
|
74
|
+
explicit GridTemplateConfig(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, AutoText title, std::vector<NitroGridButton> buttons, std::optional<GridImageSize> imageSize, std::optional<NitroBaseMapTemplateConfig> mapConfig): id(id), onWillAppear(onWillAppear), onWillDisappear(onWillDisappear), onDidAppear(onDidAppear), onDidDisappear(onDidDisappear), onPopped(onPopped), autoDismissMs(autoDismissMs), headerActions(headerActions), title(title), buttons(buttons), imageSize(imageSize), mapConfig(mapConfig) {}
|
|
71
75
|
|
|
72
76
|
public:
|
|
73
77
|
// GridTemplateConfig is not equatable because these properties are not equatable: onWillAppear, onWillDisappear, onDidAppear, onDidDisappear, onPopped, headerActions, buttons, mapConfig
|
|
@@ -93,6 +97,7 @@ namespace margelo::nitro {
|
|
|
93
97
|
JSIConverter<std::optional<std::vector<margelo::nitro::swe::iternio::reactnativeautoplay::NitroAction>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "headerActions"))),
|
|
94
98
|
JSIConverter<margelo::nitro::swe::iternio::reactnativeautoplay::AutoText>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "title"))),
|
|
95
99
|
JSIConverter<std::vector<margelo::nitro::swe::iternio::reactnativeautoplay::NitroGridButton>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "buttons"))),
|
|
100
|
+
JSIConverter<std::optional<margelo::nitro::swe::iternio::reactnativeautoplay::GridImageSize>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "imageSize"))),
|
|
96
101
|
JSIConverter<std::optional<margelo::nitro::swe::iternio::reactnativeautoplay::NitroBaseMapTemplateConfig>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "mapConfig")))
|
|
97
102
|
);
|
|
98
103
|
}
|
|
@@ -108,6 +113,7 @@ namespace margelo::nitro {
|
|
|
108
113
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "headerActions"), JSIConverter<std::optional<std::vector<margelo::nitro::swe::iternio::reactnativeautoplay::NitroAction>>>::toJSI(runtime, arg.headerActions));
|
|
109
114
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "title"), JSIConverter<margelo::nitro::swe::iternio::reactnativeautoplay::AutoText>::toJSI(runtime, arg.title));
|
|
110
115
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "buttons"), JSIConverter<std::vector<margelo::nitro::swe::iternio::reactnativeautoplay::NitroGridButton>>::toJSI(runtime, arg.buttons));
|
|
116
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "imageSize"), JSIConverter<std::optional<margelo::nitro::swe::iternio::reactnativeautoplay::GridImageSize>>::toJSI(runtime, arg.imageSize));
|
|
111
117
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "mapConfig"), JSIConverter<std::optional<margelo::nitro::swe::iternio::reactnativeautoplay::NitroBaseMapTemplateConfig>>::toJSI(runtime, arg.mapConfig));
|
|
112
118
|
return obj;
|
|
113
119
|
}
|
|
@@ -129,6 +135,7 @@ namespace margelo::nitro {
|
|
|
129
135
|
if (!JSIConverter<std::optional<std::vector<margelo::nitro::swe::iternio::reactnativeautoplay::NitroAction>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "headerActions")))) return false;
|
|
130
136
|
if (!JSIConverter<margelo::nitro::swe::iternio::reactnativeautoplay::AutoText>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "title")))) return false;
|
|
131
137
|
if (!JSIConverter<std::vector<margelo::nitro::swe::iternio::reactnativeautoplay::NitroGridButton>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "buttons")))) return false;
|
|
138
|
+
if (!JSIConverter<std::optional<margelo::nitro::swe::iternio::reactnativeautoplay::GridImageSize>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "imageSize")))) return false;
|
|
132
139
|
if (!JSIConverter<std::optional<margelo::nitro::swe::iternio::reactnativeautoplay::NitroBaseMapTemplateConfig>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "mapConfig")))) return false;
|
|
133
140
|
return true;
|
|
134
141
|
}
|
|
@@ -27,6 +27,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
|
27
27
|
prototype.registerHybridMethod("startNavigation", &HybridMapTemplateSpec::startNavigation);
|
|
28
28
|
prototype.registerHybridMethod("stopNavigation", &HybridMapTemplateSpec::stopNavigation);
|
|
29
29
|
prototype.registerHybridMethod("setManeuverState", &HybridMapTemplateSpec::setManeuverState);
|
|
30
|
+
prototype.registerHybridMethod("updateOptionsPanel", &HybridMapTemplateSpec::updateOptionsPanel);
|
|
30
31
|
});
|
|
31
32
|
}
|
|
32
33
|
|
|
@@ -41,6 +41,8 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct NitroLoadin
|
|
|
41
41
|
namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct TripConfig; }
|
|
42
42
|
// Forward declaration of `ManeuverState` to properly resolve imports.
|
|
43
43
|
namespace margelo::nitro::swe::iternio::reactnativeautoplay { enum class ManeuverState; }
|
|
44
|
+
// Forward declaration of `NitroOptionsPanelConfig` to properly resolve imports.
|
|
45
|
+
namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct NitroOptionsPanelConfig; }
|
|
44
46
|
|
|
45
47
|
#include "MapTemplateConfig.hpp"
|
|
46
48
|
#include <string>
|
|
@@ -62,6 +64,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay { enum class Maneuve
|
|
|
62
64
|
#include <variant>
|
|
63
65
|
#include "TripConfig.hpp"
|
|
64
66
|
#include "ManeuverState.hpp"
|
|
67
|
+
#include "NitroOptionsPanelConfig.hpp"
|
|
65
68
|
|
|
66
69
|
namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
67
70
|
|
|
@@ -104,9 +107,10 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
|
104
107
|
virtual void updateVisibleTravelEstimate(const std::string& templateId, VisibleTravelEstimate visibleTravelEstimate) = 0;
|
|
105
108
|
virtual void updateTravelEstimates(const std::string& templateId, const std::vector<TripPoint>& steps) = 0;
|
|
106
109
|
virtual void updateManeuvers(const std::string& templateId, const std::variant<std::vector<NitroRoutingManeuver>, NitroMessageManeuver, NitroLoadingManeuver>& maneuvers) = 0;
|
|
107
|
-
virtual void startNavigation(const std::string& templateId, const TripConfig& trip) = 0;
|
|
110
|
+
virtual std::shared_ptr<Promise<void>> startNavigation(const std::string& templateId, const TripConfig& trip) = 0;
|
|
108
111
|
virtual void stopNavigation(const std::string& templateId) = 0;
|
|
109
112
|
virtual void setManeuverState(const std::string& templateId, ManeuverState state) = 0;
|
|
113
|
+
virtual std::shared_ptr<Promise<void>> updateOptionsPanel(const std::string& templateId, const std::optional<NitroOptionsPanelConfig>& config) = 0;
|
|
110
114
|
|
|
111
115
|
protected:
|
|
112
116
|
// Hybrid Setup
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// ListImageType.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/NitroHash.hpp>)
|
|
11
|
+
#include <NitroModules/NitroHash.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
16
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
21
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
22
|
+
#else
|
|
23
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
|
+
#endif
|
|
25
|
+
|
|
26
|
+
namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* An enum which can be represented as a JavaScript union (ListImageType).
|
|
30
|
+
*/
|
|
31
|
+
enum class ListImageType {
|
|
32
|
+
LARGE SWIFT_NAME(large) = 0,
|
|
33
|
+
MEDIUM SWIFT_NAME(medium) = 1,
|
|
34
|
+
SMALL SWIFT_NAME(small) = 2,
|
|
35
|
+
EXTRA_SMALL SWIFT_NAME(extraSmall) = 3,
|
|
36
|
+
ICON SWIFT_NAME(icon) = 4,
|
|
37
|
+
} CLOSED_ENUM;
|
|
38
|
+
|
|
39
|
+
} // namespace margelo::nitro::swe::iternio::reactnativeautoplay
|
|
40
|
+
|
|
41
|
+
namespace margelo::nitro {
|
|
42
|
+
|
|
43
|
+
// C++ ListImageType <> JS ListImageType (union)
|
|
44
|
+
template <>
|
|
45
|
+
struct JSIConverter<margelo::nitro::swe::iternio::reactnativeautoplay::ListImageType> final {
|
|
46
|
+
static inline margelo::nitro::swe::iternio::reactnativeautoplay::ListImageType fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
47
|
+
std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, arg);
|
|
48
|
+
switch (hashString(unionValue.c_str(), unionValue.size())) {
|
|
49
|
+
case hashString("large"): return margelo::nitro::swe::iternio::reactnativeautoplay::ListImageType::LARGE;
|
|
50
|
+
case hashString("medium"): return margelo::nitro::swe::iternio::reactnativeautoplay::ListImageType::MEDIUM;
|
|
51
|
+
case hashString("small"): return margelo::nitro::swe::iternio::reactnativeautoplay::ListImageType::SMALL;
|
|
52
|
+
case hashString("extra_small"): return margelo::nitro::swe::iternio::reactnativeautoplay::ListImageType::EXTRA_SMALL;
|
|
53
|
+
case hashString("icon"): return margelo::nitro::swe::iternio::reactnativeautoplay::ListImageType::ICON;
|
|
54
|
+
default: [[unlikely]]
|
|
55
|
+
throw std::invalid_argument("Cannot convert \"" + unionValue + "\" to enum ListImageType - invalid value!");
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, margelo::nitro::swe::iternio::reactnativeautoplay::ListImageType arg) {
|
|
59
|
+
switch (arg) {
|
|
60
|
+
case margelo::nitro::swe::iternio::reactnativeautoplay::ListImageType::LARGE: return JSIConverter<std::string>::toJSI(runtime, "large");
|
|
61
|
+
case margelo::nitro::swe::iternio::reactnativeautoplay::ListImageType::MEDIUM: return JSIConverter<std::string>::toJSI(runtime, "medium");
|
|
62
|
+
case margelo::nitro::swe::iternio::reactnativeautoplay::ListImageType::SMALL: return JSIConverter<std::string>::toJSI(runtime, "small");
|
|
63
|
+
case margelo::nitro::swe::iternio::reactnativeautoplay::ListImageType::EXTRA_SMALL: return JSIConverter<std::string>::toJSI(runtime, "extra_small");
|
|
64
|
+
case margelo::nitro::swe::iternio::reactnativeautoplay::ListImageType::ICON: return JSIConverter<std::string>::toJSI(runtime, "icon");
|
|
65
|
+
default: [[unlikely]]
|
|
66
|
+
throw std::invalid_argument("Cannot convert ListImageType to JS - invalid value: "
|
|
67
|
+
+ std::to_string(static_cast<int>(arg)) + "!");
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
71
|
+
if (!value.isString()) {
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, value);
|
|
75
|
+
switch (hashString(unionValue.c_str(), unionValue.size())) {
|
|
76
|
+
case hashString("large"):
|
|
77
|
+
case hashString("medium"):
|
|
78
|
+
case hashString("small"):
|
|
79
|
+
case hashString("extra_small"):
|
|
80
|
+
case hashString("icon"):
|
|
81
|
+
return true;
|
|
82
|
+
default:
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
} // namespace margelo::nitro
|