@onekeyfe/react-native-chart-webview 3.0.39

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 (132) hide show
  1. package/ChartWebview.podspec +29 -0
  2. package/LICENSE +21 -0
  3. package/README.md +31 -0
  4. package/android/CMakeLists.txt +24 -0
  5. package/android/build.gradle +131 -0
  6. package/android/src/main/AndroidManifest.xml +2 -0
  7. package/android/src/main/cpp/cpp-adapter.cpp +6 -0
  8. package/android/src/main/java/com/margelo/nitro/chartwebview/ChartWebview.kt +331 -0
  9. package/android/src/main/java/com/margelo/nitro/chartwebview/ChartWebviewPackage.kt +29 -0
  10. package/android/src/main/java/com/margelo/nitro/chartwebview/PooledChartWebView.kt +385 -0
  11. package/ios/ChartWebview.swift +747 -0
  12. package/lib/module/ChartWebview.nitro.js +4 -0
  13. package/lib/module/ChartWebview.nitro.js.map +1 -0
  14. package/lib/module/bridge.js +30 -0
  15. package/lib/module/bridge.js.map +1 -0
  16. package/lib/module/index.js +19 -0
  17. package/lib/module/index.js.map +1 -0
  18. package/lib/module/package.json +1 -0
  19. package/lib/nitrogen/generated/android/c++/JFunc_void.hpp +75 -0
  20. package/lib/nitrogen/generated/android/c++/JFunc_void_std__string.hpp +76 -0
  21. package/lib/nitrogen/generated/android/c++/JHybridChartWebviewSpec.cpp +186 -0
  22. package/lib/nitrogen/generated/android/c++/JHybridChartWebviewSpec.hpp +88 -0
  23. package/lib/nitrogen/generated/android/c++/views/JHybridChartWebviewStateUpdater.cpp +96 -0
  24. package/lib/nitrogen/generated/android/c++/views/JHybridChartWebviewStateUpdater.hpp +49 -0
  25. package/lib/nitrogen/generated/android/chartwebview+autolinking.cmake +83 -0
  26. package/lib/nitrogen/generated/android/chartwebview+autolinking.gradle +27 -0
  27. package/lib/nitrogen/generated/android/chartwebviewOnLoad.cpp +50 -0
  28. package/lib/nitrogen/generated/android/chartwebviewOnLoad.hpp +25 -0
  29. package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/chartwebview/Func_void.kt +80 -0
  30. package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/chartwebview/Func_void_std__string.kt +80 -0
  31. package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/chartwebview/HybridChartWebviewSpec.kt +153 -0
  32. package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/chartwebview/chartwebviewOnLoad.kt +35 -0
  33. package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/chartwebview/views/HybridChartWebviewManager.kt +50 -0
  34. package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/chartwebview/views/HybridChartWebviewStateUpdater.kt +23 -0
  35. package/lib/nitrogen/generated/ios/ChartWebview+autolinking.rb +60 -0
  36. package/lib/nitrogen/generated/ios/ChartWebview-Swift-Cxx-Bridge.cpp +49 -0
  37. package/lib/nitrogen/generated/ios/ChartWebview-Swift-Cxx-Bridge.hpp +158 -0
  38. package/lib/nitrogen/generated/ios/ChartWebview-Swift-Cxx-Umbrella.hpp +46 -0
  39. package/lib/nitrogen/generated/ios/ChartWebviewAutolinking.mm +33 -0
  40. package/lib/nitrogen/generated/ios/ChartWebviewAutolinking.swift +25 -0
  41. package/lib/nitrogen/generated/ios/c++/HybridChartWebviewSpecSwift.cpp +11 -0
  42. package/lib/nitrogen/generated/ios/c++/HybridChartWebviewSpecSwift.hpp +164 -0
  43. package/lib/nitrogen/generated/ios/c++/views/HybridChartWebviewComponent.mm +146 -0
  44. package/lib/nitrogen/generated/ios/swift/Func_void.swift +47 -0
  45. package/lib/nitrogen/generated/ios/swift/Func_void_std__string.swift +47 -0
  46. package/lib/nitrogen/generated/ios/swift/HybridChartWebviewSpec.swift +68 -0
  47. package/lib/nitrogen/generated/ios/swift/HybridChartWebviewSpec_cxx.swift +450 -0
  48. package/lib/nitrogen/generated/shared/c++/HybridChartWebviewSpec.cpp +45 -0
  49. package/lib/nitrogen/generated/shared/c++/HybridChartWebviewSpec.hpp +87 -0
  50. package/lib/nitrogen/generated/shared/c++/views/HybridChartWebviewComponent.cpp +207 -0
  51. package/lib/nitrogen/generated/shared/c++/views/HybridChartWebviewComponent.hpp +118 -0
  52. package/lib/nitrogen/generated/shared/json/ChartWebviewConfig.json +20 -0
  53. package/lib/nitrogen/nitrogen/generated/android/c++/JFunc_void.hpp +75 -0
  54. package/lib/nitrogen/nitrogen/generated/android/c++/JFunc_void_std__string.hpp +76 -0
  55. package/lib/nitrogen/nitrogen/generated/android/c++/JHybridChartWebviewSpec.cpp +186 -0
  56. package/lib/nitrogen/nitrogen/generated/android/c++/JHybridChartWebviewSpec.hpp +88 -0
  57. package/lib/nitrogen/nitrogen/generated/android/c++/views/JHybridChartWebviewStateUpdater.cpp +96 -0
  58. package/lib/nitrogen/nitrogen/generated/android/c++/views/JHybridChartWebviewStateUpdater.hpp +49 -0
  59. package/lib/nitrogen/nitrogen/generated/android/chartwebview+autolinking.cmake +83 -0
  60. package/lib/nitrogen/nitrogen/generated/android/chartwebview+autolinking.gradle +27 -0
  61. package/lib/nitrogen/nitrogen/generated/android/chartwebviewOnLoad.cpp +50 -0
  62. package/lib/nitrogen/nitrogen/generated/android/chartwebviewOnLoad.hpp +25 -0
  63. package/lib/nitrogen/nitrogen/generated/android/kotlin/com/margelo/nitro/chartwebview/Func_void.kt +80 -0
  64. package/lib/nitrogen/nitrogen/generated/android/kotlin/com/margelo/nitro/chartwebview/Func_void_std__string.kt +80 -0
  65. package/lib/nitrogen/nitrogen/generated/android/kotlin/com/margelo/nitro/chartwebview/HybridChartWebviewSpec.kt +153 -0
  66. package/lib/nitrogen/nitrogen/generated/android/kotlin/com/margelo/nitro/chartwebview/chartwebviewOnLoad.kt +35 -0
  67. package/lib/nitrogen/nitrogen/generated/android/kotlin/com/margelo/nitro/chartwebview/views/HybridChartWebviewManager.kt +50 -0
  68. package/lib/nitrogen/nitrogen/generated/android/kotlin/com/margelo/nitro/chartwebview/views/HybridChartWebviewStateUpdater.kt +23 -0
  69. package/lib/nitrogen/nitrogen/generated/ios/ChartWebview+autolinking.rb +60 -0
  70. package/lib/nitrogen/nitrogen/generated/ios/ChartWebview-Swift-Cxx-Bridge.cpp +49 -0
  71. package/lib/nitrogen/nitrogen/generated/ios/ChartWebview-Swift-Cxx-Bridge.hpp +158 -0
  72. package/lib/nitrogen/nitrogen/generated/ios/ChartWebview-Swift-Cxx-Umbrella.hpp +46 -0
  73. package/lib/nitrogen/nitrogen/generated/ios/ChartWebviewAutolinking.mm +33 -0
  74. package/lib/nitrogen/nitrogen/generated/ios/ChartWebviewAutolinking.swift +25 -0
  75. package/lib/nitrogen/nitrogen/generated/ios/c++/HybridChartWebviewSpecSwift.cpp +11 -0
  76. package/lib/nitrogen/nitrogen/generated/ios/c++/HybridChartWebviewSpecSwift.hpp +164 -0
  77. package/lib/nitrogen/nitrogen/generated/ios/c++/views/HybridChartWebviewComponent.mm +146 -0
  78. package/lib/nitrogen/nitrogen/generated/ios/swift/Func_void.swift +47 -0
  79. package/lib/nitrogen/nitrogen/generated/ios/swift/Func_void_std__string.swift +47 -0
  80. package/lib/nitrogen/nitrogen/generated/ios/swift/HybridChartWebviewSpec.swift +68 -0
  81. package/lib/nitrogen/nitrogen/generated/ios/swift/HybridChartWebviewSpec_cxx.swift +450 -0
  82. package/lib/nitrogen/nitrogen/generated/shared/c++/HybridChartWebviewSpec.cpp +45 -0
  83. package/lib/nitrogen/nitrogen/generated/shared/c++/HybridChartWebviewSpec.hpp +87 -0
  84. package/lib/nitrogen/nitrogen/generated/shared/c++/views/HybridChartWebviewComponent.cpp +207 -0
  85. package/lib/nitrogen/nitrogen/generated/shared/c++/views/HybridChartWebviewComponent.hpp +118 -0
  86. package/lib/nitrogen/nitrogen/generated/shared/json/ChartWebviewConfig.json +20 -0
  87. package/lib/typescript/package.json +1 -0
  88. package/lib/typescript/src/ChartWebview.nitro.d.ts +21 -0
  89. package/lib/typescript/src/ChartWebview.nitro.d.ts.map +1 -0
  90. package/lib/typescript/src/bridge.d.ts +2 -0
  91. package/lib/typescript/src/bridge.d.ts.map +1 -0
  92. package/lib/typescript/src/index.d.ts +145 -0
  93. package/lib/typescript/src/index.d.ts.map +1 -0
  94. package/nitro.json +17 -0
  95. package/nitrogen/generated/android/c++/JFunc_void.hpp +75 -0
  96. package/nitrogen/generated/android/c++/JFunc_void_std__string.hpp +76 -0
  97. package/nitrogen/generated/android/c++/JHybridChartWebviewSpec.cpp +186 -0
  98. package/nitrogen/generated/android/c++/JHybridChartWebviewSpec.hpp +88 -0
  99. package/nitrogen/generated/android/c++/views/JHybridChartWebviewStateUpdater.cpp +96 -0
  100. package/nitrogen/generated/android/c++/views/JHybridChartWebviewStateUpdater.hpp +49 -0
  101. package/nitrogen/generated/android/chartwebview+autolinking.cmake +83 -0
  102. package/nitrogen/generated/android/chartwebview+autolinking.gradle +27 -0
  103. package/nitrogen/generated/android/chartwebviewOnLoad.cpp +50 -0
  104. package/nitrogen/generated/android/chartwebviewOnLoad.hpp +25 -0
  105. package/nitrogen/generated/android/kotlin/com/margelo/nitro/chartwebview/Func_void.kt +80 -0
  106. package/nitrogen/generated/android/kotlin/com/margelo/nitro/chartwebview/Func_void_std__string.kt +80 -0
  107. package/nitrogen/generated/android/kotlin/com/margelo/nitro/chartwebview/HybridChartWebviewSpec.kt +153 -0
  108. package/nitrogen/generated/android/kotlin/com/margelo/nitro/chartwebview/chartwebviewOnLoad.kt +35 -0
  109. package/nitrogen/generated/android/kotlin/com/margelo/nitro/chartwebview/views/HybridChartWebviewManager.kt +50 -0
  110. package/nitrogen/generated/android/kotlin/com/margelo/nitro/chartwebview/views/HybridChartWebviewStateUpdater.kt +23 -0
  111. package/nitrogen/generated/ios/ChartWebview+autolinking.rb +60 -0
  112. package/nitrogen/generated/ios/ChartWebview-Swift-Cxx-Bridge.cpp +49 -0
  113. package/nitrogen/generated/ios/ChartWebview-Swift-Cxx-Bridge.hpp +158 -0
  114. package/nitrogen/generated/ios/ChartWebview-Swift-Cxx-Umbrella.hpp +46 -0
  115. package/nitrogen/generated/ios/ChartWebviewAutolinking.mm +33 -0
  116. package/nitrogen/generated/ios/ChartWebviewAutolinking.swift +25 -0
  117. package/nitrogen/generated/ios/c++/HybridChartWebviewSpecSwift.cpp +11 -0
  118. package/nitrogen/generated/ios/c++/HybridChartWebviewSpecSwift.hpp +164 -0
  119. package/nitrogen/generated/ios/c++/views/HybridChartWebviewComponent.mm +146 -0
  120. package/nitrogen/generated/ios/swift/Func_void.swift +47 -0
  121. package/nitrogen/generated/ios/swift/Func_void_std__string.swift +47 -0
  122. package/nitrogen/generated/ios/swift/HybridChartWebviewSpec.swift +68 -0
  123. package/nitrogen/generated/ios/swift/HybridChartWebviewSpec_cxx.swift +450 -0
  124. package/nitrogen/generated/shared/c++/HybridChartWebviewSpec.cpp +45 -0
  125. package/nitrogen/generated/shared/c++/HybridChartWebviewSpec.hpp +87 -0
  126. package/nitrogen/generated/shared/c++/views/HybridChartWebviewComponent.cpp +207 -0
  127. package/nitrogen/generated/shared/c++/views/HybridChartWebviewComponent.hpp +118 -0
  128. package/nitrogen/generated/shared/json/ChartWebviewConfig.json +20 -0
  129. package/package.json +170 -0
  130. package/src/ChartWebview.nitro.ts +59 -0
  131. package/src/bridge.ts +27 -0
  132. package/src/index.tsx +20 -0
