@iternio/react-native-auto-play 0.1.18 → 0.2.0-alpha.2
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 +152 -8
- package/android/build.gradle +15 -1
- package/android/gradle.properties +1 -1
- package/android/src/{main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/AndroidAutoTelemetryObserver.kt → auto/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/AndroidTelemetryObserver.kt} +31 -76
- package/android/src/automotive/AndroidManifest.xml +91 -0
- package/android/src/automotive/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/AndroidTelemetryObserver.kt +191 -0
- package/android/src/main/AndroidManifest.xml +0 -10
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/AndroidAutoScreen.kt +3 -0
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/AndroidAutoTelemetryHolder.kt +97 -19
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridAndroidAutoTelemetry.kt +39 -3
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridSignInTemplate.kt +22 -0
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/TelemetryObserver.kt +56 -0
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/VirtualRenderer.kt +15 -10
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/template/AutomotivePermissionRequestTemplate.kt +103 -0
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/template/GridTemplate.kt +0 -2
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/template/Parser.kt +8 -2
- package/android/src/main/java/com/margelo/nitro/swe/iternio/reactnativeautoplay/template/SignInTemplate.kt +159 -0
- package/ios/extensions/CarPlayExtensions.swift +4 -2
- package/ios/extensions/NitroImageExtensions.swift +4 -4
- package/ios/hybrid/HybridAutoPlay.swift +31 -42
- package/ios/hybrid/HybridCluster.swift +4 -2
- package/ios/hybrid/HybridGridTemplate.swift +11 -11
- package/ios/hybrid/HybridInformationTemplate.swift +12 -13
- package/ios/hybrid/HybridListTemplate.swift +12 -13
- package/ios/hybrid/HybridMapTemplate.swift +13 -16
- package/ios/hybrid/HybridMessageTemplate.swift +7 -4
- package/ios/hybrid/HybridSearchTemplate.swift +12 -13
- package/ios/scenes/AutoPlayInterfaceController.swift +41 -13
- package/ios/scenes/AutoPlayScene.swift +2 -1
- package/ios/scenes/AutoPlaySceneViewController.swift +8 -2
- package/ios/scenes/DashboardSceneDelegate.swift +15 -7
- package/ios/scenes/HeadUnitSceneDelegate.swift +7 -5
- package/ios/scenes/WindowApplicationSceneDelegate.swift +1 -1
- package/ios/templates/AutoPlayTemplate.swift +23 -15
- package/ios/templates/GridTemplate.swift +23 -16
- package/ios/templates/InformationTemplate.swift +12 -11
- package/ios/templates/ListTemplate.swift +11 -11
- package/ios/templates/MapTemplate.swift +44 -42
- package/ios/templates/MessageTemplate.swift +8 -12
- package/ios/templates/Parser.swift +2 -1
- package/ios/templates/SearchTemplate.swift +19 -17
- package/ios/templates/TemplateStore.swift +17 -9
- package/ios/utils/RootModule.swift +19 -12
- package/ios/utils/SymbolFont.swift +2 -1
- package/ios/utils/ViewUtils.swift +2 -2
- package/lib/hooks/useAndroidAutoTelemetry.d.ts +22 -4
- package/lib/hooks/useAndroidAutoTelemetry.js +52 -24
- package/lib/index.d.ts +2 -0
- package/lib/index.js +2 -0
- package/lib/specs/AndroidAutoTelemetry.nitro.d.ts +14 -1
- package/lib/types/Telemetry.d.ts +27 -0
- package/lib/types/Telemetry.js +7 -0
- package/nitro.json +3 -0
- package/nitrogen/generated/android/ReactNativeAutoPlay+autolinking.cmake +3 -0
- package/nitrogen/generated/android/ReactNativeAutoPlayOnLoad.cpp +12 -2
- package/nitrogen/generated/android/c++/JBooleanTelemetryItem.hpp +61 -0
- package/nitrogen/generated/android/c++/JFunc_void_std__optional_Telemetry_.hpp +87 -0
- package/nitrogen/generated/android/c++/JFunc_void_std__string.hpp +10 -10
- package/nitrogen/generated/android/c++/JHybridAndroidAutoTelemetrySpec.cpp +41 -5
- package/nitrogen/generated/android/c++/JHybridAndroidAutoTelemetrySpec.hpp +2 -1
- package/nitrogen/generated/android/c++/JHybridSignInTemplateSpec.cpp +133 -0
- package/nitrogen/generated/android/c++/JHybridSignInTemplateSpec.hpp +66 -0
- package/nitrogen/generated/android/c++/JInputSignIn.hpp +103 -0
- package/nitrogen/generated/android/c++/JKeyboardType.hpp +65 -0
- package/nitrogen/generated/android/c++/JPermissionRequestResult.hpp +98 -0
- package/nitrogen/generated/android/c++/JPinSignIn.hpp +63 -0
- package/nitrogen/generated/android/c++/JQrSignIn.hpp +63 -0
- package/nitrogen/generated/android/c++/JSignInMethods.hpp +65 -0
- package/nitrogen/generated/android/c++/JSignInTemplateConfig.hpp +217 -0
- package/nitrogen/generated/android/c++/JTelemetry.hpp +25 -3
- package/nitrogen/generated/android/c++/JTextInputType.hpp +59 -0
- package/nitrogen/generated/android/c++/JVariant_QrSignIn_PinSignIn_InputSignIn.cpp +30 -0
- package/nitrogen/generated/android/c++/JVariant_QrSignIn_PinSignIn_InputSignIn.hpp +99 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/AssetImage.kt +2 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/AutoText.kt +3 -3
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/BooleanTelemetryItem.kt +41 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/Distance.kt +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/DurationWithTimeZone.kt +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/{Func_void_std__optional_Telemetry__std__optional_std__string_.kt → Func_void_std__optional_Telemetry_.kt} +14 -14
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/Func_void_std__string.kt +9 -9
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/GlyphImage.kt +2 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/GridTemplateConfig.kt +9 -9
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridAndroidAutoTelemetrySpec.kt +7 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/HybridSignInTemplateSpec.kt +62 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/ImageLane.kt +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/InformationTemplateConfig.kt +10 -10
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/InputSignIn.kt +63 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/KeyboardType.kt +23 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/LaneGuidance.kt +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/ListTemplateConfig.kt +10 -10
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/Location.kt +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/MapTemplateConfig.kt +18 -18
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/MessageTemplateConfig.kt +12 -12
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/NavigationAlertAction.kt +2 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/NitroAction.kt +7 -7
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/NitroAttributedString.kt +2 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/NitroAttributedStringImage.kt +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/NitroBaseMapTemplateConfig.kt +10 -10
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/NitroColor.kt +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/NitroGridButton.kt +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/NitroLoadingManeuver.kt +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/NitroMapButton.kt +2 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/NitroMessageManeuver.kt +3 -3
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/NitroNavigationAlert.kt +6 -6
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/NitroRoutingManeuver.kt +13 -13
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/NitroRow.kt +7 -7
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/NitroSection.kt +2 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/NumericTelemetryItem.kt +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/PermissionRequestResult.kt +41 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/PinSignIn.kt +41 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/Point.kt +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/PreferredImageLane.kt +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/QrSignIn.kt +41 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/RouteChoice.kt +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/SafeAreaInsets.kt +2 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/SearchTemplateConfig.kt +10 -10
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/SignInMethods.kt +23 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/SignInTemplateConfig.kt +78 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/StringTelemetryItem.kt +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/Telemetry.kt +24 -9
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/TextInputType.kt +21 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/TravelEstimates.kt +2 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/TripConfig.kt +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/TripPoint.kt +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/TripPreviewTextConfiguration.kt +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/TripSelectorCallback.kt +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/TripsConfig.kt +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/Variant_QrSignIn_PinSignIn_InputSignIn.kt +72 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/swe/iternio/reactnativeautoplay/VehicleTelemetryItem.kt +4 -4
- package/nitrogen/generated/shared/c++/BooleanTelemetryItem.hpp +79 -0
- package/nitrogen/generated/shared/c++/HybridAndroidAutoTelemetrySpec.cpp +1 -0
- package/nitrogen/generated/shared/c++/HybridAndroidAutoTelemetrySpec.hpp +7 -1
- package/nitrogen/generated/shared/c++/HybridSignInTemplateSpec.cpp +22 -0
- package/nitrogen/generated/shared/c++/HybridSignInTemplateSpec.hpp +66 -0
- package/nitrogen/generated/shared/c++/InputSignIn.hpp +113 -0
- package/nitrogen/generated/shared/c++/KeyboardType.hpp +64 -0
- package/nitrogen/generated/shared/c++/PermissionRequestResult.hpp +80 -0
- package/nitrogen/generated/shared/c++/PinSignIn.hpp +81 -0
- package/nitrogen/generated/shared/c++/QrSignIn.hpp +81 -0
- package/nitrogen/generated/shared/c++/SignInMethods.hpp +64 -0
- package/nitrogen/generated/shared/c++/SignInTemplateConfig.hpp +138 -0
- package/nitrogen/generated/shared/c++/Telemetry.hpp +25 -2
- package/nitrogen/generated/shared/c++/TextInputType.hpp +62 -0
- package/package.json +3 -2
- package/src/hooks/useAndroidAutoTelemetry.ts +80 -27
- package/src/index.ts +2 -0
- package/src/specs/AndroidAutoTelemetry.nitro.ts +19 -1
- package/src/specs/SignInTemplate.nitro.ts +10 -0
- package/src/templates/SignInTemplate.ts +117 -0
- package/src/types/SignInMethod.ts +41 -0
- package/src/types/Telemetry.ts +29 -0
- package/lib/hooks/useIsAutoPlayFocused.d.ts +0 -7
- package/lib/hooks/useIsAutoPlayFocused.js +0 -20
- 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/templates/AutomotivePermissionRequestTemplate.d.ts +0 -23
- package/lib/templates/AutomotivePermissionRequestTemplate.js +0 -18
- package/nitrogen/generated/android/c++/JFunc_void_std__optional_Telemetry__std__optional_std__string_.hpp +0 -85
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// PermissionRequestResult.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
#if __has_include(<NitroModules/JSIHelpers.hpp>)
|
|
21
|
+
#include <NitroModules/JSIHelpers.hpp>
|
|
22
|
+
#else
|
|
23
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
|
+
#endif
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
#include <string>
|
|
29
|
+
#include <vector>
|
|
30
|
+
|
|
31
|
+
namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* A struct which can be represented as a JavaScript object (PermissionRequestResult).
|
|
35
|
+
*/
|
|
36
|
+
struct PermissionRequestResult {
|
|
37
|
+
public:
|
|
38
|
+
std::vector<std::string> granted SWIFT_PRIVATE;
|
|
39
|
+
std::vector<std::string> denied SWIFT_PRIVATE;
|
|
40
|
+
|
|
41
|
+
public:
|
|
42
|
+
PermissionRequestResult() = default;
|
|
43
|
+
explicit PermissionRequestResult(std::vector<std::string> granted, std::vector<std::string> denied): granted(granted), denied(denied) {}
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
} // namespace margelo::nitro::swe::iternio::reactnativeautoplay
|
|
47
|
+
|
|
48
|
+
namespace margelo::nitro {
|
|
49
|
+
|
|
50
|
+
// C++ PermissionRequestResult <> JS PermissionRequestResult (object)
|
|
51
|
+
template <>
|
|
52
|
+
struct JSIConverter<margelo::nitro::swe::iternio::reactnativeautoplay::PermissionRequestResult> final {
|
|
53
|
+
static inline margelo::nitro::swe::iternio::reactnativeautoplay::PermissionRequestResult fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
54
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
55
|
+
return margelo::nitro::swe::iternio::reactnativeautoplay::PermissionRequestResult(
|
|
56
|
+
JSIConverter<std::vector<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "granted")),
|
|
57
|
+
JSIConverter<std::vector<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "denied"))
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::swe::iternio::reactnativeautoplay::PermissionRequestResult& arg) {
|
|
61
|
+
jsi::Object obj(runtime);
|
|
62
|
+
obj.setProperty(runtime, "granted", JSIConverter<std::vector<std::string>>::toJSI(runtime, arg.granted));
|
|
63
|
+
obj.setProperty(runtime, "denied", JSIConverter<std::vector<std::string>>::toJSI(runtime, arg.denied));
|
|
64
|
+
return obj;
|
|
65
|
+
}
|
|
66
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
67
|
+
if (!value.isObject()) {
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
jsi::Object obj = value.getObject(runtime);
|
|
71
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
if (!JSIConverter<std::vector<std::string>>::canConvert(runtime, obj.getProperty(runtime, "granted"))) return false;
|
|
75
|
+
if (!JSIConverter<std::vector<std::string>>::canConvert(runtime, obj.getProperty(runtime, "denied"))) return false;
|
|
76
|
+
return true;
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// PinSignIn.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
#if __has_include(<NitroModules/JSIHelpers.hpp>)
|
|
21
|
+
#include <NitroModules/JSIHelpers.hpp>
|
|
22
|
+
#else
|
|
23
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
|
+
#endif
|
|
25
|
+
|
|
26
|
+
// Forward declaration of `SignInMethods` to properly resolve imports.
|
|
27
|
+
namespace margelo::nitro::swe::iternio::reactnativeautoplay { enum class SignInMethods; }
|
|
28
|
+
|
|
29
|
+
#include "SignInMethods.hpp"
|
|
30
|
+
#include <string>
|
|
31
|
+
|
|
32
|
+
namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* A struct which can be represented as a JavaScript object (PinSignIn).
|
|
36
|
+
*/
|
|
37
|
+
struct PinSignIn {
|
|
38
|
+
public:
|
|
39
|
+
SignInMethods method SWIFT_PRIVATE;
|
|
40
|
+
std::string pin SWIFT_PRIVATE;
|
|
41
|
+
|
|
42
|
+
public:
|
|
43
|
+
PinSignIn() = default;
|
|
44
|
+
explicit PinSignIn(SignInMethods method, std::string pin): method(method), pin(pin) {}
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
} // namespace margelo::nitro::swe::iternio::reactnativeautoplay
|
|
48
|
+
|
|
49
|
+
namespace margelo::nitro {
|
|
50
|
+
|
|
51
|
+
// C++ PinSignIn <> JS PinSignIn (object)
|
|
52
|
+
template <>
|
|
53
|
+
struct JSIConverter<margelo::nitro::swe::iternio::reactnativeautoplay::PinSignIn> final {
|
|
54
|
+
static inline margelo::nitro::swe::iternio::reactnativeautoplay::PinSignIn fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
55
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
56
|
+
return margelo::nitro::swe::iternio::reactnativeautoplay::PinSignIn(
|
|
57
|
+
JSIConverter<margelo::nitro::swe::iternio::reactnativeautoplay::SignInMethods>::fromJSI(runtime, obj.getProperty(runtime, "method")),
|
|
58
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "pin"))
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::swe::iternio::reactnativeautoplay::PinSignIn& arg) {
|
|
62
|
+
jsi::Object obj(runtime);
|
|
63
|
+
obj.setProperty(runtime, "method", JSIConverter<margelo::nitro::swe::iternio::reactnativeautoplay::SignInMethods>::toJSI(runtime, arg.method));
|
|
64
|
+
obj.setProperty(runtime, "pin", JSIConverter<std::string>::toJSI(runtime, arg.pin));
|
|
65
|
+
return obj;
|
|
66
|
+
}
|
|
67
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
68
|
+
if (!value.isObject()) {
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
jsi::Object obj = value.getObject(runtime);
|
|
72
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
73
|
+
return false;
|
|
74
|
+
}
|
|
75
|
+
if (!JSIConverter<margelo::nitro::swe::iternio::reactnativeautoplay::SignInMethods>::canConvert(runtime, obj.getProperty(runtime, "method"))) return false;
|
|
76
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "pin"))) return false;
|
|
77
|
+
return true;
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// QrSignIn.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
#if __has_include(<NitroModules/JSIHelpers.hpp>)
|
|
21
|
+
#include <NitroModules/JSIHelpers.hpp>
|
|
22
|
+
#else
|
|
23
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
|
+
#endif
|
|
25
|
+
|
|
26
|
+
// Forward declaration of `SignInMethods` to properly resolve imports.
|
|
27
|
+
namespace margelo::nitro::swe::iternio::reactnativeautoplay { enum class SignInMethods; }
|
|
28
|
+
|
|
29
|
+
#include "SignInMethods.hpp"
|
|
30
|
+
#include <string>
|
|
31
|
+
|
|
32
|
+
namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* A struct which can be represented as a JavaScript object (QrSignIn).
|
|
36
|
+
*/
|
|
37
|
+
struct QrSignIn {
|
|
38
|
+
public:
|
|
39
|
+
SignInMethods method SWIFT_PRIVATE;
|
|
40
|
+
std::string url SWIFT_PRIVATE;
|
|
41
|
+
|
|
42
|
+
public:
|
|
43
|
+
QrSignIn() = default;
|
|
44
|
+
explicit QrSignIn(SignInMethods method, std::string url): method(method), url(url) {}
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
} // namespace margelo::nitro::swe::iternio::reactnativeautoplay
|
|
48
|
+
|
|
49
|
+
namespace margelo::nitro {
|
|
50
|
+
|
|
51
|
+
// C++ QrSignIn <> JS QrSignIn (object)
|
|
52
|
+
template <>
|
|
53
|
+
struct JSIConverter<margelo::nitro::swe::iternio::reactnativeautoplay::QrSignIn> final {
|
|
54
|
+
static inline margelo::nitro::swe::iternio::reactnativeautoplay::QrSignIn fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
55
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
56
|
+
return margelo::nitro::swe::iternio::reactnativeautoplay::QrSignIn(
|
|
57
|
+
JSIConverter<margelo::nitro::swe::iternio::reactnativeautoplay::SignInMethods>::fromJSI(runtime, obj.getProperty(runtime, "method")),
|
|
58
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "url"))
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::swe::iternio::reactnativeautoplay::QrSignIn& arg) {
|
|
62
|
+
jsi::Object obj(runtime);
|
|
63
|
+
obj.setProperty(runtime, "method", JSIConverter<margelo::nitro::swe::iternio::reactnativeautoplay::SignInMethods>::toJSI(runtime, arg.method));
|
|
64
|
+
obj.setProperty(runtime, "url", JSIConverter<std::string>::toJSI(runtime, arg.url));
|
|
65
|
+
return obj;
|
|
66
|
+
}
|
|
67
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
68
|
+
if (!value.isObject()) {
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
jsi::Object obj = value.getObject(runtime);
|
|
72
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
73
|
+
return false;
|
|
74
|
+
}
|
|
75
|
+
if (!JSIConverter<margelo::nitro::swe::iternio::reactnativeautoplay::SignInMethods>::canConvert(runtime, obj.getProperty(runtime, "method"))) return false;
|
|
76
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "url"))) return false;
|
|
77
|
+
return true;
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// SignInMethods.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
|
|
21
|
+
namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* An enum which can be represented as a JavaScript enum (SignInMethods).
|
|
25
|
+
*/
|
|
26
|
+
enum class SignInMethods {
|
|
27
|
+
QR SWIFT_NAME(qr) = 0,
|
|
28
|
+
PROVIDER SWIFT_NAME(provider) = 1,
|
|
29
|
+
PIN SWIFT_NAME(pin) = 2,
|
|
30
|
+
INPUT SWIFT_NAME(input) = 3,
|
|
31
|
+
} CLOSED_ENUM;
|
|
32
|
+
|
|
33
|
+
} // namespace margelo::nitro::swe::iternio::reactnativeautoplay
|
|
34
|
+
|
|
35
|
+
namespace margelo::nitro {
|
|
36
|
+
|
|
37
|
+
// C++ SignInMethods <> JS SignInMethods (enum)
|
|
38
|
+
template <>
|
|
39
|
+
struct JSIConverter<margelo::nitro::swe::iternio::reactnativeautoplay::SignInMethods> final {
|
|
40
|
+
static inline margelo::nitro::swe::iternio::reactnativeautoplay::SignInMethods fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
41
|
+
int enumValue = JSIConverter<int>::fromJSI(runtime, arg);
|
|
42
|
+
return static_cast<margelo::nitro::swe::iternio::reactnativeautoplay::SignInMethods>(enumValue);
|
|
43
|
+
}
|
|
44
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, margelo::nitro::swe::iternio::reactnativeautoplay::SignInMethods arg) {
|
|
45
|
+
int enumValue = static_cast<int>(arg);
|
|
46
|
+
return JSIConverter<int>::toJSI(runtime, enumValue);
|
|
47
|
+
}
|
|
48
|
+
static inline bool canConvert(jsi::Runtime&, const jsi::Value& value) {
|
|
49
|
+
if (!value.isNumber()) {
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
double number = value.getNumber();
|
|
53
|
+
int integer = static_cast<int>(number);
|
|
54
|
+
if (number != integer) {
|
|
55
|
+
// The integer is not the same value as the double - we truncated floating points.
|
|
56
|
+
// Enums are all integers, so the input floating point number is obviously invalid.
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
// Check if we are within the bounds of the enum.
|
|
60
|
+
return integer >= 0 && integer <= 3;
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// SignInTemplateConfig.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
#if __has_include(<NitroModules/JSIHelpers.hpp>)
|
|
21
|
+
#include <NitroModules/JSIHelpers.hpp>
|
|
22
|
+
#else
|
|
23
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
|
+
#endif
|
|
25
|
+
|
|
26
|
+
// Forward declaration of `QrSignIn` to properly resolve imports.
|
|
27
|
+
namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct QrSignIn; }
|
|
28
|
+
// Forward declaration of `PinSignIn` to properly resolve imports.
|
|
29
|
+
namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct PinSignIn; }
|
|
30
|
+
// Forward declaration of `InputSignIn` to properly resolve imports.
|
|
31
|
+
namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct InputSignIn; }
|
|
32
|
+
// Forward declaration of `NitroAction` to properly resolve imports.
|
|
33
|
+
namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct NitroAction; }
|
|
34
|
+
|
|
35
|
+
#include <string>
|
|
36
|
+
#include <optional>
|
|
37
|
+
#include <functional>
|
|
38
|
+
#include "QrSignIn.hpp"
|
|
39
|
+
#include "PinSignIn.hpp"
|
|
40
|
+
#include "InputSignIn.hpp"
|
|
41
|
+
#include <variant>
|
|
42
|
+
#include "NitroAction.hpp"
|
|
43
|
+
#include <vector>
|
|
44
|
+
|
|
45
|
+
namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* A struct which can be represented as a JavaScript object (SignInTemplateConfig).
|
|
49
|
+
*/
|
|
50
|
+
struct SignInTemplateConfig {
|
|
51
|
+
public:
|
|
52
|
+
std::string id SWIFT_PRIVATE;
|
|
53
|
+
std::optional<std::function<void(std::optional<bool> /* animated */)>> onWillAppear SWIFT_PRIVATE;
|
|
54
|
+
std::optional<std::function<void(std::optional<bool> /* animated */)>> onWillDisappear SWIFT_PRIVATE;
|
|
55
|
+
std::optional<std::function<void(std::optional<bool> /* animated */)>> onDidAppear SWIFT_PRIVATE;
|
|
56
|
+
std::optional<std::function<void(std::optional<bool> /* animated */)>> onDidDisappear SWIFT_PRIVATE;
|
|
57
|
+
std::optional<std::function<void()>> onPopped SWIFT_PRIVATE;
|
|
58
|
+
std::optional<double> autoDismissMs SWIFT_PRIVATE;
|
|
59
|
+
std::optional<std::string> title SWIFT_PRIVATE;
|
|
60
|
+
std::optional<std::string> additionalText SWIFT_PRIVATE;
|
|
61
|
+
std::optional<std::variant<QrSignIn, PinSignIn, InputSignIn>> signInMethod SWIFT_PRIVATE;
|
|
62
|
+
std::optional<std::vector<NitroAction>> headerActions SWIFT_PRIVATE;
|
|
63
|
+
std::optional<std::vector<NitroAction>> actions SWIFT_PRIVATE;
|
|
64
|
+
std::optional<std::string> instructions SWIFT_PRIVATE;
|
|
65
|
+
|
|
66
|
+
public:
|
|
67
|
+
SignInTemplateConfig() = default;
|
|
68
|
+
explicit SignInTemplateConfig(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::string> title, std::optional<std::string> additionalText, std::optional<std::variant<QrSignIn, PinSignIn, InputSignIn>> signInMethod, std::optional<std::vector<NitroAction>> headerActions, std::optional<std::vector<NitroAction>> actions, std::optional<std::string> instructions): id(id), onWillAppear(onWillAppear), onWillDisappear(onWillDisappear), onDidAppear(onDidAppear), onDidDisappear(onDidDisappear), onPopped(onPopped), autoDismissMs(autoDismissMs), title(title), additionalText(additionalText), signInMethod(signInMethod), headerActions(headerActions), actions(actions), instructions(instructions) {}
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
} // namespace margelo::nitro::swe::iternio::reactnativeautoplay
|
|
72
|
+
|
|
73
|
+
namespace margelo::nitro {
|
|
74
|
+
|
|
75
|
+
// C++ SignInTemplateConfig <> JS SignInTemplateConfig (object)
|
|
76
|
+
template <>
|
|
77
|
+
struct JSIConverter<margelo::nitro::swe::iternio::reactnativeautoplay::SignInTemplateConfig> final {
|
|
78
|
+
static inline margelo::nitro::swe::iternio::reactnativeautoplay::SignInTemplateConfig fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
79
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
80
|
+
return margelo::nitro::swe::iternio::reactnativeautoplay::SignInTemplateConfig(
|
|
81
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "id")),
|
|
82
|
+
JSIConverter<std::optional<std::function<void(std::optional<bool>)>>>::fromJSI(runtime, obj.getProperty(runtime, "onWillAppear")),
|
|
83
|
+
JSIConverter<std::optional<std::function<void(std::optional<bool>)>>>::fromJSI(runtime, obj.getProperty(runtime, "onWillDisappear")),
|
|
84
|
+
JSIConverter<std::optional<std::function<void(std::optional<bool>)>>>::fromJSI(runtime, obj.getProperty(runtime, "onDidAppear")),
|
|
85
|
+
JSIConverter<std::optional<std::function<void(std::optional<bool>)>>>::fromJSI(runtime, obj.getProperty(runtime, "onDidDisappear")),
|
|
86
|
+
JSIConverter<std::optional<std::function<void()>>>::fromJSI(runtime, obj.getProperty(runtime, "onPopped")),
|
|
87
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, "autoDismissMs")),
|
|
88
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "title")),
|
|
89
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "additionalText")),
|
|
90
|
+
JSIConverter<std::optional<std::variant<margelo::nitro::swe::iternio::reactnativeautoplay::QrSignIn, margelo::nitro::swe::iternio::reactnativeautoplay::PinSignIn, margelo::nitro::swe::iternio::reactnativeautoplay::InputSignIn>>>::fromJSI(runtime, obj.getProperty(runtime, "signInMethod")),
|
|
91
|
+
JSIConverter<std::optional<std::vector<margelo::nitro::swe::iternio::reactnativeautoplay::NitroAction>>>::fromJSI(runtime, obj.getProperty(runtime, "headerActions")),
|
|
92
|
+
JSIConverter<std::optional<std::vector<margelo::nitro::swe::iternio::reactnativeautoplay::NitroAction>>>::fromJSI(runtime, obj.getProperty(runtime, "actions")),
|
|
93
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "instructions"))
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::swe::iternio::reactnativeautoplay::SignInTemplateConfig& arg) {
|
|
97
|
+
jsi::Object obj(runtime);
|
|
98
|
+
obj.setProperty(runtime, "id", JSIConverter<std::string>::toJSI(runtime, arg.id));
|
|
99
|
+
obj.setProperty(runtime, "onWillAppear", JSIConverter<std::optional<std::function<void(std::optional<bool>)>>>::toJSI(runtime, arg.onWillAppear));
|
|
100
|
+
obj.setProperty(runtime, "onWillDisappear", JSIConverter<std::optional<std::function<void(std::optional<bool>)>>>::toJSI(runtime, arg.onWillDisappear));
|
|
101
|
+
obj.setProperty(runtime, "onDidAppear", JSIConverter<std::optional<std::function<void(std::optional<bool>)>>>::toJSI(runtime, arg.onDidAppear));
|
|
102
|
+
obj.setProperty(runtime, "onDidDisappear", JSIConverter<std::optional<std::function<void(std::optional<bool>)>>>::toJSI(runtime, arg.onDidDisappear));
|
|
103
|
+
obj.setProperty(runtime, "onPopped", JSIConverter<std::optional<std::function<void()>>>::toJSI(runtime, arg.onPopped));
|
|
104
|
+
obj.setProperty(runtime, "autoDismissMs", JSIConverter<std::optional<double>>::toJSI(runtime, arg.autoDismissMs));
|
|
105
|
+
obj.setProperty(runtime, "title", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.title));
|
|
106
|
+
obj.setProperty(runtime, "additionalText", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.additionalText));
|
|
107
|
+
obj.setProperty(runtime, "signInMethod", JSIConverter<std::optional<std::variant<margelo::nitro::swe::iternio::reactnativeautoplay::QrSignIn, margelo::nitro::swe::iternio::reactnativeautoplay::PinSignIn, margelo::nitro::swe::iternio::reactnativeautoplay::InputSignIn>>>::toJSI(runtime, arg.signInMethod));
|
|
108
|
+
obj.setProperty(runtime, "headerActions", JSIConverter<std::optional<std::vector<margelo::nitro::swe::iternio::reactnativeautoplay::NitroAction>>>::toJSI(runtime, arg.headerActions));
|
|
109
|
+
obj.setProperty(runtime, "actions", JSIConverter<std::optional<std::vector<margelo::nitro::swe::iternio::reactnativeautoplay::NitroAction>>>::toJSI(runtime, arg.actions));
|
|
110
|
+
obj.setProperty(runtime, "instructions", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.instructions));
|
|
111
|
+
return obj;
|
|
112
|
+
}
|
|
113
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
114
|
+
if (!value.isObject()) {
|
|
115
|
+
return false;
|
|
116
|
+
}
|
|
117
|
+
jsi::Object obj = value.getObject(runtime);
|
|
118
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
119
|
+
return false;
|
|
120
|
+
}
|
|
121
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "id"))) return false;
|
|
122
|
+
if (!JSIConverter<std::optional<std::function<void(std::optional<bool>)>>>::canConvert(runtime, obj.getProperty(runtime, "onWillAppear"))) return false;
|
|
123
|
+
if (!JSIConverter<std::optional<std::function<void(std::optional<bool>)>>>::canConvert(runtime, obj.getProperty(runtime, "onWillDisappear"))) return false;
|
|
124
|
+
if (!JSIConverter<std::optional<std::function<void(std::optional<bool>)>>>::canConvert(runtime, obj.getProperty(runtime, "onDidAppear"))) return false;
|
|
125
|
+
if (!JSIConverter<std::optional<std::function<void(std::optional<bool>)>>>::canConvert(runtime, obj.getProperty(runtime, "onDidDisappear"))) return false;
|
|
126
|
+
if (!JSIConverter<std::optional<std::function<void()>>>::canConvert(runtime, obj.getProperty(runtime, "onPopped"))) return false;
|
|
127
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, "autoDismissMs"))) return false;
|
|
128
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "title"))) return false;
|
|
129
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "additionalText"))) return false;
|
|
130
|
+
if (!JSIConverter<std::optional<std::variant<margelo::nitro::swe::iternio::reactnativeautoplay::QrSignIn, margelo::nitro::swe::iternio::reactnativeautoplay::PinSignIn, margelo::nitro::swe::iternio::reactnativeautoplay::InputSignIn>>>::canConvert(runtime, obj.getProperty(runtime, "signInMethod"))) return false;
|
|
131
|
+
if (!JSIConverter<std::optional<std::vector<margelo::nitro::swe::iternio::reactnativeautoplay::NitroAction>>>::canConvert(runtime, obj.getProperty(runtime, "headerActions"))) return false;
|
|
132
|
+
if (!JSIConverter<std::optional<std::vector<margelo::nitro::swe::iternio::reactnativeautoplay::NitroAction>>>::canConvert(runtime, obj.getProperty(runtime, "actions"))) return false;
|
|
133
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "instructions"))) return false;
|
|
134
|
+
return true;
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
} // namespace margelo::nitro
|
|
@@ -27,10 +27,13 @@
|
|
|
27
27
|
namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct NumericTelemetryItem; }
|
|
28
28
|
// Forward declaration of `VehicleTelemetryItem` to properly resolve imports.
|
|
29
29
|
namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct VehicleTelemetryItem; }
|
|
30
|
+
// Forward declaration of `BooleanTelemetryItem` to properly resolve imports.
|
|
31
|
+
namespace margelo::nitro::swe::iternio::reactnativeautoplay { struct BooleanTelemetryItem; }
|
|
30
32
|
|
|
31
33
|
#include "NumericTelemetryItem.hpp"
|
|
32
34
|
#include <optional>
|
|
33
35
|
#include "VehicleTelemetryItem.hpp"
|
|
36
|
+
#include "BooleanTelemetryItem.hpp"
|
|
34
37
|
|
|
35
38
|
namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
36
39
|
|
|
@@ -45,10 +48,15 @@ namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
|
45
48
|
std::optional<NumericTelemetryItem> range SWIFT_PRIVATE;
|
|
46
49
|
std::optional<NumericTelemetryItem> odometer SWIFT_PRIVATE;
|
|
47
50
|
std::optional<VehicleTelemetryItem> vehicle SWIFT_PRIVATE;
|
|
51
|
+
std::optional<NumericTelemetryItem> selectedGear SWIFT_PRIVATE;
|
|
52
|
+
std::optional<NumericTelemetryItem> envOutsideTemperature SWIFT_PRIVATE;
|
|
53
|
+
std::optional<BooleanTelemetryItem> evChargePortConnected SWIFT_PRIVATE;
|
|
54
|
+
std::optional<NumericTelemetryItem> evBatteryInstantaneousChargeRate SWIFT_PRIVATE;
|
|
55
|
+
std::optional<BooleanTelemetryItem> parkingBrakeOn SWIFT_PRIVATE;
|
|
48
56
|
|
|
49
57
|
public:
|
|
50
58
|
Telemetry() = default;
|
|
51
|
-
explicit Telemetry(std::optional<NumericTelemetryItem> speed, std::optional<NumericTelemetryItem> fuelLevel, std::optional<NumericTelemetryItem> batteryLevel, std::optional<NumericTelemetryItem> range, std::optional<NumericTelemetryItem> odometer, std::optional<VehicleTelemetryItem> vehicle): speed(speed), fuelLevel(fuelLevel), batteryLevel(batteryLevel), range(range), odometer(odometer), vehicle(vehicle) {}
|
|
59
|
+
explicit Telemetry(std::optional<NumericTelemetryItem> speed, std::optional<NumericTelemetryItem> fuelLevel, std::optional<NumericTelemetryItem> batteryLevel, std::optional<NumericTelemetryItem> range, std::optional<NumericTelemetryItem> odometer, std::optional<VehicleTelemetryItem> vehicle, std::optional<NumericTelemetryItem> selectedGear, std::optional<NumericTelemetryItem> envOutsideTemperature, std::optional<BooleanTelemetryItem> evChargePortConnected, std::optional<NumericTelemetryItem> evBatteryInstantaneousChargeRate, std::optional<BooleanTelemetryItem> parkingBrakeOn): speed(speed), fuelLevel(fuelLevel), batteryLevel(batteryLevel), range(range), odometer(odometer), vehicle(vehicle), selectedGear(selectedGear), envOutsideTemperature(envOutsideTemperature), evChargePortConnected(evChargePortConnected), evBatteryInstantaneousChargeRate(evBatteryInstantaneousChargeRate), parkingBrakeOn(parkingBrakeOn) {}
|
|
52
60
|
};
|
|
53
61
|
|
|
54
62
|
} // namespace margelo::nitro::swe::iternio::reactnativeautoplay
|
|
@@ -66,7 +74,12 @@ namespace margelo::nitro {
|
|
|
66
74
|
JSIConverter<std::optional<margelo::nitro::swe::iternio::reactnativeautoplay::NumericTelemetryItem>>::fromJSI(runtime, obj.getProperty(runtime, "batteryLevel")),
|
|
67
75
|
JSIConverter<std::optional<margelo::nitro::swe::iternio::reactnativeautoplay::NumericTelemetryItem>>::fromJSI(runtime, obj.getProperty(runtime, "range")),
|
|
68
76
|
JSIConverter<std::optional<margelo::nitro::swe::iternio::reactnativeautoplay::NumericTelemetryItem>>::fromJSI(runtime, obj.getProperty(runtime, "odometer")),
|
|
69
|
-
JSIConverter<std::optional<margelo::nitro::swe::iternio::reactnativeautoplay::VehicleTelemetryItem>>::fromJSI(runtime, obj.getProperty(runtime, "vehicle"))
|
|
77
|
+
JSIConverter<std::optional<margelo::nitro::swe::iternio::reactnativeautoplay::VehicleTelemetryItem>>::fromJSI(runtime, obj.getProperty(runtime, "vehicle")),
|
|
78
|
+
JSIConverter<std::optional<margelo::nitro::swe::iternio::reactnativeautoplay::NumericTelemetryItem>>::fromJSI(runtime, obj.getProperty(runtime, "selectedGear")),
|
|
79
|
+
JSIConverter<std::optional<margelo::nitro::swe::iternio::reactnativeautoplay::NumericTelemetryItem>>::fromJSI(runtime, obj.getProperty(runtime, "envOutsideTemperature")),
|
|
80
|
+
JSIConverter<std::optional<margelo::nitro::swe::iternio::reactnativeautoplay::BooleanTelemetryItem>>::fromJSI(runtime, obj.getProperty(runtime, "evChargePortConnected")),
|
|
81
|
+
JSIConverter<std::optional<margelo::nitro::swe::iternio::reactnativeautoplay::NumericTelemetryItem>>::fromJSI(runtime, obj.getProperty(runtime, "evBatteryInstantaneousChargeRate")),
|
|
82
|
+
JSIConverter<std::optional<margelo::nitro::swe::iternio::reactnativeautoplay::BooleanTelemetryItem>>::fromJSI(runtime, obj.getProperty(runtime, "parkingBrakeOn"))
|
|
70
83
|
);
|
|
71
84
|
}
|
|
72
85
|
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::swe::iternio::reactnativeautoplay::Telemetry& arg) {
|
|
@@ -77,6 +90,11 @@ namespace margelo::nitro {
|
|
|
77
90
|
obj.setProperty(runtime, "range", JSIConverter<std::optional<margelo::nitro::swe::iternio::reactnativeautoplay::NumericTelemetryItem>>::toJSI(runtime, arg.range));
|
|
78
91
|
obj.setProperty(runtime, "odometer", JSIConverter<std::optional<margelo::nitro::swe::iternio::reactnativeautoplay::NumericTelemetryItem>>::toJSI(runtime, arg.odometer));
|
|
79
92
|
obj.setProperty(runtime, "vehicle", JSIConverter<std::optional<margelo::nitro::swe::iternio::reactnativeautoplay::VehicleTelemetryItem>>::toJSI(runtime, arg.vehicle));
|
|
93
|
+
obj.setProperty(runtime, "selectedGear", JSIConverter<std::optional<margelo::nitro::swe::iternio::reactnativeautoplay::NumericTelemetryItem>>::toJSI(runtime, arg.selectedGear));
|
|
94
|
+
obj.setProperty(runtime, "envOutsideTemperature", JSIConverter<std::optional<margelo::nitro::swe::iternio::reactnativeautoplay::NumericTelemetryItem>>::toJSI(runtime, arg.envOutsideTemperature));
|
|
95
|
+
obj.setProperty(runtime, "evChargePortConnected", JSIConverter<std::optional<margelo::nitro::swe::iternio::reactnativeautoplay::BooleanTelemetryItem>>::toJSI(runtime, arg.evChargePortConnected));
|
|
96
|
+
obj.setProperty(runtime, "evBatteryInstantaneousChargeRate", JSIConverter<std::optional<margelo::nitro::swe::iternio::reactnativeautoplay::NumericTelemetryItem>>::toJSI(runtime, arg.evBatteryInstantaneousChargeRate));
|
|
97
|
+
obj.setProperty(runtime, "parkingBrakeOn", JSIConverter<std::optional<margelo::nitro::swe::iternio::reactnativeautoplay::BooleanTelemetryItem>>::toJSI(runtime, arg.parkingBrakeOn));
|
|
80
98
|
return obj;
|
|
81
99
|
}
|
|
82
100
|
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
@@ -93,6 +111,11 @@ namespace margelo::nitro {
|
|
|
93
111
|
if (!JSIConverter<std::optional<margelo::nitro::swe::iternio::reactnativeautoplay::NumericTelemetryItem>>::canConvert(runtime, obj.getProperty(runtime, "range"))) return false;
|
|
94
112
|
if (!JSIConverter<std::optional<margelo::nitro::swe::iternio::reactnativeautoplay::NumericTelemetryItem>>::canConvert(runtime, obj.getProperty(runtime, "odometer"))) return false;
|
|
95
113
|
if (!JSIConverter<std::optional<margelo::nitro::swe::iternio::reactnativeautoplay::VehicleTelemetryItem>>::canConvert(runtime, obj.getProperty(runtime, "vehicle"))) return false;
|
|
114
|
+
if (!JSIConverter<std::optional<margelo::nitro::swe::iternio::reactnativeautoplay::NumericTelemetryItem>>::canConvert(runtime, obj.getProperty(runtime, "selectedGear"))) return false;
|
|
115
|
+
if (!JSIConverter<std::optional<margelo::nitro::swe::iternio::reactnativeautoplay::NumericTelemetryItem>>::canConvert(runtime, obj.getProperty(runtime, "envOutsideTemperature"))) return false;
|
|
116
|
+
if (!JSIConverter<std::optional<margelo::nitro::swe::iternio::reactnativeautoplay::BooleanTelemetryItem>>::canConvert(runtime, obj.getProperty(runtime, "evChargePortConnected"))) return false;
|
|
117
|
+
if (!JSIConverter<std::optional<margelo::nitro::swe::iternio::reactnativeautoplay::NumericTelemetryItem>>::canConvert(runtime, obj.getProperty(runtime, "evBatteryInstantaneousChargeRate"))) return false;
|
|
118
|
+
if (!JSIConverter<std::optional<margelo::nitro::swe::iternio::reactnativeautoplay::BooleanTelemetryItem>>::canConvert(runtime, obj.getProperty(runtime, "parkingBrakeOn"))) return false;
|
|
96
119
|
return true;
|
|
97
120
|
}
|
|
98
121
|
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// TextInputType.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
|
|
21
|
+
namespace margelo::nitro::swe::iternio::reactnativeautoplay {
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* An enum which can be represented as a JavaScript enum (TextInputType).
|
|
25
|
+
*/
|
|
26
|
+
enum class TextInputType {
|
|
27
|
+
PASSWORD SWIFT_NAME(password) = 0,
|
|
28
|
+
DEFAULT SWIFT_NAME(default) = 1,
|
|
29
|
+
} CLOSED_ENUM;
|
|
30
|
+
|
|
31
|
+
} // namespace margelo::nitro::swe::iternio::reactnativeautoplay
|
|
32
|
+
|
|
33
|
+
namespace margelo::nitro {
|
|
34
|
+
|
|
35
|
+
// C++ TextInputType <> JS TextInputType (enum)
|
|
36
|
+
template <>
|
|
37
|
+
struct JSIConverter<margelo::nitro::swe::iternio::reactnativeautoplay::TextInputType> final {
|
|
38
|
+
static inline margelo::nitro::swe::iternio::reactnativeautoplay::TextInputType fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
39
|
+
int enumValue = JSIConverter<int>::fromJSI(runtime, arg);
|
|
40
|
+
return static_cast<margelo::nitro::swe::iternio::reactnativeautoplay::TextInputType>(enumValue);
|
|
41
|
+
}
|
|
42
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, margelo::nitro::swe::iternio::reactnativeautoplay::TextInputType arg) {
|
|
43
|
+
int enumValue = static_cast<int>(arg);
|
|
44
|
+
return JSIConverter<int>::toJSI(runtime, enumValue);
|
|
45
|
+
}
|
|
46
|
+
static inline bool canConvert(jsi::Runtime&, const jsi::Value& value) {
|
|
47
|
+
if (!value.isNumber()) {
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
double number = value.getNumber();
|
|
51
|
+
int integer = static_cast<int>(number);
|
|
52
|
+
if (number != integer) {
|
|
53
|
+
// The integer is not the same value as the double - we truncated floating points.
|
|
54
|
+
// Enums are all integers, so the input floating point number is obviously invalid.
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
// Check if we are within the bounds of the enum.
|
|
58
|
+
return integer >= 0 && integer <= 1;
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
} // namespace margelo::nitro
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iternio/react-native-auto-play",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0-alpha.2",
|
|
4
4
|
"description": "Android Auto and Apple CarPlay for react-native",
|
|
5
5
|
"main": "lib/index",
|
|
6
6
|
"module": "lib/index",
|
|
@@ -36,7 +36,8 @@
|
|
|
36
36
|
"typescript": "tsc",
|
|
37
37
|
"generate:fonts": "node ./assets/symbolFont/bundleAsset.js",
|
|
38
38
|
"specs": "nitrogen --logLevel=\"debug\"",
|
|
39
|
-
"prepare": "tsc && nitrogen && npm run generate:fonts"
|
|
39
|
+
"prepare": "tsc && nitrogen && npm run generate:fonts",
|
|
40
|
+
"swift:format": "swift-format format ./ios --in-place --recursive"
|
|
40
41
|
},
|
|
41
42
|
"keywords": [
|
|
42
43
|
"react-native",
|