@onekeyfe/react-native-splash-screen 1.1.21

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 (51) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +36 -0
  3. package/ReactNativeSplashScreen.podspec +30 -0
  4. package/android/CMakeLists.txt +24 -0
  5. package/android/build.gradle +130 -0
  6. package/android/gradle.properties +4 -0
  7. package/android/src/main/AndroidManifest.xml +1 -0
  8. package/android/src/main/cpp/cpp-adapter.cpp +6 -0
  9. package/android/src/main/java/com/margelo/nitro/reactnativesplashscreen/ReactNativeSplashScreen.kt +77 -0
  10. package/android/src/main/java/com/margelo/nitro/reactnativesplashscreen/ReactNativeSplashScreenPackage.kt +24 -0
  11. package/android/src/main/java/com/margelo/nitro/reactnativesplashscreen/SplashImageResizeMode.kt +23 -0
  12. package/android/src/main/java/com/margelo/nitro/reactnativesplashscreen/SplashScreenBridge.kt +108 -0
  13. package/android/src/main/java/com/margelo/nitro/reactnativesplashscreen/SplashScreenView.kt +34 -0
  14. package/android/src/main/java/com/margelo/nitro/reactnativesplashscreen/SplashViewController.kt +117 -0
  15. package/ios/ReactNativeSplashScreen.swift +15 -0
  16. package/lib/module/ReactNativeSplashScreen.nitro.js +4 -0
  17. package/lib/module/ReactNativeSplashScreen.nitro.js.map +1 -0
  18. package/lib/module/index.js +6 -0
  19. package/lib/module/index.js.map +1 -0
  20. package/lib/module/package.json +1 -0
  21. package/lib/typescript/package.json +1 -0
  22. package/lib/typescript/src/ReactNativeSplashScreen.nitro.d.ts +9 -0
  23. package/lib/typescript/src/ReactNativeSplashScreen.nitro.d.ts.map +1 -0
  24. package/lib/typescript/src/index.d.ts +4 -0
  25. package/lib/typescript/src/index.d.ts.map +1 -0
  26. package/nitro.json +17 -0
  27. package/nitrogen/generated/android/c++/JHybridReactNativeSplashScreenSpec.cpp +80 -0
  28. package/nitrogen/generated/android/c++/JHybridReactNativeSplashScreenSpec.hpp +66 -0
  29. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativesplashscreen/HybridReactNativeSplashScreenSpec.kt +62 -0
  30. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativesplashscreen/reactnativesplashscreenOnLoad.kt +35 -0
  31. package/nitrogen/generated/android/reactnativesplashscreen+autolinking.cmake +81 -0
  32. package/nitrogen/generated/android/reactnativesplashscreen+autolinking.gradle +27 -0
  33. package/nitrogen/generated/android/reactnativesplashscreenOnLoad.cpp +44 -0
  34. package/nitrogen/generated/android/reactnativesplashscreenOnLoad.hpp +25 -0
  35. package/nitrogen/generated/ios/ReactNativeSplashScreen+autolinking.rb +60 -0
  36. package/nitrogen/generated/ios/ReactNativeSplashScreen-Swift-Cxx-Bridge.cpp +49 -0
  37. package/nitrogen/generated/ios/ReactNativeSplashScreen-Swift-Cxx-Bridge.hpp +110 -0
  38. package/nitrogen/generated/ios/ReactNativeSplashScreen-Swift-Cxx-Umbrella.hpp +44 -0
  39. package/nitrogen/generated/ios/ReactNativeSplashScreenAutolinking.mm +33 -0
  40. package/nitrogen/generated/ios/ReactNativeSplashScreenAutolinking.swift +25 -0
  41. package/nitrogen/generated/ios/c++/HybridReactNativeSplashScreenSpecSwift.cpp +11 -0
  42. package/nitrogen/generated/ios/c++/HybridReactNativeSplashScreenSpecSwift.hpp +84 -0
  43. package/nitrogen/generated/ios/swift/Func_void_bool.swift +47 -0
  44. package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +47 -0
  45. package/nitrogen/generated/ios/swift/HybridReactNativeSplashScreenSpec.swift +57 -0
  46. package/nitrogen/generated/ios/swift/HybridReactNativeSplashScreenSpec_cxx.swift +157 -0
  47. package/nitrogen/generated/shared/c++/HybridReactNativeSplashScreenSpec.cpp +22 -0
  48. package/nitrogen/generated/shared/c++/HybridReactNativeSplashScreenSpec.hpp +63 -0
  49. package/package.json +169 -0
  50. package/src/ReactNativeSplashScreen.nitro.ts +7 -0
  51. package/src/index.tsx +8 -0
