@onekeyfe/react-native-perp-depth-bar 3.0.39 → 3.0.40

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.
Files changed (72) hide show
  1. package/android/src/main/java/com/margelo/nitro/perpdepthbar/HybridPerpDepthBars.kt +100 -1
  2. package/ios/HybridPerpDepthBars.swift +97 -1
  3. package/ios/PerpColorParser.swift +8 -0
  4. package/lib/module/index.js +25 -2
  5. package/lib/module/index.js.map +1 -1
  6. package/lib/nitrogen/generated/android/c++/JFunc_void_double.hpp +75 -0
  7. package/lib/nitrogen/generated/android/c++/JHybridPerpDepthBarsSpec.cpp +120 -0
  8. package/lib/nitrogen/generated/android/c++/JHybridPerpDepthBarsSpec.hpp +16 -0
  9. package/lib/nitrogen/generated/android/c++/views/JHybridPerpDepthBarsStateUpdater.cpp +32 -0
  10. package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/perpdepthbar/Func_void_double.kt +80 -0
  11. package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/perpdepthbar/HybridPerpDepthBarsSpec.kt +56 -0
  12. package/lib/nitrogen/generated/android/perpdepthbarOnLoad.cpp +2 -0
  13. package/lib/nitrogen/generated/ios/PerpDepthBar-Swift-Cxx-Bridge.cpp +8 -0
  14. package/lib/nitrogen/generated/ios/PerpDepthBar-Swift-Cxx-Bridge.hpp +51 -0
  15. package/lib/nitrogen/generated/ios/PerpDepthBar-Swift-Cxx-Umbrella.hpp +2 -0
  16. package/lib/nitrogen/generated/ios/c++/HybridPerpDepthBarsSpecSwift.hpp +55 -0
  17. package/lib/nitrogen/generated/ios/c++/views/HybridPerpDepthBarsComponent.mm +40 -0
  18. package/lib/nitrogen/generated/ios/swift/Func_void_double.swift +47 -0
  19. package/lib/nitrogen/generated/ios/swift/HybridPerpDepthBarsSpec.swift +8 -0
  20. package/lib/nitrogen/generated/ios/swift/HybridPerpDepthBarsSpec_cxx.swift +121 -0
  21. package/lib/nitrogen/generated/shared/c++/HybridPerpDepthBarsSpec.cpp +16 -0
  22. package/lib/nitrogen/generated/shared/c++/HybridPerpDepthBarsSpec.hpp +18 -0
  23. package/lib/nitrogen/generated/shared/c++/views/HybridPerpDepthBarsComponent.cpp +96 -0
  24. package/lib/nitrogen/generated/shared/c++/views/HybridPerpDepthBarsComponent.hpp +10 -2
  25. package/lib/nitrogen/generated/shared/json/PerpDepthBarsConfig.json +8 -0
  26. package/lib/nitrogen/nitrogen/generated/android/c++/JFunc_void_double.hpp +75 -0
  27. package/lib/nitrogen/nitrogen/generated/android/c++/JHybridPerpDepthBarsSpec.cpp +120 -0
  28. package/lib/nitrogen/nitrogen/generated/android/c++/JHybridPerpDepthBarsSpec.hpp +16 -0
  29. package/lib/nitrogen/nitrogen/generated/android/c++/views/JHybridPerpDepthBarsStateUpdater.cpp +32 -0
  30. package/lib/nitrogen/nitrogen/generated/android/kotlin/com/margelo/nitro/perpdepthbar/Func_void_double.kt +80 -0
  31. package/lib/nitrogen/nitrogen/generated/android/kotlin/com/margelo/nitro/perpdepthbar/HybridPerpDepthBarsSpec.kt +56 -0
  32. package/lib/nitrogen/nitrogen/generated/android/perpdepthbarOnLoad.cpp +2 -0
  33. package/lib/nitrogen/nitrogen/generated/ios/PerpDepthBar-Swift-Cxx-Bridge.cpp +8 -0
  34. package/lib/nitrogen/nitrogen/generated/ios/PerpDepthBar-Swift-Cxx-Bridge.hpp +51 -0
  35. package/lib/nitrogen/nitrogen/generated/ios/PerpDepthBar-Swift-Cxx-Umbrella.hpp +2 -0
  36. package/lib/nitrogen/nitrogen/generated/ios/c++/HybridPerpDepthBarsSpecSwift.hpp +55 -0
  37. package/lib/nitrogen/nitrogen/generated/ios/c++/views/HybridPerpDepthBarsComponent.mm +40 -0
  38. package/lib/nitrogen/nitrogen/generated/ios/swift/Func_void_double.swift +47 -0
  39. package/lib/nitrogen/nitrogen/generated/ios/swift/HybridPerpDepthBarsSpec.swift +8 -0
  40. package/lib/nitrogen/nitrogen/generated/ios/swift/HybridPerpDepthBarsSpec_cxx.swift +121 -0
  41. package/lib/nitrogen/nitrogen/generated/shared/c++/HybridPerpDepthBarsSpec.cpp +16 -0
  42. package/lib/nitrogen/nitrogen/generated/shared/c++/HybridPerpDepthBarsSpec.hpp +18 -0
  43. package/lib/nitrogen/nitrogen/generated/shared/c++/views/HybridPerpDepthBarsComponent.cpp +96 -0
  44. package/lib/nitrogen/nitrogen/generated/shared/c++/views/HybridPerpDepthBarsComponent.hpp +10 -2
  45. package/lib/nitrogen/nitrogen/generated/shared/json/PerpDepthBarsConfig.json +8 -0
  46. package/lib/typescript/src/PerpDepthBars.nitro.d.ts +20 -0
  47. package/lib/typescript/src/PerpDepthBars.nitro.d.ts.map +1 -1
  48. package/lib/typescript/src/index.d.ts +7 -1
  49. package/lib/typescript/src/index.d.ts.map +1 -1
  50. package/nitrogen/generated/android/c++/JFunc_void_double.hpp +75 -0
  51. package/nitrogen/generated/android/c++/JHybridPerpDepthBarsSpec.cpp +120 -0
  52. package/nitrogen/generated/android/c++/JHybridPerpDepthBarsSpec.hpp +16 -0
  53. package/nitrogen/generated/android/c++/views/JHybridPerpDepthBarsStateUpdater.cpp +32 -0
  54. package/nitrogen/generated/android/kotlin/com/margelo/nitro/perpdepthbar/Func_void_double.kt +80 -0
  55. package/nitrogen/generated/android/kotlin/com/margelo/nitro/perpdepthbar/HybridPerpDepthBarsSpec.kt +56 -0
  56. package/nitrogen/generated/android/perpdepthbarOnLoad.cpp +2 -0
  57. package/nitrogen/generated/ios/PerpDepthBar-Swift-Cxx-Bridge.cpp +8 -0
  58. package/nitrogen/generated/ios/PerpDepthBar-Swift-Cxx-Bridge.hpp +51 -0
  59. package/nitrogen/generated/ios/PerpDepthBar-Swift-Cxx-Umbrella.hpp +2 -0
  60. package/nitrogen/generated/ios/c++/HybridPerpDepthBarsSpecSwift.hpp +55 -0
  61. package/nitrogen/generated/ios/c++/views/HybridPerpDepthBarsComponent.mm +40 -0
  62. package/nitrogen/generated/ios/swift/Func_void_double.swift +47 -0
  63. package/nitrogen/generated/ios/swift/HybridPerpDepthBarsSpec.swift +8 -0
  64. package/nitrogen/generated/ios/swift/HybridPerpDepthBarsSpec_cxx.swift +121 -0
  65. package/nitrogen/generated/shared/c++/HybridPerpDepthBarsSpec.cpp +16 -0
  66. package/nitrogen/generated/shared/c++/HybridPerpDepthBarsSpec.hpp +18 -0
  67. package/nitrogen/generated/shared/c++/views/HybridPerpDepthBarsComponent.cpp +96 -0
  68. package/nitrogen/generated/shared/c++/views/HybridPerpDepthBarsComponent.hpp +10 -2
  69. package/nitrogen/generated/shared/json/PerpDepthBarsConfig.json +8 -0
  70. package/package.json +1 -1
  71. package/src/PerpDepthBars.nitro.ts +27 -0
  72. package/src/index.tsx +28 -2