@@ -0,0 +1,68 @@
1
+ ///
2
+ /// HybridChartWebviewSpec.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
+ /// See ``HybridChartWebviewSpec``
12
+ public protocol HybridChartWebviewSpec_protocol: HybridObject, HybridView {
13
+ // Properties
14
+ var uri: String? { get set }
15
+ var localBundle: String? { get set }
16
+ var entry: String? { get set }
17
+ var paramsJson: String? { get set }
18
+ var bridgeScript: String? { get set }
19
+ var reuseKey: String? { get set }
20
+ var pooled: Bool? { get set }
21
+ var active: Bool? { get set }
22
+ var onMessage: ((_ message: String) -> Void)? { get set }
23
+ var onLoadEnd: (() -> Void)? { get set }
24
+ var onError: ((_ message: String) -> Void)? { get set }
25
+
26
+ // Methods
27
+ func postMessage(message: String) throws -> Void
28
+ func reload() throws -> Void
29
+ func clearSnapshot() throws -> Void
30
+ }
31
+
32
+ public extension HybridChartWebviewSpec_protocol {
33
+ /// Default implementation of ``HybridObject.toString``
34
+ func toString() -> String {
35
+ return "[HybridObject ChartWebview]"
36
+ }
37
+ }
38
+
39
+ /// See ``HybridChartWebviewSpec``
40
+ open class HybridChartWebviewSpec_base {
41
+ private weak var cxxWrapper: HybridChartWebviewSpec_cxx? = nil
42
+ public init() { }
43
+ public func getCxxWrapper() -> HybridChartWebviewSpec_cxx {
44
+ #if DEBUG
45
+ guard self is HybridChartWebviewSpec else {
46
+ fatalError("`self` is not a `HybridChartWebviewSpec`! Did you accidentally inherit from `HybridChartWebviewSpec_base` instead of `HybridChartWebviewSpec`?")
47
+ }
48
+ #endif
49
+ if let cxxWrapper = self.cxxWrapper {
50
+ return cxxWrapper
51
+ } else {
52
+ let cxxWrapper = HybridChartWebviewSpec_cxx(self as! HybridChartWebviewSpec)
53
+ self.cxxWrapper = cxxWrapper
54
+ return cxxWrapper
55
+ }
56
+ }
57
+ }
58
+
59
+ /**
60
+ * A Swift base-protocol representing the ChartWebview HybridObject.
61
+ * Implement this protocol to create Swift-based instances of ChartWebview.
62
+ * ```swift
63
+ * class HybridChartWebview : HybridChartWebviewSpec {
64
+ * // ...
65
+ * }
66
+ * ```
67
+ */
68
+ public typealias HybridChartWebviewSpec = HybridChartWebviewSpec_protocol & HybridChartWebviewSpec_base
@@ -0,0 +1,450 @@
1
+ ///
2
+ /// HybridChartWebviewSpec_cxx.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
+ * A class implementation that bridges HybridChartWebviewSpec over to C++.
13
+ * In C++, we cannot use Swift protocols - so we need to wrap it in a class to make it strongly defined.
14
+ *
15
+ * Also, some Swift types need to be bridged with special handling:
16
+ * - Enums need to be wrapped in Structs, otherwise they cannot be accessed bi-directionally (Swift bug: https://github.com/swiftlang/swift/issues/75330)
17
+ * - Other HybridObjects need to be wrapped/unwrapped from the Swift TCxx wrapper
18
+ * - Throwing methods need to be wrapped with a Result<T, Error> type, as exceptions cannot be propagated to C++
19
+ */
20
+ open class HybridChartWebviewSpec_cxx {
21
+ /**
22
+ * The Swift <> C++ bridge's namespace (`margelo::nitro::chartwebview::bridge::swift`)
23
+ * from `ChartWebview-Swift-Cxx-Bridge.hpp`.
24
+ * This contains specialized C++ templates, and C++ helper functions that can be accessed from Swift.
25
+ */
26
+ public typealias bridge = margelo.nitro.chartwebview.bridge.swift
27
+
28
+ /**
29
+ * Holds an instance of the `HybridChartWebviewSpec` Swift protocol.
30
+ */
31
+ private var __implementation: any HybridChartWebviewSpec
32
+
33
+ /**
34
+ * Holds a weak pointer to the C++ class that wraps the Swift class.
35
+ */
36
+ private var __cxxPart: bridge.std__weak_ptr_HybridChartWebviewSpec_
37
+
38
+ /**
39
+ * Create a new `HybridChartWebviewSpec_cxx` that wraps the given `HybridChartWebviewSpec`.
40
+ * All properties and methods bridge to C++ types.
41
+ */
42
+ public init(_ implementation: any HybridChartWebviewSpec) {
43
+ self.__implementation = implementation
44
+ self.__cxxPart = .init()
45
+ /* no base class */
46
+ }
47
+
48
+ /**
49
+ * Get the actual `HybridChartWebviewSpec` instance this class wraps.
50
+ */
51
+ @inline(__always)
52
+ public func getHybridChartWebviewSpec() -> any HybridChartWebviewSpec {
53
+ return __implementation
54
+ }
55
+
56
+ /**
57
+ * Casts this instance to a retained unsafe raw pointer.
58
+ * This acquires one additional strong reference on the object!
59
+ */
60
+ public func toUnsafe() -> UnsafeMutableRawPointer {
61
+ return Unmanaged.passRetained(self).toOpaque()
62
+ }
63
+
64
+ /**
65
+ * Casts an unsafe pointer to a `HybridChartWebviewSpec_cxx`.
66
+ * The pointer has to be a retained opaque `Unmanaged<HybridChartWebviewSpec_cxx>`.
67
+ * This removes one strong reference from the object!
68
+ */
69
+ public class func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> HybridChartWebviewSpec_cxx {
70
+ return Unmanaged<HybridChartWebviewSpec_cxx>.fromOpaque(pointer).takeRetainedValue()
71
+ }
72
+
73
+ /**
74
+ * Gets (or creates) the C++ part of this Hybrid Object.
75
+ * The C++ part is a `std::shared_ptr<HybridChartWebviewSpec>`.
76
+ */
77
+ public func getCxxPart() -> bridge.std__shared_ptr_HybridChartWebviewSpec_ {
78
+ let cachedCxxPart = self.__cxxPart.lock()
79
+ if Bool(fromCxx: cachedCxxPart) {
80
+ return cachedCxxPart
81
+ } else {
82
+ let newCxxPart = bridge.create_std__shared_ptr_HybridChartWebviewSpec_(self.toUnsafe())
83
+ __cxxPart = bridge.weakify_std__shared_ptr_HybridChartWebviewSpec_(newCxxPart)
84
+ return newCxxPart
85
+ }
86
+ }
87
+
88
+
89
+
90
+ /**
91
+ * Get the memory size of the Swift class (plus size of any other allocations)
92
+ * so the JS VM can properly track it and garbage-collect the JS object if needed.
93
+ */
94
+ @inline(__always)
95
+ public var memorySize: Int {
96
+ return MemoryHelper.getSizeOf(self.__implementation) + self.__implementation.memorySize
97
+ }
98
+
99
+ /**
100
+ * Call dispose() on the Swift class.
101
+ * This _may_ be called manually from JS.
102
+ */
103
+ @inline(__always)
104
+ public func dispose() {
105
+ self.__implementation.dispose()
106
+ }
107
+
108
+ /**
109
+ * Call toString() on the Swift class.
110
+ */
111
+ @inline(__always)
112
+ public func toString() -> String {
113
+ return self.__implementation.toString()
114
+ }
115
+
116
+ // Properties
117
+ public final var uri: bridge.std__optional_std__string_ {
118
+ @inline(__always)
119
+ get {
120
+ return { () -> bridge.std__optional_std__string_ in
121
+ if let __unwrappedValue = self.__implementation.uri {
122
+ return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
123
+ } else {
124
+ return .init()
125
+ }
126
+ }()
127
+ }
128
+ @inline(__always)
129
+ set {
130
+ self.__implementation.uri = { () -> String? in
131
+ if bridge.has_value_std__optional_std__string_(newValue) {
132
+ let __unwrapped = bridge.get_std__optional_std__string_(newValue)
133
+ return String(__unwrapped)
134
+ } else {
135
+ return nil
136
+ }
137
+ }()
138
+ }
139
+ }
140
+
141
+ public final var localBundle: bridge.std__optional_std__string_ {
142
+ @inline(__always)
143
+ get {
144
+ return { () -> bridge.std__optional_std__string_ in
145
+ if let __unwrappedValue = self.__implementation.localBundle {
146
+ return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
147
+ } else {
148
+ return .init()
149
+ }
150
+ }()
151
+ }
152
+ @inline(__always)
153
+ set {
154
+ self.__implementation.localBundle = { () -> String? in
155
+ if bridge.has_value_std__optional_std__string_(newValue) {
156
+ let __unwrapped = bridge.get_std__optional_std__string_(newValue)
157
+ return String(__unwrapped)
158
+ } else {
159
+ return nil
160
+ }
161
+ }()
162
+ }
163
+ }
164
+
165
+ public final var entry: bridge.std__optional_std__string_ {
166
+ @inline(__always)
167
+ get {
168
+ return { () -> bridge.std__optional_std__string_ in
169
+ if let __unwrappedValue = self.__implementation.entry {
170
+ return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
171
+ } else {
172
+ return .init()
173
+ }
174
+ }()
175
+ }
176
+ @inline(__always)
177
+ set {
178
+ self.__implementation.entry = { () -> String? in
179
+ if bridge.has_value_std__optional_std__string_(newValue) {
180
+ let __unwrapped = bridge.get_std__optional_std__string_(newValue)
181
+ return String(__unwrapped)
182
+ } else {
183
+ return nil
184
+ }
185
+ }()
186
+ }
187
+ }
188
+
189
+ public final var paramsJson: bridge.std__optional_std__string_ {
190
+ @inline(__always)
191
+ get {
192
+ return { () -> bridge.std__optional_std__string_ in
193
+ if let __unwrappedValue = self.__implementation.paramsJson {
194
+ return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
195
+ } else {
196
+ return .init()
197
+ }
198
+ }()
199
+ }
200
+ @inline(__always)
201
+ set {
202
+ self.__implementation.paramsJson = { () -> String? in
203
+ if bridge.has_value_std__optional_std__string_(newValue) {
204
+ let __unwrapped = bridge.get_std__optional_std__string_(newValue)
205
+ return String(__unwrapped)
206
+ } else {
207
+ return nil
208
+ }
209
+ }()
210
+ }
211
+ }
212
+
213
+ public final var bridgeScript: bridge.std__optional_std__string_ {
214
+ @inline(__always)
215
+ get {
216
+ return { () -> bridge.std__optional_std__string_ in
217
+ if let __unwrappedValue = self.__implementation.bridgeScript {
218
+ return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
219
+ } else {
220
+ return .init()
221
+ }
222
+ }()
223
+ }
224
+ @inline(__always)
225
+ set {
226
+ self.__implementation.bridgeScript = { () -> String? in
227
+ if bridge.has_value_std__optional_std__string_(newValue) {
228
+ let __unwrapped = bridge.get_std__optional_std__string_(newValue)
229
+ return String(__unwrapped)
230
+ } else {
231
+ return nil
232
+ }
233
+ }()
234
+ }
235
+ }
236
+
237
+ public final var reuseKey: bridge.std__optional_std__string_ {
238
+ @inline(__always)
239
+ get {
240
+ return { () -> bridge.std__optional_std__string_ in
241
+ if let __unwrappedValue = self.__implementation.reuseKey {
242
+ return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
243
+ } else {
244
+ return .init()
245
+ }
246
+ }()
247
+ }
248
+ @inline(__always)
249
+ set {
250
+ self.__implementation.reuseKey = { () -> String? in
251
+ if bridge.has_value_std__optional_std__string_(newValue) {
252
+ let __unwrapped = bridge.get_std__optional_std__string_(newValue)
253
+ return String(__unwrapped)
254
+ } else {
255
+ return nil
256
+ }
257
+ }()
258
+ }
259
+ }
260
+
261
+ public final var pooled: bridge.std__optional_bool_ {
262
+ @inline(__always)
263
+ get {
264
+ return { () -> bridge.std__optional_bool_ in
265
+ if let __unwrappedValue = self.__implementation.pooled {
266
+ return bridge.create_std__optional_bool_(__unwrappedValue)
267
+ } else {
268
+ return .init()
269
+ }
270
+ }()
271
+ }
272
+ @inline(__always)
273
+ set {
274
+ self.__implementation.pooled = { () -> Bool? in
275
+ if bridge.has_value_std__optional_bool_(newValue) {
276
+ let __unwrapped = bridge.get_std__optional_bool_(newValue)
277
+ return __unwrapped
278
+ } else {
279
+ return nil
280
+ }
281
+ }()
282
+ }
283
+ }
284
+
285
+ public final var active: bridge.std__optional_bool_ {
286
+ @inline(__always)
287
+ get {
288
+ return { () -> bridge.std__optional_bool_ in
289
+ if let __unwrappedValue = self.__implementation.active {
290
+ return bridge.create_std__optional_bool_(__unwrappedValue)
291
+ } else {
292
+ return .init()
293
+ }
294
+ }()
295
+ }
296
+ @inline(__always)
297
+ set {
298
+ self.__implementation.active = { () -> Bool? in
299
+ if bridge.has_value_std__optional_bool_(newValue) {
300
+ let __unwrapped = bridge.get_std__optional_bool_(newValue)
301
+ return __unwrapped
302
+ } else {
303
+ return nil
304
+ }
305
+ }()
306
+ }
307
+ }
308
+
309
+ public final var onMessage: bridge.std__optional_std__function_void_const_std__string_____message______ {
310
+ @inline(__always)
311
+ get {
312
+ return { () -> bridge.std__optional_std__function_void_const_std__string_____message______ in
313
+ if let __unwrappedValue = self.__implementation.onMessage {
314
+ return bridge.create_std__optional_std__function_void_const_std__string_____message______({ () -> bridge.Func_void_std__string in
315
+ let __closureWrapper = Func_void_std__string(__unwrappedValue)
316
+ return bridge.create_Func_void_std__string(__closureWrapper.toUnsafe())
317
+ }())
318
+ } else {
319
+ return .init()
320
+ }
321
+ }()
322
+ }
323
+ @inline(__always)
324
+ set {
325
+ self.__implementation.onMessage = { () -> ((_ message: String) -> Void)? in
326
+ if bridge.has_value_std__optional_std__function_void_const_std__string_____message______(newValue) {
327
+ let __unwrapped = bridge.get_std__optional_std__function_void_const_std__string_____message______(newValue)
328
+ return { () -> (String) -> Void in
329
+ let __wrappedFunction = bridge.wrap_Func_void_std__string(__unwrapped)
330
+ return { (__message: String) -> Void in
331
+ __wrappedFunction.call(std.string(__message))
332
+ }
333
+ }()
334
+ } else {
335
+ return nil
336
+ }
337
+ }()
338
+ }
339
+ }
340
+
341
+ public final var onLoadEnd: bridge.std__optional_std__function_void____ {
342
+ @inline(__always)
343
+ get {
344
+ return { () -> bridge.std__optional_std__function_void____ in
345
+ if let __unwrappedValue = self.__implementation.onLoadEnd {
346
+ return bridge.create_std__optional_std__function_void____({ () -> bridge.Func_void in
347
+ let __closureWrapper = Func_void(__unwrappedValue)
348
+ return bridge.create_Func_void(__closureWrapper.toUnsafe())
349
+ }())
350
+ } else {
351
+ return .init()
352
+ }
353
+ }()
354
+ }
355
+ @inline(__always)
356
+ set {
357
+ self.__implementation.onLoadEnd = { () -> (() -> Void)? in
358
+ if bridge.has_value_std__optional_std__function_void____(newValue) {
359
+ let __unwrapped = bridge.get_std__optional_std__function_void____(newValue)
360
+ return { () -> () -> Void in
361
+ let __wrappedFunction = bridge.wrap_Func_void(__unwrapped)
362
+ return { () -> Void in
363
+ __wrappedFunction.call()
364
+ }
365
+ }()
366
+ } else {
367
+ return nil
368
+ }
369
+ }()
370
+ }
371
+ }
372
+
373
+ public final var onError: bridge.std__optional_std__function_void_const_std__string_____message______ {
374
+ @inline(__always)
375
+ get {
376
+ return { () -> bridge.std__optional_std__function_void_const_std__string_____message______ in
377
+ if let __unwrappedValue = self.__implementation.onError {
378
+ return bridge.create_std__optional_std__function_void_const_std__string_____message______({ () -> bridge.Func_void_std__string in
379
+ let __closureWrapper = Func_void_std__string(__unwrappedValue)
380
+ return bridge.create_Func_void_std__string(__closureWrapper.toUnsafe())
381
+ }())
382
+ } else {
383
+ return .init()
384
+ }
385
+ }()
386
+ }
387
+ @inline(__always)
388
+ set {
389
+ self.__implementation.onError = { () -> ((_ message: String) -> Void)? in
390
+ if bridge.has_value_std__optional_std__function_void_const_std__string_____message______(newValue) {
391
+ let __unwrapped = bridge.get_std__optional_std__function_void_const_std__string_____message______(newValue)
392
+ return { () -> (String) -> Void in
393
+ let __wrappedFunction = bridge.wrap_Func_void_std__string(__unwrapped)
394
+ return { (__message: String) -> Void in
395
+ __wrappedFunction.call(std.string(__message))
396
+ }
397
+ }()
398
+ } else {
399
+ return nil
400
+ }
401
+ }()
402
+ }
403
+ }
404
+
405
+ // Methods
406
+ @inline(__always)
407
+ public final func postMessage(message: std.string) -> bridge.Result_void_ {
408
+ do {
409
+ try self.__implementation.postMessage(message: String(message))
410
+ return bridge.create_Result_void_()
411
+ } catch (let __error) {
412
+ let __exceptionPtr = __error.toCpp()
413
+ return bridge.create_Result_void_(__exceptionPtr)
414
+ }
415
+ }
416
+
417
+ @inline(__always)
418
+ public final func reload() -> bridge.Result_void_ {
419
+ do {
420
+ try self.__implementation.reload()
421
+ return bridge.create_Result_void_()
422
+ } catch (let __error) {
423
+ let __exceptionPtr = __error.toCpp()
424
+ return bridge.create_Result_void_(__exceptionPtr)
425
+ }
426
+ }
427
+
428
+ @inline(__always)
429
+ public final func clearSnapshot() -> bridge.Result_void_ {
430
+ do {
431
+ try self.__implementation.clearSnapshot()
432
+ return bridge.create_Result_void_()
433
+ } catch (let __error) {
434
+ let __exceptionPtr = __error.toCpp()
435
+ return bridge.create_Result_void_(__exceptionPtr)
436
+ }
437
+ }
438
+
439
+ public final func getView() -> UnsafeMutableRawPointer {
440
+ return Unmanaged.passRetained(__implementation.view).toOpaque()
441
+ }
442
+
443
+ public final func beforeUpdate() {
444
+ __implementation.beforeUpdate()
445
+ }
446
+
447
+ public final func afterUpdate() {
448
+ __implementation.afterUpdate()
449
+ }
450
+ }
@@ -0,0 +1,45 @@
1
+ ///
2
+ /// HybridChartWebviewSpec.cpp
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
+ #include "HybridChartWebviewSpec.hpp"
9
+
10
+ namespace margelo::nitro::chartwebview {
11
+
12
+ void HybridChartWebviewSpec::loadHybridMethods() {
13
+ // load base methods/properties
14
+ HybridObject::loadHybridMethods();
15
+ // load custom methods/properties
16
+ registerHybrids(this, [](Prototype& prototype) {
17
+ prototype.registerHybridGetter("uri", &HybridChartWebviewSpec::getUri);
18
+ prototype.registerHybridSetter("uri", &HybridChartWebviewSpec::setUri);
19
+ prototype.registerHybridGetter("localBundle", &HybridChartWebviewSpec::getLocalBundle);
20
+ prototype.registerHybridSetter("localBundle", &HybridChartWebviewSpec::setLocalBundle);
21
+ prototype.registerHybridGetter("entry", &HybridChartWebviewSpec::getEntry);
22
+ prototype.registerHybridSetter("entry", &HybridChartWebviewSpec::setEntry);
23
+ prototype.registerHybridGetter("paramsJson", &HybridChartWebviewSpec::getParamsJson);
24
+ prototype.registerHybridSetter("paramsJson", &HybridChartWebviewSpec::setParamsJson);
25
+ prototype.registerHybridGetter("bridgeScript", &HybridChartWebviewSpec::getBridgeScript);
26
+ prototype.registerHybridSetter("bridgeScript", &HybridChartWebviewSpec::setBridgeScript);
27
+ prototype.registerHybridGetter("reuseKey", &HybridChartWebviewSpec::getReuseKey);
28
+ prototype.registerHybridSetter("reuseKey", &HybridChartWebviewSpec::setReuseKey);
29
+ prototype.registerHybridGetter("pooled", &HybridChartWebviewSpec::getPooled);
30
+ prototype.registerHybridSetter("pooled", &HybridChartWebviewSpec::setPooled);
31
+ prototype.registerHybridGetter("active", &HybridChartWebviewSpec::getActive);
32
+ prototype.registerHybridSetter("active", &HybridChartWebviewSpec::setActive);
33
+ prototype.registerHybridGetter("onMessage", &HybridChartWebviewSpec::getOnMessage);
34
+ prototype.registerHybridSetter("onMessage", &HybridChartWebviewSpec::setOnMessage);
35
+ prototype.registerHybridGetter("onLoadEnd", &HybridChartWebviewSpec::getOnLoadEnd);
36
+ prototype.registerHybridSetter("onLoadEnd", &HybridChartWebviewSpec::setOnLoadEnd);
37
+ prototype.registerHybridGetter("onError", &HybridChartWebviewSpec::getOnError);
38
+ prototype.registerHybridSetter("onError", &HybridChartWebviewSpec::setOnError);
39
+ prototype.registerHybridMethod("postMessage", &HybridChartWebviewSpec::postMessage);
40
+ prototype.registerHybridMethod("reload", &HybridChartWebviewSpec::reload);
41
+ prototype.registerHybridMethod("clearSnapshot", &HybridChartWebviewSpec::clearSnapshot);
42
+ });
43
+ }
44
+
45
+ } // namespace margelo::nitro::chartwebview
@@ -0,0 +1,87 @@
1
+ ///
2
+ /// HybridChartWebviewSpec.hpp
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
+ #pragma once
9
+
10
+ #if __has_include(<NitroModules/HybridObject.hpp>)
11
+ #include <NitroModules/HybridObject.hpp>
12
+ #else
13
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
14
+ #endif
15
+
16
+
17
+
18
+ #include <string>
19
+ #include <optional>
20
+ #include <functional>
21
+
22
+ namespace margelo::nitro::chartwebview {
23
+
24
+ using namespace margelo::nitro;
25
+
26
+ /**
27
+ * An abstract base class for `ChartWebview`
28
+ * Inherit this class to create instances of `HybridChartWebviewSpec` in C++.
29
+ * You must explicitly call `HybridObject`'s constructor yourself, because it is virtual.
30
+ * @example
31
+ * ```cpp
32
+ * class HybridChartWebview: public HybridChartWebviewSpec {
33
+ * public:
34
+ * HybridChartWebview(...): HybridObject(TAG) { ... }
35
+ * // ...
36
+ * };
37
+ * ```
38
+ */
39
+ class HybridChartWebviewSpec: public virtual HybridObject {
40
+ public:
41
+ // Constructor
42
+ explicit HybridChartWebviewSpec(): HybridObject(TAG) { }
43
+
44
+ // Destructor
45
+ ~HybridChartWebviewSpec() override = default;
46
+
47
+ public:
48
+ // Properties
49
+ virtual std::optional<std::string> getUri() = 0;
50
+ virtual void setUri(const std::optional<std::string>& uri) = 0;
51
+ virtual std::optional<std::string> getLocalBundle() = 0;
52
+ virtual void setLocalBundle(const std::optional<std::string>& localBundle) = 0;
53
+ virtual std::optional<std::string> getEntry() = 0;
54
+ virtual void setEntry(const std::optional<std::string>& entry) = 0;
55
+ virtual std::optional<std::string> getParamsJson() = 0;
56
+ virtual void setParamsJson(const std::optional<std::string>& paramsJson) = 0;
57
+ virtual std::optional<std::string> getBridgeScript() = 0;
58
+ virtual void setBridgeScript(const std::optional<std::string>& bridgeScript) = 0;
59
+ virtual std::optional<std::string> getReuseKey() = 0;
60
+ virtual void setReuseKey(const std::optional<std::string>& reuseKey) = 0;
61
+ virtual std::optional<bool> getPooled() = 0;
62
+ virtual void setPooled(std::optional<bool> pooled) = 0;
63
+ virtual std::optional<bool> getActive() = 0;
64
+ virtual void setActive(std::optional<bool> active) = 0;
65
+ virtual std::optional<std::function<void(const std::string& /* message */)>> getOnMessage() = 0;
66
+ virtual void setOnMessage(const std::optional<std::function<void(const std::string& /* message */)>>& onMessage) = 0;
67
+ virtual std::optional<std::function<void()>> getOnLoadEnd() = 0;
68
+ virtual void setOnLoadEnd(const std::optional<std::function<void()>>& onLoadEnd) = 0;
69
+ virtual std::optional<std::function<void(const std::string& /* message */)>> getOnError() = 0;
70
+ virtual void setOnError(const std::optional<std::function<void(const std::string& /* message */)>>& onError) = 0;
71
+
72
+ public:
73
+ // Methods
74
+ virtual void postMessage(const std::string& message) = 0;
75
+ virtual void reload() = 0;
76
+ virtual void clearSnapshot() = 0;
77
+
78
+ protected:
79
+ // Hybrid Setup
80
+ void loadHybridMethods() override;
81
+
82
+ protected:
83
+ // Tag for logging
84
+ static constexpr auto TAG = "ChartWebview";
85
+ };
86
+
87
+ } // namespace margelo::nitro::chartwebview