@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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
///
|
|
2
|
-
///
|
|
2
|
+
/// NitroSalvetron-Swift-Cxx-Umbrella.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
|
|
@@ -9,19 +9,19 @@
|
|
|
9
9
|
|
|
10
10
|
// Forward declarations of C++ defined types
|
|
11
11
|
// Forward declaration of `DeviceInfoResult` to properly resolve imports.
|
|
12
|
-
namespace margelo::nitro::
|
|
13
|
-
// Forward declaration of `
|
|
14
|
-
namespace margelo::nitro::
|
|
12
|
+
namespace margelo::nitro::salvetron { struct DeviceInfoResult; }
|
|
13
|
+
// Forward declaration of `HybridNitroSalvetronSpec` to properly resolve imports.
|
|
14
|
+
namespace margelo::nitro::salvetron { class HybridNitroSalvetronSpec; }
|
|
15
15
|
// Forward declaration of `NativeLogEntry` to properly resolve imports.
|
|
16
|
-
namespace margelo::nitro::
|
|
16
|
+
namespace margelo::nitro::salvetron { struct NativeLogEntry; }
|
|
17
17
|
// Forward declaration of `NativeLogLevel` to properly resolve imports.
|
|
18
|
-
namespace margelo::nitro::
|
|
18
|
+
namespace margelo::nitro::salvetron { enum class NativeLogLevel; }
|
|
19
19
|
// Forward declaration of `PerformanceMetrics` to properly resolve imports.
|
|
20
|
-
namespace margelo::nitro::
|
|
20
|
+
namespace margelo::nitro::salvetron { struct PerformanceMetrics; }
|
|
21
21
|
|
|
22
22
|
// Include C++ defined types
|
|
23
23
|
#include "DeviceInfoResult.hpp"
|
|
24
|
-
#include "
|
|
24
|
+
#include "HybridNitroSalvetronSpec.hpp"
|
|
25
25
|
#include "NativeLogEntry.hpp"
|
|
26
26
|
#include "NativeLogLevel.hpp"
|
|
27
27
|
#include "PerformanceMetrics.hpp"
|
|
@@ -33,7 +33,7 @@ namespace margelo::nitro::rntuisdk { struct PerformanceMetrics; }
|
|
|
33
33
|
#include <string>
|
|
34
34
|
|
|
35
35
|
// C++ helpers for Swift
|
|
36
|
-
#include "
|
|
36
|
+
#include "NitroSalvetron-Swift-Cxx-Bridge.hpp"
|
|
37
37
|
|
|
38
38
|
// Common C++ types used in Swift
|
|
39
39
|
#include <NitroModules/ArrayBufferHolder.hpp>
|
|
@@ -42,17 +42,17 @@ namespace margelo::nitro::rntuisdk { struct PerformanceMetrics; }
|
|
|
42
42
|
#include <NitroModules/DateToChronoDate.hpp>
|
|
43
43
|
|
|
44
44
|
// Forward declarations of Swift defined types
|
|
45
|
-
// Forward declaration of `
|
|
46
|
-
namespace
|
|
45
|
+
// Forward declaration of `HybridNitroSalvetronSpec_cxx` to properly resolve imports.
|
|
46
|
+
namespace NitroSalvetron { class HybridNitroSalvetronSpec_cxx; }
|
|
47
47
|
|
|
48
48
|
// Include Swift defined types
|
|
49
|
-
#if __has_include("
|
|
49
|
+
#if __has_include("NitroSalvetron-Swift.h")
|
|
50
50
|
// This header is generated by Xcode/Swift on every app build.
|
|
51
|
-
// If it cannot be found, make sure the Swift module's name (= podspec name) is actually "
|
|
52
|
-
#include "
|
|
51
|
+
// If it cannot be found, make sure the Swift module's name (= podspec name) is actually "NitroSalvetron".
|
|
52
|
+
#include "NitroSalvetron-Swift.h"
|
|
53
53
|
// Same as above, but used when building with frameworks (`use_frameworks`)
|
|
54
|
-
#elif __has_include(<
|
|
55
|
-
#include <
|
|
54
|
+
#elif __has_include(<NitroSalvetron/NitroSalvetron-Swift.h>)
|
|
55
|
+
#include <NitroSalvetron/NitroSalvetron-Swift.h>
|
|
56
56
|
#else
|
|
57
|
-
#error
|
|
57
|
+
#error NitroSalvetron's autogenerated Swift header cannot be found! Make sure the Swift module's name (= podspec name) is actually "NitroSalvetron", and try building the app first.
|
|
58
58
|
#endif
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
///
|
|
2
|
-
///
|
|
2
|
+
/// NitroSalvetronAutolinking.mm
|
|
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
|
|
@@ -7,24 +7,24 @@
|
|
|
7
7
|
|
|
8
8
|
#import <Foundation/Foundation.h>
|
|
9
9
|
#import <NitroModules/HybridObjectRegistry.hpp>
|
|
10
|
-
#import "
|
|
10
|
+
#import "NitroSalvetron-Swift-Cxx-Umbrella.hpp"
|
|
11
11
|
#import <type_traits>
|
|
12
12
|
|
|
13
|
-
#include "
|
|
13
|
+
#include "HybridNitroSalvetronSpecSwift.hpp"
|
|
14
14
|
|
|
15
|
-
@interface
|
|
15
|
+
@interface NitroSalvetronAutolinking : NSObject
|
|
16
16
|
@end
|
|
17
17
|
|
|
18
|
-
@implementation
|
|
18
|
+
@implementation NitroSalvetronAutolinking
|
|
19
19
|
|
|
20
20
|
+ (void) load {
|
|
21
21
|
using namespace margelo::nitro;
|
|
22
|
-
using namespace margelo::nitro::
|
|
22
|
+
using namespace margelo::nitro::salvetron;
|
|
23
23
|
|
|
24
24
|
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
25
|
-
"
|
|
25
|
+
"NitroSalvetron",
|
|
26
26
|
[]() -> std::shared_ptr<HybridObject> {
|
|
27
|
-
std::shared_ptr<
|
|
27
|
+
std::shared_ptr<HybridNitroSalvetronSpec> hybridObject = NitroSalvetron::NitroSalvetronAutolinking::createNitroSalvetron();
|
|
28
28
|
return hybridObject;
|
|
29
29
|
}
|
|
30
30
|
);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NitroSalvetronAutolinking.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 NitroSalvetronAutolinking {
|
|
13
|
+
public typealias bridge = margelo.nitro.salvetron.bridge.swift
|
|
14
|
+
|
|
15
|
+
public static func createNitroSalvetron() -> bridge.std__shared_ptr_HybridNitroSalvetronSpec_ {
|
|
16
|
+
let hybridObject = HybridSalvetron()
|
|
17
|
+
return { () -> bridge.std__shared_ptr_HybridNitroSalvetronSpec_ in
|
|
18
|
+
let __cxxWrapped = hybridObject.getCxxWrapper()
|
|
19
|
+
return __cxxWrapped.getCxxPart()
|
|
20
|
+
}()
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
public static func isNitroSalvetronRecyclable() -> Bool {
|
|
24
|
+
return HybridSalvetron.self is any RecyclableView.Type
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridNitroSalvetronSpecSwift.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 "HybridNitroSalvetronSpecSwift.hpp"
|
|
9
|
+
|
|
10
|
+
namespace margelo::nitro::salvetron {
|
|
11
|
+
} // namespace margelo::nitro::salvetron
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
///
|
|
2
|
-
///
|
|
2
|
+
/// HybridNitroSalvetronSpecSwift.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
|
|
@@ -7,19 +7,19 @@
|
|
|
7
7
|
|
|
8
8
|
#pragma once
|
|
9
9
|
|
|
10
|
-
#include "
|
|
10
|
+
#include "HybridNitroSalvetronSpec.hpp"
|
|
11
11
|
|
|
12
|
-
// Forward declaration of `
|
|
13
|
-
namespace
|
|
12
|
+
// Forward declaration of `HybridNitroSalvetronSpec_cxx` to properly resolve imports.
|
|
13
|
+
namespace NitroSalvetron { class HybridNitroSalvetronSpec_cxx; }
|
|
14
14
|
|
|
15
15
|
// Forward declaration of `NativeLogEntry` to properly resolve imports.
|
|
16
|
-
namespace margelo::nitro::
|
|
16
|
+
namespace margelo::nitro::salvetron { struct NativeLogEntry; }
|
|
17
17
|
// Forward declaration of `NativeLogLevel` to properly resolve imports.
|
|
18
|
-
namespace margelo::nitro::
|
|
18
|
+
namespace margelo::nitro::salvetron { enum class NativeLogLevel; }
|
|
19
19
|
// Forward declaration of `DeviceInfoResult` to properly resolve imports.
|
|
20
|
-
namespace margelo::nitro::
|
|
20
|
+
namespace margelo::nitro::salvetron { struct DeviceInfoResult; }
|
|
21
21
|
// Forward declaration of `PerformanceMetrics` to properly resolve imports.
|
|
22
|
-
namespace margelo::nitro::
|
|
22
|
+
namespace margelo::nitro::salvetron { struct PerformanceMetrics; }
|
|
23
23
|
|
|
24
24
|
#include "NativeLogEntry.hpp"
|
|
25
25
|
#include <functional>
|
|
@@ -29,30 +29,30 @@ namespace margelo::nitro::rntuisdk { struct PerformanceMetrics; }
|
|
|
29
29
|
#include <optional>
|
|
30
30
|
#include "PerformanceMetrics.hpp"
|
|
31
31
|
|
|
32
|
-
#include "
|
|
32
|
+
#include "NitroSalvetron-Swift-Cxx-Umbrella.hpp"
|
|
33
33
|
|
|
34
|
-
namespace margelo::nitro::
|
|
34
|
+
namespace margelo::nitro::salvetron {
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
|
-
* The C++ part of
|
|
37
|
+
* The C++ part of HybridNitroSalvetronSpec_cxx.swift.
|
|
38
38
|
*
|
|
39
|
-
*
|
|
39
|
+
* HybridNitroSalvetronSpecSwift (C++) accesses HybridNitroSalvetronSpec_cxx (Swift), and might
|
|
40
40
|
* contain some additional bridging code for C++ <> Swift interop.
|
|
41
41
|
*
|
|
42
42
|
* Since this obviously introduces an overhead, I hope at some point in
|
|
43
|
-
* the future,
|
|
43
|
+
* the future, HybridNitroSalvetronSpec_cxx can directly inherit from the C++ class HybridNitroSalvetronSpec
|
|
44
44
|
* to simplify the whole structure and memory management.
|
|
45
45
|
*/
|
|
46
|
-
class
|
|
46
|
+
class HybridNitroSalvetronSpecSwift: public virtual HybridNitroSalvetronSpec {
|
|
47
47
|
public:
|
|
48
48
|
// Constructor from a Swift instance
|
|
49
|
-
explicit
|
|
50
|
-
HybridObject(
|
|
49
|
+
explicit HybridNitroSalvetronSpecSwift(const NitroSalvetron::HybridNitroSalvetronSpec_cxx& swiftPart):
|
|
50
|
+
HybridObject(HybridNitroSalvetronSpec::TAG),
|
|
51
51
|
_swiftPart(swiftPart) { }
|
|
52
52
|
|
|
53
53
|
public:
|
|
54
54
|
// Get the Swift part
|
|
55
|
-
inline
|
|
55
|
+
inline NitroSalvetron::HybridNitroSalvetronSpec_cxx& getSwiftPart() noexcept {
|
|
56
56
|
return _swiftPart;
|
|
57
57
|
}
|
|
58
58
|
|
|
@@ -61,7 +61,7 @@ namespace margelo::nitro::rntuisdk {
|
|
|
61
61
|
return _swiftPart.getMemorySize();
|
|
62
62
|
}
|
|
63
63
|
bool equals(const std::shared_ptr<HybridObject>& other) override {
|
|
64
|
-
if (auto otherCast = std::dynamic_pointer_cast<
|
|
64
|
+
if (auto otherCast = std::dynamic_pointer_cast<HybridNitroSalvetronSpecSwift>(other)) {
|
|
65
65
|
return _swiftPart.equals(otherCast->_swiftPart);
|
|
66
66
|
}
|
|
67
67
|
return false;
|
|
@@ -169,7 +169,7 @@ namespace margelo::nitro::rntuisdk {
|
|
|
169
169
|
}
|
|
170
170
|
|
|
171
171
|
private:
|
|
172
|
-
|
|
172
|
+
NitroSalvetron::HybridNitroSalvetronSpec_cxx _swiftPart;
|
|
173
173
|
};
|
|
174
174
|
|
|
175
|
-
} // namespace margelo::nitro::
|
|
175
|
+
} // namespace margelo::nitro::salvetron
|
|
@@ -10,10 +10,10 @@ import NitroModules
|
|
|
10
10
|
/**
|
|
11
11
|
* Represents an instance of `DeviceInfoResult`, backed by a C++ struct.
|
|
12
12
|
*/
|
|
13
|
-
public typealias DeviceInfoResult = margelo.nitro.
|
|
13
|
+
public typealias DeviceInfoResult = margelo.nitro.salvetron.DeviceInfoResult
|
|
14
14
|
|
|
15
15
|
public extension DeviceInfoResult {
|
|
16
|
-
private typealias bridge = margelo.nitro.
|
|
16
|
+
private typealias bridge = margelo.nitro.salvetron.bridge.swift
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* Create a new instance of `DeviceInfoResult`.
|
|
@@ -12,7 +12,7 @@ import NitroModules
|
|
|
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_NativeLogEntry {
|
|
15
|
-
public typealias bridge = margelo.nitro.
|
|
15
|
+
public typealias bridge = margelo.nitro.salvetron.bridge.swift
|
|
16
16
|
|
|
17
17
|
private let closure: (_ log: NativeLogEntry) -> Void
|
|
18
18
|
|
|
@@ -12,7 +12,7 @@ import NitroModules
|
|
|
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_PerformanceMetrics {
|
|
15
|
-
public typealias bridge = margelo.nitro.
|
|
15
|
+
public typealias bridge = margelo.nitro.salvetron.bridge.swift
|
|
16
16
|
|
|
17
17
|
private let closure: (_ metrics: PerformanceMetrics) -> Void
|
|
18
18
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
///
|
|
2
|
-
///
|
|
2
|
+
/// HybridNitroSalvetronSpec.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
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
|
|
8
8
|
import NitroModules
|
|
9
9
|
|
|
10
|
-
/// See ``
|
|
11
|
-
public protocol
|
|
10
|
+
/// See ``HybridNitroSalvetronSpec``
|
|
11
|
+
public protocol HybridNitroSalvetronSpec_protocol: HybridObject {
|
|
12
12
|
// Properties
|
|
13
13
|
|
|
14
14
|
|
|
@@ -27,27 +27,27 @@ public protocol HybridNitroRnTuiSdkSpec_protocol: HybridObject {
|
|
|
27
27
|
func recordJsFrame() throws -> Void
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
public extension
|
|
30
|
+
public extension HybridNitroSalvetronSpec_protocol {
|
|
31
31
|
/// Default implementation of ``HybridObject.toString``
|
|
32
32
|
func toString() -> String {
|
|
33
|
-
return "[HybridObject
|
|
33
|
+
return "[HybridObject NitroSalvetron]"
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
/// See ``
|
|
38
|
-
open class
|
|
39
|
-
private weak var cxxWrapper:
|
|
37
|
+
/// See ``HybridNitroSalvetronSpec``
|
|
38
|
+
open class HybridNitroSalvetronSpec_base {
|
|
39
|
+
private weak var cxxWrapper: HybridNitroSalvetronSpec_cxx? = nil
|
|
40
40
|
public init() { }
|
|
41
|
-
public func getCxxWrapper() ->
|
|
41
|
+
public func getCxxWrapper() -> HybridNitroSalvetronSpec_cxx {
|
|
42
42
|
#if DEBUG
|
|
43
|
-
guard self is any
|
|
44
|
-
fatalError("`self` is not a `
|
|
43
|
+
guard self is any HybridNitroSalvetronSpec else {
|
|
44
|
+
fatalError("`self` is not a `HybridNitroSalvetronSpec`! Did you accidentally inherit from `HybridNitroSalvetronSpec_base` instead of `HybridNitroSalvetronSpec`?")
|
|
45
45
|
}
|
|
46
46
|
#endif
|
|
47
47
|
if let cxxWrapper = self.cxxWrapper {
|
|
48
48
|
return cxxWrapper
|
|
49
49
|
} else {
|
|
50
|
-
let cxxWrapper =
|
|
50
|
+
let cxxWrapper = HybridNitroSalvetronSpec_cxx(self as! any HybridNitroSalvetronSpec)
|
|
51
51
|
self.cxxWrapper = cxxWrapper
|
|
52
52
|
return cxxWrapper
|
|
53
53
|
}
|
|
@@ -55,12 +55,12 @@ open class HybridNitroRnTuiSdkSpec_base {
|
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
/**
|
|
58
|
-
* A Swift base-protocol representing the
|
|
59
|
-
* Implement this protocol to create Swift-based instances of
|
|
58
|
+
* A Swift base-protocol representing the NitroSalvetron HybridObject.
|
|
59
|
+
* Implement this protocol to create Swift-based instances of NitroSalvetron.
|
|
60
60
|
* ```swift
|
|
61
|
-
* class
|
|
61
|
+
* class HybridNitroSalvetron : HybridNitroSalvetronSpec {
|
|
62
62
|
* // ...
|
|
63
63
|
* }
|
|
64
64
|
* ```
|
|
65
65
|
*/
|
|
66
|
-
public typealias
|
|
66
|
+
public typealias HybridNitroSalvetronSpec = HybridNitroSalvetronSpec_protocol & HybridNitroSalvetronSpec_base
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
///
|
|
2
|
-
///
|
|
2
|
+
/// HybridNitroSalvetronSpec_cxx.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,7 +8,7 @@
|
|
|
8
8
|
import NitroModules
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
* A class implementation that bridges
|
|
11
|
+
* A class implementation that bridges HybridNitroSalvetronSpec over to C++.
|
|
12
12
|
* In C++, we cannot use Swift protocols - so we need to wrap it in a class to make it strongly defined.
|
|
13
13
|
*
|
|
14
14
|
* Also, some Swift types need to be bridged with special handling:
|
|
@@ -16,39 +16,39 @@ import NitroModules
|
|
|
16
16
|
* - Other HybridObjects need to be wrapped/unwrapped from the Swift TCxx wrapper
|
|
17
17
|
* - Throwing methods need to be wrapped with a Result<T, Error> type, as exceptions cannot be propagated to C++
|
|
18
18
|
*/
|
|
19
|
-
open class
|
|
19
|
+
open class HybridNitroSalvetronSpec_cxx {
|
|
20
20
|
/**
|
|
21
|
-
* The Swift <> C++ bridge's namespace (`margelo::nitro::
|
|
22
|
-
* from `
|
|
21
|
+
* The Swift <> C++ bridge's namespace (`margelo::nitro::salvetron::bridge::swift`)
|
|
22
|
+
* from `NitroSalvetron-Swift-Cxx-Bridge.hpp`.
|
|
23
23
|
* This contains specialized C++ templates, and C++ helper functions that can be accessed from Swift.
|
|
24
24
|
*/
|
|
25
|
-
public typealias bridge = margelo.nitro.
|
|
25
|
+
public typealias bridge = margelo.nitro.salvetron.bridge.swift
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
|
-
* Holds an instance of the `
|
|
28
|
+
* Holds an instance of the `HybridNitroSalvetronSpec` Swift protocol.
|
|
29
29
|
*/
|
|
30
|
-
private var __implementation: any
|
|
30
|
+
private var __implementation: any HybridNitroSalvetronSpec
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
33
|
* Holds a weak pointer to the C++ class that wraps the Swift class.
|
|
34
34
|
*/
|
|
35
|
-
private var __cxxPart: bridge.
|
|
35
|
+
private var __cxxPart: bridge.std__weak_ptr_HybridNitroSalvetronSpec_
|
|
36
36
|
|
|
37
37
|
/**
|
|
38
|
-
* Create a new `
|
|
38
|
+
* Create a new `HybridNitroSalvetronSpec_cxx` that wraps the given `HybridNitroSalvetronSpec`.
|
|
39
39
|
* All properties and methods bridge to C++ types.
|
|
40
40
|
*/
|
|
41
|
-
public init(_ implementation: any
|
|
41
|
+
public init(_ implementation: any HybridNitroSalvetronSpec) {
|
|
42
42
|
self.__implementation = implementation
|
|
43
43
|
self.__cxxPart = .init()
|
|
44
44
|
/* no base class */
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
/**
|
|
48
|
-
* Get the actual `
|
|
48
|
+
* Get the actual `HybridNitroSalvetronSpec` instance this class wraps.
|
|
49
49
|
*/
|
|
50
50
|
@inline(__always)
|
|
51
|
-
public func
|
|
51
|
+
public func getHybridNitroSalvetronSpec() -> any HybridNitroSalvetronSpec {
|
|
52
52
|
return __implementation
|
|
53
53
|
}
|
|
54
54
|
|
|
@@ -61,25 +61,25 @@ open class HybridNitroRnTuiSdkSpec_cxx {
|
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
/**
|
|
64
|
-
* Casts an unsafe pointer to a `
|
|
65
|
-
* The pointer has to be a retained opaque `Unmanaged<
|
|
64
|
+
* Casts an unsafe pointer to a `HybridNitroSalvetronSpec_cxx`.
|
|
65
|
+
* The pointer has to be a retained opaque `Unmanaged<HybridNitroSalvetronSpec_cxx>`.
|
|
66
66
|
* This removes one strong reference from the object!
|
|
67
67
|
*/
|
|
68
|
-
public class func fromUnsafe(_ pointer: UnsafeMutableRawPointer) ->
|
|
69
|
-
return Unmanaged<
|
|
68
|
+
public class func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> HybridNitroSalvetronSpec_cxx {
|
|
69
|
+
return Unmanaged<HybridNitroSalvetronSpec_cxx>.fromOpaque(pointer).takeRetainedValue()
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
/**
|
|
73
73
|
* Gets (or creates) the C++ part of this Hybrid Object.
|
|
74
|
-
* The C++ part is a `std::shared_ptr<
|
|
74
|
+
* The C++ part is a `std::shared_ptr<HybridNitroSalvetronSpec>`.
|
|
75
75
|
*/
|
|
76
|
-
public func getCxxPart() -> bridge.
|
|
76
|
+
public func getCxxPart() -> bridge.std__shared_ptr_HybridNitroSalvetronSpec_ {
|
|
77
77
|
let cachedCxxPart = self.__cxxPart.lock()
|
|
78
78
|
if Bool(fromCxx: cachedCxxPart) {
|
|
79
79
|
return cachedCxxPart
|
|
80
80
|
} else {
|
|
81
|
-
let newCxxPart = bridge.
|
|
82
|
-
__cxxPart = bridge.
|
|
81
|
+
let newCxxPart = bridge.create_std__shared_ptr_HybridNitroSalvetronSpec_(self.toUnsafe())
|
|
82
|
+
__cxxPart = bridge.weakify_std__shared_ptr_HybridNitroSalvetronSpec_(newCxxPart)
|
|
83
83
|
return newCxxPart
|
|
84
84
|
}
|
|
85
85
|
}
|
|
@@ -99,7 +99,7 @@ open class HybridNitroRnTuiSdkSpec_cxx {
|
|
|
99
99
|
* Compares this object with the given [other] object for reference equality.
|
|
100
100
|
*/
|
|
101
101
|
@inline(__always)
|
|
102
|
-
public func equals(other:
|
|
102
|
+
public func equals(other: HybridNitroSalvetronSpec_cxx) -> Bool {
|
|
103
103
|
return self.__implementation === other.__implementation
|
|
104
104
|
}
|
|
105
105
|
|
|
@@ -10,10 +10,10 @@ import NitroModules
|
|
|
10
10
|
/**
|
|
11
11
|
* Represents an instance of `NativeLogEntry`, backed by a C++ struct.
|
|
12
12
|
*/
|
|
13
|
-
public typealias NativeLogEntry = margelo.nitro.
|
|
13
|
+
public typealias NativeLogEntry = margelo.nitro.salvetron.NativeLogEntry
|
|
14
14
|
|
|
15
15
|
public extension NativeLogEntry {
|
|
16
|
-
private typealias bridge = margelo.nitro.
|
|
16
|
+
private typealias bridge = margelo.nitro.salvetron.bridge.swift
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* Create a new instance of `NativeLogEntry`.
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
/**
|
|
9
9
|
* Represents the JS union `NativeLogLevel`, backed by a C++ enum.
|
|
10
10
|
*/
|
|
11
|
-
public typealias NativeLogLevel = margelo.nitro.
|
|
11
|
+
public typealias NativeLogLevel = margelo.nitro.salvetron.NativeLogLevel
|
|
12
12
|
|
|
13
13
|
public extension NativeLogLevel {
|
|
14
14
|
/**
|
|
@@ -10,10 +10,10 @@ import NitroModules
|
|
|
10
10
|
/**
|
|
11
11
|
* Represents an instance of `PerformanceMetrics`, backed by a C++ struct.
|
|
12
12
|
*/
|
|
13
|
-
public typealias PerformanceMetrics = margelo.nitro.
|
|
13
|
+
public typealias PerformanceMetrics = margelo.nitro.salvetron.PerformanceMetrics
|
|
14
14
|
|
|
15
15
|
public extension PerformanceMetrics {
|
|
16
|
-
private typealias bridge = margelo.nitro.
|
|
16
|
+
private typealias bridge = margelo.nitro.salvetron.bridge.swift
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* Create a new instance of `PerformanceMetrics`.
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
|
|
33
33
|
#include <string>
|
|
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 (DeviceInfoResult).
|
|
@@ -52,23 +52,23 @@ namespace margelo::nitro::rntuisdk {
|
|
|
52
52
|
friend bool operator==(const DeviceInfoResult& lhs, const DeviceInfoResult& 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++ DeviceInfoResult <> JS DeviceInfoResult (object)
|
|
60
60
|
template <>
|
|
61
|
-
struct JSIConverter<margelo::nitro::
|
|
62
|
-
static inline margelo::nitro::
|
|
61
|
+
struct JSIConverter<margelo::nitro::salvetron::DeviceInfoResult> final {
|
|
62
|
+
static inline margelo::nitro::salvetron::DeviceInfoResult 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::DeviceInfoResult(
|
|
65
65
|
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "deviceId"))),
|
|
66
66
|
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "deviceName"))),
|
|
67
67
|
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "appName"))),
|
|
68
68
|
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "bundleId")))
|
|
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::DeviceInfoResult& arg) {
|
|
72
72
|
jsi::Object obj(runtime);
|
|
73
73
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "deviceId"), JSIConverter<std::string>::toJSI(runtime, arg.deviceId));
|
|
74
74
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "deviceName"), JSIConverter<std::string>::toJSI(runtime, arg.deviceName));
|
package/nitrogen/generated/shared/c++/{HybridNitroRnTuiSdkSpec.cpp → HybridNitroSalvetronSpec.cpp}
RENAMED
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
///
|
|
2
|
-
///
|
|
2
|
+
/// HybridNitroSalvetronSpec.cpp
|
|
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
|
|
6
6
|
///
|
|
7
7
|
|
|
8
|
-
#include "
|
|
8
|
+
#include "HybridNitroSalvetronSpec.hpp"
|
|
9
9
|
|
|
10
|
-
namespace margelo::nitro::
|
|
10
|
+
namespace margelo::nitro::salvetron {
|
|
11
11
|
|
|
12
|
-
void
|
|
12
|
+
void HybridNitroSalvetronSpec::loadHybridMethods() {
|
|
13
13
|
// load base methods/properties
|
|
14
14
|
HybridObject::loadHybridMethods();
|
|
15
15
|
// load custom methods/properties
|
|
16
16
|
registerHybrids(this, [](Prototype& prototype) {
|
|
17
|
-
prototype.registerHybridMethod("sum", &
|
|
18
|
-
prototype.registerHybridMethod("startLogCapture", &
|
|
19
|
-
prototype.registerHybridMethod("stopLogCapture", &
|
|
20
|
-
prototype.registerHybridMethod("isCapturing", &
|
|
21
|
-
prototype.registerHybridMethod("getDeviceInfo", &
|
|
22
|
-
prototype.registerHybridMethod("getStoredDeviceId", &
|
|
23
|
-
prototype.registerHybridMethod("storeDeviceId", &
|
|
24
|
-
prototype.registerHybridMethod("startPerformanceMonitoring", &
|
|
25
|
-
prototype.registerHybridMethod("stopPerformanceMonitoring", &
|
|
26
|
-
prototype.registerHybridMethod("isPerformanceMonitoring", &
|
|
27
|
-
prototype.registerHybridMethod("getPerformanceSnapshot", &
|
|
28
|
-
prototype.registerHybridMethod("recordJsFrame", &
|
|
17
|
+
prototype.registerHybridMethod("sum", &HybridNitroSalvetronSpec::sum);
|
|
18
|
+
prototype.registerHybridMethod("startLogCapture", &HybridNitroSalvetronSpec::startLogCapture);
|
|
19
|
+
prototype.registerHybridMethod("stopLogCapture", &HybridNitroSalvetronSpec::stopLogCapture);
|
|
20
|
+
prototype.registerHybridMethod("isCapturing", &HybridNitroSalvetronSpec::isCapturing);
|
|
21
|
+
prototype.registerHybridMethod("getDeviceInfo", &HybridNitroSalvetronSpec::getDeviceInfo);
|
|
22
|
+
prototype.registerHybridMethod("getStoredDeviceId", &HybridNitroSalvetronSpec::getStoredDeviceId);
|
|
23
|
+
prototype.registerHybridMethod("storeDeviceId", &HybridNitroSalvetronSpec::storeDeviceId);
|
|
24
|
+
prototype.registerHybridMethod("startPerformanceMonitoring", &HybridNitroSalvetronSpec::startPerformanceMonitoring);
|
|
25
|
+
prototype.registerHybridMethod("stopPerformanceMonitoring", &HybridNitroSalvetronSpec::stopPerformanceMonitoring);
|
|
26
|
+
prototype.registerHybridMethod("isPerformanceMonitoring", &HybridNitroSalvetronSpec::isPerformanceMonitoring);
|
|
27
|
+
prototype.registerHybridMethod("getPerformanceSnapshot", &HybridNitroSalvetronSpec::getPerformanceSnapshot);
|
|
28
|
+
prototype.registerHybridMethod("recordJsFrame", &HybridNitroSalvetronSpec::recordJsFrame);
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
} // namespace margelo::nitro::
|
|
32
|
+
} // namespace margelo::nitro::salvetron
|