@onekeyfe/react-native-get-random-values 3.0.81 → 3.0.82

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 (21) hide show
  1. package/nitrogen/generated/android/c++/JHybridReactNativeGetRandomValuesSpec.cpp +21 -20
  2. package/nitrogen/generated/android/c++/JHybridReactNativeGetRandomValuesSpec.hpp +20 -22
  3. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativegetrandomvalues/HybridReactNativeGetRandomValuesSpec.kt +15 -18
  4. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativegetrandomvalues/reactnativegetrandomvaluesOnLoad.kt +1 -1
  5. package/nitrogen/generated/android/reactnativegetrandomvalues+autolinking.cmake +1 -1
  6. package/nitrogen/generated/android/reactnativegetrandomvalues+autolinking.gradle +1 -1
  7. package/nitrogen/generated/android/reactnativegetrandomvaluesOnLoad.cpp +27 -17
  8. package/nitrogen/generated/android/reactnativegetrandomvaluesOnLoad.hpp +14 -5
  9. package/nitrogen/generated/ios/ReactNativeGetRandomValues+autolinking.rb +2 -2
  10. package/nitrogen/generated/ios/ReactNativeGetRandomValues-Swift-Cxx-Bridge.cpp +1 -1
  11. package/nitrogen/generated/ios/ReactNativeGetRandomValues-Swift-Cxx-Bridge.hpp +1 -1
  12. package/nitrogen/generated/ios/ReactNativeGetRandomValues-Swift-Cxx-Umbrella.hpp +1 -1
  13. package/nitrogen/generated/ios/ReactNativeGetRandomValuesAutolinking.mm +1 -1
  14. package/nitrogen/generated/ios/ReactNativeGetRandomValuesAutolinking.swift +9 -8
  15. package/nitrogen/generated/ios/c++/HybridReactNativeGetRandomValuesSpecSwift.cpp +1 -1
  16. package/nitrogen/generated/ios/c++/HybridReactNativeGetRandomValuesSpecSwift.hpp +7 -1
  17. package/nitrogen/generated/ios/swift/HybridReactNativeGetRandomValuesSpec.swift +3 -4
  18. package/nitrogen/generated/ios/swift/HybridReactNativeGetRandomValuesSpec_cxx.swift +9 -2
  19. package/nitrogen/generated/shared/c++/HybridReactNativeGetRandomValuesSpec.cpp +1 -1
  20. package/nitrogen/generated/shared/c++/HybridReactNativeGetRandomValuesSpec.hpp +1 -1
  21. package/package.json +4 -4
@@ -2,7 +2,7 @@
2
2
  /// JHybridReactNativeGetRandomValuesSpec.cpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #include "JHybridReactNativeGetRandomValuesSpec.hpp"
@@ -13,30 +13,31 @@
13
13
 
