@salve-software/salvetron-react-native 1.0.1 → 1.1.0
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/{NitroRnTuiSdk.podspec → NitroSalvetron.podspec} +3 -3
- package/android/CMakeLists.txt +3 -3
- package/android/build.gradle +6 -6
- package/android/src/main/cpp/cpp-adapter.cpp +2 -2
- package/android/src/main/java/com/margelo/nitro/{rntuisdk/HybridRnTuiSdk.kt → salvetron/HybridSalvetron.kt} +8 -8
- package/android/src/main/java/com/margelo/nitro/{rntuisdk → salvetron}/PerformanceMonitor.kt +1 -1
- package/android/src/main/java/com/margelo/nitro/{rntuisdk/RnTuiSdkPackage.kt → salvetron/SalvetronPackage.kt} +3 -3
- package/ios/{HybridRnTuiSdk.swift → HybridSalvetron.swift} +4 -4
- package/ios/PerformanceMonitor.swift +1 -1
- package/lib/commonjs/index.js +2 -2
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/library/client/salvetron-client.js +8 -8
- package/lib/commonjs/library/client/salvetron-client.js.map +1 -1
- package/lib/commonjs/library/device/device-handler.js +6 -6
- package/lib/commonjs/library/device/device-handler.js.map +1 -1
- package/lib/commonjs/library/performance-handler/performance-handler.js +4 -4
- package/lib/commonjs/library/performance-handler/performance-handler.js.map +1 -1
- package/lib/commonjs/specs/{rn-tui-sdk.nitro.js → salvetron.nitro.js} +1 -1
- package/lib/commonjs/specs/{rn-tui-sdk.nitro.js.map → salvetron.nitro.js.map} +1 -1
- package/lib/module/index.js +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/library/client/salvetron-client.js +8 -8
- package/lib/module/library/client/salvetron-client.js.map +1 -1
- package/lib/module/library/device/device-handler.js +7 -7
- package/lib/module/library/device/device-handler.js.map +1 -1
- package/lib/module/library/performance-handler/performance-handler.js +4 -4
- package/lib/module/library/performance-handler/performance-handler.js.map +1 -1
- package/lib/module/specs/salvetron.nitro.js +4 -0
- package/lib/module/specs/{rn-tui-sdk.nitro.js.map → salvetron.nitro.js.map} +1 -1
- package/lib/typescript/src/index.d.ts +2 -2
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/library/client/salvetron-client.d.ts +2 -2
- package/lib/typescript/src/library/client/salvetron-client.d.ts.map +1 -1
- package/lib/typescript/src/library/performance-handler/performance-handler.d.ts +1 -1
- package/lib/typescript/src/library/performance-handler/performance-handler.d.ts.map +1 -1
- package/lib/typescript/src/library/performance-handler/types.d.ts +2 -2
- package/lib/typescript/src/library/performance-handler/types.d.ts.map +1 -1
- package/lib/typescript/src/specs/{rn-tui-sdk.nitro.d.ts → salvetron.nitro.d.ts} +2 -2
- package/lib/typescript/src/specs/salvetron.nitro.d.ts.map +1 -0
- package/nitro.json +7 -7
- package/nitrogen/generated/android/{NitroRnTuiSdk+autolinking.cmake → NitroSalvetron+autolinking.cmake} +11 -11
- package/nitrogen/generated/android/{NitroRnTuiSdk+autolinking.gradle → NitroSalvetron+autolinking.gradle} +3 -3
- package/nitrogen/generated/android/NitroSalvetronOnLoad.cpp +58 -0
- package/nitrogen/generated/android/{NitroRnTuiSdkOnLoad.hpp → NitroSalvetronOnLoad.hpp} +6 -6
- package/nitrogen/generated/android/c++/JDeviceInfoResult.hpp +3 -3
- package/nitrogen/generated/android/c++/JFunc_void_NativeLogEntry.hpp +4 -4
- package/nitrogen/generated/android/c++/JFunc_void_PerformanceMetrics.hpp +4 -4
- package/nitrogen/generated/android/c++/{JHybridNitroRnTuiSdkSpec.cpp → JHybridNitroSalvetronSpec.cpp} +30 -30
- package/nitrogen/generated/android/c++/{JHybridNitroRnTuiSdkSpec.hpp → JHybridNitroSalvetronSpec.hpp} +13 -13
- package/nitrogen/generated/android/c++/JNativeLogEntry.hpp +3 -3
- package/nitrogen/generated/android/c++/JNativeLogLevel.hpp +3 -3
- package/nitrogen/generated/android/c++/JPerformanceMetrics.hpp +3 -3
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/{rntuisdk → salvetron}/DeviceInfoResult.kt +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/{rntuisdk → salvetron}/Func_void_NativeLogEntry.kt +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/{rntuisdk → salvetron}/Func_void_PerformanceMetrics.kt +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/{rntuisdk/HybridNitroRnTuiSdkSpec.kt → salvetron/HybridNitroSalvetronSpec.kt} +9 -9
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/{rntuisdk → salvetron}/NativeLogEntry.kt +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/{rntuisdk → salvetron}/NativeLogLevel.kt +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/{rntuisdk/NitroRnTuiSdkOnLoad.kt → salvetron/NitroSalvetronOnLoad.kt} +9 -9
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/{rntuisdk → salvetron}/PerformanceMetrics.kt +1 -1
- package/nitrogen/generated/ios/{NitroRnTuiSdk+autolinking.rb → NitroSalvetron+autolinking.rb} +4 -4
- package/nitrogen/generated/ios/NitroSalvetron-Swift-Cxx-Bridge.cpp +49 -0
- package/nitrogen/generated/ios/{NitroRnTuiSdk-Swift-Cxx-Bridge.hpp → NitroSalvetron-Swift-Cxx-Bridge.hpp} +20 -20
- package/nitrogen/generated/ios/{NitroRnTuiSdk-Swift-Cxx-Umbrella.hpp → NitroSalvetron-Swift-Cxx-Umbrella.hpp} +17 -17
- package/nitrogen/generated/ios/{NitroRnTuiSdkAutolinking.mm → NitroSalvetronAutolinking.mm} +8 -8
- package/nitrogen/generated/ios/NitroSalvetronAutolinking.swift +26 -0
- package/nitrogen/generated/ios/c++/HybridNitroSalvetronSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/{HybridNitroRnTuiSdkSpecSwift.hpp → HybridNitroSalvetronSpecSwift.hpp} +20 -20
- package/nitrogen/generated/ios/swift/DeviceInfoResult.swift +2 -2
- package/nitrogen/generated/ios/swift/Func_void_NativeLogEntry.swift +1 -1
- package/nitrogen/generated/ios/swift/Func_void_PerformanceMetrics.swift +1 -1
- package/nitrogen/generated/ios/swift/{HybridNitroRnTuiSdkSpec.swift → HybridNitroSalvetronSpec.swift} +16 -16
- package/nitrogen/generated/ios/swift/{HybridNitroRnTuiSdkSpec_cxx.swift → HybridNitroSalvetronSpec_cxx.swift} +22 -22
- package/nitrogen/generated/ios/swift/NativeLogEntry.swift +2 -2
- package/nitrogen/generated/ios/swift/NativeLogLevel.swift +1 -1
- package/nitrogen/generated/ios/swift/PerformanceMetrics.swift +2 -2
- package/nitrogen/generated/shared/c++/DeviceInfoResult.hpp +6 -6
- package/nitrogen/generated/shared/c++/{HybridNitroRnTuiSdkSpec.cpp → HybridNitroSalvetronSpec.cpp} +17 -17
- package/nitrogen/generated/shared/c++/{HybridNitroRnTuiSdkSpec.hpp → HybridNitroSalvetronSpec.hpp} +14 -14
- package/nitrogen/generated/shared/c++/NativeLogEntry.hpp +10 -10
- package/nitrogen/generated/shared/c++/NativeLogLevel.hpp +13 -13
- package/nitrogen/generated/shared/c++/PerformanceMetrics.hpp +6 -6
- package/package.json +1 -1
- package/src/index.ts +3 -3
- package/src/library/client/salvetron-client.ts +10 -10
- package/src/library/device/__tests__/device-handler.test.ts +5 -5
- package/src/library/device/device-handler.ts +7 -7
- package/src/library/performance-handler/performance-handler.ts +6 -6
- package/src/library/performance-handler/types.ts +2 -2
- package/src/specs/{rn-tui-sdk.nitro.ts → salvetron.nitro.ts} +1 -1
- package/lib/module/specs/rn-tui-sdk.nitro.js +0 -4
- package/lib/typescript/src/specs/rn-tui-sdk.nitro.d.ts.map +0 -1
- package/nitrogen/generated/android/NitroRnTuiSdkOnLoad.cpp +0 -58
- package/nitrogen/generated/ios/NitroRnTuiSdk-Swift-Cxx-Bridge.cpp +0 -49
- package/nitrogen/generated/ios/NitroRnTuiSdkAutolinking.swift +0 -26
- package/nitrogen/generated/ios/c++/HybridNitroRnTuiSdkSpecSwift.cpp +0 -11
package/nitrogen/generated/shared/c++/{HybridNitroRnTuiSdkSpec.hpp → HybridNitroSalvetronSpec.hpp}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
///
|
|
2
|
-
///
|
|
2
|
+
/// HybridNitroSalvetronSpec.hpp
|
|
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
|
|
@@ -14,11 +14,11 @@
|
|
|
14
14
|
#endif
|
|
15
15
|
|
|
16
16
|
// Forward declaration of `NativeLogEntry` to properly resolve imports.
|
|
17
|
-
namespace margelo::nitro::
|
|
17
|
+
namespace margelo::nitro::salvetron { struct NativeLogEntry; }
|
|
18
18
|
// Forward declaration of `DeviceInfoResult` to properly resolve imports.
|
|
19
|
-
namespace margelo::nitro::
|
|
19
|
+
namespace margelo::nitro::salvetron { struct DeviceInfoResult; }
|
|
20
20
|
// Forward declaration of `PerformanceMetrics` to properly resolve imports.
|
|
21
|
-
namespace margelo::nitro::
|
|
21
|
+
namespace margelo::nitro::salvetron { struct PerformanceMetrics; }
|
|
22
22
|
|
|
23
23
|
#include "NativeLogEntry.hpp"
|
|
24
24
|
#include <functional>
|
|
@@ -27,30 +27,30 @@ namespace margelo::nitro::rntuisdk { struct PerformanceMetrics; }
|
|
|
27
27
|
#include <optional>
|
|
28
28
|
#include "PerformanceMetrics.hpp"
|
|
29
29
|
|
|
30
|
-
namespace margelo::nitro::
|
|
30
|
+
namespace margelo::nitro::salvetron {
|
|
31
31
|
|
|
32
32
|
using namespace margelo::nitro;
|
|
33
33
|
|
|
34
34
|
/**
|
|
35
|
-
* An abstract base class for `
|
|
36
|
-
* Inherit this class to create instances of `
|
|
35
|
+
* An abstract base class for `NitroSalvetron`
|
|
36
|
+
* Inherit this class to create instances of `HybridNitroSalvetronSpec` in C++.
|
|
37
37
|
* You must explicitly call `HybridObject`'s constructor yourself, because it is virtual.
|
|
38
38
|
* @example
|
|
39
39
|
* ```cpp
|
|
40
|
-
* class
|
|
40
|
+
* class HybridNitroSalvetron: public HybridNitroSalvetronSpec {
|
|
41
41
|
* public:
|
|
42
|
-
*
|
|
42
|
+
* HybridNitroSalvetron(...): HybridObject(TAG) { ... }
|
|
43
43
|
* // ...
|
|
44
44
|
* };
|
|
45
45
|
* ```
|
|
46
46
|
*/
|
|
47
|
-
class
|
|
47
|
+
class HybridNitroSalvetronSpec: public virtual HybridObject {
|
|
48
48
|
public:
|
|
49
49
|
// Constructor
|
|
50
|
-
explicit
|
|
50
|
+
explicit HybridNitroSalvetronSpec(): HybridObject(TAG) { }
|
|
51
51
|
|
|
52
52
|
// Destructor
|
|
53
|
-
~
|
|
53
|
+
~HybridNitroSalvetronSpec() override = default;
|
|
54
54
|
|
|
55
55
|
public:
|
|
56
56
|
// Properties
|
|
@@ -77,7 +77,7 @@ namespace margelo::nitro::rntuisdk {
|
|
|
77
77
|
|
|
78
78
|
protected:
|
|
79
79
|
// Tag for logging
|
|
80
|
-
static constexpr auto TAG = "
|
|
80
|
+
static constexpr auto TAG = "NitroSalvetron";
|
|
81
81
|
};
|
|
82
82
|
|
|
83
|
-
} // namespace margelo::nitro::
|
|
83
|
+
} // namespace margelo::nitro::salvetron
|
|
@@ -29,12 +29,12 @@
|
|
|
29
29
|
#endif
|
|
30
30
|
|
|
31
31
|
// Forward declaration of `NativeLogLevel` to properly resolve imports.
|
|
32
|
-
namespace margelo::nitro::
|
|
32
|
+
namespace margelo::nitro::salvetron { enum class NativeLogLevel; }
|
|
33
33
|
|
|
34
34
|
#include "NativeLogLevel.hpp"
|
|
35
35
|
#include <string>
|
|
36
36
|
|
|
37
|
-
namespace margelo::nitro::
|
|
37
|
+
namespace margelo::nitro::salvetron {
|
|
38
38
|
|
|
39
39
|
/**
|
|
40
40
|
* A struct which can be represented as a JavaScript object (NativeLogEntry).
|
|
@@ -54,25 +54,25 @@ namespace margelo::nitro::rntuisdk {
|
|
|
54
54
|
friend bool operator==(const NativeLogEntry& lhs, const NativeLogEntry& rhs) = default;
|
|
55
55
|
};
|
|
56
56
|
|
|
57
|
-
} // namespace margelo::nitro::
|
|
57
|
+
} // namespace margelo::nitro::salvetron
|
|
58
58
|
|
|
59
59
|
namespace margelo::nitro {
|
|
60
60
|
|
|
61
61
|
// C++ NativeLogEntry <> JS NativeLogEntry (object)
|
|
62
62
|
template <>
|
|
63
|
-
struct JSIConverter<margelo::nitro::
|
|
64
|
-
static inline margelo::nitro::
|
|
63
|
+
struct JSIConverter<margelo::nitro::salvetron::NativeLogEntry> final {
|
|
64
|
+
static inline margelo::nitro::salvetron::NativeLogEntry fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
65
65
|
jsi::Object obj = arg.asObject(runtime);
|
|
66
|
-
return margelo::nitro::
|
|
67
|
-
JSIConverter<margelo::nitro::
|
|
66
|
+
return margelo::nitro::salvetron::NativeLogEntry(
|
|
67
|
+
JSIConverter<margelo::nitro::salvetron::NativeLogLevel>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "level"))),
|
|
68
68
|
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "message"))),
|
|
69
69
|
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "tag"))),
|
|
70
70
|
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "timestamp")))
|
|
71
71
|
);
|
|
72
72
|
}
|
|
73
|
-
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::
|
|
73
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::salvetron::NativeLogEntry& arg) {
|
|
74
74
|
jsi::Object obj(runtime);
|
|
75
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "level"), JSIConverter<margelo::nitro::
|
|
75
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "level"), JSIConverter<margelo::nitro::salvetron::NativeLogLevel>::toJSI(runtime, arg.level));
|
|
76
76
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "message"), JSIConverter<std::string>::toJSI(runtime, arg.message));
|
|
77
77
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "tag"), JSIConverter<std::string>::toJSI(runtime, arg.tag));
|
|
78
78
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "timestamp"), JSIConverter<double>::toJSI(runtime, arg.timestamp));
|
|
@@ -86,7 +86,7 @@ namespace margelo::nitro {
|
|
|
86
86
|
if (!nitro::isPlainObject(runtime, obj)) {
|
|
87
87
|
return false;
|
|
88
88
|
}
|
|
89
|
-
if (!JSIConverter<margelo::nitro::
|
|
89
|
+
if (!JSIConverter<margelo::nitro::salvetron::NativeLogLevel>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "level")))) return false;
|
|
90
90
|
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "message")))) return false;
|
|
91
91
|
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "tag")))) return false;
|
|
92
92
|
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "timestamp")))) return false;
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
24
|
#endif
|
|
25
25
|
|
|
26
|
-
namespace margelo::nitro::
|
|
26
|
+
namespace margelo::nitro::salvetron {
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
29
|
* An enum which can be represented as a JavaScript union (NativeLogLevel).
|
|
@@ -35,30 +35,30 @@ namespace margelo::nitro::rntuisdk {
|
|
|
35
35
|
ERROR SWIFT_NAME(error) = 3,
|
|
36
36
|
} CLOSED_ENUM;
|
|
37
37
|
|
|
38
|
-
} // namespace margelo::nitro::
|
|
38
|
+
} // namespace margelo::nitro::salvetron
|
|
39
39
|
|
|
40
40
|
namespace margelo::nitro {
|
|
41
41
|
|
|
42
42
|
// C++ NativeLogLevel <> JS NativeLogLevel (union)
|
|
43
43
|
template <>
|
|
44
|
-
struct JSIConverter<margelo::nitro::
|
|
45
|
-
static inline margelo::nitro::
|
|
44
|
+
struct JSIConverter<margelo::nitro::salvetron::NativeLogLevel> final {
|
|
45
|
+
static inline margelo::nitro::salvetron::NativeLogLevel fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
46
46
|
std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, arg);
|
|
47
47
|
switch (hashString(unionValue.c_str(), unionValue.size())) {
|
|
48
|
-
case hashString("verbose"): return margelo::nitro::
|
|
49
|
-
case hashString("info"): return margelo::nitro::
|
|
50
|
-
case hashString("warn"): return margelo::nitro::
|
|
51
|
-
case hashString("error"): return margelo::nitro::
|
|
48
|
+
case hashString("verbose"): return margelo::nitro::salvetron::NativeLogLevel::VERBOSE;
|
|
49
|
+
case hashString("info"): return margelo::nitro::salvetron::NativeLogLevel::INFO;
|
|
50
|
+
case hashString("warn"): return margelo::nitro::salvetron::NativeLogLevel::WARN;
|
|
51
|
+
case hashString("error"): return margelo::nitro::salvetron::NativeLogLevel::ERROR;
|
|
52
52
|
default: [[unlikely]]
|
|
53
53
|
throw std::invalid_argument("Cannot convert \"" + unionValue + "\" to enum NativeLogLevel - invalid value!");
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
|
-
static inline jsi::Value toJSI(jsi::Runtime& runtime, margelo::nitro::
|
|
56
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, margelo::nitro::salvetron::NativeLogLevel arg) {
|
|
57
57
|
switch (arg) {
|
|
58
|
-
case margelo::nitro::
|
|
59
|
-
case margelo::nitro::
|
|
60
|
-
case margelo::nitro::
|
|
61
|
-
case margelo::nitro::
|
|
58
|
+
case margelo::nitro::salvetron::NativeLogLevel::VERBOSE: return JSIConverter<std::string>::toJSI(runtime, "verbose");
|
|
59
|
+
case margelo::nitro::salvetron::NativeLogLevel::INFO: return JSIConverter<std::string>::toJSI(runtime, "info");
|
|
60
|
+
case margelo::nitro::salvetron::NativeLogLevel::WARN: return JSIConverter<std::string>::toJSI(runtime, "warn");
|
|
61
|
+
case margelo::nitro::salvetron::NativeLogLevel::ERROR: return JSIConverter<std::string>::toJSI(runtime, "error");
|
|
62
62
|
default: [[unlikely]]
|
|
63
63
|
throw std::invalid_argument("Cannot convert NativeLogLevel to JS - invalid value: "
|
|
64
64
|
+ std::to_string(static_cast<int>(arg)) + "!");
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
|
|
35
|
-
namespace margelo::nitro::
|
|
35
|
+
namespace margelo::nitro::salvetron {
|
|
36
36
|
|
|
37
37
|
/**
|
|
38
38
|
* A struct which can be represented as a JavaScript object (PerformanceMetrics).
|
|
@@ -52,23 +52,23 @@ namespace margelo::nitro::rntuisdk {
|
|
|
52
52
|
friend bool operator==(const PerformanceMetrics& lhs, const PerformanceMetrics& rhs) = default;
|
|
53
53
|
};
|
|
54
54
|
|
|
55
|
-
} // namespace margelo::nitro::
|
|
55
|
+
} // namespace margelo::nitro::salvetron
|
|
56
56
|
|
|
57
57
|
namespace margelo::nitro {
|
|
58
58
|
|
|
59
59
|
// C++ PerformanceMetrics <> JS PerformanceMetrics (object)
|
|
60
60
|
template <>
|
|
61
|
-
struct JSIConverter<margelo::nitro::
|
|
62
|
-
static inline margelo::nitro::
|
|
61
|
+
struct JSIConverter<margelo::nitro::salvetron::PerformanceMetrics> final {
|
|
62
|
+
static inline margelo::nitro::salvetron::PerformanceMetrics fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
63
63
|
jsi::Object obj = arg.asObject(runtime);
|
|
64
|
-
return margelo::nitro::
|
|
64
|
+
return margelo::nitro::salvetron::PerformanceMetrics(
|
|
65
65
|
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "uiFps"))),
|
|
66
66
|
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "jsFps"))),
|
|
67
67
|
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "memoryUsageMB"))),
|
|
68
68
|
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "cpuUsagePercent")))
|
|
69
69
|
);
|
|
70
70
|
}
|
|
71
|
-
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::
|
|
71
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::salvetron::PerformanceMetrics& arg) {
|
|
72
72
|
jsi::Object obj(runtime);
|
|
73
73
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "uiFps"), JSIConverter<double>::toJSI(runtime, arg.uiFps));
|
|
74
74
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "jsFps"), JSIConverter<double>::toJSI(runtime, arg.jsFps));
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { NitroModules } from 'react-native-nitro-modules'
|
|
2
|
-
import type {
|
|
2
|
+
import type { NitroSalvetron as NitroSalvetronSpec } from './specs/salvetron.nitro'
|
|
3
3
|
|
|
4
|
-
export const
|
|
5
|
-
NitroModules.createHybridObject<
|
|
4
|
+
export const NitroSalvetron =
|
|
5
|
+
NitroModules.createHybridObject<NitroSalvetronSpec>('NitroSalvetron')
|
|
6
6
|
|
|
7
7
|
export { default } from './library'
|
|
@@ -14,7 +14,7 @@ import type {
|
|
|
14
14
|
NativeLogSource,
|
|
15
15
|
ProjectInfoEvent,
|
|
16
16
|
} from '../types'
|
|
17
|
-
import type {
|
|
17
|
+
import type { NitroSalvetron as NitroSalvetronSpec } from '../../specs/salvetron.nitro'
|
|
18
18
|
|
|
19
19
|
import {
|
|
20
20
|
DEFAULT_IGNORED_URLS,
|
|
@@ -40,7 +40,7 @@ export class SalvetronClient {
|
|
|
40
40
|
private manualDisconnect = false
|
|
41
41
|
|
|
42
42
|
// Native log capture
|
|
43
|
-
private
|
|
43
|
+
private nitroSalvetron: NitroSalvetronSpec | null = null
|
|
44
44
|
private nativeLogCaptureEnabled = false
|
|
45
45
|
|
|
46
46
|
// Network handler
|
|
@@ -134,7 +134,7 @@ export class SalvetronClient {
|
|
|
134
134
|
}
|
|
135
135
|
|
|
136
136
|
try {
|
|
137
|
-
const nitro = this.
|
|
137
|
+
const nitro = this.getNitroSalvetron()
|
|
138
138
|
const success = nitro.startLogCapture((log) => {
|
|
139
139
|
this.handleNativeLog(log)
|
|
140
140
|
})
|
|
@@ -157,7 +157,7 @@ export class SalvetronClient {
|
|
|
157
157
|
if (!this.nativeLogCaptureEnabled) return
|
|
158
158
|
|
|
159
159
|
try {
|
|
160
|
-
const nitro = this.
|
|
160
|
+
const nitro = this.getNitroSalvetron()
|
|
161
161
|
nitro.stopLogCapture()
|
|
162
162
|
this.nativeLogCaptureEnabled = false
|
|
163
163
|
console.log('[Salvetron] Native log capture disabled')
|
|
@@ -183,7 +183,7 @@ export class SalvetronClient {
|
|
|
183
183
|
}
|
|
184
184
|
|
|
185
185
|
this.performanceHandler = new PerformanceHandler({
|
|
186
|
-
|
|
186
|
+
nitroSalvetron: this.getNitroSalvetron(),
|
|
187
187
|
onEvent: (event) => this.send(event),
|
|
188
188
|
})
|
|
189
189
|
|
|
@@ -220,12 +220,12 @@ export class SalvetronClient {
|
|
|
220
220
|
return this.performanceMonitoringEnabled
|
|
221
221
|
}
|
|
222
222
|
|
|
223
|
-
private
|
|
224
|
-
if (!this.
|
|
225
|
-
this.
|
|
226
|
-
NitroModules.createHybridObject<
|
|
223
|
+
private getNitroSalvetron(): NitroSalvetronSpec {
|
|
224
|
+
if (!this.nitroSalvetron) {
|
|
225
|
+
this.nitroSalvetron =
|
|
226
|
+
NitroModules.createHybridObject<NitroSalvetronSpec>('NitroSalvetron')
|
|
227
227
|
}
|
|
228
|
-
return this.
|
|
228
|
+
return this.nitroSalvetron
|
|
229
229
|
}
|
|
230
230
|
|
|
231
231
|
private handleNativeLog(log: {
|
|
@@ -8,12 +8,12 @@ import { Platform } from 'react-native';
|
|
|
8
8
|
|
|
9
9
|
import { DeviceHandler } from '../device-handler';
|
|
10
10
|
|
|
11
|
-
import {
|
|
11
|
+
import { NitroSalvetron } from '../../../index';
|
|
12
12
|
|
|
13
13
|
import { generateUUID } from '../utils/generate-uuid';
|
|
14
14
|
|
|
15
15
|
jest.mock('../../../index', () => ({
|
|
16
|
-
|
|
16
|
+
NitroSalvetron: {
|
|
17
17
|
getDeviceInfo: jest.fn(),
|
|
18
18
|
getStoredDeviceId: jest.fn(),
|
|
19
19
|
storeDeviceId: jest.fn(),
|
|
@@ -37,7 +37,7 @@ describe('DeviceHandler', () => {
|
|
|
37
37
|
Platform.OS = 'ios';
|
|
38
38
|
|
|
39
39
|
(
|
|
40
|
-
|
|
40
|
+
NitroSalvetron.getDeviceInfo as jest.Mock
|
|
41
41
|
).mockReturnValue({});
|
|
42
42
|
|
|
43
43
|
const handler = new DeviceHandler();
|
|
@@ -51,7 +51,7 @@ describe('DeviceHandler', () => {
|
|
|
51
51
|
Platform.OS = 'android';
|
|
52
52
|
|
|
53
53
|
(
|
|
54
|
-
|
|
54
|
+
NitroSalvetron.getDeviceInfo as jest.Mock
|
|
55
55
|
).mockReturnValue({});
|
|
56
56
|
|
|
57
57
|
const handler = new DeviceHandler();
|
|
@@ -65,7 +65,7 @@ describe('DeviceHandler', () => {
|
|
|
65
65
|
Platform.OS = 'android';
|
|
66
66
|
|
|
67
67
|
(
|
|
68
|
-
|
|
68
|
+
NitroSalvetron.getDeviceInfo as jest.Mock
|
|
69
69
|
).mockReturnValue({
|
|
70
70
|
deviceId: 'id',
|
|
71
71
|
deviceName: 'Pixel',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Platform } from 'react-native'
|
|
2
|
-
import {
|
|
2
|
+
import { NitroSalvetron } from '../../index'
|
|
3
3
|
import { generateUUID } from './utils/generate-uuid'
|
|
4
4
|
import type { DeviceInfoData } from './types'
|
|
5
5
|
|
|
@@ -13,20 +13,20 @@ export class DeviceHandler {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
try {
|
|
16
|
-
const nativeInfo =
|
|
16
|
+
const nativeInfo = NitroSalvetron.getDeviceInfo()
|
|
17
17
|
if (nativeInfo.deviceId) {
|
|
18
18
|
this.cachedDeviceId = nativeInfo.deviceId
|
|
19
19
|
return nativeInfo.deviceId
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
const storedId =
|
|
22
|
+
const storedId = NitroSalvetron.getStoredDeviceId()
|
|
23
23
|
if (storedId) {
|
|
24
24
|
this.cachedDeviceId = storedId
|
|
25
25
|
return storedId
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
const newId = generateUUID()
|
|
29
|
-
|
|
29
|
+
NitroSalvetron.storeDeviceId(newId)
|
|
30
30
|
this.cachedDeviceId = newId
|
|
31
31
|
return newId
|
|
32
32
|
} catch (err) {
|
|
@@ -40,7 +40,7 @@ export class DeviceHandler {
|
|
|
40
40
|
return this.cachedDeviceName
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
const nativeInfo =
|
|
43
|
+
const nativeInfo = NitroSalvetron.getDeviceInfo()
|
|
44
44
|
if (nativeInfo.deviceName) {
|
|
45
45
|
this.cachedDeviceName = nativeInfo.deviceName
|
|
46
46
|
return nativeInfo.deviceName
|
|
@@ -53,7 +53,7 @@ export class DeviceHandler {
|
|
|
53
53
|
|
|
54
54
|
getAppName(): string {
|
|
55
55
|
try {
|
|
56
|
-
const nativeInfo =
|
|
56
|
+
const nativeInfo = NitroSalvetron.getDeviceInfo()
|
|
57
57
|
return nativeInfo.appName || 'React Native App'
|
|
58
58
|
} catch {
|
|
59
59
|
return 'React Native App'
|
|
@@ -62,7 +62,7 @@ export class DeviceHandler {
|
|
|
62
62
|
|
|
63
63
|
getBundleId(): string {
|
|
64
64
|
try {
|
|
65
|
-
const nativeInfo =
|
|
65
|
+
const nativeInfo = NitroSalvetron.getDeviceInfo()
|
|
66
66
|
return nativeInfo.bundleId || ''
|
|
67
67
|
} catch {
|
|
68
68
|
return ''
|
|
@@ -3,18 +3,18 @@
|
|
|
3
3
|
* Tracks JS thread responsiveness and forwards native performance metrics
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import type {
|
|
6
|
+
import type { NitroSalvetron as NitroSalvetronSpec } from '../../specs/salvetron.nitro'
|
|
7
7
|
import type { PerformanceHandlerConfig, PerformanceMetricsEvent } from './types'
|
|
8
8
|
|
|
9
9
|
export class PerformanceHandler {
|
|
10
|
-
private
|
|
10
|
+
private nitroSalvetron: NitroSalvetronSpec
|
|
11
11
|
private onEvent: (event: PerformanceMetricsEvent) => void
|
|
12
12
|
private intervalMs: number
|
|
13
13
|
private isMonitoring = false
|
|
14
14
|
private jsFrameInterval: ReturnType<typeof setInterval> | null = null
|
|
15
15
|
|
|
16
16
|
constructor(config: PerformanceHandlerConfig) {
|
|
17
|
-
this.
|
|
17
|
+
this.nitroSalvetron = config.nitroSalvetron
|
|
18
18
|
this.onEvent = config.onEvent
|
|
19
19
|
this.intervalMs = config.intervalMs ?? 1000
|
|
20
20
|
}
|
|
@@ -30,7 +30,7 @@ export class PerformanceHandler {
|
|
|
30
30
|
|
|
31
31
|
try {
|
|
32
32
|
// Start native performance monitoring
|
|
33
|
-
const success = this.
|
|
33
|
+
const success = this.nitroSalvetron.startPerformanceMonitoring((metrics) => {
|
|
34
34
|
this.handleMetrics(metrics)
|
|
35
35
|
}, this.intervalMs)
|
|
36
36
|
|
|
@@ -40,7 +40,7 @@ export class PerformanceHandler {
|
|
|
40
40
|
// Start JS frame tracking - call recordJsFrame every 16ms (~60fps)
|
|
41
41
|
this.jsFrameInterval = setInterval(() => {
|
|
42
42
|
try {
|
|
43
|
-
this.
|
|
43
|
+
this.nitroSalvetron.recordJsFrame()
|
|
44
44
|
} catch (error) {
|
|
45
45
|
console.error('[Salvetron] Failed to record JS frame:', error)
|
|
46
46
|
}
|
|
@@ -69,7 +69,7 @@ export class PerformanceHandler {
|
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
// Stop native monitoring
|
|
72
|
-
this.
|
|
72
|
+
this.nitroSalvetron.stopPerformanceMonitoring()
|
|
73
73
|
this.isMonitoring = false
|
|
74
74
|
console.log('[Salvetron] Performance monitoring disabled')
|
|
75
75
|
} catch (error) {
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
* Performance handler types
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import type {
|
|
5
|
+
import type { NitroSalvetron as NitroSalvetronSpec } from '../../specs/salvetron.nitro'
|
|
6
6
|
|
|
7
7
|
export interface PerformanceHandlerConfig {
|
|
8
|
-
|
|
8
|
+
nitroSalvetron: NitroSalvetronSpec
|
|
9
9
|
onEvent: (event: PerformanceMetricsEvent) => void
|
|
10
10
|
intervalMs?: number
|
|
11
11
|
}
|
|
@@ -46,7 +46,7 @@ export interface PerformanceMetrics {
|
|
|
46
46
|
*/
|
|
47
47
|
export type PerformanceMetricsCallback = (metrics: PerformanceMetrics) => void
|
|
48
48
|
|
|
49
|
-
export interface
|
|
49
|
+
export interface NitroSalvetron extends HybridObject<{ ios: 'swift', android: 'kotlin' }> {
|
|
50
50
|
sum(num1: number, num2: number): number
|
|
51
51
|
|
|
52
52
|
/**
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rn-tui-sdk.nitro.d.ts","sourceRoot":"","sources":["../../../../src/specs/rn-tui-sdk.nitro.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AAE9D;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAA;AAElE;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,cAAc,CAAA;IACrB,OAAO,EAAE,MAAM,CAAA;IACf,GAAG,EAAE,MAAM,CAAA;IACX,SAAS,EAAE,MAAM,CAAA;CAClB;AAED;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,GAAG,EAAE,cAAc,KAAK,IAAI,CAAA;AAE7D;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,MAAM,CAAA;IAChB,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,aAAa,EAAE,MAAM,CAAA;IACrB,eAAe,EAAE,MAAM,CAAA;CACxB;AAED;;GAEG;AACH,MAAM,MAAM,0BAA0B,GAAG,CAAC,OAAO,EAAE,kBAAkB,KAAK,IAAI,CAAA;AAE9E,MAAM,WAAW,aAAc,SAAQ,YAAY,CAAC;IAAE,GAAG,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,QAAQ,CAAA;CAAE,CAAC;IACtF,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;IAEvC;;;;OAIG;IACH,eAAe,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAA;IAElD;;OAEG;IACH,cAAc,IAAI,IAAI,CAAA;IAEtB;;OAEG;IACH,WAAW,IAAI,OAAO,CAAA;IAEtB;;;OAGG;IACH,aAAa,IAAI,gBAAgB,CAAA;IAEjC;;;OAGG;IACH,iBAAiB,IAAI,MAAM,GAAG,SAAS,CAAA;IAEvC;;;OAGG;IACH,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IAErC;;;;;OAKG;IACH,0BAA0B,CAAC,SAAS,EAAE,0BAA0B,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;IAE/F;;OAEG;IACH,yBAAyB,IAAI,IAAI,CAAA;IAEjC;;OAEG;IACH,uBAAuB,IAAI,OAAO,CAAA;IAElC;;OAEG;IACH,sBAAsB,IAAI,kBAAkB,CAAA;IAE5C;;OAEG;IACH,aAAa,IAAI,IAAI,CAAA;CACtB"}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// NitroRnTuiSdkOnLoad.cpp
|
|
3
|
-
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
-
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
-
///
|
|
7
|
-
|
|
8
|
-
#ifndef BUILDING_NITRORNTUISDK_WITH_GENERATED_CMAKE_PROJECT
|
|
9
|
-
#error NitroRnTuiSdkOnLoad.cpp is not being built with the autogenerated CMakeLists.txt project. Is a different CMakeLists.txt building this?
|
|
10
|
-
#endif
|
|
11
|
-
|
|
12
|
-
#include "NitroRnTuiSdkOnLoad.hpp"
|
|
13
|
-
|
|
14
|
-
#include <jni.h>
|
|
15
|
-
#include <fbjni/fbjni.h>
|
|
16
|
-
#include <NitroModules/HybridObjectRegistry.hpp>
|
|
17
|
-
|
|
18
|
-
#include "JHybridNitroRnTuiSdkSpec.hpp"
|
|
19
|
-
#include "JFunc_void_NativeLogEntry.hpp"
|
|
20
|
-
#include "JFunc_void_PerformanceMetrics.hpp"
|
|
21
|
-
#include <NitroModules/DefaultConstructableObject.hpp>
|
|
22
|
-
|
|
23
|
-
namespace margelo::nitro::rntuisdk {
|
|
24
|
-
|
|
25
|
-
int initialize(JavaVM* vm) {
|
|
26
|
-
return facebook::jni::initialize(vm, []() {
|
|
27
|
-
::margelo::nitro::rntuisdk::registerAllNatives();
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
struct JHybridNitroRnTuiSdkSpecImpl: public jni::JavaClass<JHybridNitroRnTuiSdkSpecImpl, JHybridNitroRnTuiSdkSpec::JavaPart> {
|
|
32
|
-
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/rntuisdk/HybridRnTuiSdk;";
|
|
33
|
-
static std::shared_ptr<JHybridNitroRnTuiSdkSpec> create() {
|
|
34
|
-
static const auto constructorFn = javaClassStatic()->getConstructor<JHybridNitroRnTuiSdkSpecImpl::javaobject()>();
|
|
35
|
-
jni::local_ref<JHybridNitroRnTuiSdkSpec::JavaPart> javaPart = javaClassStatic()->newObject(constructorFn);
|
|
36
|
-
return javaPart->getJHybridNitroRnTuiSdkSpec();
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
void registerAllNatives() {
|
|
41
|
-
using namespace margelo::nitro;
|
|
42
|
-
using namespace margelo::nitro::rntuisdk;
|
|
43
|
-
|
|
44
|
-
// Register native JNI methods
|
|
45
|
-
margelo::nitro::rntuisdk::JHybridNitroRnTuiSdkSpec::CxxPart::registerNatives();
|
|
46
|
-
margelo::nitro::rntuisdk::JFunc_void_NativeLogEntry_cxx::registerNatives();
|
|
47
|
-
margelo::nitro::rntuisdk::JFunc_void_PerformanceMetrics_cxx::registerNatives();
|
|
48
|
-
|
|
49
|
-
// Register Nitro Hybrid Objects
|
|
50
|
-
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
51
|
-
"NitroRnTuiSdk",
|
|
52
|
-
[]() -> std::shared_ptr<HybridObject> {
|
|
53
|
-
return JHybridNitroRnTuiSdkSpecImpl::create();
|
|
54
|
-
}
|
|
55
|
-
);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
} // namespace margelo::nitro::rntuisdk
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// NitroRnTuiSdk-Swift-Cxx-Bridge.cpp
|
|
3
|
-
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
-
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
-
///
|
|
7
|
-
|
|
8
|
-
#include "NitroRnTuiSdk-Swift-Cxx-Bridge.hpp"
|
|
9
|
-
|
|
10
|
-
// Include C++ implementation defined types
|
|
11
|
-
#include "HybridNitroRnTuiSdkSpecSwift.hpp"
|
|
12
|
-
#include "NitroRnTuiSdk-Swift-Cxx-Umbrella.hpp"
|
|
13
|
-
#include <NitroModules/NitroDefines.hpp>
|
|
14
|
-
|
|
15
|
-
namespace margelo::nitro::rntuisdk::bridge::swift {
|
|
16
|
-
|
|
17
|
-
// pragma MARK: std::function<void(const NativeLogEntry& /* log */)>
|
|
18
|
-
Func_void_NativeLogEntry create_Func_void_NativeLogEntry(void* NON_NULL swiftClosureWrapper) noexcept {
|
|
19
|
-
auto swiftClosure = NitroRnTuiSdk::Func_void_NativeLogEntry::fromUnsafe(swiftClosureWrapper);
|
|
20
|
-
return [swiftClosure = std::move(swiftClosure)](const NativeLogEntry& log) mutable -> void {
|
|
21
|
-
swiftClosure.call(log);
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
// pragma MARK: std::function<void(const PerformanceMetrics& /* metrics */)>
|
|
26
|
-
Func_void_PerformanceMetrics create_Func_void_PerformanceMetrics(void* NON_NULL swiftClosureWrapper) noexcept {
|
|
27
|
-
auto swiftClosure = NitroRnTuiSdk::Func_void_PerformanceMetrics::fromUnsafe(swiftClosureWrapper);
|
|
28
|
-
return [swiftClosure = std::move(swiftClosure)](const PerformanceMetrics& metrics) mutable -> void {
|
|
29
|
-
swiftClosure.call(metrics);
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
// pragma MARK: std::shared_ptr<HybridNitroRnTuiSdkSpec>
|
|
34
|
-
std::shared_ptr<HybridNitroRnTuiSdkSpec> create_std__shared_ptr_HybridNitroRnTuiSdkSpec_(void* NON_NULL swiftUnsafePointer) noexcept {
|
|
35
|
-
NitroRnTuiSdk::HybridNitroRnTuiSdkSpec_cxx swiftPart = NitroRnTuiSdk::HybridNitroRnTuiSdkSpec_cxx::fromUnsafe(swiftUnsafePointer);
|
|
36
|
-
return std::make_shared<margelo::nitro::rntuisdk::HybridNitroRnTuiSdkSpecSwift>(swiftPart);
|
|
37
|
-
}
|
|
38
|
-
void* NON_NULL get_std__shared_ptr_HybridNitroRnTuiSdkSpec_(std__shared_ptr_HybridNitroRnTuiSdkSpec_ cppType) {
|
|
39
|
-
std::shared_ptr<margelo::nitro::rntuisdk::HybridNitroRnTuiSdkSpecSwift> swiftWrapper = std::dynamic_pointer_cast<margelo::nitro::rntuisdk::HybridNitroRnTuiSdkSpecSwift>(cppType);
|
|
40
|
-
#ifdef NITRO_DEBUG
|
|
41
|
-
if (swiftWrapper == nullptr) [[unlikely]] {
|
|
42
|
-
throw std::runtime_error("Class \"HybridNitroRnTuiSdkSpec\" is not implemented in Swift!");
|
|
43
|
-
}
|
|
44
|
-
#endif
|
|
45
|
-
NitroRnTuiSdk::HybridNitroRnTuiSdkSpec_cxx& swiftPart = swiftWrapper->getSwiftPart();
|
|
46
|
-
return swiftPart.toUnsafe();
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
} // namespace margelo::nitro::rntuisdk::bridge::swift
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// NitroRnTuiSdkAutolinking.swift
|
|
3
|
-
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
-
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
-
///
|
|
7
|
-
|
|
8
|
-
import NitroModules
|
|
9
|
-
|
|
10
|
-
// TODO: Use empty enums once Swift supports exporting them as namespaces
|
|
11
|
-
// See: https://github.com/swiftlang/swift/pull/83616
|
|
12
|
-
public final class NitroRnTuiSdkAutolinking {
|
|
13
|
-
public typealias bridge = margelo.nitro.rntuisdk.bridge.swift
|
|
14
|
-
|
|
15
|
-
public static func createNitroRnTuiSdk() -> bridge.std__shared_ptr_HybridNitroRnTuiSdkSpec_ {
|
|
16
|
-
let hybridObject = HybridRnTuiSdk()
|
|
17
|
-
return { () -> bridge.std__shared_ptr_HybridNitroRnTuiSdkSpec_ in
|
|
18
|
-
let __cxxWrapped = hybridObject.getCxxWrapper()
|
|
19
|
-
return __cxxWrapped.getCxxPart()
|
|
20
|
-
}()
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
public static func isNitroRnTuiSdkRecyclable() -> Bool {
|
|
24
|
-
return HybridRnTuiSdk.self is any RecyclableView.Type
|
|
25
|
-
}
|
|
26
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
///
|
|
2
|
-
/// HybridNitroRnTuiSdkSpecSwift.cpp
|
|
3
|
-
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
-
/// https://github.com/mrousavy/nitro
|
|
5
|
-
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
-
///
|
|
7
|
-
|
|
8
|
-
#include "HybridNitroRnTuiSdkSpecSwift.hpp"
|
|
9
|
-
|
|
10
|
-
namespace margelo::nitro::rntuisdk {
|
|
11
|
-
} // namespace margelo::nitro::rntuisdk
|