@iternio/react-native-auto-play 0.4.8 → 0.4.11
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 +93 -0
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/VoiceInputManager.kt +20 -286
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/utils/ThreadUtil.kt +13 -6
- package/ios/hybrid/HybridAutoPlay.swift +51 -2
- package/ios/utils/VoiceInputManager.swift +40 -144
- package/lib/index.d.ts +1 -3
- package/lib/index.js +1 -2
- package/lib/scenes/CarPlayDashboardScene.d.ts +1 -0
- package/lib/scenes/CarPlayDashboardScene.js +13 -7
- package/lib/specs/AutoPlay.nitro.d.ts +35 -0
- package/nitro.json +0 -10
- package/nitrogen/generated/android/ReactNativeAutoPlay+autolinking.cmake +0 -2
- package/nitrogen/generated/android/ReactNativeAutoPlayOnLoad.cpp +0 -18
- package/nitrogen/generated/android/c++/JActiveCarUxRestrictions.hpp +8 -8
- package/nitrogen/generated/android/c++/JGridTemplateConfig.hpp +16 -16
- package/nitrogen/generated/android/c++/JHybridAndroidAutoTelemetrySpec.cpp +4 -4
- package/nitrogen/generated/android/c++/JHybridAutoPlaySpec.cpp +52 -4
- package/nitrogen/generated/android/c++/JHybridAutoPlaySpec.hpp +5 -0
- package/nitrogen/generated/android/c++/JHybridClusterSpec.cpp +4 -4
- package/nitrogen/generated/android/c++/JHybridGridTemplateSpec.cpp +4 -4
- package/nitrogen/generated/android/c++/JHybridListTemplateSpec.cpp +4 -4
- package/nitrogen/generated/android/c++/JHybridMapTemplateSpec.cpp +15 -15
- package/nitrogen/generated/android/c++/JInformationTemplateConfig.hpp +16 -16
- package/nitrogen/generated/android/c++/JLaneGuidance.hpp +16 -16
- package/nitrogen/generated/android/c++/JListTemplateConfig.hpp +16 -16
- package/nitrogen/generated/android/c++/JMapTemplateConfig.hpp +16 -16
- package/nitrogen/generated/android/c++/JMessageTemplateConfig.hpp +16 -16
- package/nitrogen/generated/android/c++/JNitroAttributedString.hpp +8 -8
- package/nitrogen/generated/android/c++/JNitroBaseMapTemplateConfig.hpp +16 -16
- package/nitrogen/generated/android/c++/JNitroManeuver.cpp +4 -4
- package/nitrogen/generated/android/c++/JNitroManeuver.hpp +4 -4
- package/nitrogen/generated/android/c++/JNitroRoutingManeuver.hpp +16 -16
- package/nitrogen/generated/android/c++/JNitroSection.hpp +8 -8
- package/nitrogen/generated/android/c++/JPermissionRequestResult.hpp +16 -16
- package/nitrogen/generated/android/c++/JRouteChoice.hpp +32 -32
- package/nitrogen/generated/android/c++/JSearchTemplateConfig.hpp +8 -8
- package/nitrogen/generated/android/c++/JSignInTemplateConfig.hpp +16 -16
- package/nitrogen/generated/android/c++/JTripsConfig.hpp +8 -8
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/ActiveCarUxRestrictions.kt +19 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/AppFocusState.kt +15 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/AssetImage.kt +23 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/AutoText.kt +17 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/BooleanTelemetryItem.kt +15 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/Distance.kt +15 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/DurationWithTimeZone.kt +15 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/GlyphImage.kt +21 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/GoogleSignIn.kt +19 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/GoogleSignInAccount.kt +27 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/GridTemplateConfig.kt +33 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridAutoPlaySpec.kt +21 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/ImageLane.kt +15 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/InformationTemplateConfig.kt +35 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/InputSignIn.kt +27 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/LaneGuidance.kt +15 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/ListTemplateConfig.kt +33 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/Location.kt +15 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/MapTemplateConfig.kt +51 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/MessageTemplateConfig.kt +37 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/NavigationAlertAction.kt +17 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/NitroAction.kt +27 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/NitroAttributedString.kt +15 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/NitroAttributedStringImage.kt +15 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/NitroBaseMapTemplateConfig.kt +29 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/NitroColor.kt +15 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/NitroGridButton.kt +17 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/NitroImage.kt +18 -8
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/NitroLoadingManeuver.kt +17 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/NitroManeuver.kt +18 -8
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/NitroMapButton.kt +17 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/NitroMessageManeuver.kt +19 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/NitroNavigationAlert.kt +31 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/NitroRoutingManeuver.kt +49 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/NitroRow.kt +27 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/NitroSection.kt +17 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/NumericTelemetryItem.kt +15 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/PermissionRequestResult.kt +15 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/PinSignIn.kt +15 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/Point.kt +15 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/PreferredImageLane.kt +19 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/QrSignIn.kt +15 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/RemoteImage.kt +17 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/RouteChoice.kt +21 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/SafeAreaInsets.kt +21 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/SearchTemplateConfig.kt +39 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/SignInTemplateConfig.kt +37 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/StringTelemetryItem.kt +15 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/Telemetry.kt +35 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/TravelEstimates.kt +19 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/TripConfig.kt +15 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/TripPoint.kt +19 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/TripPreviewTextConfiguration.kt +19 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/TripSelectorCallback.kt +13 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/TripsConfig.kt +15 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/Variant_GlyphImage_AssetImage_RemoteImage.kt +18 -8
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/Variant_PreferredImageLane_ImageLane.kt +16 -7
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/Variant_QrSignIn_PinSignIn_InputSignIn_GoogleSignIn.kt +20 -9
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/VehicleTelemetryItem.kt +19 -0
- package/nitrogen/generated/ios/ReactNativeAutoPlay+autolinking.rb +2 -0
- package/nitrogen/generated/ios/ReactNativeAutoPlay-Swift-Cxx-Bridge.cpp +16 -41
- package/nitrogen/generated/ios/ReactNativeAutoPlay-Swift-Cxx-Bridge.hpp +126 -201
- package/nitrogen/generated/ios/ReactNativeAutoPlay-Swift-Cxx-Umbrella.hpp +0 -11
- package/nitrogen/generated/ios/ReactNativeAutoPlayAutolinking.mm +0 -8
- package/nitrogen/generated/ios/ReactNativeAutoPlayAutolinking.swift +0 -12
- package/nitrogen/generated/ios/c++/HybridAutoPlaySpecSwift.hpp +42 -0
- package/nitrogen/generated/ios/swift/Func_void_bool.swift +5 -5
- package/nitrogen/generated/ios/swift/{Func_void_VoiceInputResult.swift → Func_void_std__shared_ptr_ArrayBuffer_.swift} +10 -10
- package/nitrogen/generated/ios/swift/HybridAutoPlaySpec.swift +5 -0
- package/nitrogen/generated/ios/swift/HybridAutoPlaySpec_cxx.swift +94 -0
- package/nitrogen/generated/ios/swift/NitroImage.swift +13 -0
- package/nitrogen/generated/ios/swift/NitroManeuver.swift +13 -0
- package/nitrogen/generated/ios/swift/Variant_GlyphImage_AssetImage_RemoteImage.swift +13 -0
- package/nitrogen/generated/ios/swift/Variant_PreferredImageLane_ImageLane.swift +12 -0
- package/nitrogen/generated/shared/c++/HybridAutoPlaySpec.cpp +5 -0
- package/nitrogen/generated/shared/c++/HybridAutoPlaySpec.hpp +6 -0
- package/package.json +2 -2
- package/src/index.ts +1 -3
- package/src/scenes/CarPlayDashboardScene.ts +18 -11
- package/src/specs/AutoPlay.nitro.ts +44 -0
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridVoice.kt +0 -97
- package/ios/hybrid/HybridVoice.swift +0 -65
- package/lib/HybridAutoPlay.d.ts +0 -2
- package/lib/HybridAutoPlay.js +0 -2
- package/lib/components/OnAppearedChildRenderer.d.ts +0 -10
- package/lib/components/OnAppearedChildRenderer.js +0 -26
- package/lib/hooks/useIsAutoPlayFocused.d.ts +0 -7
- package/lib/hooks/useIsAutoPlayFocused.js +0 -20
- package/lib/hybrid/HybridVoice.d.ts +0 -52
- package/lib/hybrid/HybridVoice.js +0 -52
- package/lib/hybrid.d.ts +0 -2
- package/lib/hybrid.js +0 -2
- package/lib/specs/AutomotivePermissionRequestTemplate.d.ts +0 -11
- package/lib/specs/AutomotivePermissionRequestTemplate.js +0 -1
- package/lib/specs/AutomotivePermissionRequestTemplate.nitro.d.ts +0 -11
- package/lib/specs/AutomotivePermissionRequestTemplate.nitro.js +0 -1
- package/lib/specs/Voice.nitro.d.ts +0 -11
- package/lib/specs/Voice.nitro.js +0 -1
- package/lib/templates/AutomotivePermissionRequestTemplate.d.ts +0 -23
- package/lib/templates/AutomotivePermissionRequestTemplate.js +0 -18
- package/lib/types/Glyphmap.d.ts +0 -4105
- package/lib/types/Glyphmap.js +0 -4105
- package/lib/types/Voice.d.ts +0 -16
- package/lib/types/Voice.js +0 -1
- package/nitrogen/generated/android/c++/JFunc_void_VoiceInputChunk.hpp +0 -81
- package/nitrogen/generated/android/c++/JHybridVoiceSpec.cpp +0 -104
- package/nitrogen/generated/android/c++/JHybridVoiceSpec.hpp +0 -66
- package/nitrogen/generated/android/c++/JVoiceInputChunk.hpp +0 -64
- package/nitrogen/generated/android/c++/JVoiceInputResult.hpp +0 -64
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/Func_void_VoiceInputChunk.kt +0 -80
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridVoiceSpec.kt +0 -72
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/VoiceInputChunk.kt +0 -41
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/VoiceInputResult.kt +0 -41
- package/nitrogen/generated/ios/c++/HybridVoiceSpecSwift.cpp +0 -11
- package/nitrogen/generated/ios/c++/HybridVoiceSpecSwift.hpp +0 -116
- package/nitrogen/generated/ios/swift/Func_void_VoiceInputChunk.swift +0 -46
- package/nitrogen/generated/ios/swift/HybridVoiceSpec.swift +0 -58
- package/nitrogen/generated/ios/swift/HybridVoiceSpec_cxx.swift +0 -234
- package/nitrogen/generated/ios/swift/VoiceInputChunk.swift +0 -60
- package/nitrogen/generated/ios/swift/VoiceInputResult.swift +0 -60
- package/nitrogen/generated/shared/c++/HybridVoiceSpec.cpp +0 -24
- package/nitrogen/generated/shared/c++/HybridVoiceSpec.hpp +0 -73
- package/nitrogen/generated/shared/c++/VoiceInputChunk.hpp +0 -89
- package/nitrogen/generated/shared/c++/VoiceInputResult.hpp +0 -89
- package/src/hybrid/HybridVoice.ts +0 -79
- package/src/specs/Voice.nitro.ts +0 -16
- package/src/types/Voice.ts +0 -18
|
@@ -52,8 +52,6 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay { class HybridMapTem
|
|
|
52
52
|
namespace margelo::nitro::swe::iternio::reactnativeautoplay { class HybridMessageTemplateSpec; }
|
|
53
53
|
// Forward declaration of `HybridSearchTemplateSpec` to properly resolve imports.
|
|
54
54
|
namespace margelo::nitro::swe::iternio::reactnativeautoplay { class HybridSearchTemplateSpec; }
|
|
55
|
-
// Forward declaration of `HybridVoiceSpec` to properly resolve imports.
|
|
56
|
-
namespace margelo::nitro::swe::iternio::reactnativeautoplay { class HybridVoiceSpec; }
|
|
57
55
|
// Forward declaration of `ImageLane` to properly resolve imports.
|
|
58
56
|
namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct ImageLane; }
|
|
59
57
|
// Forward declaration of `InformationTemplateConfig` to properly resolve imports.
|
|
@@ -150,10 +148,6 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay { enum class TurnTyp
|
|
|
150
148
|
namespace margelo::nitro::swe::iternio::reactnativeautoplay { enum class VisibilityState; }
|
|
151
149
|
// Forward declaration of `VisibleTravelEstimate` to properly resolve imports.
|
|
152
150
|
namespace margelo::nitro::swe::iternio::reactnativeautoplay { enum class VisibleTravelEstimate; }
|
|
153
|
-
// Forward declaration of `VoiceInputChunk` to properly resolve imports.
|
|
154
|
-
namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct VoiceInputChunk; }
|
|
155
|
-
// Forward declaration of `VoiceInputResult` to properly resolve imports.
|
|
156
|
-
namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct VoiceInputResult; }
|
|
157
151
|
// Forward declaration of `ZoomEvent` to properly resolve imports.
|
|
158
152
|
namespace margelo::nitro::swe::iternio::reactnativeautoplay { enum class ZoomEvent; }
|
|
159
153
|
|
|
@@ -180,7 +174,6 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay { enum class ZoomEve
|
|
|
180
174
|
#include "HybridMapTemplateSpec.hpp"
|
|
181
175
|
#include "HybridMessageTemplateSpec.hpp"
|
|
182
176
|
#include "HybridSearchTemplateSpec.hpp"
|
|
183
|
-
#include "HybridVoiceSpec.hpp"
|
|
184
177
|
#include "ImageLane.hpp"
|
|
185
178
|
#include "InformationTemplateConfig.hpp"
|
|
186
179
|
#include "KeepType.hpp"
|
|
@@ -229,8 +222,6 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay { enum class ZoomEve
|
|
|
229
222
|
#include "TurnType.hpp"
|
|
230
223
|
#include "VisibilityState.hpp"
|
|
231
224
|
#include "VisibleTravelEstimate.hpp"
|
|
232
|
-
#include "VoiceInputChunk.hpp"
|
|
233
|
-
#include "VoiceInputResult.hpp"
|
|
234
225
|
#include "ZoomEvent.hpp"
|
|
235
226
|
#include <NitroModules/ArrayBuffer.hpp>
|
|
236
227
|
#include <NitroModules/Promise.hpp>
|
|
@@ -271,8 +262,6 @@ namespace ReactNativeAutoPlay { class HybridMapTemplateSpec_cxx; }
|
|
|
271
262
|
namespace ReactNativeAutoPlay { class HybridMessageTemplateSpec_cxx; }
|
|
272
263
|
// Forward declaration of `HybridSearchTemplateSpec_cxx` to properly resolve imports.
|
|
273
264
|
namespace ReactNativeAutoPlay { class HybridSearchTemplateSpec_cxx; }
|
|
274
|
-
// Forward declaration of `HybridVoiceSpec_cxx` to properly resolve imports.
|
|
275
|
-
namespace ReactNativeAutoPlay { class HybridVoiceSpec_cxx; }
|
|
276
265
|
|
|
277
266
|
// Include Swift defined types
|
|
278
267
|
#if __has_include("ReactNativeAutoPlay-Swift.h")
|
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
#import "ReactNativeAutoPlay-Swift-Cxx-Umbrella.hpp"
|
|
11
11
|
#import <type_traits>
|
|
12
12
|
|
|
13
|
-
#include "HybridVoiceSpecSwift.hpp"
|
|
14
13
|
#include "HybridAutoPlaySpecSwift.hpp"
|
|
15
14
|
#include "HybridListTemplateSpecSwift.hpp"
|
|
16
15
|
#include "HybridInformationTemplateSpecSwift.hpp"
|
|
@@ -30,13 +29,6 @@
|
|
|
30
29
|
using namespace margelo::nitro;
|
|
31
30
|
using namespace margelo::nitro::swe::iternio::reactnativeautoplay;
|
|
32
31
|
|
|
33
|
-
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
34
|
-
"Voice",
|
|
35
|
-
[]() -> std::shared_ptr<HybridObject> {
|
|
36
|
-
std::shared_ptr<HybridVoiceSpec> hybridObject = ReactNativeAutoPlay::ReactNativeAutoPlayAutolinking::createVoice();
|
|
37
|
-
return hybridObject;
|
|
38
|
-
}
|
|
39
|
-
);
|
|
40
32
|
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
41
33
|
"AutoPlay",
|
|
42
34
|
[]() -> std::shared_ptr<HybridObject> {
|
|
@@ -12,18 +12,6 @@ import NitroModules
|
|
|
12
12
|
public final class ReactNativeAutoPlayAutolinking {
|
|
13
13
|
public typealias bridge = margelo.nitro.swe.iternio.reactnativeautoplay.bridge.swift
|
|
14
14
|
|
|
15
|
-
public static func createVoice() -> bridge.std__shared_ptr_HybridVoiceSpec_ {
|
|
16
|
-
let hybridObject = HybridVoice()
|
|
17
|
-
return { () -> bridge.std__shared_ptr_HybridVoiceSpec_ in
|
|
18
|
-
let __cxxWrapped = hybridObject.getCxxWrapper()
|
|
19
|
-
return __cxxWrapped.getCxxPart()
|
|
20
|
-
}()
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
public static func isVoiceRecyclable() -> Bool {
|
|
24
|
-
return HybridVoice.self is any RecyclableView.Type
|
|
25
|
-
}
|
|
26
|
-
|
|
27
15
|
public static func createAutoPlay() -> bridge.std__shared_ptr_HybridAutoPlaySpec_ {
|
|
28
16
|
let hybridObject = HybridAutoPlay()
|
|
29
17
|
return { () -> bridge.std__shared_ptr_HybridAutoPlaySpec_ in
|
|
@@ -18,6 +18,8 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay { enum class EventNa
|
|
|
18
18
|
namespace margelo::nitro::swe::iternio::reactnativeautoplay { enum class VisibilityState; }
|
|
19
19
|
// Forward declaration of `Location` to properly resolve imports.
|
|
20
20
|
namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct Location; }
|
|
21
|
+
// Forward declaration of `ArrayBufferHolder` to properly resolve imports.
|
|
22
|
+
namespace NitroModules { class ArrayBufferHolder; }
|
|
21
23
|
// Forward declaration of `SafeAreaInsets` to properly resolve imports.
|
|
22
24
|
namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct SafeAreaInsets; }
|
|
23
25
|
// Forward declaration of `NitroAction` to properly resolve imports.
|
|
@@ -44,6 +46,8 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay { enum class NitroBu
|
|
|
44
46
|
#include "Location.hpp"
|
|
45
47
|
#include <optional>
|
|
46
48
|
#include <NitroModules/Promise.hpp>
|
|
49
|
+
#include <NitroModules/ArrayBuffer.hpp>
|
|
50
|
+
#include <NitroModules/ArrayBufferHolder.hpp>
|
|
47
51
|
#include "SafeAreaInsets.hpp"
|
|
48
52
|
#include "NitroAction.hpp"
|
|
49
53
|
#include <vector>
|
|
@@ -130,6 +134,36 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
|
130
134
|
auto __value = std::move(__result.value());
|
|
131
135
|
return __value;
|
|
132
136
|
}
|
|
137
|
+
inline bool hasVoiceInputPermission() override {
|
|
138
|
+
auto __result = _swiftPart.hasVoiceInputPermission();
|
|
139
|
+
if (__result.hasError()) [[unlikely]] {
|
|
140
|
+
std::rethrow_exception(__result.error());
|
|
141
|
+
}
|
|
142
|
+
auto __value = std::move(__result.value());
|
|
143
|
+
return __value;
|
|
144
|
+
}
|
|
145
|
+
inline std::shared_ptr<Promise<bool>> requestVoiceInputPermission() override {
|
|
146
|
+
auto __result = _swiftPart.requestVoiceInputPermission();
|
|
147
|
+
if (__result.hasError()) [[unlikely]] {
|
|
148
|
+
std::rethrow_exception(__result.error());
|
|
149
|
+
}
|
|
150
|
+
auto __value = std::move(__result.value());
|
|
151
|
+
return __value;
|
|
152
|
+
}
|
|
153
|
+
inline std::shared_ptr<Promise<std::shared_ptr<ArrayBuffer>>> startVoiceInput(std::optional<double> silenceThresholdMs, std::optional<double> maxDurationMs, const std::optional<std::string>& listeningText) override {
|
|
154
|
+
auto __result = _swiftPart.startVoiceInput(silenceThresholdMs, maxDurationMs, listeningText);
|
|
155
|
+
if (__result.hasError()) [[unlikely]] {
|
|
156
|
+
std::rethrow_exception(__result.error());
|
|
157
|
+
}
|
|
158
|
+
auto __value = std::move(__result.value());
|
|
159
|
+
return __value;
|
|
160
|
+
}
|
|
161
|
+
inline void stopVoiceInput() override {
|
|
162
|
+
auto __result = _swiftPart.stopVoiceInput();
|
|
163
|
+
if (__result.hasError()) [[unlikely]] {
|
|
164
|
+
std::rethrow_exception(__result.error());
|
|
165
|
+
}
|
|
166
|
+
}
|
|
133
167
|
inline std::shared_ptr<Promise<void>> setRootTemplate(const std::string& templateId) override {
|
|
134
168
|
auto __result = _swiftPart.setRootTemplate(templateId);
|
|
135
169
|
if (__result.hasError()) [[unlikely]] {
|
|
@@ -194,6 +228,14 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
|
194
228
|
auto __value = std::move(__result.value());
|
|
195
229
|
return __value;
|
|
196
230
|
}
|
|
231
|
+
inline bool isCarServiceRunning() override {
|
|
232
|
+
auto __result = _swiftPart.isCarServiceRunning();
|
|
233
|
+
if (__result.hasError()) [[unlikely]] {
|
|
234
|
+
std::rethrow_exception(__result.error());
|
|
235
|
+
}
|
|
236
|
+
auto __value = std::move(__result.value());
|
|
237
|
+
return __value;
|
|
238
|
+
}
|
|
197
239
|
|
|
198
240
|
private:
|
|
199
241
|
ReactNativeAutoPlay::HybridAutoPlaySpec_cxx _swiftPart;
|
|
@@ -8,21 +8,21 @@
|
|
|
8
8
|
import NitroModules
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
* Wraps a Swift `(_
|
|
11
|
+
* Wraps a Swift `(_ isPanningInterfaceVisible: Bool) -> Void` as a class.
|
|
12
12
|
* This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
|
|
13
13
|
*/
|
|
14
14
|
public final class Func_void_bool {
|
|
15
15
|
public typealias bridge = margelo.nitro.swe.iternio.reactnativeautoplay.bridge.swift
|
|
16
16
|
|
|
17
|
-
private let closure: (_
|
|
17
|
+
private let closure: (_ isPanningInterfaceVisible: Bool) -> Void
|
|
18
18
|
|
|
19
|
-
public init(_ closure: @escaping (_
|
|
19
|
+
public init(_ closure: @escaping (_ isPanningInterfaceVisible: Bool) -> Void) {
|
|
20
20
|
self.closure = closure
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
@inline(__always)
|
|
24
|
-
public func call(
|
|
25
|
-
self.closure(
|
|
24
|
+
public func call(isPanningInterfaceVisible: Bool) -> Void {
|
|
25
|
+
self.closure(isPanningInterfaceVisible)
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
///
|
|
2
|
-
///
|
|
2
|
+
/// Func_void_std__shared_ptr_ArrayBuffer_.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
|
|
@@ -8,20 +8,20 @@
|
|
|
8
8
|
import NitroModules
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
* Wraps a Swift `(_ value:
|
|
11
|
+
* Wraps a Swift `(_ value: ArrayBuffer) -> Void` as a class.
|
|
12
12
|
* This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
|
|
13
13
|
*/
|
|
14
|
-
public final class
|
|
14
|
+
public final class Func_void_std__shared_ptr_ArrayBuffer_ {
|
|
15
15
|
public typealias bridge = margelo.nitro.swe.iternio.reactnativeautoplay.bridge.swift
|
|
16
16
|
|
|
17
|
-
private let closure: (_ value:
|
|
17
|
+
private let closure: (_ value: ArrayBuffer) -> Void
|
|
18
18
|
|
|
19
|
-
public init(_ closure: @escaping (_ value:
|
|
19
|
+
public init(_ closure: @escaping (_ value: ArrayBuffer) -> Void) {
|
|
20
20
|
self.closure = closure
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
@inline(__always)
|
|
24
|
-
public func call(value:
|
|
24
|
+
public func call(value: ArrayBuffer) -> Void {
|
|
25
25
|
self.closure(value)
|
|
26
26
|
}
|
|
27
27
|
|
|
@@ -35,12 +35,12 @@ public final class Func_void_VoiceInputResult {
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
/**
|
|
38
|
-
* Casts an unsafe pointer to a `
|
|
39
|
-
* The pointer has to be a retained opaque `Unmanaged<
|
|
38
|
+
* Casts an unsafe pointer to a `Func_void_std__shared_ptr_ArrayBuffer_`.
|
|
39
|
+
* The pointer has to be a retained opaque `Unmanaged<Func_void_std__shared_ptr_ArrayBuffer_>`.
|
|
40
40
|
* This removes one strong reference from the object!
|
|
41
41
|
*/
|
|
42
42
|
@inline(__always)
|
|
43
|
-
public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) ->
|
|
44
|
-
return Unmanaged<
|
|
43
|
+
public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_std__shared_ptr_ArrayBuffer_ {
|
|
44
|
+
return Unmanaged<Func_void_std__shared_ptr_ArrayBuffer_>.fromOpaque(pointer).takeRetainedValue()
|
|
45
45
|
}
|
|
46
46
|
}
|
|
@@ -16,6 +16,10 @@ public protocol HybridAutoPlaySpec_protocol: HybridObject {
|
|
|
16
16
|
func addListener(eventType: EventName, callback: @escaping () -> Void) throws -> () -> Void
|
|
17
17
|
func addListenerRenderState(moduleName: String, callback: @escaping (_ payload: VisibilityState) -> Void) throws -> () -> Void
|
|
18
18
|
func addListenerVoiceInput(callback: @escaping (_ coordinates: Location?, _ query: String?) -> Void) throws -> () -> Void
|
|
19
|
+
func hasVoiceInputPermission() throws -> Bool
|
|
20
|
+
func requestVoiceInputPermission() throws -> Promise<Bool>
|
|
21
|
+
func startVoiceInput(silenceThresholdMs: Double?, maxDurationMs: Double?, listeningText: String?) throws -> Promise<ArrayBuffer>
|
|
22
|
+
func stopVoiceInput() throws -> Void
|
|
19
23
|
func setRootTemplate(templateId: String) throws -> Promise<Void>
|
|
20
24
|
func pushTemplate(templateId: String) throws -> Promise<Void>
|
|
21
25
|
func popTemplate(animate: Bool?) throws -> Promise<Void>
|
|
@@ -24,6 +28,7 @@ public protocol HybridAutoPlaySpec_protocol: HybridObject {
|
|
|
24
28
|
func addSafeAreaInsetsListener(moduleName: String, callback: @escaping (_ insets: SafeAreaInsets) -> Void) throws -> () -> Void
|
|
25
29
|
func setTemplateHeaderActions(templateId: String, headerActions: [NitroAction]?) throws -> Promise<Void>
|
|
26
30
|
func isConnected() throws -> Bool
|
|
31
|
+
func isCarServiceRunning() throws -> Bool
|
|
27
32
|
}
|
|
28
33
|
|
|
29
34
|
public extension HybridAutoPlaySpec_protocol {
|
|
@@ -196,6 +196,88 @@ open class HybridAutoPlaySpec_cxx {
|
|
|
196
196
|
}
|
|
197
197
|
}
|
|
198
198
|
|
|
199
|
+
@inline(__always)
|
|
200
|
+
public final func hasVoiceInputPermission() -> bridge.Result_bool_ {
|
|
201
|
+
do {
|
|
202
|
+
let __result = try self.__implementation.hasVoiceInputPermission()
|
|
203
|
+
let __resultCpp = __result
|
|
204
|
+
return bridge.create_Result_bool_(__resultCpp)
|
|
205
|
+
} catch (let __error) {
|
|
206
|
+
let __exceptionPtr = __error.toCpp()
|
|
207
|
+
return bridge.create_Result_bool_(__exceptionPtr)
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
@inline(__always)
|
|
212
|
+
public final func requestVoiceInputPermission() -> bridge.Result_std__shared_ptr_Promise_bool___ {
|
|
213
|
+
do {
|
|
214
|
+
let __result = try self.__implementation.requestVoiceInputPermission()
|
|
215
|
+
let __resultCpp = { () -> bridge.std__shared_ptr_Promise_bool__ in
|
|
216
|
+
let __promise = bridge.create_std__shared_ptr_Promise_bool__()
|
|
217
|
+
let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_bool__(__promise)
|
|
218
|
+
__result
|
|
219
|
+
.then({ __result in __promiseHolder.resolve(__result) })
|
|
220
|
+
.catch({ __error in __promiseHolder.reject(__error.toCpp()) })
|
|
221
|
+
return __promise
|
|
222
|
+
}()
|
|
223
|
+
return bridge.create_Result_std__shared_ptr_Promise_bool___(__resultCpp)
|
|
224
|
+
} catch (let __error) {
|
|
225
|
+
let __exceptionPtr = __error.toCpp()
|
|
226
|
+
return bridge.create_Result_std__shared_ptr_Promise_bool___(__exceptionPtr)
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
@inline(__always)
|
|
231
|
+
public final func startVoiceInput(silenceThresholdMs: bridge.std__optional_double_, maxDurationMs: bridge.std__optional_double_, listeningText: bridge.std__optional_std__string_) -> bridge.Result_std__shared_ptr_Promise_std__shared_ptr_ArrayBuffer____ {
|
|
232
|
+
do {
|
|
233
|
+
let __result = try self.__implementation.startVoiceInput(silenceThresholdMs: { () -> Double? in
|
|
234
|
+
if bridge.has_value_std__optional_double_(silenceThresholdMs) {
|
|
235
|
+
let __unwrapped = bridge.get_std__optional_double_(silenceThresholdMs)
|
|
236
|
+
return __unwrapped
|
|
237
|
+
} else {
|
|
238
|
+
return nil
|
|
239
|
+
}
|
|
240
|
+
}(), maxDurationMs: { () -> Double? in
|
|
241
|
+
if bridge.has_value_std__optional_double_(maxDurationMs) {
|
|
242
|
+
let __unwrapped = bridge.get_std__optional_double_(maxDurationMs)
|
|
243
|
+
return __unwrapped
|
|
244
|
+
} else {
|
|
245
|
+
return nil
|
|
246
|
+
}
|
|
247
|
+
}(), listeningText: { () -> String? in
|
|
248
|
+
if bridge.has_value_std__optional_std__string_(listeningText) {
|
|
249
|
+
let __unwrapped = bridge.get_std__optional_std__string_(listeningText)
|
|
250
|
+
return String(__unwrapped)
|
|
251
|
+
} else {
|
|
252
|
+
return nil
|
|
253
|
+
}
|
|
254
|
+
}())
|
|
255
|
+
let __resultCpp = { () -> bridge.std__shared_ptr_Promise_std__shared_ptr_ArrayBuffer___ in
|
|
256
|
+
let __promise = bridge.create_std__shared_ptr_Promise_std__shared_ptr_ArrayBuffer___()
|
|
257
|
+
let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_std__shared_ptr_ArrayBuffer___(__promise)
|
|
258
|
+
__result
|
|
259
|
+
.then({ __result in __promiseHolder.resolve(__result.getArrayBuffer()) })
|
|
260
|
+
.catch({ __error in __promiseHolder.reject(__error.toCpp()) })
|
|
261
|
+
return __promise
|
|
262
|
+
}()
|
|
263
|
+
return bridge.create_Result_std__shared_ptr_Promise_std__shared_ptr_ArrayBuffer____(__resultCpp)
|
|
264
|
+
} catch (let __error) {
|
|
265
|
+
let __exceptionPtr = __error.toCpp()
|
|
266
|
+
return bridge.create_Result_std__shared_ptr_Promise_std__shared_ptr_ArrayBuffer____(__exceptionPtr)
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
@inline(__always)
|
|
271
|
+
public final func stopVoiceInput() -> bridge.Result_void_ {
|
|
272
|
+
do {
|
|
273
|
+
try self.__implementation.stopVoiceInput()
|
|
274
|
+
return bridge.create_Result_void_()
|
|
275
|
+
} catch (let __error) {
|
|
276
|
+
let __exceptionPtr = __error.toCpp()
|
|
277
|
+
return bridge.create_Result_void_(__exceptionPtr)
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
|
|
199
281
|
@inline(__always)
|
|
200
282
|
public final func setRootTemplate(templateId: std.string) -> bridge.Result_std__shared_ptr_Promise_void___ {
|
|
201
283
|
do {
|
|
@@ -369,4 +451,16 @@ open class HybridAutoPlaySpec_cxx {
|
|
|
369
451
|
return bridge.create_Result_bool_(__exceptionPtr)
|
|
370
452
|
}
|
|
371
453
|
}
|
|
454
|
+
|
|
455
|
+
@inline(__always)
|
|
456
|
+
public final func isCarServiceRunning() -> bridge.Result_bool_ {
|
|
457
|
+
do {
|
|
458
|
+
let __result = try self.__implementation.isCarServiceRunning()
|
|
459
|
+
let __resultCpp = __result
|
|
460
|
+
return bridge.create_Result_bool_(__resultCpp)
|
|
461
|
+
} catch (let __error) {
|
|
462
|
+
let __exceptionPtr = __error.toCpp()
|
|
463
|
+
return bridge.create_Result_bool_(__exceptionPtr)
|
|
464
|
+
}
|
|
465
|
+
}
|
|
372
466
|
}
|
|
@@ -17,3 +17,16 @@ public indirect enum NitroImage {
|
|
|
17
17
|
case second(AssetImage)
|
|
18
18
|
case third(RemoteImage)
|
|
19
19
|
}
|
|
20
|
+
|
|
21
|
+
public extension NitroImage {
|
|
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
|
+
}
|
|
@@ -17,3 +17,16 @@ public indirect enum NitroManeuver {
|
|
|
17
17
|
case second(NitroMessageManeuver)
|
|
18
18
|
case third(NitroLoadingManeuver)
|
|
19
19
|
}
|
|
20
|
+
|
|
21
|
+
public extension NitroManeuver {
|
|
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
|
+
}
|
|
@@ -17,3 +17,16 @@ public indirect enum Variant_GlyphImage_AssetImage_RemoteImage {
|
|
|
17
17
|
case second(AssetImage)
|
|
18
18
|
case third(RemoteImage)
|
|
19
19
|
}
|
|
20
|
+
|
|
21
|
+
public extension Variant_GlyphImage_AssetImage_RemoteImage {
|
|
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
|
+
}
|
|
@@ -16,3 +16,15 @@ public indirect enum Variant_PreferredImageLane_ImageLane {
|
|
|
16
16
|
case first(PreferredImageLane)
|
|
17
17
|
case second(ImageLane)
|
|
18
18
|
}
|
|
19
|
+
|
|
20
|
+
public extension Variant_PreferredImageLane_ImageLane {
|
|
21
|
+
func asType<T>(_ type: T.Type = T.self) -> T? {
|
|
22
|
+
switch self {
|
|
23
|
+
case .first(let value): return value as? T
|
|
24
|
+
case .second(let value): return value as? T
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
func isType<T>(_ type: T.Type = T.self) -> Bool {
|
|
28
|
+
return self.asType(type) != nil
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -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);
|
|
@@ -25,6 +29,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
|
25
29
|
prototype.registerHybridMethod("addSafeAreaInsetsListener", &HybridAutoPlaySpec::addSafeAreaInsetsListener);
|
|
26
30
|
prototype.registerHybridMethod("setTemplateHeaderActions", &HybridAutoPlaySpec::setTemplateHeaderActions);
|
|
27
31
|
prototype.registerHybridMethod("isConnected", &HybridAutoPlaySpec::isConnected);
|
|
32
|
+
prototype.registerHybridMethod("isCarServiceRunning", &HybridAutoPlaySpec::isCarServiceRunning);
|
|
28
33
|
});
|
|
29
34
|
}
|
|
30
35
|
|
|
@@ -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;
|
|
@@ -77,6 +82,7 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
|
77
82
|
virtual std::function<void()> addSafeAreaInsetsListener(const std::string& moduleName, const std::function<void(const SafeAreaInsets& /* insets */)>& callback) = 0;
|
|
78
83
|
virtual std::shared_ptr<Promise<void>> setTemplateHeaderActions(const std::string& templateId, const std::optional<std::vector<NitroAction>>& headerActions) = 0;
|
|
79
84
|
virtual bool isConnected() = 0;
|
|
85
|
+
virtual bool isCarServiceRunning() = 0;
|
|
80
86
|
|
|
81
87
|
protected:
|
|
82
88
|
// Hybrid Setup
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iternio/react-native-auto-play",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.11",
|
|
4
4
|
"description": "Android Auto and Apple CarPlay for react-native",
|
|
5
5
|
"main": "lib/index",
|
|
6
6
|
"module": "lib/index",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"@types/jest": "^29.5.12",
|
|
62
62
|
"@types/react": "~19.2.0",
|
|
63
63
|
"dpdm": "^4.0.1",
|
|
64
|
-
"nitrogen": "^0.35.
|
|
64
|
+
"nitrogen": "^0.35.9",
|
|
65
65
|
"typescript": "^5.8.3"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
package/src/index.ts
CHANGED
|
@@ -3,12 +3,11 @@ import { NitroModules } from 'react-native-nitro-modules';
|
|
|
3
3
|
import AutoPlayHeadlessJsTask from './AutoPlayHeadlessJsTask';
|
|
4
4
|
import { HybridAndroidAutoTelemetry } from './hybrid/HybridAndroidAutoTelemetry';
|
|
5
5
|
import { HybridAutoPlay } from './hybrid/HybridAutoPlay';
|
|
6
|
-
import { HybridVoice } from './hybrid/HybridVoice';
|
|
7
6
|
import type { AndroidAutomotive } from './specs/AndroidAutomotive.nitro';
|
|
8
7
|
|
|
9
8
|
AutoPlayHeadlessJsTask.registerHeadlessTask(HybridAutoPlay);
|
|
10
9
|
|
|
11
|
-
export { HybridAndroidAutoTelemetry, HybridAutoPlay
|
|
10
|
+
export { HybridAndroidAutoTelemetry, HybridAutoPlay };
|
|
12
11
|
|
|
13
12
|
export const HybridAndroidAutomotive =
|
|
14
13
|
Platform.OS === 'android'
|
|
@@ -55,7 +54,6 @@ export * from './types/SignInMethod';
|
|
|
55
54
|
export * from './types/Telemetry';
|
|
56
55
|
export * from './types/Text';
|
|
57
56
|
export * from './types/Trip';
|
|
58
|
-
export type { VoiceInputChunk, VoiceInputOptions, VoiceInputResult } from './types/Voice';
|
|
59
57
|
export type {
|
|
60
58
|
AlertPriority,
|
|
61
59
|
NavigationAlert as Alert,
|
|
@@ -25,6 +25,7 @@ export type CarPlayDashboardEvent = EventName | VisibilityState;
|
|
|
25
25
|
|
|
26
26
|
class Dashboard {
|
|
27
27
|
private component: React.ComponentType<RootComponentInitialProps> | null = null;
|
|
28
|
+
private componentRegistered = false;
|
|
28
29
|
public isConnected = false;
|
|
29
30
|
public readonly id = 'CarPlayDashboard';
|
|
30
31
|
|
|
@@ -47,20 +48,26 @@ class Dashboard {
|
|
|
47
48
|
}
|
|
48
49
|
|
|
49
50
|
const { component, isConnected } = this;
|
|
50
|
-
if (
|
|
51
|
+
if (component == null) {
|
|
51
52
|
return;
|
|
52
53
|
}
|
|
53
54
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
55
|
+
if (!this.componentRegistered) {
|
|
56
|
+
AppRegistry.registerComponent(
|
|
57
|
+
this.id,
|
|
58
|
+
() => (props) =>
|
|
59
|
+
React.createElement(SafeAreaInsetsProvider, {
|
|
60
|
+
moduleName: this.id,
|
|
61
|
+
// biome-ignore lint/correctness/noChildrenProp: there is no other way in a ts file
|
|
62
|
+
children: React.createElement(component, props),
|
|
63
|
+
})
|
|
64
|
+
);
|
|
65
|
+
this.componentRegistered = true;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if (isConnected) {
|
|
69
|
+
HybridCarPlayDashboard.initRootView();
|
|
70
|
+
}
|
|
64
71
|
}
|
|
65
72
|
|
|
66
73
|
public setComponent(component: React.ComponentType<RootComponentInitialProps>) {
|
|
@@ -44,6 +44,43 @@ export interface AutoPlay extends HybridObject<{ android: 'kotlin'; ios: 'swift'
|
|
|
44
44
|
callback: (coordinates: Location | undefined, query: string | undefined) => void
|
|
45
45
|
): CleanupCallback;
|
|
46
46
|
|
|
47
|
+
/**
|
|
48
|
+
* Returns true if microphone permission has already been granted.
|
|
49
|
+
*/
|
|
50
|
+
hasVoiceInputPermission(): boolean;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Request microphone permission from the user.
|
|
54
|
+
* On Android: uses the car context when Android Auto is connected, otherwise
|
|
55
|
+
* falls back to the React Native application context.
|
|
56
|
+
* On iOS: uses AVAudioApplication (iOS 17+) or AVAudioSession (iOS 15–16).
|
|
57
|
+
* Returns true if permission was granted, false if denied.
|
|
58
|
+
*/
|
|
59
|
+
requestVoiceInputPermission(): Promise<boolean>;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Start an in-app voice recording session.
|
|
63
|
+
* On Android: acquires audio focus and captures via CarAudioRecord when
|
|
64
|
+
* Android Auto is connected, otherwise uses standard AudioRecord.
|
|
65
|
+
* On iOS: presents CPVoiceControlTemplate (when a car is connected) and
|
|
66
|
+
* captures audio via AVAudioEngine.
|
|
67
|
+
* Resolves with the complete raw PCM buffer (16 kHz, 16-bit, mono) when
|
|
68
|
+
* silence is detected, the max duration is reached, or stopVoiceInput() is called.
|
|
69
|
+
* Rejects if microphone permission has not been granted or recording fails to start.
|
|
70
|
+
*/
|
|
71
|
+
startVoiceInput(
|
|
72
|
+
silenceThresholdMs?: number,
|
|
73
|
+
maxDurationMs?: number,
|
|
74
|
+
listeningText?: string
|
|
75
|
+
): Promise<ArrayBuffer>;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Stop the active voice recording session early. Causes the Promise returned
|
|
79
|
+
* by startVoiceInput() to resolve with the audio captured so far.
|
|
80
|
+
* No-op if no recording is in progress.
|
|
81
|
+
*/
|
|
82
|
+
stopVoiceInput(): void;
|
|
83
|
+
|
|
47
84
|
/**
|
|
48
85
|
* sets the specified template as root template, initializes a new stack
|
|
49
86
|
* Promise might contain an error message in case setting root template failed
|
|
@@ -92,4 +129,11 @@ export interface AutoPlay extends HybridObject<{ android: 'kotlin'; ios: 'swift'
|
|
|
92
129
|
* @returns true if AutoPlay is connected, false otherwise.
|
|
93
130
|
*/
|
|
94
131
|
isConnected(): boolean;
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Check if the native AutoPlay is currently running.
|
|
135
|
+
* Use this to distinguish a headless execution triggered by AA / CP
|
|
136
|
+
* from one triggered by other sources (e.g. notification updates).
|
|
137
|
+
*/
|
|
138
|
+
isCarServiceRunning(): boolean;
|
|
95
139
|
}
|