@onekeyfe/react-native-perp-depth-bar 3.0.48 → 3.0.52
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/src/main/java/com/margelo/nitro/perpdepthbar/HybridPerpDepthBars.kt +121 -15
- package/android/src/main/java/com/margelo/nitro/perpdepthbar/HybridPerpSideRatio.kt +30 -0
- package/ios/HybridPerpDepthBars.swift +84 -5
- package/ios/HybridPerpSideRatio.swift +19 -1
- package/ios/PerpColorParser.swift +10 -1
- package/lib/nitrogen/generated/android/c++/JHybridPerpDepthBarsSpec.cpp +47 -1
- package/lib/nitrogen/generated/android/c++/JHybridPerpDepthBarsSpec.hpp +6 -1
- package/lib/nitrogen/generated/android/c++/JHybridPerpSideRatioSpec.cpp +4 -1
- package/lib/nitrogen/generated/android/c++/JHybridPerpSideRatioSpec.hpp +1 -1
- package/lib/nitrogen/generated/android/c++/views/JHybridPerpDepthBarsStateUpdater.cpp +8 -0
- package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/perpdepthbar/HybridPerpDepthBarsSpec.kt +19 -0
- package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/perpdepthbar/HybridPerpSideRatioSpec.kt +3 -1
- package/lib/nitrogen/generated/ios/PerpDepthBar-Swift-Cxx-Bridge.hpp +11 -0
- package/lib/nitrogen/generated/ios/PerpDepthBar-Swift-Cxx-Umbrella.hpp +3 -0
- package/lib/nitrogen/generated/ios/c++/HybridPerpDepthBarsSpecSwift.hpp +29 -2
- package/lib/nitrogen/generated/ios/c++/HybridPerpSideRatioSpecSwift.hpp +6 -1
- package/lib/nitrogen/generated/ios/c++/views/HybridPerpDepthBarsComponent.mm +10 -0
- package/lib/nitrogen/generated/ios/swift/HybridPerpDepthBarsSpec.swift +4 -1
- package/lib/nitrogen/generated/ios/swift/HybridPerpDepthBarsSpec_cxx.swift +44 -0
- package/lib/nitrogen/generated/ios/swift/HybridPerpSideRatioSpec.swift +1 -1
- package/lib/nitrogen/generated/ios/swift/HybridPerpSideRatioSpec_cxx.swift +11 -0
- package/lib/nitrogen/generated/shared/c++/HybridPerpDepthBarsSpec.cpp +6 -0
- package/lib/nitrogen/generated/shared/c++/HybridPerpDepthBarsSpec.hpp +7 -1
- package/lib/nitrogen/generated/shared/c++/HybridPerpSideRatioSpec.cpp +1 -0
- package/lib/nitrogen/generated/shared/c++/HybridPerpSideRatioSpec.hpp +1 -1
- package/lib/nitrogen/generated/shared/c++/views/HybridPerpDepthBarsComponent.cpp +24 -0
- package/lib/nitrogen/generated/shared/c++/views/HybridPerpDepthBarsComponent.hpp +2 -0
- package/lib/nitrogen/generated/shared/json/PerpDepthBarsConfig.json +2 -0
- package/lib/nitrogen/nitrogen/generated/android/c++/JHybridPerpDepthBarsSpec.cpp +47 -1
- package/lib/nitrogen/nitrogen/generated/android/c++/JHybridPerpDepthBarsSpec.hpp +6 -1
- package/lib/nitrogen/nitrogen/generated/android/c++/JHybridPerpSideRatioSpec.cpp +4 -1
- package/lib/nitrogen/nitrogen/generated/android/c++/JHybridPerpSideRatioSpec.hpp +1 -1
- package/lib/nitrogen/nitrogen/generated/android/c++/views/JHybridPerpDepthBarsStateUpdater.cpp +8 -0
- package/lib/nitrogen/nitrogen/generated/android/kotlin/com/margelo/nitro/perpdepthbar/HybridPerpDepthBarsSpec.kt +19 -0
- package/lib/nitrogen/nitrogen/generated/android/kotlin/com/margelo/nitro/perpdepthbar/HybridPerpSideRatioSpec.kt +3 -1
- package/lib/nitrogen/nitrogen/generated/ios/PerpDepthBar-Swift-Cxx-Bridge.hpp +11 -0
- package/lib/nitrogen/nitrogen/generated/ios/PerpDepthBar-Swift-Cxx-Umbrella.hpp +3 -0
- package/lib/nitrogen/nitrogen/generated/ios/c++/HybridPerpDepthBarsSpecSwift.hpp +29 -2
- package/lib/nitrogen/nitrogen/generated/ios/c++/HybridPerpSideRatioSpecSwift.hpp +6 -1
- package/lib/nitrogen/nitrogen/generated/ios/c++/views/HybridPerpDepthBarsComponent.mm +10 -0
- package/lib/nitrogen/nitrogen/generated/ios/swift/HybridPerpDepthBarsSpec.swift +4 -1
- package/lib/nitrogen/nitrogen/generated/ios/swift/HybridPerpDepthBarsSpec_cxx.swift +44 -0
- package/lib/nitrogen/nitrogen/generated/ios/swift/HybridPerpSideRatioSpec.swift +1 -1
- package/lib/nitrogen/nitrogen/generated/ios/swift/HybridPerpSideRatioSpec_cxx.swift +11 -0
- package/lib/nitrogen/nitrogen/generated/shared/c++/HybridPerpDepthBarsSpec.cpp +6 -0
- package/lib/nitrogen/nitrogen/generated/shared/c++/HybridPerpDepthBarsSpec.hpp +7 -1
- package/lib/nitrogen/nitrogen/generated/shared/c++/HybridPerpSideRatioSpec.cpp +1 -0
- package/lib/nitrogen/nitrogen/generated/shared/c++/HybridPerpSideRatioSpec.hpp +1 -1
- package/lib/nitrogen/nitrogen/generated/shared/c++/views/HybridPerpDepthBarsComponent.cpp +24 -0
- package/lib/nitrogen/nitrogen/generated/shared/c++/views/HybridPerpDepthBarsComponent.hpp +2 -0
- package/lib/nitrogen/nitrogen/generated/shared/json/PerpDepthBarsConfig.json +2 -0
- package/lib/typescript/src/PerpDepthBars.nitro.d.ts +81 -3
- package/lib/typescript/src/PerpDepthBars.nitro.d.ts.map +1 -1
- package/lib/typescript/src/PerpSideRatio.nitro.d.ts +25 -2
- package/lib/typescript/src/PerpSideRatio.nitro.d.ts.map +1 -1
- package/nitrogen/generated/android/c++/JHybridPerpDepthBarsSpec.cpp +47 -1
- package/nitrogen/generated/android/c++/JHybridPerpDepthBarsSpec.hpp +6 -1
- package/nitrogen/generated/android/c++/JHybridPerpSideRatioSpec.cpp +4 -1
- package/nitrogen/generated/android/c++/JHybridPerpSideRatioSpec.hpp +1 -1
- package/nitrogen/generated/android/c++/views/JHybridPerpDepthBarsStateUpdater.cpp +8 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/perpdepthbar/HybridPerpDepthBarsSpec.kt +19 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/perpdepthbar/HybridPerpSideRatioSpec.kt +3 -1
- package/nitrogen/generated/ios/PerpDepthBar-Swift-Cxx-Bridge.hpp +11 -0
- package/nitrogen/generated/ios/PerpDepthBar-Swift-Cxx-Umbrella.hpp +3 -0
- package/nitrogen/generated/ios/c++/HybridPerpDepthBarsSpecSwift.hpp +29 -2
- package/nitrogen/generated/ios/c++/HybridPerpSideRatioSpecSwift.hpp +6 -1
- package/nitrogen/generated/ios/c++/views/HybridPerpDepthBarsComponent.mm +10 -0
- package/nitrogen/generated/ios/swift/HybridPerpDepthBarsSpec.swift +4 -1
- package/nitrogen/generated/ios/swift/HybridPerpDepthBarsSpec_cxx.swift +44 -0
- package/nitrogen/generated/ios/swift/HybridPerpSideRatioSpec.swift +1 -1
- package/nitrogen/generated/ios/swift/HybridPerpSideRatioSpec_cxx.swift +11 -0
- package/nitrogen/generated/shared/c++/HybridPerpDepthBarsSpec.cpp +6 -0
- package/nitrogen/generated/shared/c++/HybridPerpDepthBarsSpec.hpp +7 -1
- package/nitrogen/generated/shared/c++/HybridPerpSideRatioSpec.cpp +1 -0
- package/nitrogen/generated/shared/c++/HybridPerpSideRatioSpec.hpp +1 -1
- package/nitrogen/generated/shared/c++/views/HybridPerpDepthBarsComponent.cpp +24 -0
- package/nitrogen/generated/shared/c++/views/HybridPerpDepthBarsComponent.hpp +2 -0
- package/nitrogen/generated/shared/json/PerpDepthBarsConfig.json +2 -0
- package/package.json +1 -1
- package/src/PerpDepthBars.nitro.ts +85 -9
- package/src/PerpSideRatio.nitro.ts +27 -3
|
@@ -297,6 +297,28 @@ open class HybridPerpDepthBarsSpec_cxx {
|
|
|
297
297
|
}
|
|
298
298
|
}
|
|
299
299
|
|
|
300
|
+
public final var placeholderText: std.string {
|
|
301
|
+
@inline(__always)
|
|
302
|
+
get {
|
|
303
|
+
return std.string(self.__implementation.placeholderText)
|
|
304
|
+
}
|
|
305
|
+
@inline(__always)
|
|
306
|
+
set {
|
|
307
|
+
self.__implementation.placeholderText = String(newValue)
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
public final var placeholderRows: Double {
|
|
312
|
+
@inline(__always)
|
|
313
|
+
get {
|
|
314
|
+
return self.__implementation.placeholderRows
|
|
315
|
+
}
|
|
316
|
+
@inline(__always)
|
|
317
|
+
set {
|
|
318
|
+
self.__implementation.placeholderRows = newValue
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
|
|
300
322
|
public final var onRowPress: bridge.std__optional_std__function_void_double____rowIndex______ {
|
|
301
323
|
@inline(__always)
|
|
302
324
|
get {
|
|
@@ -330,6 +352,28 @@ open class HybridPerpDepthBarsSpec_cxx {
|
|
|
330
352
|
}
|
|
331
353
|
|
|
332
354
|
// Methods
|
|
355
|
+
@inline(__always)
|
|
356
|
+
public final func setDepth(buffer: ArrayBuffer) -> bridge.Result_void_ {
|
|
357
|
+
do {
|
|
358
|
+
try self.__implementation.setDepth(buffer: buffer)
|
|
359
|
+
return bridge.create_Result_void_()
|
|
360
|
+
} catch (let __error) {
|
|
361
|
+
let __exceptionPtr = __error.toCpp()
|
|
362
|
+
return bridge.create_Result_void_(__exceptionPtr)
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
@inline(__always)
|
|
367
|
+
public final func setText(prices: bridge.std__vector_std__string_, sizes: bridge.std__vector_std__string_) -> bridge.Result_void_ {
|
|
368
|
+
do {
|
|
369
|
+
try self.__implementation.setText(prices: prices.map({ __item in String(__item) }), sizes: sizes.map({ __item in String(__item) }))
|
|
370
|
+
return bridge.create_Result_void_()
|
|
371
|
+
} catch (let __error) {
|
|
372
|
+
let __exceptionPtr = __error.toCpp()
|
|
373
|
+
return bridge.create_Result_void_(__exceptionPtr)
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
|
|
333
377
|
public final func getView() -> UnsafeMutableRawPointer {
|
|
334
378
|
return Unmanaged.passRetained(__implementation.view).toOpaque()
|
|
335
379
|
}
|
|
@@ -21,7 +21,7 @@ public protocol HybridPerpSideRatioSpec_protocol: HybridObject, HybridView {
|
|
|
21
21
|
var reducedMotion: Bool { get set }
|
|
22
22
|
|
|
23
23
|
// Methods
|
|
24
|
-
|
|
24
|
+
func setRatio(bidPercentage: Double, askPercentage: Double) throws -> Void
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
public extension HybridPerpSideRatioSpec_protocol {
|
|
@@ -203,6 +203,17 @@ open class HybridPerpSideRatioSpec_cxx {
|
|
|
203
203
|
}
|
|
204
204
|
|
|
205
205
|
// Methods
|
|
206
|
+
@inline(__always)
|
|
207
|
+
public final func setRatio(bidPercentage: Double, askPercentage: Double) -> bridge.Result_void_ {
|
|
208
|
+
do {
|
|
209
|
+
try self.__implementation.setRatio(bidPercentage: bidPercentage, askPercentage: askPercentage)
|
|
210
|
+
return bridge.create_Result_void_()
|
|
211
|
+
} catch (let __error) {
|
|
212
|
+
let __exceptionPtr = __error.toCpp()
|
|
213
|
+
return bridge.create_Result_void_(__exceptionPtr)
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
|
|
206
217
|
public final func getView() -> UnsafeMutableRawPointer {
|
|
207
218
|
return Unmanaged.passRetained(__implementation.view).toOpaque()
|
|
208
219
|
}
|
|
@@ -44,8 +44,14 @@ namespace margelo::nitro::perpdepthbar {
|
|
|
44
44
|
prototype.registerHybridSetter("sizeFontSize", &HybridPerpDepthBarsSpec::setSizeFontSize);
|
|
45
45
|
prototype.registerHybridGetter("textInset", &HybridPerpDepthBarsSpec::getTextInset);
|
|
46
46
|
prototype.registerHybridSetter("textInset", &HybridPerpDepthBarsSpec::setTextInset);
|
|
47
|
+
prototype.registerHybridGetter("placeholderText", &HybridPerpDepthBarsSpec::getPlaceholderText);
|
|
48
|
+
prototype.registerHybridSetter("placeholderText", &HybridPerpDepthBarsSpec::setPlaceholderText);
|
|
49
|
+
prototype.registerHybridGetter("placeholderRows", &HybridPerpDepthBarsSpec::getPlaceholderRows);
|
|
50
|
+
prototype.registerHybridSetter("placeholderRows", &HybridPerpDepthBarsSpec::setPlaceholderRows);
|
|
47
51
|
prototype.registerHybridGetter("onRowPress", &HybridPerpDepthBarsSpec::getOnRowPress);
|
|
48
52
|
prototype.registerHybridSetter("onRowPress", &HybridPerpDepthBarsSpec::setOnRowPress);
|
|
53
|
+
prototype.registerHybridMethod("setDepth", &HybridPerpDepthBarsSpec::setDepth);
|
|
54
|
+
prototype.registerHybridMethod("setText", &HybridPerpDepthBarsSpec::setText);
|
|
49
55
|
});
|
|
50
56
|
}
|
|
51
57
|
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
#include <string>
|
|
20
20
|
#include <functional>
|
|
21
21
|
#include <optional>
|
|
22
|
+
#include <NitroModules/ArrayBuffer.hpp>
|
|
22
23
|
|
|
23
24
|
namespace margelo::nitro::perpdepthbar {
|
|
24
25
|
|
|
@@ -77,12 +78,17 @@ namespace margelo::nitro::perpdepthbar {
|
|
|
77
78
|
virtual void setSizeFontSize(double sizeFontSize) = 0;
|
|
78
79
|
virtual double getTextInset() = 0;
|
|
79
80
|
virtual void setTextInset(double textInset) = 0;
|
|
81
|
+
virtual std::string getPlaceholderText() = 0;
|
|
82
|
+
virtual void setPlaceholderText(const std::string& placeholderText) = 0;
|
|
83
|
+
virtual double getPlaceholderRows() = 0;
|
|
84
|
+
virtual void setPlaceholderRows(double placeholderRows) = 0;
|
|
80
85
|
virtual std::optional<std::function<void(double /* rowIndex */)>> getOnRowPress() = 0;
|
|
81
86
|
virtual void setOnRowPress(const std::optional<std::function<void(double /* rowIndex */)>>& onRowPress) = 0;
|
|
82
87
|
|
|
83
88
|
public:
|
|
84
89
|
// Methods
|
|
85
|
-
|
|
90
|
+
virtual void setDepth(const std::shared_ptr<ArrayBuffer>& buffer) = 0;
|
|
91
|
+
virtual void setText(const std::vector<std::string>& prices, const std::vector<std::string>& sizes) = 0;
|
|
86
92
|
|
|
87
93
|
protected:
|
|
88
94
|
// Hybrid Setup
|
|
@@ -30,6 +30,7 @@ namespace margelo::nitro::perpdepthbar {
|
|
|
30
30
|
prototype.registerHybridSetter("gap", &HybridPerpSideRatioSpec::setGap);
|
|
31
31
|
prototype.registerHybridGetter("reducedMotion", &HybridPerpSideRatioSpec::getReducedMotion);
|
|
32
32
|
prototype.registerHybridSetter("reducedMotion", &HybridPerpSideRatioSpec::setReducedMotion);
|
|
33
|
+
prototype.registerHybridMethod("setRatio", &HybridPerpSideRatioSpec::setRatio);
|
|
33
34
|
});
|
|
34
35
|
}
|
|
35
36
|
|
|
@@ -175,6 +175,26 @@ namespace margelo::nitro::perpdepthbar::views {
|
|
|
175
175
|
throw std::runtime_error(std::string("PerpDepthBars.textInset: ") + exc.what());
|
|
176
176
|
}
|
|
177
177
|
}()),
|
|
178
|
+
placeholderText([&]() -> CachedProp<std::string> {
|
|
179
|
+
try {
|
|
180
|
+
const react::RawValue* rawValue = rawProps.at("placeholderText", nullptr, nullptr);
|
|
181
|
+
if (rawValue == nullptr) return sourceProps.placeholderText;
|
|
182
|
+
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
183
|
+
return CachedProp<std::string>::fromRawValue(*runtime, value, sourceProps.placeholderText);
|
|
184
|
+
} catch (const std::exception& exc) {
|
|
185
|
+
throw std::runtime_error(std::string("PerpDepthBars.placeholderText: ") + exc.what());
|
|
186
|
+
}
|
|
187
|
+
}()),
|
|
188
|
+
placeholderRows([&]() -> CachedProp<double> {
|
|
189
|
+
try {
|
|
190
|
+
const react::RawValue* rawValue = rawProps.at("placeholderRows", nullptr, nullptr);
|
|
191
|
+
if (rawValue == nullptr) return sourceProps.placeholderRows;
|
|
192
|
+
const auto& [runtime, value] = (std::pair<jsi::Runtime*, jsi::Value>)*rawValue;
|
|
193
|
+
return CachedProp<double>::fromRawValue(*runtime, value, sourceProps.placeholderRows);
|
|
194
|
+
} catch (const std::exception& exc) {
|
|
195
|
+
throw std::runtime_error(std::string("PerpDepthBars.placeholderRows: ") + exc.what());
|
|
196
|
+
}
|
|
197
|
+
}()),
|
|
178
198
|
onRowPress([&]() -> CachedProp<std::optional<std::function<void(double /* rowIndex */)>>> {
|
|
179
199
|
try {
|
|
180
200
|
const react::RawValue* rawValue = rawProps.at("onRowPress", nullptr, nullptr);
|
|
@@ -213,6 +233,8 @@ namespace margelo::nitro::perpdepthbar::views {
|
|
|
213
233
|
priceFontSize(other.priceFontSize),
|
|
214
234
|
sizeFontSize(other.sizeFontSize),
|
|
215
235
|
textInset(other.textInset),
|
|
236
|
+
placeholderText(other.placeholderText),
|
|
237
|
+
placeholderRows(other.placeholderRows),
|
|
216
238
|
onRowPress(other.onRowPress),
|
|
217
239
|
hybridRef(other.hybridRef) { }
|
|
218
240
|
|
|
@@ -233,6 +255,8 @@ namespace margelo::nitro::perpdepthbar::views {
|
|
|
233
255
|
case hashString("priceFontSize"): return true;
|
|
234
256
|
case hashString("sizeFontSize"): return true;
|
|
235
257
|
case hashString("textInset"): return true;
|
|
258
|
+
case hashString("placeholderText"): return true;
|
|
259
|
+
case hashString("placeholderRows"): return true;
|
|
236
260
|
case hashString("onRowPress"): return true;
|
|
237
261
|
case hashString("hybridRef"): return true;
|
|
238
262
|
default: return false;
|
|
@@ -59,6 +59,8 @@ namespace margelo::nitro::perpdepthbar::views {
|
|
|
59
59
|
CachedProp<double> priceFontSize;
|
|
60
60
|
CachedProp<double> sizeFontSize;
|
|
61
61
|
CachedProp<double> textInset;
|
|
62
|
+
CachedProp<std::string> placeholderText;
|
|
63
|
+
CachedProp<double> placeholderRows;
|
|
62
64
|
CachedProp<std::optional<std::function<void(double /* rowIndex */)>>> onRowPress;
|
|
63
65
|
CachedProp<std::optional<std::function<void(const std::shared_ptr<HybridPerpDepthBarsSpec>& /* ref */)>>> hybridRef;
|
|
64
66
|
|
|
@@ -11,7 +11,17 @@ import type { HybridView, HybridViewMethods, HybridViewProps } from 'react-nativ
|
|
|
11
11
|
* All values are in points (DIP); the native side quantizes to physical pixels.
|
|
12
12
|
*/
|
|
13
13
|
export interface PerpDepthBarsProps extends HybridViewProps {
|
|
14
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* Depth percentage per row, 0..100. Length == number of rows on this side.
|
|
16
|
+
*
|
|
17
|
+
* INITIAL VALUE ONLY when using the imperative path. The first
|
|
18
|
+
* `setDepth(buffer)` call switches the view into imperative mode; from then on
|
|
19
|
+
* this prop is IGNORED on every prop-update transaction (so unrelated
|
|
20
|
+
* high-frequency prop commits like `prices`/`sizes` can't wipe the bars —
|
|
21
|
+
* REACT-NATIVE-1JZ). For high-frequency depth updates ALWAYS call `setDepth`;
|
|
22
|
+
* do NOT keep writing this prop at tick rate. Callers that never call
|
|
23
|
+
* `setDepth` may drive the bars purely through this prop (each write retargets).
|
|
24
|
+
*/
|
|
15
25
|
percents: number[];
|
|
16
26
|
/** Row height in points (matches the sibling RN text row height). */
|
|
17
27
|
rowHeight: number;
|
|
@@ -30,9 +40,28 @@ export interface PerpDepthBarsProps extends HybridViewProps {
|
|
|
30
40
|
* empty<->full so native snaps to the new values WITHOUT animating.
|
|
31
41
|
*/
|
|
32
42
|
epoch: number;
|
|
33
|
-
/**
|
|
43
|
+
/**
|
|
44
|
+
* Per-row price text, parallel to `percents` (same length / order). Drawn
|
|
45
|
+
* natively per row (price left-aligned), so the order-book ladder needs NO
|
|
46
|
+
* sibling RN <Text> rows. Empty => the view renders bars only.
|
|
47
|
+
*
|
|
48
|
+
* INITIAL VALUE ONLY for high-frequency callers: the first `setText` call
|
|
49
|
+
* switches the text layer into imperative mode and this prop is then IGNORED on
|
|
50
|
+
* every prop-update transaction. For high-frequency text updates ALWAYS call
|
|
51
|
+
* `setText`; do NOT keep writing this prop at tick rate (string-array prop
|
|
52
|
+
* commits are the heaviest part of the Fabric props + JSI path — exactly what
|
|
53
|
+
* REACT-NATIVE-1JZ avoids). Callers that update infrequently may drive it
|
|
54
|
+
* purely through this prop.
|
|
55
|
+
*/
|
|
34
56
|
prices: string[];
|
|
35
|
-
/**
|
|
57
|
+
/**
|
|
58
|
+
* Per-row size text, parallel to `percents`. Drawn natively per row (size
|
|
59
|
+
* right-aligned). Empty => bars only.
|
|
60
|
+
*
|
|
61
|
+
* INITIAL VALUE ONLY for high-frequency callers: update via `setText`; this
|
|
62
|
+
* prop is IGNORED once `setText` has been called (see `prices` —
|
|
63
|
+
* REACT-NATIVE-1JZ).
|
|
64
|
+
*/
|
|
36
65
|
sizes: string[];
|
|
37
66
|
/** Price text color: hex or rgba()/rgb(). */
|
|
38
67
|
priceColor: string;
|
|
@@ -44,6 +73,23 @@ export interface PerpDepthBarsProps extends HybridViewProps {
|
|
|
44
73
|
sizeFontSize: number;
|
|
45
74
|
/** Horizontal text inset in points (price padding-left, size padding-right). */
|
|
46
75
|
textInset: number;
|
|
76
|
+
/**
|
|
77
|
+
* Per-row placeholder text drawn while the column has NO real data (no rows
|
|
78
|
+
* from `percents`/`setDepth` and no `prices`/`sizes`/`setText`), e.g. "--".
|
|
79
|
+
* Empty string disables the placeholder. This replaces any RN skeleton/overlay:
|
|
80
|
+
* the view draws the placeholder itself, then atomically swaps to real numbers
|
|
81
|
+
* the moment data lands — so there is never a blank frame between the two
|
|
82
|
+
* (the old overlay approach removed the JS skeleton a few frames before the
|
|
83
|
+
* native view had painted, flashing blank). Drawn in `priceColor` (left) and
|
|
84
|
+
* `sizeColor` (right); no bar fill.
|
|
85
|
+
*/
|
|
86
|
+
placeholderText: string;
|
|
87
|
+
/**
|
|
88
|
+
* How many placeholder rows to draw when `placeholderText` is shown. Match the
|
|
89
|
+
* order book's rows-per-side so the column reserves a stable height before any
|
|
90
|
+
* data arrives. Ignored once real data is present.
|
|
91
|
+
*/
|
|
92
|
+
placeholderRows: number;
|
|
47
93
|
/**
|
|
48
94
|
* Fired natively when a row is tapped. `rowIndex` is the 0-based row
|
|
49
95
|
* (top→bottom, parallel to `percents`/`prices`/`sizes`). The view handles
|
|
@@ -52,6 +98,38 @@ export interface PerpDepthBarsProps extends HybridViewProps {
|
|
|
52
98
|
onRowPress?: (rowIndex: number) => void;
|
|
53
99
|
}
|
|
54
100
|
export interface PerpDepthBarsMethods extends HybridViewMethods {
|
|
101
|
+
/**
|
|
102
|
+
* Imperatively update the per-row depth percentages, bypassing the
|
|
103
|
+
* high-frequency `percents` prop write path (and its props/JSICache lock
|
|
104
|
+
* contention — REACT-NATIVE-1JZ).
|
|
105
|
+
*
|
|
106
|
+
* `buffer` is a packed `Float32Array` (little-endian): one float per row,
|
|
107
|
+
* each the row's depth percentage with the SAME semantics as the
|
|
108
|
+
* `percents: number[]` prop (0..100, clamped natively exactly like the prop
|
|
109
|
+
* setter). Row count == `buffer.byteLength / 4`. The native side rebuilds
|
|
110
|
+
* its animation targets from these values and reuses the identical
|
|
111
|
+
* clamp/target/frame-loop logic as the `percents` prop path — only the data
|
|
112
|
+
* source differs.
|
|
113
|
+
*
|
|
114
|
+
* The `percents` prop is retained for backward compatibility; callers may
|
|
115
|
+
* use either path.
|
|
116
|
+
*/
|
|
117
|
+
setDepth(buffer: ArrayBuffer): void;
|
|
118
|
+
/**
|
|
119
|
+
* Imperatively update the per-row price/size text, bypassing the
|
|
120
|
+
* high-frequency `prices`/`sizes` prop write path (and its props/JSICache lock
|
|
121
|
+
* contention — REACT-NATIVE-1JZ). Companion to [setDepth] for the text layer.
|
|
122
|
+
*
|
|
123
|
+
* `prices[i]` / `sizes[i]` are the formatted strings for row `i`, parallel to
|
|
124
|
+
* the depth buffer pushed via `setDepth` (same length / order). Pass `[]` for a
|
|
125
|
+
* side that draws bars only. Call this in the SAME frame/effect as `setDepth`
|
|
126
|
+
* so the bar fill and its row text always come from one source frame (no
|
|
127
|
+
* fill-vs-text misalignment).
|
|
128
|
+
*
|
|
129
|
+
* The `prices`/`sizes` props are retained for backward compatibility; callers
|
|
130
|
+
* may use either path.
|
|
131
|
+
*/
|
|
132
|
+
setText(prices: string[], sizes: string[]): void;
|
|
55
133
|
}
|
|
56
134
|
export type PerpDepthBars = HybridView<PerpDepthBarsProps, PerpDepthBarsMethods>;
|
|
57
135
|
//# sourceMappingURL=PerpDepthBars.nitro.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PerpDepthBars.nitro.d.ts","sourceRoot":"","sources":["../../../src/PerpDepthBars.nitro.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,iBAAiB,EACjB,eAAe,EAChB,MAAM,4BAA4B,CAAC;AAEpC;;;;;;;;;;GAUG;AACH,MAAM,WAAW,kBAAmB,SAAQ,eAAe;IACzD
|
|
1
|
+
{"version":3,"file":"PerpDepthBars.nitro.d.ts","sourceRoot":"","sources":["../../../src/PerpDepthBars.nitro.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,iBAAiB,EACjB,eAAe,EAChB,MAAM,4BAA4B,CAAC;AAEpC;;;;;;;;;;GAUG;AACH,MAAM,WAAW,kBAAmB,SAAQ,eAAe;IACzD;;;;;;;;;;OAUG;IACH,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,qEAAqE;IACrE,SAAS,EAAE,MAAM,CAAC;IAClB,kFAAkF;IAClF,YAAY,EAAE,MAAM,CAAC;IACrB,iFAAiF;IACjF,QAAQ,EAAE,MAAM,CAAC;IACjB,yEAAyE;IACzE,KAAK,EAAE,MAAM,CAAC;IACd,yDAAyD;IACzD,MAAM,EAAE,MAAM,CAAC;IACf,gEAAgE;IAChE,aAAa,EAAE,OAAO,CAAC;IACvB;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;;;;;;;;;;OAYG;IACH,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB;;;;;;;OAOG;IACH,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,6CAA6C;IAC7C,UAAU,EAAE,MAAM,CAAC;IACnB,4CAA4C;IAC5C,SAAS,EAAE,MAAM,CAAC;IAClB,sCAAsC;IACtC,aAAa,EAAE,MAAM,CAAC;IACtB,qCAAqC;IACrC,YAAY,EAAE,MAAM,CAAC;IACrB,gFAAgF;IAChF,SAAS,EAAE,MAAM,CAAC;IAElB;;;;;;;;;OASG;IACH,eAAe,EAAE,MAAM,CAAC;IACxB;;;;OAIG;IACH,eAAe,EAAE,MAAM,CAAC;IAExB;;;;OAIG;IACH,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;CACzC;AAED,MAAM,WAAW,oBAAqB,SAAQ,iBAAiB;IAC7D;;;;;;;;;;;;;;;OAeG;IACH,QAAQ,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,CAAC;IAEpC;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;CAClD;AAED,MAAM,MAAM,aAAa,GAAG,UAAU,CAAC,kBAAkB,EAAE,oBAAoB,CAAC,CAAC"}
|
|
@@ -6,9 +6,19 @@ import type { HybridView, HybridViewMethods, HybridViewProps } from 'react-nativ
|
|
|
6
6
|
* alignment risk is low.
|
|
7
7
|
*/
|
|
8
8
|
export interface PerpSideRatioProps extends HybridViewProps {
|
|
9
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* Bid (long) share, 0..100. INITIAL VALUE ONLY for high-frequency callers:
|
|
11
|
+
* the first `setRatio` call switches the view into imperative mode and this
|
|
12
|
+
* prop is then ignored, so unrelated prop commits can't reset the split to the
|
|
13
|
+
* static initial value (REACT-NATIVE-1JZ). Update via `setRatio`. Callers that
|
|
14
|
+
* update infrequently may drive it purely through this prop.
|
|
15
|
+
*/
|
|
10
16
|
bidPercentage: number;
|
|
11
|
-
/**
|
|
17
|
+
/**
|
|
18
|
+
* Ask (short) share, 0..100. INITIAL VALUE ONLY for high-frequency callers:
|
|
19
|
+
* this prop is IGNORED once `setRatio` has been called; update via `setRatio`
|
|
20
|
+
* (see `bidPercentage` — REACT-NATIVE-1JZ).
|
|
21
|
+
*/
|
|
12
22
|
askPercentage: number;
|
|
13
23
|
/** Resolved long (bid) color. */
|
|
14
24
|
longColor: string;
|
|
@@ -24,6 +34,19 @@ export interface PerpSideRatioProps extends HybridViewProps {
|
|
|
24
34
|
reducedMotion: boolean;
|
|
25
35
|
}
|
|
26
36
|
export interface PerpSideRatioMethods extends HybridViewMethods {
|
|
37
|
+
/**
|
|
38
|
+
* Imperatively update the bid/ask ratio, bypassing the high-frequency
|
|
39
|
+
* `bidPercentage`/`askPercentage` prop write path (and its props/JSICache
|
|
40
|
+
* lock contention — REACT-NATIVE-1JZ). Companion to `PerpDepthBars.setDepth`.
|
|
41
|
+
*
|
|
42
|
+
* `bidPercentage`/`askPercentage` carry the EXACT SAME semantics as the
|
|
43
|
+
* props of the same name (0..100 shares; the native side derives the split
|
|
44
|
+
* fraction identically). The native side routes these through the same
|
|
45
|
+
* clamp/target/animation path the prop setters use — only the data source
|
|
46
|
+
* differs. The `bidPercentage`/`askPercentage` props are retained for
|
|
47
|
+
* backward compatibility; callers may use either path.
|
|
48
|
+
*/
|
|
49
|
+
setRatio(bidPercentage: number, askPercentage: number): void;
|
|
27
50
|
}
|
|
28
51
|
export type PerpSideRatio = HybridView<PerpSideRatioProps, PerpSideRatioMethods>;
|
|
29
52
|
//# sourceMappingURL=PerpSideRatio.nitro.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PerpSideRatio.nitro.d.ts","sourceRoot":"","sources":["../../../src/PerpSideRatio.nitro.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,iBAAiB,EACjB,eAAe,EAChB,MAAM,4BAA4B,CAAC;AAEpC;;;;;GAKG;AACH,MAAM,WAAW,kBAAmB,SAAQ,eAAe;IACzD
|
|
1
|
+
{"version":3,"file":"PerpSideRatio.nitro.d.ts","sourceRoot":"","sources":["../../../src/PerpSideRatio.nitro.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,iBAAiB,EACjB,eAAe,EAChB,MAAM,4BAA4B,CAAC;AAEpC;;;;;GAKG;AACH,MAAM,WAAW,kBAAmB,SAAQ,eAAe;IACzD;;;;;;OAMG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB;;;;OAIG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB,iCAAiC;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,kCAAkC;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,sCAAsC;IACtC,aAAa,EAAE,MAAM,CAAC;IACtB,qCAAqC;IACrC,YAAY,EAAE,MAAM,CAAC;IACrB,8CAA8C;IAC9C,GAAG,EAAE,MAAM,CAAC;IACZ,gEAAgE;IAChE,aAAa,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,oBAAqB,SAAQ,iBAAiB;IAC7D;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,aAAa,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9D;AAED,MAAM,MAAM,aAAa,GAAG,UAAU,CAAC,kBAAkB,EAAE,oBAAoB,CAAC,CAAC"}
|
|
@@ -15,6 +15,9 @@
|
|
|
15
15
|
#include <optional>
|
|
16
16
|
#include "JFunc_void_double.hpp"
|
|
17
17
|
#include <NitroModules/JNICallable.hpp>
|
|
18
|
+
#include <NitroModules/ArrayBuffer.hpp>
|
|
19
|
+
#include <NitroModules/JArrayBuffer.hpp>
|
|
20
|
+
#include <NitroModules/JUnit.hpp>
|
|
18
21
|
|
|
19
22
|
namespace margelo::nitro::perpdepthbar {
|
|
20
23
|
|
|
@@ -226,6 +229,24 @@ namespace margelo::nitro::perpdepthbar {
|
|
|
226
229
|
static const auto method = javaClassStatic()->getMethod<void(double /* textInset */)>("setTextInset");
|
|
227
230
|
method(_javaPart, textInset);
|
|
228
231
|
}
|
|
232
|
+
std::string JHybridPerpDepthBarsSpec::getPlaceholderText() {
|
|
233
|
+
static const auto method = javaClassStatic()->getMethod<jni::local_ref<jni::JString>()>("getPlaceholderText");
|
|
234
|
+
auto __result = method(_javaPart);
|
|
235
|
+
return __result->toStdString();
|
|
236
|
+
}
|
|
237
|
+
void JHybridPerpDepthBarsSpec::setPlaceholderText(const std::string& placeholderText) {
|
|
238
|
+
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<jni::JString> /* placeholderText */)>("setPlaceholderText");
|
|
239
|
+
method(_javaPart, jni::make_jstring(placeholderText));
|
|
240
|
+
}
|
|
241
|
+
double JHybridPerpDepthBarsSpec::getPlaceholderRows() {
|
|
242
|
+
static const auto method = javaClassStatic()->getMethod<double()>("getPlaceholderRows");
|
|
243
|
+
auto __result = method(_javaPart);
|
|
244
|
+
return __result;
|
|
245
|
+
}
|
|
246
|
+
void JHybridPerpDepthBarsSpec::setPlaceholderRows(double placeholderRows) {
|
|
247
|
+
static const auto method = javaClassStatic()->getMethod<void(double /* placeholderRows */)>("setPlaceholderRows");
|
|
248
|
+
method(_javaPart, placeholderRows);
|
|
249
|
+
}
|
|
229
250
|
std::optional<std::function<void(double /* rowIndex */)>> JHybridPerpDepthBarsSpec::getOnRowPress() {
|
|
230
251
|
static const auto method = javaClassStatic()->getMethod<jni::local_ref<JFunc_void_double::javaobject>()>("getOnRowPress_cxx");
|
|
231
252
|
auto __result = method(_javaPart);
|
|
@@ -245,6 +266,31 @@ namespace margelo::nitro::perpdepthbar {
|
|
|
245
266
|
}
|
|
246
267
|
|
|
247
268
|
// Methods
|
|
248
|
-
|
|
269
|
+
void JHybridPerpDepthBarsSpec::setDepth(const std::shared_ptr<ArrayBuffer>& buffer) {
|
|
270
|
+
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JArrayBuffer::javaobject> /* buffer */)>("setDepth");
|
|
271
|
+
method(_javaPart, JArrayBuffer::wrap(buffer));
|
|
272
|
+
}
|
|
273
|
+
void JHybridPerpDepthBarsSpec::setText(const std::vector<std::string>& prices, const std::vector<std::string>& sizes) {
|
|
274
|
+
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<jni::JArrayClass<jni::JString>> /* prices */, jni::alias_ref<jni::JArrayClass<jni::JString>> /* sizes */)>("setText");
|
|
275
|
+
method(_javaPart, [&]() {
|
|
276
|
+
size_t __size = prices.size();
|
|
277
|
+
jni::local_ref<jni::JArrayClass<jni::JString>> __array = jni::JArrayClass<jni::JString>::newArray(__size);
|
|
278
|
+
for (size_t __i = 0; __i < __size; __i++) {
|
|
279
|
+
const auto& __element = prices[__i];
|
|
280
|
+
auto __elementJni = jni::make_jstring(__element);
|
|
281
|
+
__array->setElement(__i, *__elementJni);
|
|
282
|
+
}
|
|
283
|
+
return __array;
|
|
284
|
+
}(), [&]() {
|
|
285
|
+
size_t __size = sizes.size();
|
|
286
|
+
jni::local_ref<jni::JArrayClass<jni::JString>> __array = jni::JArrayClass<jni::JString>::newArray(__size);
|
|
287
|
+
for (size_t __i = 0; __i < __size; __i++) {
|
|
288
|
+
const auto& __element = sizes[__i];
|
|
289
|
+
auto __elementJni = jni::make_jstring(__element);
|
|
290
|
+
__array->setElement(__i, *__elementJni);
|
|
291
|
+
}
|
|
292
|
+
return __array;
|
|
293
|
+
}());
|
|
294
|
+
}
|
|
249
295
|
|
|
250
296
|
} // namespace margelo::nitro::perpdepthbar
|
|
@@ -80,12 +80,17 @@ namespace margelo::nitro::perpdepthbar {
|
|
|
80
80
|
void setSizeFontSize(double sizeFontSize) override;
|
|
81
81
|
double getTextInset() override;
|
|
82
82
|
void setTextInset(double textInset) override;
|
|
83
|
+
std::string getPlaceholderText() override;
|
|
84
|
+
void setPlaceholderText(const std::string& placeholderText) override;
|
|
85
|
+
double getPlaceholderRows() override;
|
|
86
|
+
void setPlaceholderRows(double placeholderRows) override;
|
|
83
87
|
std::optional<std::function<void(double /* rowIndex */)>> getOnRowPress() override;
|
|
84
88
|
void setOnRowPress(const std::optional<std::function<void(double /* rowIndex */)>>& onRowPress) override;
|
|
85
89
|
|
|
86
90
|
public:
|
|
87
91
|
// Methods
|
|
88
|
-
|
|
92
|
+
void setDepth(const std::shared_ptr<ArrayBuffer>& buffer) override;
|
|
93
|
+
void setText(const std::vector<std::string>& prices, const std::vector<std::string>& sizes) override;
|
|
89
94
|
|
|
90
95
|
private:
|
|
91
96
|
friend HybridBase;
|
|
@@ -114,6 +114,9 @@ namespace margelo::nitro::perpdepthbar {
|
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
// Methods
|
|
117
|
-
|
|
117
|
+
void JHybridPerpSideRatioSpec::setRatio(double bidPercentage, double askPercentage) {
|
|
118
|
+
static const auto method = javaClassStatic()->getMethod<void(double /* bidPercentage */, double /* askPercentage */)>("setRatio");
|
|
119
|
+
method(_javaPart, bidPercentage, askPercentage);
|
|
120
|
+
}
|
|
118
121
|
|
|
119
122
|
} // namespace margelo::nitro::perpdepthbar
|
|
@@ -96,6 +96,14 @@ void JHybridPerpDepthBarsStateUpdater::updateViewProps(jni::alias_ref<jni::JClas
|
|
|
96
96
|
view->setTextInset(props.textInset.value);
|
|
97
97
|
// TODO: Set isDirty = false
|
|
98
98
|
}
|
|
99
|
+
if (props.placeholderText.isDirty) {
|
|
100
|
+
view->setPlaceholderText(props.placeholderText.value);
|
|
101
|
+
// TODO: Set isDirty = false
|
|
102
|
+
}
|
|
103
|
+
if (props.placeholderRows.isDirty) {
|
|
104
|
+
view->setPlaceholderRows(props.placeholderRows.value);
|
|
105
|
+
// TODO: Set isDirty = false
|
|
106
|
+
}
|
|
99
107
|
if (props.onRowPress.isDirty) {
|
|
100
108
|
view->setOnRowPress(props.onRowPress.value);
|
|
101
109
|
// TODO: Set isDirty = false
|
package/nitrogen/generated/android/kotlin/com/margelo/nitro/perpdepthbar/HybridPerpDepthBarsSpec.kt
CHANGED
|
@@ -10,6 +10,7 @@ package com.margelo.nitro.perpdepthbar
|
|
|
10
10
|
import androidx.annotation.Keep
|
|
11
11
|
import com.facebook.jni.HybridData
|
|
12
12
|
import com.facebook.proguard.annotations.DoNotStrip
|
|
13
|
+
import com.margelo.nitro.core.ArrayBuffer
|
|
13
14
|
import com.margelo.nitro.views.HybridView
|
|
14
15
|
|
|
15
16
|
/**
|
|
@@ -132,6 +133,18 @@ abstract class HybridPerpDepthBarsSpec: HybridView() {
|
|
|
132
133
|
@set:Keep
|
|
133
134
|
abstract var textInset: Double
|
|
134
135
|
|
|
136
|
+
@get:DoNotStrip
|
|
137
|
+
@get:Keep
|
|
138
|
+
@set:DoNotStrip
|
|
139
|
+
@set:Keep
|
|
140
|
+
abstract var placeholderText: String
|
|
141
|
+
|
|
142
|
+
@get:DoNotStrip
|
|
143
|
+
@get:Keep
|
|
144
|
+
@set:DoNotStrip
|
|
145
|
+
@set:Keep
|
|
146
|
+
abstract var placeholderRows: Double
|
|
147
|
+
|
|
135
148
|
abstract var onRowPress: ((rowIndex: Double) -> Unit)?
|
|
136
149
|
|
|
137
150
|
private var onRowPress_cxx: Func_void_double?
|
|
@@ -147,7 +160,13 @@ abstract class HybridPerpDepthBarsSpec: HybridView() {
|
|
|
147
160
|
}
|
|
148
161
|
|
|
149
162
|
// Methods
|
|
163
|
+
@DoNotStrip
|
|
164
|
+
@Keep
|
|
165
|
+
abstract fun setDepth(buffer: ArrayBuffer): Unit
|
|
150
166
|
|
|
167
|
+
@DoNotStrip
|
|
168
|
+
@Keep
|
|
169
|
+
abstract fun setText(prices: Array<String>, sizes: Array<String>): Unit
|
|
151
170
|
|
|
152
171
|
private external fun initHybrid(): HybridData
|
|
153
172
|
|
package/nitrogen/generated/android/kotlin/com/margelo/nitro/perpdepthbar/HybridPerpSideRatioSpec.kt
CHANGED
|
@@ -91,7 +91,9 @@ abstract class HybridPerpSideRatioSpec: HybridView() {
|
|
|
91
91
|
abstract var reducedMotion: Boolean
|
|
92
92
|
|
|
93
93
|
// Methods
|
|
94
|
-
|
|
94
|
+
@DoNotStrip
|
|
95
|
+
@Keep
|
|
96
|
+
abstract fun setRatio(bidPercentage: Double, askPercentage: Double): Unit
|
|
95
97
|
|
|
96
98
|
private external fun initHybrid(): HybridData
|
|
97
99
|
|
|
@@ -22,6 +22,8 @@ namespace PerpDepthBar { class HybridPerpSideRatioSpec_cxx; }
|
|
|
22
22
|
// Include C++ defined types
|
|
23
23
|
#include "HybridPerpDepthBarsSpec.hpp"
|
|
24
24
|
#include "HybridPerpSideRatioSpec.hpp"
|
|
25
|
+
#include <NitroModules/Result.hpp>
|
|
26
|
+
#include <exception>
|
|
25
27
|
#include <functional>
|
|
26
28
|
#include <memory>
|
|
27
29
|
#include <optional>
|
|
@@ -105,6 +107,15 @@ namespace margelo::nitro::perpdepthbar::bridge::swift {
|
|
|
105
107
|
using std__weak_ptr_HybridPerpDepthBarsSpec_ = std::weak_ptr<HybridPerpDepthBarsSpec>;
|
|
106
108
|
inline std__weak_ptr_HybridPerpDepthBarsSpec_ weakify_std__shared_ptr_HybridPerpDepthBarsSpec_(const std::shared_ptr<HybridPerpDepthBarsSpec>& strong) noexcept { return strong; }
|
|
107
109
|
|
|
110
|
+
// pragma MARK: Result<void>
|
|
111
|
+
using Result_void_ = Result<void>;
|
|
112
|
+
inline Result_void_ create_Result_void_() noexcept {
|
|
113
|
+
return Result<void>::withValue();
|
|
114
|
+
}
|
|
115
|
+
inline Result_void_ create_Result_void_(const std::exception_ptr& error) noexcept {
|
|
116
|
+
return Result<void>::withError(error);
|
|
117
|
+
}
|
|
118
|
+
|
|
108
119
|
// pragma MARK: std::shared_ptr<HybridPerpSideRatioSpec>
|
|
109
120
|
/**
|
|
110
121
|
* Specialized version of `std::shared_ptr<HybridPerpSideRatioSpec>`.
|
|
@@ -16,6 +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 <NitroModules/ArrayBuffer.hpp>
|
|
20
|
+
#include <NitroModules/Result.hpp>
|
|
21
|
+
#include <exception>
|
|
19
22
|
#include <functional>
|
|
20
23
|
#include <memory>
|
|
21
24
|
#include <optional>
|
|
@@ -12,12 +12,15 @@
|
|
|
12
12
|
// Forward declaration of `HybridPerpDepthBarsSpec_cxx` to properly resolve imports.
|
|
13
13
|
namespace PerpDepthBar { class HybridPerpDepthBarsSpec_cxx; }
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
// Forward declaration of `ArrayBufferHolder` to properly resolve imports.
|
|
16
|
+
namespace NitroModules { class ArrayBufferHolder; }
|
|
16
17
|
|
|
17
18
|
#include <vector>
|
|
18
19
|
#include <string>
|
|
19
20
|
#include <functional>
|
|
20
21
|
#include <optional>
|
|
22
|
+
#include <NitroModules/ArrayBuffer.hpp>
|
|
23
|
+
#include <NitroModules/ArrayBufferHolder.hpp>
|
|
21
24
|
|
|
22
25
|
#include "PerpDepthBar-Swift-Cxx-Umbrella.hpp"
|
|
23
26
|
|
|
@@ -156,6 +159,19 @@ namespace margelo::nitro::perpdepthbar {
|
|
|
156
159
|
inline void setTextInset(double textInset) noexcept override {
|
|
157
160
|
_swiftPart.setTextInset(std::forward<decltype(textInset)>(textInset));
|
|
158
161
|
}
|
|
162
|
+
inline std::string getPlaceholderText() noexcept override {
|
|
163
|
+
auto __result = _swiftPart.getPlaceholderText();
|
|
164
|
+
return __result;
|
|
165
|
+
}
|
|
166
|
+
inline void setPlaceholderText(const std::string& placeholderText) noexcept override {
|
|
167
|
+
_swiftPart.setPlaceholderText(placeholderText);
|
|
168
|
+
}
|
|
169
|
+
inline double getPlaceholderRows() noexcept override {
|
|
170
|
+
return _swiftPart.getPlaceholderRows();
|
|
171
|
+
}
|
|
172
|
+
inline void setPlaceholderRows(double placeholderRows) noexcept override {
|
|
173
|
+
_swiftPart.setPlaceholderRows(std::forward<decltype(placeholderRows)>(placeholderRows));
|
|
174
|
+
}
|
|
159
175
|
inline std::optional<std::function<void(double /* rowIndex */)>> getOnRowPress() noexcept override {
|
|
160
176
|
auto __result = _swiftPart.getOnRowPress();
|
|
161
177
|
return __result;
|
|
@@ -166,7 +182,18 @@ namespace margelo::nitro::perpdepthbar {
|
|
|
166
182
|
|
|
167
183
|
public:
|
|
168
184
|
// Methods
|
|
169
|
-
|
|
185
|
+
inline void setDepth(const std::shared_ptr<ArrayBuffer>& buffer) override {
|
|
186
|
+
auto __result = _swiftPart.setDepth(ArrayBufferHolder(buffer));
|
|
187
|
+
if (__result.hasError()) [[unlikely]] {
|
|
188
|
+
std::rethrow_exception(__result.error());
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
inline void setText(const std::vector<std::string>& prices, const std::vector<std::string>& sizes) override {
|
|
192
|
+
auto __result = _swiftPart.setText(prices, sizes);
|
|
193
|
+
if (__result.hasError()) [[unlikely]] {
|
|
194
|
+
std::rethrow_exception(__result.error());
|
|
195
|
+
}
|
|
196
|
+
}
|
|
170
197
|
|
|
171
198
|
private:
|
|
172
199
|
PerpDepthBar::HybridPerpDepthBarsSpec_cxx _swiftPart;
|