14
14
  namespace margelo::nitro::reactnativegetrandomvalues {
15
15
 
16
- jni::local_ref<JHybridReactNativeGetRandomValuesSpec::jhybriddata> JHybridReactNativeGetRandomValuesSpec::initHybrid(jni::alias_ref<jhybridobject> jThis) {
17
- return makeCxxInstance(jThis);
18
- }
19
-
20
- void JHybridReactNativeGetRandomValuesSpec::registerNatives() {
21
- registerHybrid({
22
- makeNativeMethod("initHybrid", JHybridReactNativeGetRandomValuesSpec::initHybrid),
23
- });
16
+ std::shared_ptr<JHybridReactNativeGetRandomValuesSpec> JHybridReactNativeGetRandomValuesSpec::JavaPart::getJHybridReactNativeGetRandomValuesSpec() {
17
+ auto hybridObject = JHybridObject::JavaPart::getJHybridObject();
18
+ auto castHybridObject = std::dynamic_pointer_cast<JHybridReactNativeGetRandomValuesSpec>(hybridObject);
19
+ if (castHybridObject == nullptr) [[unlikely]] {
20
+ throw std::runtime_error("Failed to downcast JHybridObject to JHybridReactNativeGetRandomValuesSpec!");
21
+ }
22
+ return castHybridObject;
24
23
  }
25
24
 
26
- size_t JHybridReactNativeGetRandomValuesSpec::getExternalMemorySize() noexcept {
27
- static const auto method = javaClassStatic()->getMethod<jlong()>("getMemorySize");
28
- return method(_javaPart);
25
+ jni::local_ref<JHybridReactNativeGetRandomValuesSpec::CxxPart::jhybriddata> JHybridReactNativeGetRandomValuesSpec::CxxPart::initHybrid(jni::alias_ref<jhybridobject> jThis) {
26
+ return makeCxxInstance(jThis);
29
27
  }
30
28
 
31
- void JHybridReactNativeGetRandomValuesSpec::dispose() noexcept {
32
- static const auto method = javaClassStatic()->getMethod<void()>("dispose");
33
- method(_javaPart);
29
+ std::shared_ptr<JHybridObject> JHybridReactNativeGetRandomValuesSpec::CxxPart::createHybridObject(const jni::local_ref<JHybridObject::JavaPart>& javaPart) {
30
+ auto castJavaPart = jni::dynamic_ref_cast<JHybridReactNativeGetRandomValuesSpec::JavaPart>(javaPart);
31
+ if (castJavaPart == nullptr) [[unlikely]] {
32
+ throw std::runtime_error("Failed to cast JHybridObject::JavaPart to JHybridReactNativeGetRandomValuesSpec::JavaPart!");
33
+ }
34
+ return std::make_shared<JHybridReactNativeGetRandomValuesSpec>(castJavaPart);
34
35
  }
35
36
 
36
- std::string JHybridReactNativeGetRandomValuesSpec::toString() {
37
- static const auto method = javaClassStatic()->getMethod<jni::JString()>("toString");
38
- auto javaString = method(_javaPart);
39
- return javaString->toStdString();
37
+ void JHybridReactNativeGetRandomValuesSpec::CxxPart::registerNatives() {
38
+ registerHybrid({
39
+ makeNativeMethod("initHybrid", JHybridReactNativeGetRandomValuesSpec::CxxPart::initHybrid),
40
+ });
40
41
  }
41
42
 
42
43
  // Properties
@@ -44,7 +45,7 @@ namespace margelo::nitro::reactnativegetrandomvalues {
44
45
 
45
46
  // Methods
46
47
  std::string JHybridReactNativeGetRandomValuesSpec::getRandomBase64(double byteLength) {
47
- static const auto method = javaClassStatic()->getMethod<jni::local_ref<jni::JString>(double /* byteLength */)>("getRandomBase64");
48
+ static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<jni::JString>(double /* byteLength */)>("getRandomBase64");
48
49
  auto __result = method(_javaPart, byteLength);
49
50
  return __result->toStdString();
50
51
  }
@@ -2,7 +2,7 @@
2
2
  /// HybridReactNativeGetRandomValuesSpec.hpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #pragma once
@@ -18,33 +18,33 @@ namespace margelo::nitro::reactnativegetrandomvalues {
18
18
 
19
19
  using namespace facebook;
20
20
 
21
- class JHybridReactNativeGetRandomValuesSpec: public jni::HybridClass<JHybridReactNativeGetRandomValuesSpec, JHybridObject>,
22
- public virtual HybridReactNativeGetRandomValuesSpec {
21
+ class JHybridReactNativeGetRandomValuesSpec: public virtual HybridReactNativeGetRandomValuesSpec, public virtual JHybridObject {
23
22
  public:
24
- static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/reactnativegetrandomvalues/HybridReactNativeGetRandomValuesSpec;";
25
- static jni::local_ref<jhybriddata> initHybrid(jni::alias_ref<jhybridobject> jThis);
26
- static void registerNatives();
27
-
28
- protected:
29
- // C++ constructor (called from Java via `initHybrid()`)
30
- explicit JHybridReactNativeGetRandomValuesSpec(jni::alias_ref<jhybridobject> jThis) :
31
- HybridObject(HybridReactNativeGetRandomValuesSpec::TAG),
32
- HybridBase(jThis),
33
- _javaPart(jni::make_global(jThis)) {}
23
+ struct JavaPart: public jni::JavaClass<JavaPart, JHybridObject::JavaPart> {
24
+ static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/reactnativegetrandomvalues/HybridReactNativeGetRandomValuesSpec;";
25
+ std::shared_ptr<JHybridReactNativeGetRandomValuesSpec> getJHybridReactNativeGetRandomValuesSpec();
26
+ };
27
+ struct CxxPart: public jni::HybridClass<CxxPart, JHybridObject::CxxPart> {
28
+ static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/reactnativegetrandomvalues/HybridReactNativeGetRandomValuesSpec$CxxPart;";
29
+ static jni::local_ref<jhybriddata> initHybrid(jni::alias_ref<jhybridobject> jThis);
30
+ static void registerNatives();
31
+ using HybridBase::HybridBase;
32
+ protected:
33
+ std::shared_ptr<JHybridObject> createHybridObject(const jni::local_ref<JHybridObject::JavaPart>& javaPart) override;
34
+ };
34
35
 
35
36
  public:
37
+ explicit JHybridReactNativeGetRandomValuesSpec(const jni::local_ref<JHybridReactNativeGetRandomValuesSpec::JavaPart>& javaPart):
38
+ HybridObject(HybridReactNativeGetRandomValuesSpec::TAG),
39
+ JHybridObject(javaPart),
40
+ _javaPart(jni::make_global(javaPart)) {}
36
41
  ~JHybridReactNativeGetRandomValuesSpec() override {
37
42
  // Hermes GC can destroy JS objects on a non-JNI Thread.
38
43
  jni::ThreadScope::WithClassLoader([&] { _javaPart.reset(); });
39
44
  }
40
45
 
41
46
  public:
42
- size_t getExternalMemorySize() noexcept override;
43
- void dispose() noexcept override;
44
- std::string toString() override;
45
-
46
- public:
47
- inline const jni::global_ref<JHybridReactNativeGetRandomValuesSpec::javaobject>& getJavaPart() const noexcept {
47
+ inline const jni::global_ref<JHybridReactNativeGetRandomValuesSpec::JavaPart>& getJavaPart() const noexcept {
48
48
  return _javaPart;
49
49
  }
50
50
 
@@ -57,9 +57,7 @@ namespace margelo::nitro::reactnativegetrandomvalues {
57
57
  std::string getRandomBase64(double byteLength) override;
58
58
 
59
59
  private:
60
- friend HybridBase;
61
- using HybridBase::HybridBase;
62
- jni::global_ref<JHybridReactNativeGetRandomValuesSpec::javaobject> _javaPart;
60
+ jni::global_ref<JHybridReactNativeGetRandomValuesSpec::JavaPart> _javaPart;
63
61
  };
64
62
 
65
63
  } // namespace margelo::nitro::reactnativegetrandomvalues
@@ -2,7 +2,7 @@
2
2
  /// HybridReactNativeGetRandomValuesSpec.kt
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  package com.margelo.nitro.reactnativegetrandomvalues
@@ -24,32 +24,29 @@ import com.margelo.nitro.core.HybridObject
24
24
  "LocalVariableName", "PropertyName", "PrivatePropertyName", "FunctionName"
25
25
  )
26
26
  abstract class HybridReactNativeGetRandomValuesSpec: HybridObject() {
27
- @DoNotStrip
28
- private var mHybridData: HybridData = initHybrid()
29
-
30
- init {
31
- super.updateNative(mHybridData)
32
- }
27
+ // Properties
28
+
33
29
 
34
- override fun updateNative(hybridData: HybridData) {
35
- mHybridData = hybridData
36
- super.updateNative(hybridData)
37
- }
30
+ // Methods
31
+ @DoNotStrip
32
+ @Keep
33
+ abstract fun getRandomBase64(byteLength: Double): String
38
34
 
39
35
  // Default implementation of `HybridObject.toString()`
40
36
  override fun toString(): String {
41
37
  return "[HybridObject ReactNativeGetRandomValues]"
42
38
  }
43
39
 
44
- // Properties
45
-
46
-
47
- // Methods
40
+ // C++ backing class
48
41
  @DoNotStrip
49
42
  @Keep
50
- abstract fun getRandomBase64(byteLength: Double): String
51
-
52
- private external fun initHybrid(): HybridData
43
+ protected open class CxxPart(javaPart: HybridReactNativeGetRandomValuesSpec): HybridObject.CxxPart(javaPart) {
44
+ // C++ JHybridReactNativeGetRandomValuesSpec::CxxPart::initHybrid(...)
45
+ external override fun initHybrid(): HybridData
46
+ }
47
+ override fun createCxxPart(): CxxPart {
48
+ return CxxPart(this)
49
+ }
53
50
 
54
51
  companion object {
55
52
  protected const val TAG = "HybridReactNativeGetRandomValuesSpec"
@@ -2,7 +2,7 @@
2
2
  /// reactnativegetrandomvaluesOnLoad.kt
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  package com.margelo.nitro.reactnativegetrandomvalues
@@ -2,7 +2,7 @@
2
2
  # reactnativegetrandomvalues+autolinking.cmake
3
3
  # This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  # https://github.com/mrousavy/nitro
5
- # Copyright © 2026 Marc Rousavy @ Margelo
5
+ # Copyright © Marc Rousavy @ Margelo
6
6
  #
7
7
 
8
8
  # This is a CMake file that adds all files generated by Nitrogen
@@ -2,7 +2,7 @@
2
2
  /// reactnativegetrandomvalues+autolinking.gradle
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  /// This is a Gradle file that adds all files generated by Nitrogen
@@ -2,7 +2,7 @@
2
2
  /// reactnativegetrandomvaluesOnLoad.cpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #ifndef BUILDING_REACTNATIVEGETRANDOMVALUES_WITH_GENERATED_CMAKE_PROJECT
@@ -21,24 +21,34 @@
21
21
  namespace margelo::nitro::reactnativegetrandomvalues {
22
22
 
23
23
  int initialize(JavaVM* vm) {
24
+ return facebook::jni::initialize(vm, []() {
25
+ ::margelo::nitro::reactnativegetrandomvalues::registerAllNatives();
26
+ });
27
+ }
28
+
29
+ struct JHybridReactNativeGetRandomValuesSpecImpl: public jni::JavaClass<JHybridReactNativeGetRandomValuesSpecImpl, JHybridReactNativeGetRandomValuesSpec::JavaPart> {
30
+ static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/reactnativegetrandomvalues/ReactNativeGetRandomValues;";
31
+ static std::shared_ptr<JHybridReactNativeGetRandomValuesSpec> create() {
32
+ static const auto constructorFn = javaClassStatic()->getConstructor<JHybridReactNativeGetRandomValuesSpecImpl::javaobject()>();
33
+ jni::local_ref<JHybridReactNativeGetRandomValuesSpec::JavaPart> javaPart = javaClassStatic()->newObject(constructorFn);
34
+ return javaPart->getJHybridReactNativeGetRandomValuesSpec();
35
+ }
36
+ };
37
+
38
+ void registerAllNatives() {
24
39
  using namespace margelo::nitro;
25
40
  using namespace margelo::nitro::reactnativegetrandomvalues;
26
- using namespace facebook;
27
-
28
- return facebook::jni::initialize(vm, [] {
29
- // Register native JNI methods
30
- margelo::nitro::reactnativegetrandomvalues::JHybridReactNativeGetRandomValuesSpec::registerNatives();
31
-
32
- // Register Nitro Hybrid Objects
33
- HybridObjectRegistry::registerHybridObjectConstructor(
34
- "ReactNativeGetRandomValues",
35
- []() -> std::shared_ptr<HybridObject> {
36
- static DefaultConstructableObject<JHybridReactNativeGetRandomValuesSpec::javaobject> object("com/margelo/nitro/reactnativegetrandomvalues/ReactNativeGetRandomValues");
37
- auto instance = object.create();
38
- return instance->cthis()->shared();
39
- }
40
- );
41
- });
41
+
42
+ // Register native JNI methods
43
+ margelo::nitro::reactnativegetrandomvalues::JHybridReactNativeGetRandomValuesSpec::CxxPart::registerNatives();
44
+
45
+ // Register Nitro Hybrid Objects
46
+ HybridObjectRegistry::registerHybridObjectConstructor(
47
+ "ReactNativeGetRandomValues",
48
+ []() -> std::shared_ptr<HybridObject> {
49
+ return JHybridReactNativeGetRandomValuesSpecImpl::create();
50
+ }
51
+ );
42
52
  }
43
53
 
44
54
  } // namespace margelo::nitro::reactnativegetrandomvalues
@@ -2,24 +2,33 @@
2
2
  /// reactnativegetrandomvaluesOnLoad.hpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #include <jni.h>
9
+ #include <functional>
9
10
  #include <NitroModules/NitroDefines.hpp>
10
11
 
11
12
  namespace margelo::nitro::reactnativegetrandomvalues {
12
13
 
14
+ [[deprecated("Use registerNatives() instead.")]]
15
+ int initialize(JavaVM* vm);
16
+
13
17
  /**
14
- * Initializes the native (C++) part of reactnativegetrandomvalues, and autolinks all Hybrid Objects.
15
- * Call this in your `JNI_OnLoad` function (probably inside `cpp-adapter.cpp`).
18
+ * Register the native (C++) part of reactnativegetrandomvalues, and autolinks all Hybrid Objects.
19
+ * Call this in your `JNI_OnLoad` function (probably inside `cpp-adapter.cpp`),
20
+ * inside a `facebook::jni::initialize(vm, ...)` call.
16
21
  * Example:
17
22
  * ```cpp (cpp-adapter.cpp)
18
23
  * JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void*) {
19
- * return margelo::nitro::reactnativegetrandomvalues::initialize(vm);
24
+ * return facebook::jni::initialize(vm, []() {
25
+ * // register all reactnativegetrandomvalues HybridObjects
26
+ * margelo::nitro::reactnativegetrandomvalues::registerNatives();
27
+ * // any other custom registrations go here.
28
+ * });
20
29
  * }
21
30
  * ```
22
31
  */
23
- int initialize(JavaVM* vm);
32
+ void registerAllNatives();
24
33
 
25
34
  } // namespace margelo::nitro::reactnativegetrandomvalues
@@ -2,7 +2,7 @@
2
2
  # ReactNativeGetRandomValues+autolinking.rb
3
3
  # This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  # https://github.com/mrousavy/nitro
5
- # Copyright © 2026 Marc Rousavy @ Margelo
5
+ # Copyright © Marc Rousavy @ Margelo
6
6
  #
7
7
 
8
8
  # This is a Ruby script that adds all files generated by Nitrogen
@@ -52,7 +52,7 @@ def add_nitrogen_files(spec)
52
52
  spec.pod_target_xcconfig = current_pod_target_xcconfig.merge({
53
53
  # Use C++ 20
54
54
  "CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
55
- # Enables C++ <-> Swift interop (by default it's only C)
55
+ # Enables C++ <-> Swift interop (by default it's only ObjC)
56
56
  "SWIFT_OBJC_INTEROP_MODE" => "objcxx",
57
57
  # Enables stricter modular headers
58
58
  "DEFINES_MODULE" => "YES",
@@ -2,7 +2,7 @@
2
2
  /// ReactNativeGetRandomValues-Swift-Cxx-Bridge.cpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #include "ReactNativeGetRandomValues-Swift-Cxx-Bridge.hpp"
@@ -2,7 +2,7 @@
2
2
  /// ReactNativeGetRandomValues-Swift-Cxx-Bridge.hpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #pragma once
@@ -2,7 +2,7 @@
2
2
  /// ReactNativeGetRandomValues-Swift-Cxx-Umbrella.hpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #pragma once
@@ -2,7 +2,7 @@
2
2
  /// ReactNativeGetRandomValuesAutolinking.mm
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #import <Foundation/Foundation.h>
@@ -2,19 +2,16 @@
2
2
  /// ReactNativeGetRandomValuesAutolinking.swift
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
+ import NitroModules
9
+
10
+ // TODO: Use empty enums once Swift supports exporting them as namespaces
11
+ // See: https://github.com/swiftlang/swift/pull/83616
8
12
  public final class ReactNativeGetRandomValuesAutolinking {
9
13
  public typealias bridge = margelo.nitro.reactnativegetrandomvalues.bridge.swift
10
14
 
11
- /**
12
- * Creates an instance of a Swift class that implements `HybridReactNativeGetRandomValuesSpec`,
13
- * and wraps it in a Swift class that can directly interop with C++ (`HybridReactNativeGetRandomValuesSpec_cxx`)
14
- *
15
- * This is generated by Nitrogen and will initialize the class specified
16
- * in the `"autolinking"` property of `nitro.json` (in this case, `ReactNativeGetRandomValues`).
17
- */
18
15
  public static func createReactNativeGetRandomValues() -> bridge.std__shared_ptr_HybridReactNativeGetRandomValuesSpec_ {
19
16
  let hybridObject = ReactNativeGetRandomValues()
20
17
  return { () -> bridge.std__shared_ptr_HybridReactNativeGetRandomValuesSpec_ in
@@ -22,4 +19,8 @@ public final class ReactNativeGetRandomValuesAutolinking {
22
19
  return __cxxWrapped.getCxxPart()
23
20
  }()
24
21
  }
22
+
23
+ public static func isReactNativeGetRandomValuesRecyclable() -> Bool {
24
+ return ReactNativeGetRandomValues.self is any RecyclableView.Type
25
+ }
25
26
  }
@@ -2,7 +2,7 @@
2
2
  /// HybridReactNativeGetRandomValuesSpecSwift.cpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #include "HybridReactNativeGetRandomValuesSpecSwift.hpp"
@@ -2,7 +2,7 @@
2
2
  /// HybridReactNativeGetRandomValuesSpecSwift.hpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #pragma once
@@ -47,6 +47,12 @@ namespace margelo::nitro::reactnativegetrandomvalues {
47
47
  inline size_t getExternalMemorySize() noexcept override {
48
48
  return _swiftPart.getMemorySize();
49
49
  }
50
+ bool equals(const std::shared_ptr<HybridObject>& other) override {
51
+ if (auto otherCast = std::dynamic_pointer_cast<HybridReactNativeGetRandomValuesSpecSwift>(other)) {
52
+ return _swiftPart.equals(otherCast->_swiftPart);
53
+ }
54
+ return false;
55
+ }
50
56
  void dispose() noexcept override {
51
57
  _swiftPart.dispose();
52
58
  }
@@ -2,10 +2,9 @@
2
2
  /// HybridReactNativeGetRandomValuesSpec.swift
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
- import Foundation
9
8
  import NitroModules
10
9
 
11
10
  /// See ``HybridReactNativeGetRandomValuesSpec``
@@ -30,14 +29,14 @@ open class HybridReactNativeGetRandomValuesSpec_base {
30
29
  public init() { }
31
30
  public func getCxxWrapper() -> HybridReactNativeGetRandomValuesSpec_cxx {
32
31
  #if DEBUG
33
- guard self is HybridReactNativeGetRandomValuesSpec else {
32
+ guard self is any HybridReactNativeGetRandomValuesSpec else {
34
33
  fatalError("`self` is not a `HybridReactNativeGetRandomValuesSpec`! Did you accidentally inherit from `HybridReactNativeGetRandomValuesSpec_base` instead of `HybridReactNativeGetRandomValuesSpec`?")
35
34
  }
36
35
  #endif
37
36
  if let cxxWrapper = self.cxxWrapper {
38
37
  return cxxWrapper
39
38
  } else {
40
- let cxxWrapper = HybridReactNativeGetRandomValuesSpec_cxx(self as! HybridReactNativeGetRandomValuesSpec)
39
+ let cxxWrapper = HybridReactNativeGetRandomValuesSpec_cxx(self as! any HybridReactNativeGetRandomValuesSpec)
41
40
  self.cxxWrapper = cxxWrapper
42
41
  return cxxWrapper
43
42
  }
@@ -2,10 +2,9 @@
2
2
  /// HybridReactNativeGetRandomValuesSpec_cxx.swift
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
- import Foundation
9
8
  import NitroModules
10
9
 
11
10
  /**
@@ -96,6 +95,14 @@ open class HybridReactNativeGetRandomValuesSpec_cxx {
96
95
  return MemoryHelper.getSizeOf(self.__implementation) + self.__implementation.memorySize
97
96
  }
98
97
 
98
+ /**
99
+ * Compares this object with the given [other] object for reference equality.
100
+ */
101
+ @inline(__always)
102
+ public func equals(other: HybridReactNativeGetRandomValuesSpec_cxx) -> Bool {
103
+ return self.__implementation === other.__implementation
104
+ }
105
+
99
106
  /**
100
107
  * Call dispose() on the Swift class.
101
108
  * This _may_ be called manually from JS.
@@ -2,7 +2,7 @@
2
2
  /// HybridReactNativeGetRandomValuesSpec.cpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #include "HybridReactNativeGetRandomValuesSpec.hpp"
@@ -2,7 +2,7 @@
2
2
  /// HybridReactNativeGetRandomValuesSpec.hpp
3
3
  /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
4
  /// https://github.com/mrousavy/nitro
5
- /// Copyright © 2026 Marc Rousavy @ Margelo
5
+ /// Copyright © Marc Rousavy @ Margelo
6
6
  ///
7
7
 
8
8
  #pragma once
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onekeyfe/react-native-get-random-values",
3
- "version": "3.0.81",
3
+ "version": "3.0.82",
4
4
  "description": "react-native-get-random-values",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",
@@ -78,12 +78,12 @@
78
78
  "eslint-plugin-prettier": "^5.5.4",
79
79
  "jest": "^29.7.0",
80
80
  "lefthook": "^2.0.3",
81
- "nitrogen": "0.31.10",
81
+ "nitrogen": "0.35.2",
82
82
  "prettier": "^2.8.8",
83
83
  "react": "19.2.0",
84
84
  "react-native": "patch:react-native@npm%3A0.83.0#~/.yarn/patches/react-native-npm-0.83.0-577d0f2d83.patch",
85
85
  "react-native-builder-bob": "^0.40.13",
86
- "react-native-nitro-modules": "0.33.2",
86
+ "react-native-nitro-modules": "0.35.2",
87
87
  "release-it": "^19.0.4",
88
88
  "turbo": "^2.5.6",
89
89
  "typescript": "^5.9.2"
@@ -91,7 +91,7 @@
91
91
  "peerDependencies": {
92
92
  "react": "*",
93
93
  "react-native": "*",
94
- "react-native-nitro-modules": "0.33.2"
94
+ "react-native-nitro-modules": "0.35.2"
95
95
  },
96
96
  "react-native-builder-bob": {
97
97
  "source": "src",