@@ -89,6 +89,62 @@ abstract class HybridPerpDepthBarsSpec: HybridView() {
89
89
  @set:DoNotStrip
90
90
  @set:Keep
91
91
  abstract var epoch: Double
92
+
93
+ @get:DoNotStrip
94
+ @get:Keep
95
+ @set:DoNotStrip
96
+ @set:Keep
97
+ abstract var prices: Array<String>
98
+
99
+ @get:DoNotStrip
100
+ @get:Keep
101
+ @set:DoNotStrip
102
+ @set:Keep
103
+ abstract var sizes: Array<String>
104
+
105
+ @get:DoNotStrip
106
+ @get:Keep
107
+ @set:DoNotStrip
108
+ @set:Keep
109
+ abstract var priceColor: String
110
+
111
+ @get:DoNotStrip
112
+ @get:Keep
113
+ @set:DoNotStrip
114
+ @set:Keep
115
+ abstract var sizeColor: String
116
+
117
+ @get:DoNotStrip
118
+ @get:Keep
119
+ @set:DoNotStrip
120
+ @set:Keep
121
+ abstract var priceFontSize: Double
122
+
123
+ @get:DoNotStrip
124
+ @get:Keep
125
+ @set:DoNotStrip
126
+ @set:Keep
127
+ abstract var sizeFontSize: Double
128
+
129
+ @get:DoNotStrip
130
+ @get:Keep
131
+ @set:DoNotStrip
132
+ @set:Keep
133
+ abstract var textInset: Double
134
+
135
+ abstract var onRowPress: ((rowIndex: Double) -> Unit)?
136
+
137
+ private var onRowPress_cxx: Func_void_double?
138
+ @Keep
139
+ @DoNotStrip
140
+ get() {
141
+ return onRowPress?.let { Func_void_double_java(it) }
142
+ }
143
+ @Keep
144
+ @DoNotStrip
145
+ set(value) {
146
+ onRowPress = value?.let { it }
147
+ }
92
148
 
93
149
  // Methods
94
150
 
@@ -16,6 +16,7 @@
16
16
  #include <NitroModules/HybridObjectRegistry.hpp>
17
17
 
18
18
  #include "JHybridPerpDepthBarsSpec.hpp"
19
+ #include "JFunc_void_double.hpp"
19
20
  #include "views/JHybridPerpDepthBarsStateUpdater.hpp"
20
21
  #include "JHybridPerpSideRatioSpec.hpp"
21
22
  #include "views/JHybridPerpSideRatioStateUpdater.hpp"
@@ -31,6 +32,7 @@ int initialize(JavaVM* vm) {
31
32
  return facebook::jni::initialize(vm, [] {
32
33
  // Register native JNI methods
33
34
  margelo::nitro::perpdepthbar::JHybridPerpDepthBarsSpec::registerNatives();
35
+ margelo::nitro::perpdepthbar::JFunc_void_double_cxx::registerNatives();
34
36
  margelo::nitro::perpdepthbar::views::JHybridPerpDepthBarsStateUpdater::registerNatives();
35
37
  margelo::nitro::perpdepthbar::JHybridPerpSideRatioSpec::registerNatives();
36
38
  margelo::nitro::perpdepthbar::views::JHybridPerpSideRatioStateUpdater::registerNatives();
@@ -15,6 +15,14 @@
15
15
 
16
16
  namespace margelo::nitro::perpdepthbar::bridge::swift {
17
17
 
18
+ // pragma MARK: std::function<void(double /* rowIndex */)>
19
+ Func_void_double create_Func_void_double(void* NON_NULL swiftClosureWrapper) noexcept {
20
+ auto swiftClosure = PerpDepthBar::Func_void_double::fromUnsafe(swiftClosureWrapper);
21
+ return [swiftClosure = std::move(swiftClosure)](double rowIndex) mutable -> void {
22
+ swiftClosure.call(rowIndex);
23
+ };
24
+ }
25
+
18
26
  // pragma MARK: std::shared_ptr<HybridPerpDepthBarsSpec>
19
27
  std::shared_ptr<HybridPerpDepthBarsSpec> create_std__shared_ptr_HybridPerpDepthBarsSpec_(void* NON_NULL swiftUnsafePointer) noexcept {
20
28
  PerpDepthBar::HybridPerpDepthBarsSpec_cxx swiftPart = PerpDepthBar::HybridPerpDepthBarsSpec_cxx::fromUnsafe(swiftUnsafePointer);
@@ -22,7 +22,10 @@ namespace PerpDepthBar { class HybridPerpSideRatioSpec_cxx; }
22
22
  // Include C++ defined types
23
23
  #include "HybridPerpDepthBarsSpec.hpp"
24
24
  #include "HybridPerpSideRatioSpec.hpp"
25
+ #include <functional>
25
26
  #include <memory>
27
+ #include <optional>
28
+ #include <string>
26
29
  #include <vector>
27
30
 
28
31
  /**
@@ -42,6 +45,54 @@ namespace margelo::nitro::perpdepthbar::bridge::swift {
42
45
  return vector;
43
46
  }
44
47
 
48
+ // pragma MARK: std::vector<std::string>
49
+ /**
50
+ * Specialized version of `std::vector<std::string>`.
51
+ */
52
+ using std__vector_std__string_ = std::vector<std::string>;
53
+ inline std::vector<std::string> create_std__vector_std__string_(size_t size) noexcept {
54
+ std::vector<std::string> vector;
55
+ vector.reserve(size);
56
+ return vector;
57
+ }
58
+
59
+ // pragma MARK: std::function<void(double /* rowIndex */)>
60
+ /**
61
+ * Specialized version of `std::function<void(double)>`.
62
+ */
63
+ using Func_void_double = std::function<void(double /* rowIndex */)>;
64
+ /**
65
+ * Wrapper class for a `std::function<void(double / * rowIndex * /)>`, this can be used from Swift.
66
+ */
67
+ class Func_void_double_Wrapper final {
68
+ public:
69
+ explicit Func_void_double_Wrapper(std::function<void(double /* rowIndex */)>&& func): _function(std::make_unique<std::function<void(double /* rowIndex */)>>(std::move(func))) {}
70
+ inline void call(double rowIndex) const noexcept {
71
+ _function->operator()(rowIndex);
72
+ }
73
+ private:
74
+ std::unique_ptr<std::function<void(double /* rowIndex */)>> _function;
75
+ } SWIFT_NONCOPYABLE;
76
+ Func_void_double create_Func_void_double(void* NON_NULL swiftClosureWrapper) noexcept;
77
+ inline Func_void_double_Wrapper wrap_Func_void_double(Func_void_double value) noexcept {
78
+ return Func_void_double_Wrapper(std::move(value));
79
+ }
80
+
81
+ // pragma MARK: std::optional<std::function<void(double /* rowIndex */)>>
82
+ /**
83
+ * Specialized version of `std::optional<std::function<void(double / * rowIndex * /)>>`.
84
+ */
85
+ using std__optional_std__function_void_double____rowIndex______ = std::optional<std::function<void(double /* rowIndex */)>>;
86
+ inline std::optional<std::function<void(double /* rowIndex */)>> create_std__optional_std__function_void_double____rowIndex______(const std::function<void(double /* rowIndex */)>& value) noexcept {
87
+ return std::optional<std::function<void(double /* rowIndex */)>>(value);
88
+ }
89
+ inline bool has_value_std__optional_std__function_void_double____rowIndex______(const std::optional<std::function<void(double /* rowIndex */)>>& optional) noexcept {
90
+ return optional.has_value();
91
+ }
92
+ inline std::function<void(double /* rowIndex */)> get_std__optional_std__function_void_double____rowIndex______(const std::optional<std::function<void(double /* rowIndex */)>>& optional) noexcept {
93
+ return *optional;
94
+ }
95
+
45
96
  // pragma MARK: std::shared_ptr<HybridPerpDepthBarsSpec>
46
97
  /**
47
98
  * Specialized version of `std::shared_ptr<HybridPerpDepthBarsSpec>`.
@@ -16,7 +16,9 @@ namespace margelo::nitro::perpdepthbar { class HybridPerpSideRatioSpec; }
16
16
  // Include C++ defined types
17
17
  #include "HybridPerpDepthBarsSpec.hpp"
18
18
  #include "HybridPerpSideRatioSpec.hpp"
19
+ #include <functional>
19
20
  #include <memory>
21
+ #include <optional>
20
22
  #include <string>
21
23
  #include <vector>
22
24
 
@@ -16,6 +16,8 @@ namespace PerpDepthBar { class HybridPerpDepthBarsSpec_cxx; }
16
16
 
17
17
  #include <vector>
18
18
  #include <string>
19
+ #include <functional>
20
+ #include <optional>
19
21
 
20
22
  #include "PerpDepthBar-Swift-Cxx-Umbrella.hpp"
21
23
 
@@ -108,6 +110,59 @@ namespace margelo::nitro::perpdepthbar {
108
110
  inline void setEpoch(double epoch) noexcept override {
109
111
  _swiftPart.setEpoch(std::forward<decltype(epoch)>(epoch));
110
112
  }
113
+ inline std::vector<std::string> getPrices() noexcept override {
114
+ auto __result = _swiftPart.getPrices();
115
+ return __result;
116
+ }
117
+ inline void setPrices(const std::vector<std::string>& prices) noexcept override {
118
+ _swiftPart.setPrices(prices);
119
+ }
120
+ inline std::vector<std::string> getSizes() noexcept override {
121
+ auto __result = _swiftPart.getSizes();
122
+ return __result;
123
+ }
124
+ inline void setSizes(const std::vector<std::string>& sizes) noexcept override {
125
+ _swiftPart.setSizes(sizes);
126
+ }
127
+ inline std::string getPriceColor() noexcept override {
128
+ auto __result = _swiftPart.getPriceColor();
129
+ return __result;
130
+ }
131
+ inline void setPriceColor(const std::string& priceColor) noexcept override {
132
+ _swiftPart.setPriceColor(priceColor);
133
+ }
134
+ inline std::string getSizeColor() noexcept override {
135
+ auto __result = _swiftPart.getSizeColor();
136
+ return __result;
137
+ }
138
+ inline void setSizeColor(const std::string& sizeColor) noexcept override {
139
+ _swiftPart.setSizeColor(sizeColor);
140
+ }
141
+ inline double getPriceFontSize() noexcept override {
142
+ return _swiftPart.getPriceFontSize();
143
+ }
144
+ inline void setPriceFontSize(double priceFontSize) noexcept override {
145
+ _swiftPart.setPriceFontSize(std::forward<decltype(priceFontSize)>(priceFontSize));
146
+ }
147
+ inline double getSizeFontSize() noexcept override {
148
+ return _swiftPart.getSizeFontSize();
149
+ }
150
+ inline void setSizeFontSize(double sizeFontSize) noexcept override {
151
+ _swiftPart.setSizeFontSize(std::forward<decltype(sizeFontSize)>(sizeFontSize));
152
+ }
153
+ inline double getTextInset() noexcept override {
154
+ return _swiftPart.getTextInset();
155
+ }
156
+ inline void setTextInset(double textInset) noexcept override {
157
+ _swiftPart.setTextInset(std::forward<decltype(textInset)>(textInset));
158
+ }
159
+ inline std::optional<std::function<void(double /* rowIndex */)>> getOnRowPress() noexcept override {
160
+ auto __result = _swiftPart.getOnRowPress();
161
+ return __result;
162
+ }
163
+ inline void setOnRowPress(const std::optional<std::function<void(double /* rowIndex */)>>& onRowPress) noexcept override {
164
+ _swiftPart.setOnRowPress(onRowPress);
165
+ }
111
166
 
112
167
  public:
113
168
  // Methods
@@ -111,6 +111,46 @@ using namespace margelo::nitro::perpdepthbar::views;
111
111
  swiftPart.setEpoch(newViewProps.epoch.value);
112
112
  newViewProps.epoch.isDirty = false;
113
113
  }
114
+ // prices: array
115
+ if (newViewProps.prices.isDirty) {
116
+ swiftPart.setPrices(newViewProps.prices.value);
117
+ newViewProps.prices.isDirty = false;
118
+ }
119
+ // sizes: array
120
+ if (newViewProps.sizes.isDirty) {
121
+ swiftPart.setSizes(newViewProps.sizes.value);
122
+ newViewProps.sizes.isDirty = false;
123
+ }
124
+ // priceColor: string
125
+ if (newViewProps.priceColor.isDirty) {
126
+ swiftPart.setPriceColor(newViewProps.priceColor.value);
127
+ newViewProps.priceColor.isDirty = false;
128
+ }
129
+ // sizeColor: string
130
+ if (newViewProps.sizeColor.isDirty) {
131
+ swiftPart.setSizeColor(newViewProps.sizeColor.value);
132
+ newViewProps.sizeColor.isDirty = false;
133
+ }
134
+ // priceFontSize: number
135
+ if (newViewProps.priceFontSize.isDirty) {
136
+ swiftPart.setPriceFontSize(newViewProps.priceFontSize.value);
137
+ newViewProps.priceFontSize.isDirty = false;
138
+ }
139
+ // sizeFontSize: number
140
+ if (newViewProps.sizeFontSize.isDirty) {
141
+ swiftPart.setSizeFontSize(newViewProps.sizeFontSize.value);
142
+ newViewProps.sizeFontSize.isDirty = false;
143
+ }
144
+ // textInset: number
145
+ if (newViewProps.textInset.isDirty) {
146
+ swiftPart.setTextInset(newViewProps.textInset.value);
147
+ newViewProps.textInset.isDirty = false;
148
+ }
149
+ // onRowPress: optional
150
+ if (newViewProps.onRowPress.isDirty) {
151
+ swiftPart.setOnRowPress(newViewProps.onRowPress.value);
152
+ newViewProps.onRowPress.isDirty = false;
153
+ }
114
154
 
115
155
  swiftPart.afterUpdate();
116
156
 
@@ -0,0 +1,47 @@
1
+ ///
2
+ /// Func_void_double.swift
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ import Foundation
9
+ import NitroModules
10
+
11
+ /**
12
+ * Wraps a Swift `(_ rowIndex: Double) -> Void` as a class.
13
+ * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
14
+ */
15
+ public final class Func_void_double {
16
+ public typealias bridge = margelo.nitro.perpdepthbar.bridge.swift
17
+
18
+ private let closure: (_ rowIndex: Double) -> Void
19
+
20
+ public init(_ closure: @escaping (_ rowIndex: Double) -> Void) {
21
+ self.closure = closure
22
+ }
23
+
24
+ @inline(__always)
25
+ public func call(rowIndex: Double) -> Void {
26
+ self.closure(rowIndex)
27
+ }
28
+
29
+ /**
30
+ * Casts this instance to a retained unsafe raw pointer.
31
+ * This acquires one additional strong reference on the object!
32
+ */
33
+ @inline(__always)
34
+ public func toUnsafe() -> UnsafeMutableRawPointer {
35
+ return Unmanaged.passRetained(self).toOpaque()
36
+ }
37
+
38
+ /**
39
+ * Casts an unsafe pointer to a `Func_void_double`.
40
+ * The pointer has to be a retained opaque `Unmanaged<Func_void_double>`.
41
+ * This removes one strong reference from the object!
42
+ */
43
+ @inline(__always)
44
+ public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_double {
45
+ return Unmanaged<Func_void_double>.fromOpaque(pointer).takeRetainedValue()
46
+ }
47
+ }
@@ -19,6 +19,14 @@ public protocol HybridPerpDepthBarsSpec_protocol: HybridObject, HybridView {
19
19
  var origin: String { get set }
20
20
  var reducedMotion: Bool { get set }
21
21
  var epoch: Double { get set }
22
+ var prices: [String] { get set }
23
+ var sizes: [String] { get set }
24
+ var priceColor: String { get set }
25
+ var sizeColor: String { get set }
26
+ var priceFontSize: Double { get set }
27
+ var sizeFontSize: Double { get set }
28
+ var textInset: Double { get set }
29
+ var onRowPress: ((_ rowIndex: Double) -> Void)? { get set }
22
30
 
23
31
  // Methods
24
32
 
@@ -207,6 +207,127 @@ open class HybridPerpDepthBarsSpec_cxx {
207
207
  self.__implementation.epoch = newValue
208
208
  }
209
209
  }
210
+
211
+ public final var prices: bridge.std__vector_std__string_ {
212
+ @inline(__always)
213
+ get {
214
+ return { () -> bridge.std__vector_std__string_ in
215
+ var __vector = bridge.create_std__vector_std__string_(self.__implementation.prices.count)
216
+ for __item in self.__implementation.prices {
217
+ __vector.push_back(std.string(__item))
218
+ }
219
+ return __vector
220
+ }()
221
+ }
222
+ @inline(__always)
223
+ set {
224
+ self.__implementation.prices = newValue.map({ __item in String(__item) })
225
+ }
226
+ }
227
+
228
+ public final var sizes: bridge.std__vector_std__string_ {
229
+ @inline(__always)
230
+ get {
231
+ return { () -> bridge.std__vector_std__string_ in
232
+ var __vector = bridge.create_std__vector_std__string_(self.__implementation.sizes.count)
233
+ for __item in self.__implementation.sizes {
234
+ __vector.push_back(std.string(__item))
235
+ }
236
+ return __vector
237
+ }()
238
+ }
239
+ @inline(__always)
240
+ set {
241
+ self.__implementation.sizes = newValue.map({ __item in String(__item) })
242
+ }
243
+ }
244
+
245
+ public final var priceColor: std.string {
246
+ @inline(__always)
247
+ get {
248
+ return std.string(self.__implementation.priceColor)
249
+ }
250
+ @inline(__always)
251
+ set {
252
+ self.__implementation.priceColor = String(newValue)
253
+ }
254
+ }
255
+
256
+ public final var sizeColor: std.string {
257
+ @inline(__always)
258
+ get {
259
+ return std.string(self.__implementation.sizeColor)
260
+ }
261
+ @inline(__always)
262
+ set {
263
+ self.__implementation.sizeColor = String(newValue)
264
+ }
265
+ }
266
+
267
+ public final var priceFontSize: Double {
268
+ @inline(__always)
269
+ get {
270
+ return self.__implementation.priceFontSize
271
+ }
272
+ @inline(__always)
273
+ set {
274
+ self.__implementation.priceFontSize = newValue
275
+ }
276
+ }
277
+
278
+ public final var sizeFontSize: Double {
279
+ @inline(__always)
280
+ get {
281
+ return self.__implementation.sizeFontSize
282
+ }
283
+ @inline(__always)
284
+ set {
285
+ self.__implementation.sizeFontSize = newValue
286
+ }
287
+ }
288
+
289
+ public final var textInset: Double {
290
+ @inline(__always)
291
+ get {
292
+ return self.__implementation.textInset
293
+ }
294
+ @inline(__always)
295
+ set {
296
+ self.__implementation.textInset = newValue
297
+ }
298
+ }
299
+
300
+ public final var onRowPress: bridge.std__optional_std__function_void_double____rowIndex______ {
301
+ @inline(__always)
302
+ get {
303
+ return { () -> bridge.std__optional_std__function_void_double____rowIndex______ in
304
+ if let __unwrappedValue = self.__implementation.onRowPress {
305
+ return bridge.create_std__optional_std__function_void_double____rowIndex______({ () -> bridge.Func_void_double in
306
+ let __closureWrapper = Func_void_double(__unwrappedValue)
307
+ return bridge.create_Func_void_double(__closureWrapper.toUnsafe())
308
+ }())
309
+ } else {
310
+ return .init()
311
+ }
312
+ }()
313
+ }
314
+ @inline(__always)
315
+ set {
316
+ self.__implementation.onRowPress = { () -> ((_ rowIndex: Double) -> Void)? in
317
+ if bridge.has_value_std__optional_std__function_void_double____rowIndex______(newValue) {
318
+ let __unwrapped = bridge.get_std__optional_std__function_void_double____rowIndex______(newValue)
319
+ return { () -> (Double) -> Void in
320
+ let __wrappedFunction = bridge.wrap_Func_void_double(__unwrapped)
321
+ return { (__rowIndex: Double) -> Void in
322
+ __wrappedFunction.call(__rowIndex)
323
+ }
324
+ }()
325
+ } else {
326
+ return nil
327
+ }
328
+ }()
329
+ }
330
+ }
210
331
 
211
332
  // Methods
212
333
  public final func getView() -> UnsafeMutableRawPointer {
@@ -30,6 +30,22 @@ namespace margelo::nitro::perpdepthbar {
30
30
  prototype.registerHybridSetter("reducedMotion", &HybridPerpDepthBarsSpec::setReducedMotion);
31
31
  prototype.registerHybridGetter("epoch", &HybridPerpDepthBarsSpec::getEpoch);
32
32
  prototype.registerHybridSetter("epoch", &HybridPerpDepthBarsSpec::setEpoch);
33
+ prototype.registerHybridGetter("prices", &HybridPerpDepthBarsSpec::getPrices);
34
+ prototype.registerHybridSetter("prices", &HybridPerpDepthBarsSpec::setPrices);
35
+ prototype.registerHybridGetter("sizes", &HybridPerpDepthBarsSpec::getSizes);
36
+ prototype.registerHybridSetter("sizes", &HybridPerpDepthBarsSpec::setSizes);
37
+ prototype.registerHybridGetter("priceColor", &HybridPerpDepthBarsSpec::getPriceColor);
38
+ prototype.registerHybridSetter("priceColor", &HybridPerpDepthBarsSpec::setPriceColor);
39
+ prototype.registerHybridGetter("sizeColor", &HybridPerpDepthBarsSpec::getSizeColor);
40
+ prototype.registerHybridSetter("sizeColor", &HybridPerpDepthBarsSpec::setSizeColor);
41
+ prototype.registerHybridGetter("priceFontSize", &HybridPerpDepthBarsSpec::getPriceFontSize);
42
+ prototype.registerHybridSetter("priceFontSize", &HybridPerpDepthBarsSpec::setPriceFontSize);
43
+ prototype.registerHybridGetter("sizeFontSize", &HybridPerpDepthBarsSpec::getSizeFontSize);
44
+ prototype.registerHybridSetter("sizeFontSize", &HybridPerpDepthBarsSpec::setSizeFontSize);
45
+ prototype.registerHybridGetter("textInset", &HybridPerpDepthBarsSpec::getTextInset);
46
+ prototype.registerHybridSetter("textInset", &HybridPerpDepthBarsSpec::setTextInset);
47
+ prototype.registerHybridGetter("onRowPress", &HybridPerpDepthBarsSpec::getOnRowPress);
48
+ prototype.registerHybridSetter("onRowPress", &HybridPerpDepthBarsSpec::setOnRowPress);
33
49
  });
34
50
  }
35
51
 
@@ -17,6 +17,8 @@
17
17
 
18
18
  #include <vector>
19
19
  #include <string>
20
+ #include <functional>
21
+ #include <optional>
20
22
 
21
23
  namespace margelo::nitro::perpdepthbar {
22
24
 
@@ -61,6 +63,22 @@ namespace margelo::nitro::perpdepthbar {
61
63
  virtual void setReducedMotion(bool reducedMotion) = 0;
62
64
  virtual double getEpoch() = 0;
63
65
  virtual void setEpoch(double epoch) = 0;
66
+ virtual std::vector<std::string> getPrices() = 0;
67
+ virtual void setPrices(const std::vector<std::string>& prices) = 0;
68
+ virtual std::vector<std::string> getSizes() = 0;
69
+ virtual void setSizes(const std::vector<std::string>& sizes) = 0;
70
+ virtual std::string getPriceColor() = 0;
71
+ virtual void setPriceColor(const std::string& priceColor) = 0;
72
+ virtual std::string getSizeColor() = 0;
73
+ virtual void setSizeColor(const std::string& sizeColor) = 0;
74
+ virtual double getPriceFontSize() = 0;
75
+ virtual void setPriceFontSize(double priceFontSize) = 0;
76
+ virtual double getSizeFontSize() = 0;
77
+ virtual void setSizeFontSize(double sizeFontSize) = 0;
78
+ virtual double getTextInset() = 0;
79
+ virtual void setTextInset(double textInset) = 0;
80
+ virtual std::optional<std::function<void(double /* rowIndex */)>> getOnRowPress() = 0;
81
+ virtual void setOnRowPress(const std::optional<std::function<void(double /* rowIndex */)>>& onRowPress) = 0;
64
82
 
65
83
  public:
66
84
  // Methods
@@ -105,6 +105,86 @@ namespace margelo::nitro::perpdepthbar::views {
105
105
  throw std::runtime_error(std::string("PerpDepthBars.epoch: ") + exc.what());
106
106
  }
107
107
  }()),
108
+ prices([&]() -> CachedProp<std::vector<std::string>> {
109
+ try {
110
+ const react::RawValue* rawValue = rawProps.at("prices", nullptr, nullptr);
111
+ if (rawValue == nullptr) return sourceProps.prices;
112
+ const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
113
+ return CachedProp<std::vector<std::string>>::fromRawValue(*runtime, value, sourceProps.prices);
114
+ } catch (const std::exception& exc) {
115
+ throw std::runtime_error(std::string("PerpDepthBars.prices: ") + exc.what());
116
+ }
117
+ }()),
118
+ sizes([&]() -> CachedProp<std::vector<std::string>> {
119
+ try {
120
+ const react::RawValue* rawValue = rawProps.at("sizes", nullptr, nullptr);
121
+ if (rawValue == nullptr) return sourceProps.sizes;
122
+ const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
123
+ return CachedProp<std::vector<std::string>>::fromRawValue(*runtime, value, sourceProps.sizes);
124
+ } catch (const std::exception& exc) {
125
+ throw std::runtime_error(std::string("PerpDepthBars.sizes: ") + exc.what());
126
+ }
127
+ }()),
128
+ priceColor([&]() -> CachedProp<std::string> {
129
+ try {
130
+ const react::RawValue* rawValue = rawProps.at("priceColor", nullptr, nullptr);
131
+ if (rawValue == nullptr) return sourceProps.priceColor;
132
+ const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
133
+ return CachedProp<std::string>::fromRawValue(*runtime, value, sourceProps.priceColor);
134
+ } catch (const std::exception& exc) {
135
+ throw std::runtime_error(std::string("PerpDepthBars.priceColor: ") + exc.what());
136
+ }
137
+ }()),
138
+ sizeColor([&]() -> CachedProp<std::string> {
139
+ try {
140
+ const react::RawValue* rawValue = rawProps.at("sizeColor", nullptr, nullptr);
141
+ if (rawValue == nullptr) return sourceProps.sizeColor;
142
+ const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
143
+ return CachedProp<std::string>::fromRawValue(*runtime, value, sourceProps.sizeColor);
144
+ } catch (const std::exception& exc) {
145
+ throw std::runtime_error(std::string("PerpDepthBars.sizeColor: ") + exc.what());
146
+ }
147
+ }()),
148
+ priceFontSize([&]() -> CachedProp<double> {
149
+ try {
150
+ const react::RawValue* rawValue = rawProps.at("priceFontSize", nullptr, nullptr);
151
+ if (rawValue == nullptr) return sourceProps.priceFontSize;
152
+ const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
153
+ return CachedProp<double>::fromRawValue(*runtime, value, sourceProps.priceFontSize);
154
+ } catch (const std::exception& exc) {
155
+ throw std::runtime_error(std::string("PerpDepthBars.priceFontSize: ") + exc.what());
156
+ }
157
+ }()),
158
+ sizeFontSize([&]() -> CachedProp<double> {
159
+ try {
160
+ const react::RawValue* rawValue = rawProps.at("sizeFontSize", nullptr, nullptr);
161
+ if (rawValue == nullptr) return sourceProps.sizeFontSize;
162
+ const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
163
+ return CachedProp<double>::fromRawValue(*runtime, value, sourceProps.sizeFontSize);
164
+ } catch (const std::exception& exc) {
165
+ throw std::runtime_error(std::string("PerpDepthBars.sizeFontSize: ") + exc.what());
166
+ }
167
+ }()),
168
+ textInset([&]() -> CachedProp<double> {
169
+ try {
170
+ const react::RawValue* rawValue = rawProps.at("textInset", nullptr, nullptr);
171
+ if (rawValue == nullptr) return sourceProps.textInset;
172
+ const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
173
+ return CachedProp<double>::fromRawValue(*runtime, value, sourceProps.textInset);
174
+ } catch (const std::exception& exc) {
175
+ throw std::runtime_error(std::string("PerpDepthBars.textInset: ") + exc.what());
176
+ }
177
+ }()),
178
+ onRowPress([&]() -> CachedProp<std::optional<std::function<void(double /* rowIndex */)>>> {
179
+ try {
180
+ const react::RawValue* rawValue = rawProps.at("onRowPress", nullptr, nullptr);
181
+ if (rawValue == nullptr) return sourceProps.onRowPress;
182
+ const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
183
+ return CachedProp<std::optional<std::function<void(double /* rowIndex */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, "f"), sourceProps.onRowPress);
184
+ } catch (const std::exception& exc) {
185
+ throw std::runtime_error(std::string("PerpDepthBars.onRowPress: ") + exc.what());
186
+ }
187
+ }()),
108
188
  hybridRef([&]() -> CachedProp<std::optional<std::function<void(const std::shared_ptr<HybridPerpDepthBarsSpec>& /* ref */)>>> {
109
189
  try {
110
190
  const react::RawValue* rawValue = rawProps.at("hybridRef", nullptr, nullptr);
@@ -126,6 +206,14 @@ namespace margelo::nitro::perpdepthbar::views {
126
206
  origin(other.origin),
127
207
  reducedMotion(other.reducedMotion),
128
208
  epoch(other.epoch),
209
+ prices(other.prices),
210
+ sizes(other.sizes),
211
+ priceColor(other.priceColor),
212
+ sizeColor(other.sizeColor),
213
+ priceFontSize(other.priceFontSize),
214
+ sizeFontSize(other.sizeFontSize),
215
+ textInset(other.textInset),
216
+ onRowPress(other.onRowPress),
129
217
  hybridRef(other.hybridRef) { }
130
218
 
131
219
  bool HybridPerpDepthBarsProps::filterObjectKeys(const std::string& propName) {
@@ -138,6 +226,14 @@ namespace margelo::nitro::perpdepthbar::views {
138
226
  case hashString("origin"): return true;
139
227
  case hashString("reducedMotion"): return true;
140
228
  case hashString("epoch"): return true;
229
+ case hashString("prices"): return true;
230
+ case hashString("sizes"): return true;
231
+ case hashString("priceColor"): return true;
232
+ case hashString("sizeColor"): return true;
233
+ case hashString("priceFontSize"): return true;
234
+ case hashString("sizeFontSize"): return true;
235
+ case hashString("textInset"): return true;
236
+ case hashString("onRowPress"): return true;
141
237
  case hashString("hybridRef"): return true;
142
238
  default: return false;
143
239
  }
@@ -18,10 +18,10 @@
18
18
 
19
19
  #include <vector>
20
20
  #include <string>
21
- #include <memory>
22
- #include "HybridPerpDepthBarsSpec.hpp"
23
21
  #include <functional>
24
22
  #include <optional>
23
+ #include <memory>
24
+ #include "HybridPerpDepthBarsSpec.hpp"
25
25
 
26
26
  namespace margelo::nitro::perpdepthbar::views {
27
27
 
@@ -52,6 +52,14 @@ namespace margelo::nitro::perpdepthbar::views {
52
52
  CachedProp<std::string> origin;
53
53
  CachedProp<bool> reducedMotion;
54
54
  CachedProp<double> epoch;
55
+ CachedProp<std::vector<std::string>> prices;
56
+ CachedProp<std::vector<std::string>> sizes;
57
+ CachedProp<std::string> priceColor;
58
+ CachedProp<std::string> sizeColor;
59
+ CachedProp<double> priceFontSize;
60
+ CachedProp<double> sizeFontSize;
61
+ CachedProp<double> textInset;
62
+ CachedProp<std::optional<std::function<void(double /* rowIndex */)>>> onRowPress;
55
63
  CachedProp<std::optional<std::function<void(const std::shared_ptr<HybridPerpDepthBarsSpec>& /* ref */)>>> hybridRef;
56
64
 
57
65
  private: