@iternio/react-native-auto-play 0.0.8 → 0.0.10
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/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridAutoPlay.kt +10 -9
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridGridTemplate.kt +6 -3
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridInformationTemplate.kt +7 -5
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridListTemplate.kt +6 -3
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridMapTemplate.kt +6 -3
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridSearchTemplate.kt +6 -3
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/VirtualRenderer.kt +1 -0
- package/ios/hybrid/HybridAutoPlay.swift +48 -16
- package/ios/hybrid/HybridGridTemplate.swift +17 -10
- package/ios/hybrid/HybridInformationTemplate.swift +18 -10
- package/ios/hybrid/HybridListTemplate.swift +18 -10
- package/ios/hybrid/HybridMapTemplate.swift +20 -12
- package/ios/hybrid/HybridMessageTemplate.swift +4 -7
- package/ios/hybrid/HybridSearchTemplate.swift +20 -10
- package/ios/scenes/AutoPlayInterfaceController.swift +11 -14
- package/ios/scenes/AutoPlayScene.swift +1 -1
- package/ios/scenes/HeadUnitSceneDelegate.swift +5 -4
- package/ios/templates/AutoPlayTemplate.swift +3 -2
- package/ios/templates/GridTemplate.swift +1 -2
- package/ios/templates/InformationTemplate.swift +1 -2
- package/ios/templates/ListTemplate.swift +3 -2
- package/ios/templates/MapTemplate.swift +37 -32
- package/ios/templates/SearchTemplate.swift +11 -7
- package/ios/templates/TemplateStore.swift +8 -8
- package/ios/utils/RootModule.swift +13 -40
- package/lib/specs/AutoPlay.nitro.d.ts +1 -1
- package/lib/specs/GridTemplate.nitro.d.ts +1 -1
- package/lib/specs/InformationTemplate.nitro.d.ts +1 -1
- package/lib/specs/ListTemplate.nitro.d.ts +1 -1
- package/lib/specs/MapTemplate.nitro.d.ts +1 -1
- package/lib/specs/SearchTemplate.nitro.d.ts +1 -1
- package/lib/templates/GridTemplate.d.ts +1 -1
- package/lib/templates/GridTemplate.js +1 -1
- package/lib/templates/InformationTemplate.d.ts +1 -1
- package/lib/templates/InformationTemplate.js +1 -1
- package/lib/templates/ListTemplate.d.ts +1 -1
- package/lib/templates/ListTemplate.js +1 -1
- package/lib/templates/MapTemplate.d.ts +2 -2
- package/lib/templates/MapTemplate.js +2 -2
- package/lib/templates/SearchTemplate.d.ts +1 -1
- package/lib/templates/SearchTemplate.js +1 -1
- package/lib/templates/Template.d.ts +1 -1
- package/lib/templates/Template.js +1 -1
- package/nitrogen/generated/android/c++/JHybridAutoPlaySpec.cpp +14 -3
- package/nitrogen/generated/android/c++/JHybridAutoPlaySpec.hpp +1 -1
- package/nitrogen/generated/android/c++/JHybridGridTemplateSpec.cpp +16 -3
- package/nitrogen/generated/android/c++/JHybridGridTemplateSpec.hpp +1 -1
- package/nitrogen/generated/android/c++/JHybridInformationTemplateSpec.cpp +16 -3
- package/nitrogen/generated/android/c++/JHybridInformationTemplateSpec.hpp +1 -1
- package/nitrogen/generated/android/c++/JHybridListTemplateSpec.cpp +16 -3
- package/nitrogen/generated/android/c++/JHybridListTemplateSpec.hpp +1 -1
- package/nitrogen/generated/android/c++/JHybridMapTemplateSpec.cpp +16 -3
- package/nitrogen/generated/android/c++/JHybridMapTemplateSpec.hpp +1 -1
- package/nitrogen/generated/android/c++/JHybridSearchTemplateSpec.cpp +16 -3
- package/nitrogen/generated/android/c++/JHybridSearchTemplateSpec.hpp +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridAutoPlaySpec.kt +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridGridTemplateSpec.kt +2 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridInformationTemplateSpec.kt +2 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridListTemplateSpec.kt +2 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridMapTemplateSpec.kt +2 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridSearchTemplateSpec.kt +2 -1
- package/nitrogen/generated/ios/ReactNativeAutoPlay-Swift-Cxx-Bridge.hpp +9 -9
- package/nitrogen/generated/ios/c++/HybridAutoPlaySpecSwift.hpp +3 -1
- package/nitrogen/generated/ios/c++/HybridGridTemplateSpecSwift.hpp +4 -1
- package/nitrogen/generated/ios/c++/HybridInformationTemplateSpecSwift.hpp +4 -1
- package/nitrogen/generated/ios/c++/HybridListTemplateSpecSwift.hpp +4 -1
- package/nitrogen/generated/ios/c++/HybridMapTemplateSpecSwift.hpp +4 -1
- package/nitrogen/generated/ios/c++/HybridSearchTemplateSpecSwift.hpp +4 -1
- package/nitrogen/generated/ios/swift/HybridAutoPlaySpec.swift +1 -1
- package/nitrogen/generated/ios/swift/HybridAutoPlaySpec_cxx.swift +12 -4
- package/nitrogen/generated/ios/swift/HybridGridTemplateSpec.swift +2 -1
- package/nitrogen/generated/ios/swift/HybridGridTemplateSpec_cxx.swift +13 -4
- package/nitrogen/generated/ios/swift/HybridInformationTemplateSpec.swift +2 -1
- package/nitrogen/generated/ios/swift/HybridInformationTemplateSpec_cxx.swift +13 -4
- package/nitrogen/generated/ios/swift/HybridListTemplateSpec.swift +2 -1
- package/nitrogen/generated/ios/swift/HybridListTemplateSpec_cxx.swift +13 -4
- package/nitrogen/generated/ios/swift/HybridMapTemplateSpec.swift +2 -1
- package/nitrogen/generated/ios/swift/HybridMapTemplateSpec_cxx.swift +13 -4
- package/nitrogen/generated/ios/swift/HybridSearchTemplateSpec.swift +2 -1
- package/nitrogen/generated/ios/swift/HybridSearchTemplateSpec_cxx.swift +13 -4
- package/nitrogen/generated/shared/c++/HybridAutoPlaySpec.hpp +1 -1
- package/nitrogen/generated/shared/c++/HybridGridTemplateSpec.hpp +2 -1
- package/nitrogen/generated/shared/c++/HybridInformationTemplateSpec.hpp +2 -1
- package/nitrogen/generated/shared/c++/HybridListTemplateSpec.hpp +2 -1
- package/nitrogen/generated/shared/c++/HybridMapTemplateSpec.hpp +2 -1
- package/nitrogen/generated/shared/c++/HybridSearchTemplateSpec.hpp +2 -1
- package/package.json +1 -1
- package/src/specs/AutoPlay.nitro.ts +1 -1
- package/src/specs/GridTemplate.nitro.ts +1 -1
- package/src/specs/InformationTemplate.nitro.ts +1 -1
- package/src/specs/ListTemplate.nitro.ts +1 -1
- package/src/specs/MapTemplate.nitro.ts +1 -1
- package/src/specs/SearchTemplate.nitro.ts +4 -1
- package/src/templates/GridTemplate.ts +1 -1
- package/src/templates/InformationTemplate.ts +1 -1
- package/src/templates/ListTemplate.ts +1 -1
- package/src/templates/MapTemplate.ts +2 -2
- package/src/templates/SearchTemplate.ts +1 -1
- package/src/templates/Template.ts +1 -1
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
import Foundation
|
|
9
9
|
import NitroModules
|
|
10
|
+
import NitroModules
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
13
|
* A class implementation that bridges HybridListTemplateSpec over to C++.
|
|
@@ -129,9 +130,9 @@ open class HybridListTemplateSpec_cxx {
|
|
|
129
130
|
}
|
|
130
131
|
|
|
131
132
|
@inline(__always)
|
|
132
|
-
public final func updateListTemplateSections(templateId: std.string, sections: bridge.std__optional_std__vector_NitroSection__) -> bridge.
|
|
133
|
+
public final func updateListTemplateSections(templateId: std.string, sections: bridge.std__optional_std__vector_NitroSection__) -> bridge.Result_std__shared_ptr_Promise_void___ {
|
|
133
134
|
do {
|
|
134
|
-
try self.__implementation.updateListTemplateSections(templateId: String(templateId), sections: { () -> [NitroSection]? in
|
|
135
|
+
let __result = try self.__implementation.updateListTemplateSections(templateId: String(templateId), sections: { () -> [NitroSection]? in
|
|
135
136
|
if bridge.has_value_std__optional_std__vector_NitroSection__(sections) {
|
|
136
137
|
let __unwrapped = bridge.get_std__optional_std__vector_NitroSection__(sections)
|
|
137
138
|
return __unwrapped.map({ __item in __item })
|
|
@@ -139,10 +140,18 @@ open class HybridListTemplateSpec_cxx {
|
|
|
139
140
|
return nil
|
|
140
141
|
}
|
|
141
142
|
}())
|
|
142
|
-
|
|
143
|
+
let __resultCpp = { () -> bridge.std__shared_ptr_Promise_void__ in
|
|
144
|
+
let __promise = bridge.create_std__shared_ptr_Promise_void__()
|
|
145
|
+
let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_void__(__promise)
|
|
146
|
+
__result
|
|
147
|
+
.then({ __result in __promiseHolder.resolve() })
|
|
148
|
+
.catch({ __error in __promiseHolder.reject(__error.toCpp()) })
|
|
149
|
+
return __promise
|
|
150
|
+
}()
|
|
151
|
+
return bridge.create_Result_std__shared_ptr_Promise_void___(__resultCpp)
|
|
143
152
|
} catch (let __error) {
|
|
144
153
|
let __exceptionPtr = __error.toCpp()
|
|
145
|
-
return bridge.
|
|
154
|
+
return bridge.create_Result_std__shared_ptr_Promise_void___(__exceptionPtr)
|
|
146
155
|
}
|
|
147
156
|
}
|
|
148
157
|
}
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
import Foundation
|
|
9
9
|
import NitroModules
|
|
10
|
+
import NitroModules
|
|
10
11
|
|
|
11
12
|
/// See ``HybridMapTemplateSpec``
|
|
12
13
|
public protocol HybridMapTemplateSpec_protocol: HybridObject {
|
|
@@ -20,7 +21,7 @@ public protocol HybridMapTemplateSpec_protocol: HybridObject {
|
|
|
20
21
|
func dismissNavigationAlert(templateId: String, navigationAlertId: Double) throws -> Void
|
|
21
22
|
func showTripSelector(templateId: String, trips: [TripsConfig], selectedTripId: String?, textConfig: TripPreviewTextConfiguration, onTripSelected: @escaping (_ tripId: String, _ routeId: String) -> Void, onTripStarted: @escaping (_ tripId: String, _ routeId: String) -> Void, onBackPressed: @escaping () -> Void, mapButtons: [NitroMapButton]) throws -> TripSelectorCallback
|
|
22
23
|
func hideTripSelector(templateId: String) throws -> Void
|
|
23
|
-
func setTemplateMapButtons(templateId: String, buttons: [NitroMapButton]?) throws -> Void
|
|
24
|
+
func setTemplateMapButtons(templateId: String, buttons: [NitroMapButton]?) throws -> Promise<Void>
|
|
24
25
|
func updateVisibleTravelEstimate(templateId: String, visibleTravelEstimate: VisibleTravelEstimate) throws -> Void
|
|
25
26
|
func updateTravelEstimates(templateId: String, steps: [TripPoint]) throws -> Void
|
|
26
27
|
func updateManeuvers(templateId: String, maneuvers: NitroManeuver) throws -> Void
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
import Foundation
|
|
9
9
|
import NitroModules
|
|
10
|
+
import NitroModules
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
13
|
* A class implementation that bridges HybridMapTemplateSpec over to C++.
|
|
@@ -207,9 +208,9 @@ open class HybridMapTemplateSpec_cxx {
|
|
|
207
208
|
}
|
|
208
209
|
|
|
209
210
|
@inline(__always)
|
|
210
|
-
public final func setTemplateMapButtons(templateId: std.string, buttons: bridge.std__optional_std__vector_NitroMapButton__) -> bridge.
|
|
211
|
+
public final func setTemplateMapButtons(templateId: std.string, buttons: bridge.std__optional_std__vector_NitroMapButton__) -> bridge.Result_std__shared_ptr_Promise_void___ {
|
|
211
212
|
do {
|
|
212
|
-
try self.__implementation.setTemplateMapButtons(templateId: String(templateId), buttons: { () -> [NitroMapButton]? in
|
|
213
|
+
let __result = try self.__implementation.setTemplateMapButtons(templateId: String(templateId), buttons: { () -> [NitroMapButton]? in
|
|
213
214
|
if bridge.has_value_std__optional_std__vector_NitroMapButton__(buttons) {
|
|
214
215
|
let __unwrapped = bridge.get_std__optional_std__vector_NitroMapButton__(buttons)
|
|
215
216
|
return __unwrapped.map({ __item in __item })
|
|
@@ -217,10 +218,18 @@ open class HybridMapTemplateSpec_cxx {
|
|
|
217
218
|
return nil
|
|
218
219
|
}
|
|
219
220
|
}())
|
|
220
|
-
|
|
221
|
+
let __resultCpp = { () -> bridge.std__shared_ptr_Promise_void__ in
|
|
222
|
+
let __promise = bridge.create_std__shared_ptr_Promise_void__()
|
|
223
|
+
let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_void__(__promise)
|
|
224
|
+
__result
|
|
225
|
+
.then({ __result in __promiseHolder.resolve() })
|
|
226
|
+
.catch({ __error in __promiseHolder.reject(__error.toCpp()) })
|
|
227
|
+
return __promise
|
|
228
|
+
}()
|
|
229
|
+
return bridge.create_Result_std__shared_ptr_Promise_void___(__resultCpp)
|
|
221
230
|
} catch (let __error) {
|
|
222
231
|
let __exceptionPtr = __error.toCpp()
|
|
223
|
-
return bridge.
|
|
232
|
+
return bridge.create_Result_std__shared_ptr_Promise_void___(__exceptionPtr)
|
|
224
233
|
}
|
|
225
234
|
}
|
|
226
235
|
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
import Foundation
|
|
9
9
|
import NitroModules
|
|
10
|
+
import NitroModules
|
|
10
11
|
|
|
11
12
|
/// See ``HybridSearchTemplateSpec``
|
|
12
13
|
public protocol HybridSearchTemplateSpec_protocol: HybridObject {
|
|
@@ -15,7 +16,7 @@ public protocol HybridSearchTemplateSpec_protocol: HybridObject {
|
|
|
15
16
|
|
|
16
17
|
// Methods
|
|
17
18
|
func createSearchTemplate(config: SearchTemplateConfig) throws -> Void
|
|
18
|
-
func updateSearchResults(templateId: String, results: NitroSection) throws -> Void
|
|
19
|
+
func updateSearchResults(templateId: String, results: NitroSection) throws -> Promise<Void>
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
public extension HybridSearchTemplateSpec_protocol {
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
import Foundation
|
|
9
9
|
import NitroModules
|
|
10
|
+
import NitroModules
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
13
|
* A class implementation that bridges HybridSearchTemplateSpec over to C++.
|
|
@@ -129,13 +130,21 @@ open class HybridSearchTemplateSpec_cxx {
|
|
|
129
130
|
}
|
|
130
131
|
|
|
131
132
|
@inline(__always)
|
|
132
|
-
public final func updateSearchResults(templateId: std.string, results: NitroSection) -> bridge.
|
|
133
|
+
public final func updateSearchResults(templateId: std.string, results: NitroSection) -> bridge.Result_std__shared_ptr_Promise_void___ {
|
|
133
134
|
do {
|
|
134
|
-
try self.__implementation.updateSearchResults(templateId: String(templateId), results: results)
|
|
135
|
-
|
|
135
|
+
let __result = try self.__implementation.updateSearchResults(templateId: String(templateId), results: results)
|
|
136
|
+
let __resultCpp = { () -> bridge.std__shared_ptr_Promise_void__ in
|
|
137
|
+
let __promise = bridge.create_std__shared_ptr_Promise_void__()
|
|
138
|
+
let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_void__(__promise)
|
|
139
|
+
__result
|
|
140
|
+
.then({ __result in __promiseHolder.resolve() })
|
|
141
|
+
.catch({ __error in __promiseHolder.reject(__error.toCpp()) })
|
|
142
|
+
return __promise
|
|
143
|
+
}()
|
|
144
|
+
return bridge.create_Result_std__shared_ptr_Promise_void___(__resultCpp)
|
|
136
145
|
} catch (let __error) {
|
|
137
146
|
let __exceptionPtr = __error.toCpp()
|
|
138
|
-
return bridge.
|
|
147
|
+
return bridge.create_Result_std__shared_ptr_Promise_void___(__exceptionPtr)
|
|
139
148
|
}
|
|
140
149
|
}
|
|
141
150
|
}
|
|
@@ -71,7 +71,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
|
71
71
|
virtual std::shared_ptr<Promise<void>> popToRootTemplate(std::optional<bool> animate) = 0;
|
|
72
72
|
virtual std::shared_ptr<Promise<void>> popToTemplate(const std::string& templateId, std::optional<bool> animate) = 0;
|
|
73
73
|
virtual std::function<void()> addSafeAreaInsetsListener(const std::string& moduleName, const std::function<void(const SafeAreaInsets& /* insets */)>& callback) = 0;
|
|
74
|
-
virtual void setTemplateHeaderActions(const std::string& templateId, const std::optional<std::vector<NitroAction>>& headerActions) = 0;
|
|
74
|
+
virtual std::shared_ptr<Promise<void>> setTemplateHeaderActions(const std::string& templateId, const std::optional<std::vector<NitroAction>>& headerActions) = 0;
|
|
75
75
|
virtual bool isConnected() = 0;
|
|
76
76
|
|
|
77
77
|
protected:
|
|
@@ -19,6 +19,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct GridTemplat
|
|
|
19
19
|
namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct NitroGridButton; }
|
|
20
20
|
|
|
21
21
|
#include "GridTemplateConfig.hpp"
|
|
22
|
+
#include <NitroModules/Promise.hpp>
|
|
22
23
|
#include <string>
|
|
23
24
|
#include "NitroGridButton.hpp"
|
|
24
25
|
#include <vector>
|
|
@@ -55,7 +56,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
|
55
56
|
public:
|
|
56
57
|
// Methods
|
|
57
58
|
virtual void createGridTemplate(const GridTemplateConfig& config) = 0;
|
|
58
|
-
virtual void updateGridTemplateButtons(const std::string& templateId, const std::vector<NitroGridButton>& buttons) = 0;
|
|
59
|
+
virtual std::shared_ptr<Promise<void>> updateGridTemplateButtons(const std::string& templateId, const std::vector<NitroGridButton>& buttons) = 0;
|
|
59
60
|
|
|
60
61
|
protected:
|
|
61
62
|
// Hybrid Setup
|
|
@@ -19,6 +19,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct Information
|
|
|
19
19
|
namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct NitroSection; }
|
|
20
20
|
|
|
21
21
|
#include "InformationTemplateConfig.hpp"
|
|
22
|
+
#include <NitroModules/Promise.hpp>
|
|
22
23
|
#include <string>
|
|
23
24
|
#include "NitroSection.hpp"
|
|
24
25
|
|
|
@@ -54,7 +55,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
|
54
55
|
public:
|
|
55
56
|
// Methods
|
|
56
57
|
virtual void createInformationTemplate(const InformationTemplateConfig& config) = 0;
|
|
57
|
-
virtual void updateInformationTemplateSections(const std::string& templateId, const NitroSection& section) = 0;
|
|
58
|
+
virtual std::shared_ptr<Promise<void>> updateInformationTemplateSections(const std::string& templateId, const NitroSection& section) = 0;
|
|
58
59
|
|
|
59
60
|
protected:
|
|
60
61
|
// Hybrid Setup
|
|
@@ -19,6 +19,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct ListTemplat
|
|
|
19
19
|
namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct NitroSection; }
|
|
20
20
|
|
|
21
21
|
#include "ListTemplateConfig.hpp"
|
|
22
|
+
#include <NitroModules/Promise.hpp>
|
|
22
23
|
#include <string>
|
|
23
24
|
#include "NitroSection.hpp"
|
|
24
25
|
#include <vector>
|
|
@@ -56,7 +57,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
|
56
57
|
public:
|
|
57
58
|
// Methods
|
|
58
59
|
virtual void createListTemplate(const ListTemplateConfig& config) = 0;
|
|
59
|
-
virtual void updateListTemplateSections(const std::string& templateId, const std::optional<std::vector<NitroSection>>& sections) = 0;
|
|
60
|
+
virtual std::shared_ptr<Promise<void>> updateListTemplateSections(const std::string& templateId, const std::optional<std::vector<NitroSection>>& sections) = 0;
|
|
60
61
|
|
|
61
62
|
protected:
|
|
62
63
|
// Hybrid Setup
|
|
@@ -49,6 +49,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct TripConfig;
|
|
|
49
49
|
#include "TripPreviewTextConfiguration.hpp"
|
|
50
50
|
#include <functional>
|
|
51
51
|
#include "NitroMapButton.hpp"
|
|
52
|
+
#include <NitroModules/Promise.hpp>
|
|
52
53
|
#include "VisibleTravelEstimate.hpp"
|
|
53
54
|
#include "TripPoint.hpp"
|
|
54
55
|
#include "NitroRoutingManeuver.hpp"
|
|
@@ -93,7 +94,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
|
93
94
|
virtual void dismissNavigationAlert(const std::string& templateId, double navigationAlertId) = 0;
|
|
94
95
|
virtual TripSelectorCallback showTripSelector(const std::string& templateId, const std::vector<TripsConfig>& trips, const std::optional<std::string>& selectedTripId, const TripPreviewTextConfiguration& textConfig, const std::function<void(const std::string& /* tripId */, const std::string& /* routeId */)>& onTripSelected, const std::function<void(const std::string& /* tripId */, const std::string& /* routeId */)>& onTripStarted, const std::function<void()>& onBackPressed, const std::vector<NitroMapButton>& mapButtons) = 0;
|
|
95
96
|
virtual void hideTripSelector(const std::string& templateId) = 0;
|
|
96
|
-
virtual void setTemplateMapButtons(const std::string& templateId, const std::optional<std::vector<NitroMapButton>>& buttons) = 0;
|
|
97
|
+
virtual std::shared_ptr<Promise<void>> setTemplateMapButtons(const std::string& templateId, const std::optional<std::vector<NitroMapButton>>& buttons) = 0;
|
|
97
98
|
virtual void updateVisibleTravelEstimate(const std::string& templateId, VisibleTravelEstimate visibleTravelEstimate) = 0;
|
|
98
99
|
virtual void updateTravelEstimates(const std::string& templateId, const std::vector<TripPoint>& steps) = 0;
|
|
99
100
|
virtual void updateManeuvers(const std::string& templateId, const std::variant<std::vector<NitroRoutingManeuver>, NitroMessageManeuver>& maneuvers) = 0;
|
|
@@ -19,6 +19,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct SearchTempl
|
|
|
19
19
|
namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct NitroSection; }
|
|
20
20
|
|
|
21
21
|
#include "SearchTemplateConfig.hpp"
|
|
22
|
+
#include <NitroModules/Promise.hpp>
|
|
22
23
|
#include <string>
|
|
23
24
|
#include "NitroSection.hpp"
|
|
24
25
|
|
|
@@ -54,7 +55,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
|
54
55
|
public:
|
|
55
56
|
// Methods
|
|
56
57
|
virtual void createSearchTemplate(const SearchTemplateConfig& config) = 0;
|
|
57
|
-
virtual void updateSearchResults(const std::string& templateId, const NitroSection& results) = 0;
|
|
58
|
+
virtual std::shared_ptr<Promise<void>> updateSearchResults(const std::string& templateId, const NitroSection& results) = 0;
|
|
58
59
|
|
|
59
60
|
protected:
|
|
60
61
|
// Hybrid Setup
|
package/package.json
CHANGED
|
@@ -68,7 +68,7 @@ export interface AutoPlay extends HybridObject<{ android: 'kotlin'; ios: 'swift'
|
|
|
68
68
|
/**
|
|
69
69
|
* update a templates headerActions
|
|
70
70
|
*/
|
|
71
|
-
setTemplateHeaderActions(templateId: string, headerActions?: Array<NitroAction>): void
|
|
71
|
+
setTemplateHeaderActions(templateId: string, headerActions?: Array<NitroAction>): Promise<void>;
|
|
72
72
|
|
|
73
73
|
/**
|
|
74
74
|
* Check if AutoPlay is connected.
|
|
@@ -7,5 +7,5 @@ interface GridTemplateConfig extends NitroTemplateConfig, NitroGridTemplateConfi
|
|
|
7
7
|
|
|
8
8
|
export interface GridTemplate extends HybridObject<{ android: 'kotlin'; ios: 'swift' }> {
|
|
9
9
|
createGridTemplate(config: GridTemplateConfig): void;
|
|
10
|
-
updateGridTemplateButtons(templateId: string, buttons: Array<NitroGridButton>): void
|
|
10
|
+
updateGridTemplateButtons(templateId: string, buttons: Array<NitroGridButton>): Promise<void>;
|
|
11
11
|
}
|
|
@@ -39,7 +39,7 @@ export interface MapTemplate extends HybridObject<{ android: 'kotlin'; ios: 'swi
|
|
|
39
39
|
mapButtons: Array<NitroMapButton>
|
|
40
40
|
): TripSelectorCallback;
|
|
41
41
|
hideTripSelector(templateId: string): void;
|
|
42
|
-
setTemplateMapButtons(templateId: string, buttons?: Array<NitroMapButton>): void
|
|
42
|
+
setTemplateMapButtons(templateId: string, buttons?: Array<NitroMapButton>): Promise<void>;
|
|
43
43
|
updateVisibleTravelEstimate(
|
|
44
44
|
templateId: string,
|
|
45
45
|
visibleTravelEstimate: VisibleTravelEstimate
|
|
@@ -6,5 +6,8 @@ interface SearchTemplateConfig extends NitroTemplateConfig, NitroSearchTemplateC
|
|
|
6
6
|
|
|
7
7
|
export interface SearchTemplate extends HybridObject<{ android: 'kotlin'; ios: 'swift' }> {
|
|
8
8
|
createSearchTemplate(config: SearchTemplateConfig): void;
|
|
9
|
-
updateSearchResults(
|
|
9
|
+
updateSearchResults(
|
|
10
|
+
templateId: string,
|
|
11
|
+
results: NitroSearchTemplateConfig['results']
|
|
12
|
+
): Promise<void>;
|
|
10
13
|
}
|
|
@@ -65,7 +65,7 @@ export class GridTemplate extends Template<GridTemplateConfig, HeaderActions<Gri
|
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
public updateGrid(buttons: Array<GridButton<GridTemplate>>) {
|
|
68
|
-
HybridGridTemplate.updateGridTemplateButtons(
|
|
68
|
+
return HybridGridTemplate.updateGridTemplateButtons(
|
|
69
69
|
this.id,
|
|
70
70
|
NitroGridUtil.convert(this.template, buttons)
|
|
71
71
|
);
|
|
@@ -116,7 +116,7 @@ export class InformationTemplate extends Template<
|
|
|
116
116
|
|
|
117
117
|
public updateItems(items?: InformationItems) {
|
|
118
118
|
const section = this.getSection(items);
|
|
119
|
-
HybridInformationTemplate.updateInformationTemplateSections(
|
|
119
|
+
return HybridInformationTemplate.updateInformationTemplateSections(
|
|
120
120
|
this.id,
|
|
121
121
|
NitroSectionUtil.convert(this.template, section)?.at(0) ?? { items: [], type: 'default' }
|
|
122
122
|
);
|
|
@@ -122,7 +122,7 @@ export class ListTemplate extends Template<ListTemplateConfig, HeaderActions<Lis
|
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
public updateSections(sections?: Section<ListTemplate>) {
|
|
125
|
-
HybridListTemplate.updateListTemplateSections(
|
|
125
|
+
return HybridListTemplate.updateListTemplateSections(
|
|
126
126
|
this.id,
|
|
127
127
|
NitroSectionUtil.convert(this.template, sections)
|
|
128
128
|
);
|
|
@@ -198,12 +198,12 @@ export class MapTemplate extends Template<MapTemplateConfig, MapTemplateConfig['
|
|
|
198
198
|
|
|
199
199
|
public setMapButtons(mapButtons: MapTemplateConfig['mapButtons']) {
|
|
200
200
|
const buttons = NitroMapButton.convert(this.template, mapButtons);
|
|
201
|
-
HybridMapTemplate.setTemplateMapButtons(this.id, buttons);
|
|
201
|
+
return HybridMapTemplate.setTemplateMapButtons(this.id, buttons);
|
|
202
202
|
}
|
|
203
203
|
|
|
204
204
|
public override setHeaderActions(headerActions: MapTemplateConfig['headerActions']) {
|
|
205
205
|
const nitroActions = NitroActionUtil.convert(this.template, headerActions);
|
|
206
|
-
HybridAutoPlay.setTemplateHeaderActions(this.id, nitroActions);
|
|
206
|
+
return HybridAutoPlay.setTemplateHeaderActions(this.id, nitroActions);
|
|
207
207
|
}
|
|
208
208
|
|
|
209
209
|
/**
|
|
@@ -87,7 +87,7 @@ export class SearchTemplate extends Template<SearchTemplateConfig, HeaderActions
|
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
public updateSearchResults(results?: SingleSection<SearchTemplate>) {
|
|
90
|
-
HybridSearchTemplate.updateSearchResults(
|
|
90
|
+
return HybridSearchTemplate.updateSearchResults(
|
|
91
91
|
this.id,
|
|
92
92
|
NitroSectionUtil.convert(this.template, results)?.at(0) ?? {
|
|
93
93
|
items: [],
|
|
@@ -104,6 +104,6 @@ export class Template<TemplateConfigType, ActionsType> {
|
|
|
104
104
|
|
|
105
105
|
public setHeaderActions<T>(headerActions?: ActionsType) {
|
|
106
106
|
const nitroActions = NitroActionUtil.convert(headerActions as HeaderActions<T>);
|
|
107
|
-
HybridAutoPlay.setTemplateHeaderActions(this.id, nitroActions);
|
|
107
|
+
return HybridAutoPlay.setTemplateHeaderActions(this.id, nitroActions);
|
|
108
108
|
}
|
|
109
109
|
}
|