@@ -0,0 +1,110 @@
1
+ ///
2
+ /// ReactNativeSplashScreen-Swift-Cxx-Bridge.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
+ // Forward declarations of C++ defined types
11
+ // Forward declaration of `HybridReactNativeSplashScreenSpec` to properly resolve imports.
12
+ namespace margelo::nitro::reactnativesplashscreen { class HybridReactNativeSplashScreenSpec; }
13
+
14
+ // Forward declarations of Swift defined types
15
+ // Forward declaration of `HybridReactNativeSplashScreenSpec_cxx` to properly resolve imports.
16
+ namespace ReactNativeSplashScreen { class HybridReactNativeSplashScreenSpec_cxx; }
17
+
18
+ // Include C++ defined types
19
+ #include "HybridReactNativeSplashScreenSpec.hpp"
20
+ #include <NitroModules/Promise.hpp>
21
+ #include <NitroModules/PromiseHolder.hpp>
22
+ #include <NitroModules/Result.hpp>
23
+ #include <exception>
24
+ #include <functional>
25
+ #include <memory>
26
+
27
+ /**
28
+ * Contains specialized versions of C++ templated types so they can be accessed from Swift,
29
+ * as well as helper functions to interact with those C++ types from Swift.
30
+ */
31
+ namespace margelo::nitro::reactnativesplashscreen::bridge::swift {
32
+
33
+ // pragma MARK: std::shared_ptr<Promise<bool>>
34
+ /**
35
+ * Specialized version of `std::shared_ptr<Promise<bool>>`.
36
+ */
37
+ using std__shared_ptr_Promise_bool__ = std::shared_ptr<Promise<bool>>;
38
+ inline std::shared_ptr<Promise<bool>> create_std__shared_ptr_Promise_bool__() noexcept {
39
+ return Promise<bool>::create();
40
+ }
41
+ inline PromiseHolder<bool> wrap_std__shared_ptr_Promise_bool__(std::shared_ptr<Promise<bool>> promise) noexcept {
42
+ return PromiseHolder<bool>(std::move(promise));
43
+ }
44
+
45
+ // pragma MARK: std::function<void(bool /* result */)>
46
+ /**
47
+ * Specialized version of `std::function<void(bool)>`.
48
+ */
49
+ using Func_void_bool = std::function<void(bool /* result */)>;
50
+ /**
51
+ * Wrapper class for a `std::function<void(bool / * result * /)>`, this can be used from Swift.
52
+ */
53
+ class Func_void_bool_Wrapper final {
54
+ public:
55
+ explicit Func_void_bool_Wrapper(std::function<void(bool /* result */)>&& func): _function(std::make_unique<std::function<void(bool /* result */)>>(std::move(func))) {}
56
+ inline void call(bool result) const noexcept {
57
+ _function->operator()(result);
58
+ }
59
+ private:
60
+ std::unique_ptr<std::function<void(bool /* result */)>> _function;
61
+ } SWIFT_NONCOPYABLE;
62
+ Func_void_bool create_Func_void_bool(void* NON_NULL swiftClosureWrapper) noexcept;
63
+ inline Func_void_bool_Wrapper wrap_Func_void_bool(Func_void_bool value) noexcept {
64
+ return Func_void_bool_Wrapper(std::move(value));
65
+ }
66
+
67
+ // pragma MARK: std::function<void(const std::exception_ptr& /* error */)>
68
+ /**
69
+ * Specialized version of `std::function<void(const std::exception_ptr&)>`.
70
+ */
71
+ using Func_void_std__exception_ptr = std::function<void(const std::exception_ptr& /* error */)>;
72
+ /**
73
+ * Wrapper class for a `std::function<void(const std::exception_ptr& / * error * /)>`, this can be used from Swift.
74
+ */
75
+ class Func_void_std__exception_ptr_Wrapper final {
76
+ public:
77
+ explicit Func_void_std__exception_ptr_Wrapper(std::function<void(const std::exception_ptr& /* error */)>&& func): _function(std::make_unique<std::function<void(const std::exception_ptr& /* error */)>>(std::move(func))) {}
78
+ inline void call(std::exception_ptr error) const noexcept {
79
+ _function->operator()(error);
80
+ }
81
+ private:
82
+ std::unique_ptr<std::function<void(const std::exception_ptr& /* error */)>> _function;
83
+ } SWIFT_NONCOPYABLE;
84
+ Func_void_std__exception_ptr create_Func_void_std__exception_ptr(void* NON_NULL swiftClosureWrapper) noexcept;
85
+ inline Func_void_std__exception_ptr_Wrapper wrap_Func_void_std__exception_ptr(Func_void_std__exception_ptr value) noexcept {
86
+ return Func_void_std__exception_ptr_Wrapper(std::move(value));
87
+ }
88
+
89
+ // pragma MARK: std::shared_ptr<HybridReactNativeSplashScreenSpec>
90
+ /**
91
+ * Specialized version of `std::shared_ptr<HybridReactNativeSplashScreenSpec>`.
92
+ */
93
+ using std__shared_ptr_HybridReactNativeSplashScreenSpec_ = std::shared_ptr<HybridReactNativeSplashScreenSpec>;
94
+ std::shared_ptr<HybridReactNativeSplashScreenSpec> create_std__shared_ptr_HybridReactNativeSplashScreenSpec_(void* NON_NULL swiftUnsafePointer) noexcept;
95
+ void* NON_NULL get_std__shared_ptr_HybridReactNativeSplashScreenSpec_(std__shared_ptr_HybridReactNativeSplashScreenSpec_ cppType);
96
+
97
+ // pragma MARK: std::weak_ptr<HybridReactNativeSplashScreenSpec>
98
+ using std__weak_ptr_HybridReactNativeSplashScreenSpec_ = std::weak_ptr<HybridReactNativeSplashScreenSpec>;
99
+ inline std__weak_ptr_HybridReactNativeSplashScreenSpec_ weakify_std__shared_ptr_HybridReactNativeSplashScreenSpec_(const std::shared_ptr<HybridReactNativeSplashScreenSpec>& strong) noexcept { return strong; }
100
+
101
+ // pragma MARK: Result<std::shared_ptr<Promise<bool>>>
102
+ using Result_std__shared_ptr_Promise_bool___ = Result<std::shared_ptr<Promise<bool>>>;
103
+ inline Result_std__shared_ptr_Promise_bool___ create_Result_std__shared_ptr_Promise_bool___(const std::shared_ptr<Promise<bool>>& value) noexcept {
104
+ return Result<std::shared_ptr<Promise<bool>>>::withValue(value);
105
+ }
106
+ inline Result_std__shared_ptr_Promise_bool___ create_Result_std__shared_ptr_Promise_bool___(const std::exception_ptr& error) noexcept {
107
+ return Result<std::shared_ptr<Promise<bool>>>::withError(error);
108
+ }
109
+
110
+ } // namespace margelo::nitro::reactnativesplashscreen::bridge::swift
@@ -0,0 +1,44 @@
1
+ ///
2
+ /// ReactNativeSplashScreen-Swift-Cxx-Umbrella.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
+ // Forward declarations of C++ defined types
11
+ // Forward declaration of `HybridReactNativeSplashScreenSpec` to properly resolve imports.
12
+ namespace margelo::nitro::reactnativesplashscreen { class HybridReactNativeSplashScreenSpec; }
13
+
14
+ // Include C++ defined types
15
+ #include "HybridReactNativeSplashScreenSpec.hpp"
16
+ #include <NitroModules/Promise.hpp>
17
+ #include <NitroModules/Result.hpp>
18
+ #include <exception>
19
+ #include <memory>
20
+
21
+ // C++ helpers for Swift
22
+ #include "ReactNativeSplashScreen-Swift-Cxx-Bridge.hpp"
23
+
24
+ // Common C++ types used in Swift
25
+ #include <NitroModules/ArrayBufferHolder.hpp>
26
+ #include <NitroModules/AnyMapUtils.hpp>
27
+ #include <NitroModules/RuntimeError.hpp>
28
+ #include <NitroModules/DateToChronoDate.hpp>
29
+
30
+ // Forward declarations of Swift defined types
31
+ // Forward declaration of `HybridReactNativeSplashScreenSpec_cxx` to properly resolve imports.
32
+ namespace ReactNativeSplashScreen { class HybridReactNativeSplashScreenSpec_cxx; }
33
+
34
+ // Include Swift defined types
35
+ #if __has_include("ReactNativeSplashScreen-Swift.h")
36
+ // This header is generated by Xcode/Swift on every app build.
37
+ // If it cannot be found, make sure the Swift module's name (= podspec name) is actually "ReactNativeSplashScreen".
38
+ #include "ReactNativeSplashScreen-Swift.h"
39
+ // Same as above, but used when building with frameworks (`use_frameworks`)
40
+ #elif __has_include(<ReactNativeSplashScreen/ReactNativeSplashScreen-Swift.h>)
41
+ #include <ReactNativeSplashScreen/ReactNativeSplashScreen-Swift.h>
42
+ #else
43
+ #error ReactNativeSplashScreen's autogenerated Swift header cannot be found! Make sure the Swift module's name (= podspec name) is actually "ReactNativeSplashScreen", and try building the app first.
44
+ #endif
@@ -0,0 +1,33 @@
1
+ ///
2
+ /// ReactNativeSplashScreenAutolinking.mm
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/Foundation.h>
9
+ #import <NitroModules/HybridObjectRegistry.hpp>
10
+ #import "ReactNativeSplashScreen-Swift-Cxx-Umbrella.hpp"
11
+ #import <type_traits>
12
+
13
+ #include "HybridReactNativeSplashScreenSpecSwift.hpp"
14
+
15
+ @interface ReactNativeSplashScreenAutolinking : NSObject
16
+ @end
17
+
18
+ @implementation ReactNativeSplashScreenAutolinking
19
+
20
+ + (void) load {
21
+ using namespace margelo::nitro;
22
+ using namespace margelo::nitro::reactnativesplashscreen;
23
+
24
+ HybridObjectRegistry::registerHybridObjectConstructor(
25
+ "ReactNativeSplashScreen",
26
+ []() -> std::shared_ptr<HybridObject> {
27
+ std::shared_ptr<HybridReactNativeSplashScreenSpec> hybridObject = ReactNativeSplashScreen::ReactNativeSplashScreenAutolinking::createReactNativeSplashScreen();
28
+ return hybridObject;
29
+ }
30
+ );
31
+ }
32
+
33
+ @end
@@ -0,0 +1,25 @@
1
+ ///
2
+ /// ReactNativeSplashScreenAutolinking.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
+ public final class ReactNativeSplashScreenAutolinking {
9
+ public typealias bridge = margelo.nitro.reactnativesplashscreen.bridge.swift
10
+
11
+ /**
12
+ * Creates an instance of a Swift class that implements `HybridReactNativeSplashScreenSpec`,
13
+ * and wraps it in a Swift class that can directly interop with C++ (`HybridReactNativeSplashScreenSpec_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, `ReactNativeSplashScreen`).
17
+ */
18
+ public static func createReactNativeSplashScreen() -> bridge.std__shared_ptr_HybridReactNativeSplashScreenSpec_ {
19
+ let hybridObject = ReactNativeSplashScreen()
20
+ return { () -> bridge.std__shared_ptr_HybridReactNativeSplashScreenSpec_ in
21
+ let __cxxWrapped = hybridObject.getCxxWrapper()
22
+ return __cxxWrapped.getCxxPart()
23
+ }()
24
+ }
25
+ }
@@ -0,0 +1,11 @@
1
+ ///
2
+ /// HybridReactNativeSplashScreenSpecSwift.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 "HybridReactNativeSplashScreenSpecSwift.hpp"
9
+
10
+ namespace margelo::nitro::reactnativesplashscreen {
11
+ } // namespace margelo::nitro::reactnativesplashscreen
@@ -0,0 +1,84 @@
1
+ ///
2
+ /// HybridReactNativeSplashScreenSpecSwift.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
+ #include "HybridReactNativeSplashScreenSpec.hpp"
11
+
12
+ // Forward declaration of `HybridReactNativeSplashScreenSpec_cxx` to properly resolve imports.
13
+ namespace ReactNativeSplashScreen { class HybridReactNativeSplashScreenSpec_cxx; }
14
+
15
+
16
+
17
+ #include <NitroModules/Promise.hpp>
18
+
19
+ #include "ReactNativeSplashScreen-Swift-Cxx-Umbrella.hpp"
20
+
21
+ namespace margelo::nitro::reactnativesplashscreen {
22
+
23
+ /**
24
+ * The C++ part of HybridReactNativeSplashScreenSpec_cxx.swift.
25
+ *
26
+ * HybridReactNativeSplashScreenSpecSwift (C++) accesses HybridReactNativeSplashScreenSpec_cxx (Swift), and might
27
+ * contain some additional bridging code for C++ <> Swift interop.
28
+ *
29
+ * Since this obviously introduces an overhead, I hope at some point in
30
+ * the future, HybridReactNativeSplashScreenSpec_cxx can directly inherit from the C++ class HybridReactNativeSplashScreenSpec
31
+ * to simplify the whole structure and memory management.
32
+ */
33
+ class HybridReactNativeSplashScreenSpecSwift: public virtual HybridReactNativeSplashScreenSpec {
34
+ public:
35
+ // Constructor from a Swift instance
36
+ explicit HybridReactNativeSplashScreenSpecSwift(const ReactNativeSplashScreen::HybridReactNativeSplashScreenSpec_cxx& swiftPart):
37
+ HybridObject(HybridReactNativeSplashScreenSpec::TAG),
38
+ _swiftPart(swiftPart) { }
39
+
40
+ public:
41
+ // Get the Swift part
42
+ inline ReactNativeSplashScreen::HybridReactNativeSplashScreenSpec_cxx& getSwiftPart() noexcept {
43
+ return _swiftPart;
44
+ }
45
+
46
+ public:
47
+ inline size_t getExternalMemorySize() noexcept override {
48
+ return _swiftPart.getMemorySize();
49
+ }
50
+ void dispose() noexcept override {
51
+ _swiftPart.dispose();
52
+ }
53
+ std::string toString() override {
54
+ return _swiftPart.toString();
55
+ }
56
+
57
+ public:
58
+ // Properties
59
+
60
+
61
+ public:
62
+ // Methods
63
+ inline std::shared_ptr<Promise<bool>> preventAutoHideAsync() override {
64
+ auto __result = _swiftPart.preventAutoHideAsync();
65
+ if (__result.hasError()) [[unlikely]] {
66
+ std::rethrow_exception(__result.error());
67
+ }
68
+ auto __value = std::move(__result.value());
69
+ return __value;
70
+ }
71
+ inline std::shared_ptr<Promise<bool>> hideAsync() override {
72
+ auto __result = _swiftPart.hideAsync();
73
+ if (__result.hasError()) [[unlikely]] {
74
+ std::rethrow_exception(__result.error());
75
+ }
76
+ auto __value = std::move(__result.value());
77
+ return __value;
78
+ }
79
+
80
+ private:
81
+ ReactNativeSplashScreen::HybridReactNativeSplashScreenSpec_cxx _swiftPart;
82
+ };
83
+
84
+ } // namespace margelo::nitro::reactnativesplashscreen
@@ -0,0 +1,47 @@
1
+ ///
2
+ /// Func_void_bool.swift
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ import Foundation
9
+ import NitroModules
10
+
11
+ /**
12
+ * Wraps a Swift `(_ value: Bool) -> Void` as a class.
13
+ * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
14
+ */
15
+ public final class Func_void_bool {
16
+ public typealias bridge = margelo.nitro.reactnativesplashscreen.bridge.swift
17
+
18
+ private let closure: (_ value: Bool) -> Void
19
+
20
+ public init(_ closure: @escaping (_ value: Bool) -> Void) {
21
+ self.closure = closure
22
+ }
23
+
24
+ @inline(__always)
25
+ public func call(value: Bool) -> Void {
26
+ self.closure(value)
27
+ }
28
+
29
+ /**
30
+ * Casts this instance to a retained unsafe raw pointer.
31
+ * This acquires one additional strong reference on the object!
32
+ */
33
+ @inline(__always)
34
+ public func toUnsafe() -> UnsafeMutableRawPointer {
35
+ return Unmanaged.passRetained(self).toOpaque()
36
+ }
37
+
38
+ /**
39
+ * Casts an unsafe pointer to a `Func_void_bool`.
40
+ * The pointer has to be a retained opaque `Unmanaged<Func_void_bool>`.
41
+ * This removes one strong reference from the object!
42
+ */
43
+ @inline(__always)
44
+ public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_bool {
45
+ return Unmanaged<Func_void_bool>.fromOpaque(pointer).takeRetainedValue()
46
+ }
47
+ }
@@ -0,0 +1,47 @@
1
+ ///
2
+ /// Func_void_std__exception_ptr.swift
3
+ /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
4
+ /// https://github.com/mrousavy/nitro
5
+ /// Copyright © 2026 Marc Rousavy @ Margelo
6
+ ///
7
+
8
+ import Foundation
9
+ import NitroModules
10
+
11
+ /**
12
+ * Wraps a Swift `(_ error: Error) -> Void` as a class.
13
+ * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
14
+ */
15
+ public final class Func_void_std__exception_ptr {
16
+ public typealias bridge = margelo.nitro.reactnativesplashscreen.bridge.swift
17
+
18
+ private let closure: (_ error: Error) -> Void
19
+
20
+ public init(_ closure: @escaping (_ error: Error) -> Void) {
21
+ self.closure = closure
22
+ }
23
+
24
+ @inline(__always)
25
+ public func call(error: std.exception_ptr) -> Void {
26
+ self.closure(RuntimeError.from(cppError: error))
27
+ }
28
+
29
+ /**
30
+ * Casts this instance to a retained unsafe raw pointer.
31
+ * This acquires one additional strong reference on the object!
32
+ */
33
+ @inline(__always)
34
+ public func toUnsafe() -> UnsafeMutableRawPointer {
35
+ return Unmanaged.passRetained(self).toOpaque()
36
+ }
37
+
38
+ /**
39
+ * Casts an unsafe pointer to a `Func_void_std__exception_ptr`.
40
+ * The pointer has to be a retained opaque `Unmanaged<Func_void_std__exception_ptr>`.
41
+ * This removes one strong reference from the object!
42
+ */
43
+ @inline(__always)
44
+ public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_std__exception_ptr {
45
+ return Unmanaged<Func_void_std__exception_ptr>.fromOpaque(pointer).takeRetainedValue()
46
+ }
47
+ }
@@ -0,0 +1,57 @@
1
+ ///
2
+ /// HybridReactNativeSplashScreenSpec.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 ``HybridReactNativeSplashScreenSpec``
12
+ public protocol HybridReactNativeSplashScreenSpec_protocol: HybridObject {
13
+ // Properties
14
+
15
+
16
+ // Methods
17
+ func preventAutoHideAsync() throws -> Promise<Bool>
18
+ func hideAsync() throws -> Promise<Bool>
19
+ }
20
+
21
+ public extension HybridReactNativeSplashScreenSpec_protocol {
22
+ /// Default implementation of ``HybridObject.toString``
23
+ func toString() -> String {
24
+ return "[HybridObject ReactNativeSplashScreen]"
25
+ }
26
+ }
27
+
28
+ /// See ``HybridReactNativeSplashScreenSpec``
29
+ open class HybridReactNativeSplashScreenSpec_base {
30
+ private weak var cxxWrapper: HybridReactNativeSplashScreenSpec_cxx? = nil
31
+ public init() { }
32
+ public func getCxxWrapper() -> HybridReactNativeSplashScreenSpec_cxx {
33
+ #if DEBUG
34
+ guard self is HybridReactNativeSplashScreenSpec else {
35
+ fatalError("`self` is not a `HybridReactNativeSplashScreenSpec`! Did you accidentally inherit from `HybridReactNativeSplashScreenSpec_base` instead of `HybridReactNativeSplashScreenSpec`?")
36
+ }
37
+ #endif
38
+ if let cxxWrapper = self.cxxWrapper {
39
+ return cxxWrapper
40
+ } else {
41
+ let cxxWrapper = HybridReactNativeSplashScreenSpec_cxx(self as! HybridReactNativeSplashScreenSpec)
42
+ self.cxxWrapper = cxxWrapper
43
+ return cxxWrapper
44
+ }
45
+ }
46
+ }
47
+
48
+ /**
49
+ * A Swift base-protocol representing the ReactNativeSplashScreen HybridObject.
50
+ * Implement this protocol to create Swift-based instances of ReactNativeSplashScreen.
51
+ * ```swift
52
+ * class HybridReactNativeSplashScreen : HybridReactNativeSplashScreenSpec {
53
+ * // ...
54
+ * }
55
+ * ```
56
+ */
57
+ public typealias HybridReactNativeSplashScreenSpec = HybridReactNativeSplashScreenSpec_protocol & HybridReactNativeSplashScreenSpec_base
@@ -0,0 +1,157 @@
1
+ ///
2
+ /// HybridReactNativeSplashScreenSpec_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 HybridReactNativeSplashScreenSpec 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 HybridReactNativeSplashScreenSpec_cxx {
21
+ /**
22
+ * The Swift <> C++ bridge's namespace (`margelo::nitro::reactnativesplashscreen::bridge::swift`)
23
+ * from `ReactNativeSplashScreen-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.reactnativesplashscreen.bridge.swift
27
+
28
+ /**
29
+ * Holds an instance of the `HybridReactNativeSplashScreenSpec` Swift protocol.
30
+ */
31
+ private var __implementation: any HybridReactNativeSplashScreenSpec
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_HybridReactNativeSplashScreenSpec_
37
+
38
+ /**
39
+ * Create a new `HybridReactNativeSplashScreenSpec_cxx` that wraps the given `HybridReactNativeSplashScreenSpec`.
40
+ * All properties and methods bridge to C++ types.
41
+ */
42
+ public init(_ implementation: any HybridReactNativeSplashScreenSpec) {
43
+ self.__implementation = implementation
44
+ self.__cxxPart = .init()
45
+ /* no base class */
46
+ }
47
+
48
+ /**
49
+ * Get the actual `HybridReactNativeSplashScreenSpec` instance this class wraps.
50
+ */
51
+ @inline(__always)
52
+ public func getHybridReactNativeSplashScreenSpec() -> any HybridReactNativeSplashScreenSpec {
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 `HybridReactNativeSplashScreenSpec_cxx`.
66
+ * The pointer has to be a retained opaque `Unmanaged<HybridReactNativeSplashScreenSpec_cxx>`.
67
+ * This removes one strong reference from the object!
68
+ */
69
+ public class func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> HybridReactNativeSplashScreenSpec_cxx {
70
+ return Unmanaged<HybridReactNativeSplashScreenSpec_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<HybridReactNativeSplashScreenSpec>`.
76
+ */
77
+ public func getCxxPart() -> bridge.std__shared_ptr_HybridReactNativeSplashScreenSpec_ {
78
+ let cachedCxxPart = self.__cxxPart.lock()
79
+ if Bool(fromCxx: cachedCxxPart) {
80
+ return cachedCxxPart
81
+ } else {
82
+ let newCxxPart = bridge.create_std__shared_ptr_HybridReactNativeSplashScreenSpec_(self.toUnsafe())
83
+ __cxxPart = bridge.weakify_std__shared_ptr_HybridReactNativeSplashScreenSpec_(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
+
118
+
119
+ // Methods
120
+ @inline(__always)
121
+ public final func preventAutoHideAsync() -> bridge.Result_std__shared_ptr_Promise_bool___ {
122
+ do {
123
+ let __result = try self.__implementation.preventAutoHideAsync()
124
+ let __resultCpp = { () -> bridge.std__shared_ptr_Promise_bool__ in
125
+ let __promise = bridge.create_std__shared_ptr_Promise_bool__()
126
+ let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_bool__(__promise)
127
+ __result
128
+ .then({ __result in __promiseHolder.resolve(__result) })
129
+ .catch({ __error in __promiseHolder.reject(__error.toCpp()) })
130
+ return __promise
131
+ }()
132
+ return bridge.create_Result_std__shared_ptr_Promise_bool___(__resultCpp)
133
+ } catch (let __error) {
134
+ let __exceptionPtr = __error.toCpp()
135
+ return bridge.create_Result_std__shared_ptr_Promise_bool___(__exceptionPtr)
136
+ }
137
+ }
138
+
139
+ @inline(__always)
140
+ public final func hideAsync() -> bridge.Result_std__shared_ptr_Promise_bool___ {
141
+ do {
142
+ let __result = try self.__implementation.hideAsync()
143
+ let __resultCpp = { () -> bridge.std__shared_ptr_Promise_bool__ in
144
+ let __promise = bridge.create_std__shared_ptr_Promise_bool__()
145
+ let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_bool__(__promise)
146
+ __result
147
+ .then({ __result in __promiseHolder.resolve(__result) })
148
+ .catch({ __error in __promiseHolder.reject(__error.toCpp()) })
149
+ return __promise
150
+ }()
151
+ return bridge.create_Result_std__shared_ptr_Promise_bool___(__resultCpp)
152
+ } catch (let __error) {
153
+ let __exceptionPtr = __error.toCpp()
154
+ return bridge.create_Result_std__shared_ptr_Promise_bool___(__exceptionPtr)
155
+ }
156
+ }
157
+ }
@@ -0,0 +1,22 @@
1
+ ///
2
+ /// HybridReactNativeSplashScreenSpec.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 "HybridReactNativeSplashScreenSpec.hpp"
9
+
10
+ namespace margelo::nitro::reactnativesplashscreen {
11
+
12
+ void HybridReactNativeSplashScreenSpec::loadHybridMethods() {
13
+ // load base methods/properties
14
+ HybridObject::loadHybridMethods();
15
+ // load custom methods/properties
16
+ registerHybrids(this, [](Prototype& prototype) {
17
+ prototype.registerHybridMethod("preventAutoHideAsync", &HybridReactNativeSplashScreenSpec::preventAutoHideAsync);
18
+ prototype.registerHybridMethod("hideAsync", &HybridReactNativeSplashScreenSpec::hideAsync);
19
+ });
20
+ }
21
+
22
+ } // namespace margelo::nitro::reactnativesplashscreen