From 5d4356a126a2a8a82ca2426d088b20e04d9e30ba Mon Sep 17 00:00:00 2001 From: huhuanming Date: Thu, 12 Mar 2026 18:02:00 +0800 Subject: [PATCH 01/14] feat(bundle-update): add resetToBuiltInBundle API and bump to 1.1.37 Add resetToBuiltInBundle() method to clear currentBundleVersion preference, allowing the app to revert to the built-in JS bundle on next restart. Co-Authored-By: Claude Opus 4.6 --- native-modules/native-logger/package.json | 2 +- .../react-native-app-update/package.json | 2 +- .../package.json | 2 +- .../ReactNativeBundleUpdate.kt | 16 ++++++++++++++++ .../ios/ReactNativeBundleUpdate.swift | 16 ++++++++++++++++ .../JHybridReactNativeBundleUpdateSpec.cpp | 15 +++++++++++++++ .../JHybridReactNativeBundleUpdateSpec.hpp | 1 + .../HybridReactNativeBundleUpdateSpec.kt | 4 ++++ ...HybridReactNativeBundleUpdateSpecSwift.hpp | 8 ++++++++ .../HybridReactNativeBundleUpdateSpec.swift | 1 + ...ybridReactNativeBundleUpdateSpec_cxx.swift | 19 +++++++++++++++++++ .../c++/HybridReactNativeBundleUpdateSpec.cpp | 1 + .../c++/HybridReactNativeBundleUpdateSpec.hpp | 1 + .../react-native-bundle-update/package.json | 2 +- .../src/ReactNativeBundleUpdate.nitro.ts | 1 + .../package.json | 2 +- .../package.json | 2 +- .../react-native-device-utils/package.json | 2 +- .../package.json | 2 +- .../react-native-keychain-module/package.json | 2 +- .../react-native-lite-card/package.json | 2 +- .../react-native-perf-memory/package.json | 2 +- .../react-native-splash-screen/package.json | 2 +- .../react-native-auto-size-input/package.json | 2 +- .../react-native-pager-view/package.json | 2 +- .../react-native-skeleton/package.json | 2 +- .../react-native-tab-view/package.json | 2 +- 27 files changed, 99 insertions(+), 16 deletions(-) diff --git a/native-modules/native-logger/package.json b/native-modules/native-logger/package.json index bc8c081..d4724fb 100644 --- a/native-modules/native-logger/package.json +++ b/native-modules/native-logger/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/react-native-native-logger", - "version": "1.1.36", + "version": "1.1.37", "description": "react-native-native-logger", "main": "./lib/module/index.js", "types": "./lib/typescript/src/index.d.ts", diff --git a/native-modules/react-native-app-update/package.json b/native-modules/react-native-app-update/package.json index 712c6f1..8efb22c 100644 --- a/native-modules/react-native-app-update/package.json +++ b/native-modules/react-native-app-update/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/react-native-app-update", - "version": "1.1.36", + "version": "1.1.37", "description": "react-native-app-update", "main": "./lib/module/index.js", "types": "./lib/typescript/src/index.d.ts", diff --git a/native-modules/react-native-background-thread/package.json b/native-modules/react-native-background-thread/package.json index 32ba0b3..f63741b 100644 --- a/native-modules/react-native-background-thread/package.json +++ b/native-modules/react-native-background-thread/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/react-native-background-thread", - "version": "1.1.36", + "version": "1.1.37", "description": "react-native-background-thread", "main": "./lib/module/index.js", "types": "./lib/typescript/src/index.d.ts", diff --git a/native-modules/react-native-bundle-update/android/src/main/java/com/margelo/nitro/reactnativebundleupdate/ReactNativeBundleUpdate.kt b/native-modules/react-native-bundle-update/android/src/main/java/com/margelo/nitro/reactnativebundleupdate/ReactNativeBundleUpdate.kt index 263e639..b9a0dcb 100644 --- a/native-modules/react-native-bundle-update/android/src/main/java/com/margelo/nitro/reactnativebundleupdate/ReactNativeBundleUpdate.kt +++ b/native-modules/react-native-bundle-update/android/src/main/java/com/margelo/nitro/reactnativebundleupdate/ReactNativeBundleUpdate.kt @@ -1066,6 +1066,22 @@ class ReactNativeBundleUpdate : HybridReactNativeBundleUpdateSpec() { } } + override fun resetToBuiltInBundle(): Promise { + return Promise.async { + OneKeyLog.info("BundleUpdate", "resetToBuiltInBundle: clearing currentBundleVersion preference...") + val context = getContext() + val prefs = context.getSharedPreferences("BundleUpdatePrefs", Context.MODE_PRIVATE) + val currentVersion = prefs.getString("currentBundleVersion", null) + if (currentVersion != null) { + prefs.edit().remove("currentBundleVersion").apply() + OneKeyLog.info("BundleUpdate", "resetToBuiltInBundle: removed currentBundleVersion=$currentVersion") + } else { + OneKeyLog.info("BundleUpdate", "resetToBuiltInBundle: no currentBundleVersion set, already using built-in bundle") + } + OneKeyLog.info("BundleUpdate", "resetToBuiltInBundle: completed, app will use built-in bundle on next restart") + } + } + override fun clearAllJSBundleData(): Promise { return Promise.async { OneKeyLog.info("BundleUpdate", "clearAllJSBundleData: starting...") diff --git a/native-modules/react-native-bundle-update/ios/ReactNativeBundleUpdate.swift b/native-modules/react-native-bundle-update/ios/ReactNativeBundleUpdate.swift index c7f1511..f0a83e0 100644 --- a/native-modules/react-native-bundle-update/ios/ReactNativeBundleUpdate.swift +++ b/native-modules/react-native-bundle-update/ios/ReactNativeBundleUpdate.swift @@ -1029,6 +1029,22 @@ class ReactNativeBundleUpdate: HybridReactNativeBundleUpdateSpec { } } + func resetToBuiltInBundle() throws -> Promise { + return Promise.async { + OneKeyLog.info("BundleUpdate", "resetToBuiltInBundle: clearing currentBundleVersion preference...") + let ud = UserDefaults.standard + if let cbv = ud.string(forKey: "currentBundleVersion") { + ud.removeObject(forKey: cbv) + ud.removeObject(forKey: "currentBundleVersion") + OneKeyLog.info("BundleUpdate", "resetToBuiltInBundle: removed currentBundleVersion=\(cbv)") + } else { + OneKeyLog.info("BundleUpdate", "resetToBuiltInBundle: no currentBundleVersion set, already using built-in bundle") + } + ud.synchronize() + OneKeyLog.info("BundleUpdate", "resetToBuiltInBundle: completed, app will use built-in bundle on next restart") + } + } + func clearAllJSBundleData() throws -> Promise { return Promise.async { OneKeyLog.info("BundleUpdate", "clearAllJSBundleData: starting...") diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/android/c++/JHybridReactNativeBundleUpdateSpec.cpp b/native-modules/react-native-bundle-update/nitrogen/generated/android/c++/JHybridReactNativeBundleUpdateSpec.cpp index e69e836..4443d97 100644 --- a/native-modules/react-native-bundle-update/nitrogen/generated/android/c++/JHybridReactNativeBundleUpdateSpec.cpp +++ b/native-modules/react-native-bundle-update/nitrogen/generated/android/c++/JHybridReactNativeBundleUpdateSpec.cpp @@ -203,6 +203,21 @@ namespace margelo::nitro::reactnativebundleupdate { return __promise; }(); } + std::shared_ptr> JHybridReactNativeBundleUpdateSpec::resetToBuiltInBundle() { + static const auto method = javaClassStatic()->getMethod()>("resetToBuiltInBundle"); + auto __result = method(_javaPart); + return [&]() { + auto __promise = Promise::create(); + __result->cthis()->addOnResolvedListener([=](const jni::alias_ref& /* unit */) { + __promise->resolve(); + }); + __result->cthis()->addOnRejectedListener([=](const jni::alias_ref& __throwable) { + jni::JniException __jniError(__throwable); + __promise->reject(std::make_exception_ptr(__jniError)); + }); + return __promise; + }(); + } std::shared_ptr>> JHybridReactNativeBundleUpdateSpec::getFallbackUpdateBundleData() { static const auto method = javaClassStatic()->getMethod()>("getFallbackUpdateBundleData"); auto __result = method(_javaPart); diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/android/c++/JHybridReactNativeBundleUpdateSpec.hpp b/native-modules/react-native-bundle-update/nitrogen/generated/android/c++/JHybridReactNativeBundleUpdateSpec.hpp index aa41d47..3718806 100644 --- a/native-modules/react-native-bundle-update/nitrogen/generated/android/c++/JHybridReactNativeBundleUpdateSpec.hpp +++ b/native-modules/react-native-bundle-update/nitrogen/generated/android/c++/JHybridReactNativeBundleUpdateSpec.hpp @@ -61,6 +61,7 @@ namespace margelo::nitro::reactnativebundleupdate { std::shared_ptr> installBundle(const BundleInstallParams& params) override; std::shared_ptr> clearBundle() override; std::shared_ptr> clearAllJSBundleData() override; + std::shared_ptr> resetToBuiltInBundle() override; std::shared_ptr>> getFallbackUpdateBundleData() override; std::shared_ptr> setCurrentUpdateBundleData(const BundleSwitchParams& params) override; std::string getWebEmbedPath() override; diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/HybridReactNativeBundleUpdateSpec.kt b/native-modules/react-native-bundle-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/HybridReactNativeBundleUpdateSpec.kt index 1043779..55cf384 100644 --- a/native-modules/react-native-bundle-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/HybridReactNativeBundleUpdateSpec.kt +++ b/native-modules/react-native-bundle-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/HybridReactNativeBundleUpdateSpec.kt @@ -74,6 +74,10 @@ abstract class HybridReactNativeBundleUpdateSpec: HybridObject() { @Keep abstract fun clearAllJSBundleData(): Promise + @DoNotStrip + @Keep + abstract fun resetToBuiltInBundle(): Promise + @DoNotStrip @Keep abstract fun getFallbackUpdateBundleData(): Promise> diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/ios/c++/HybridReactNativeBundleUpdateSpecSwift.hpp b/native-modules/react-native-bundle-update/nitrogen/generated/ios/c++/HybridReactNativeBundleUpdateSpecSwift.hpp index 4cefe5e..c71bbd9 100644 --- a/native-modules/react-native-bundle-update/nitrogen/generated/ios/c++/HybridReactNativeBundleUpdateSpecSwift.hpp +++ b/native-modules/react-native-bundle-update/nitrogen/generated/ios/c++/HybridReactNativeBundleUpdateSpecSwift.hpp @@ -154,6 +154,14 @@ namespace margelo::nitro::reactnativebundleupdate { auto __value = std::move(__result.value()); return __value; } + inline std::shared_ptr> resetToBuiltInBundle() override { + auto __result = _swiftPart.resetToBuiltInBundle(); + if (__result.hasError()) [[unlikely]] { + std::rethrow_exception(__result.error()); + } + auto __value = std::move(__result.value()); + return __value; + } inline std::shared_ptr>> getFallbackUpdateBundleData() override { auto __result = _swiftPart.getFallbackUpdateBundleData(); if (__result.hasError()) [[unlikely]] { diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/HybridReactNativeBundleUpdateSpec.swift b/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/HybridReactNativeBundleUpdateSpec.swift index ba30758..3cd0322 100644 --- a/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/HybridReactNativeBundleUpdateSpec.swift +++ b/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/HybridReactNativeBundleUpdateSpec.swift @@ -21,6 +21,7 @@ public protocol HybridReactNativeBundleUpdateSpec_protocol: HybridObject { func installBundle(params: BundleInstallParams) throws -> Promise func clearBundle() throws -> Promise func clearAllJSBundleData() throws -> Promise + func resetToBuiltInBundle() throws -> Promise func getFallbackUpdateBundleData() throws -> Promise<[FallbackBundleInfo]> func setCurrentUpdateBundleData(params: BundleSwitchParams) throws -> Promise func getWebEmbedPath() throws -> String diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/HybridReactNativeBundleUpdateSpec_cxx.swift b/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/HybridReactNativeBundleUpdateSpec_cxx.swift index d719594..759d98e 100644 --- a/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/HybridReactNativeBundleUpdateSpec_cxx.swift +++ b/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/HybridReactNativeBundleUpdateSpec_cxx.swift @@ -250,6 +250,25 @@ open class HybridReactNativeBundleUpdateSpec_cxx { } } + @inline(__always) + public final func resetToBuiltInBundle() -> bridge.Result_std__shared_ptr_Promise_void___ { + do { + let __result = try self.__implementation.resetToBuiltInBundle() + let __resultCpp = { () -> bridge.std__shared_ptr_Promise_void__ in + let __promise = bridge.create_std__shared_ptr_Promise_void__() + let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_void__(__promise) + __result + .then({ __result in __promiseHolder.resolve() }) + .catch({ __error in __promiseHolder.reject(__error.toCpp()) }) + return __promise + }() + return bridge.create_Result_std__shared_ptr_Promise_void___(__resultCpp) + } catch (let __error) { + let __exceptionPtr = __error.toCpp() + return bridge.create_Result_std__shared_ptr_Promise_void___(__exceptionPtr) + } + } + @inline(__always) public final func getFallbackUpdateBundleData() -> bridge.Result_std__shared_ptr_Promise_std__vector_FallbackBundleInfo____ { do { diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/shared/c++/HybridReactNativeBundleUpdateSpec.cpp b/native-modules/react-native-bundle-update/nitrogen/generated/shared/c++/HybridReactNativeBundleUpdateSpec.cpp index e96d892..0769943 100644 --- a/native-modules/react-native-bundle-update/nitrogen/generated/shared/c++/HybridReactNativeBundleUpdateSpec.cpp +++ b/native-modules/react-native-bundle-update/nitrogen/generated/shared/c++/HybridReactNativeBundleUpdateSpec.cpp @@ -21,6 +21,7 @@ namespace margelo::nitro::reactnativebundleupdate { prototype.registerHybridMethod("installBundle", &HybridReactNativeBundleUpdateSpec::installBundle); prototype.registerHybridMethod("clearBundle", &HybridReactNativeBundleUpdateSpec::clearBundle); prototype.registerHybridMethod("clearAllJSBundleData", &HybridReactNativeBundleUpdateSpec::clearAllJSBundleData); + prototype.registerHybridMethod("resetToBuiltInBundle", &HybridReactNativeBundleUpdateSpec::resetToBuiltInBundle); prototype.registerHybridMethod("getFallbackUpdateBundleData", &HybridReactNativeBundleUpdateSpec::getFallbackUpdateBundleData); prototype.registerHybridMethod("setCurrentUpdateBundleData", &HybridReactNativeBundleUpdateSpec::setCurrentUpdateBundleData); prototype.registerHybridMethod("getWebEmbedPath", &HybridReactNativeBundleUpdateSpec::getWebEmbedPath); diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/shared/c++/HybridReactNativeBundleUpdateSpec.hpp b/native-modules/react-native-bundle-update/nitrogen/generated/shared/c++/HybridReactNativeBundleUpdateSpec.hpp index 6de13ee..3884f63 100644 --- a/native-modules/react-native-bundle-update/nitrogen/generated/shared/c++/HybridReactNativeBundleUpdateSpec.hpp +++ b/native-modules/react-native-bundle-update/nitrogen/generated/shared/c++/HybridReactNativeBundleUpdateSpec.hpp @@ -93,6 +93,7 @@ namespace margelo::nitro::reactnativebundleupdate { virtual std::shared_ptr> installBundle(const BundleInstallParams& params) = 0; virtual std::shared_ptr> clearBundle() = 0; virtual std::shared_ptr> clearAllJSBundleData() = 0; + virtual std::shared_ptr> resetToBuiltInBundle() = 0; virtual std::shared_ptr>> getFallbackUpdateBundleData() = 0; virtual std::shared_ptr> setCurrentUpdateBundleData(const BundleSwitchParams& params) = 0; virtual std::string getWebEmbedPath() = 0; diff --git a/native-modules/react-native-bundle-update/package.json b/native-modules/react-native-bundle-update/package.json index 8f28288..a699e3e 100644 --- a/native-modules/react-native-bundle-update/package.json +++ b/native-modules/react-native-bundle-update/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/react-native-bundle-update", - "version": "1.1.36", + "version": "1.1.37", "description": "react-native-bundle-update", "main": "./lib/module/index.js", "types": "./lib/typescript/src/index.d.ts", diff --git a/native-modules/react-native-bundle-update/src/ReactNativeBundleUpdate.nitro.ts b/native-modules/react-native-bundle-update/src/ReactNativeBundleUpdate.nitro.ts index c2fe887..5d4839f 100644 --- a/native-modules/react-native-bundle-update/src/ReactNativeBundleUpdate.nitro.ts +++ b/native-modules/react-native-bundle-update/src/ReactNativeBundleUpdate.nitro.ts @@ -97,6 +97,7 @@ export interface ReactNativeBundleUpdate // Clear clearBundle(): Promise; clearAllJSBundleData(): Promise; + resetToBuiltInBundle(): Promise; // Bundle data getFallbackUpdateBundleData(): Promise; diff --git a/native-modules/react-native-check-biometric-auth-changed/package.json b/native-modules/react-native-check-biometric-auth-changed/package.json index 8b2b6b1..0252dd8 100644 --- a/native-modules/react-native-check-biometric-auth-changed/package.json +++ b/native-modules/react-native-check-biometric-auth-changed/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/react-native-check-biometric-auth-changed", - "version": "1.1.36", + "version": "1.1.37", "description": "react-native-check-biometric-auth-changed", "main": "./lib/module/index.js", "types": "./lib/typescript/src/index.d.ts", diff --git a/native-modules/react-native-cloud-kit-module/package.json b/native-modules/react-native-cloud-kit-module/package.json index 3a3c1d8..a96f536 100644 --- a/native-modules/react-native-cloud-kit-module/package.json +++ b/native-modules/react-native-cloud-kit-module/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/react-native-cloud-kit-module", - "version": "1.1.36", + "version": "1.1.37", "description": "react-native-cloud-kit-module", "main": "./lib/module/index.js", "types": "./lib/typescript/src/index.d.ts", diff --git a/native-modules/react-native-device-utils/package.json b/native-modules/react-native-device-utils/package.json index 281f88c..4765b56 100644 --- a/native-modules/react-native-device-utils/package.json +++ b/native-modules/react-native-device-utils/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/react-native-device-utils", - "version": "1.1.36", + "version": "1.1.37", "description": "react-native-device-utils", "main": "./lib/module/index.js", "types": "./lib/typescript/src/index.d.ts", diff --git a/native-modules/react-native-get-random-values/package.json b/native-modules/react-native-get-random-values/package.json index 3971bdd..5bfd801 100644 --- a/native-modules/react-native-get-random-values/package.json +++ b/native-modules/react-native-get-random-values/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/react-native-get-random-values", - "version": "1.1.36", + "version": "1.1.37", "description": "react-native-get-random-values", "main": "./lib/module/index.js", "types": "./lib/typescript/src/index.d.ts", diff --git a/native-modules/react-native-keychain-module/package.json b/native-modules/react-native-keychain-module/package.json index 6e95efe..ef8ed00 100644 --- a/native-modules/react-native-keychain-module/package.json +++ b/native-modules/react-native-keychain-module/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/react-native-keychain-module", - "version": "1.1.36", + "version": "1.1.37", "description": "react-native-keychain-module", "main": "./lib/module/index.js", "types": "./lib/typescript/src/index.d.ts", diff --git a/native-modules/react-native-lite-card/package.json b/native-modules/react-native-lite-card/package.json index d873250..d842f36 100644 --- a/native-modules/react-native-lite-card/package.json +++ b/native-modules/react-native-lite-card/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/react-native-lite-card", - "version": "1.1.36", + "version": "1.1.37", "description": "lite card", "main": "./lib/module/index.js", "types": "./lib/typescript/src/index.d.ts", diff --git a/native-modules/react-native-perf-memory/package.json b/native-modules/react-native-perf-memory/package.json index 725c7ff..f06388c 100644 --- a/native-modules/react-native-perf-memory/package.json +++ b/native-modules/react-native-perf-memory/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/react-native-perf-memory", - "version": "1.1.36", + "version": "1.1.37", "description": "react-native-perf-memory", "main": "./lib/module/index.js", "types": "./lib/typescript/src/index.d.ts", diff --git a/native-modules/react-native-splash-screen/package.json b/native-modules/react-native-splash-screen/package.json index ab4e3d2..30942ba 100644 --- a/native-modules/react-native-splash-screen/package.json +++ b/native-modules/react-native-splash-screen/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/react-native-splash-screen", - "version": "1.1.36", + "version": "1.1.37", "description": "react-native-splash-screen", "main": "./lib/module/index.js", "types": "./lib/typescript/src/index.d.ts", diff --git a/native-views/react-native-auto-size-input/package.json b/native-views/react-native-auto-size-input/package.json index bb3565e..f458c4f 100644 --- a/native-views/react-native-auto-size-input/package.json +++ b/native-views/react-native-auto-size-input/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/react-native-auto-size-input", - "version": "1.1.36", + "version": "1.1.37", "description": "Auto-sizing text input with font scaling, prefix and suffix support", "main": "./lib/module/index.js", "types": "./lib/typescript/src/index.d.ts", diff --git a/native-views/react-native-pager-view/package.json b/native-views/react-native-pager-view/package.json index bd49fc9..ad2911e 100644 --- a/native-views/react-native-pager-view/package.json +++ b/native-views/react-native-pager-view/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/react-native-pager-view", - "version": "1.1.36", + "version": "1.1.37", "description": "React Native wrapper for Android and iOS ViewPager", "source": "./src/index.tsx", "main": "./lib/module/index.js", diff --git a/native-views/react-native-skeleton/package.json b/native-views/react-native-skeleton/package.json index b7ce4a6..37117c4 100644 --- a/native-views/react-native-skeleton/package.json +++ b/native-views/react-native-skeleton/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/react-native-skeleton", - "version": "1.1.36", + "version": "1.1.37", "description": "react-native-skeleton", "main": "./lib/module/index.js", "types": "./lib/typescript/src/index.d.ts", diff --git a/native-views/react-native-tab-view/package.json b/native-views/react-native-tab-view/package.json index 11a8a34..4b1824b 100644 --- a/native-views/react-native-tab-view/package.json +++ b/native-views/react-native-tab-view/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/react-native-tab-view", - "version": "1.1.36", + "version": "1.1.37", "description": "Native Bottom Tabs for React Native (UIKit implementation)", "source": "./src/index.tsx", "main": "./lib/module/index.js", From 1e354c85d448e8f9d376b568eb3b803293818682 Mon Sep 17 00:00:00 2001 From: huhuanming Date: Thu, 12 Mar 2026 18:05:17 +0800 Subject: [PATCH 02/14] docs: add 1.1.37 changelog entry Co-Authored-By: Claude Opus 4.6 --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 79dc3d7..db24bf2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,14 @@ All notable changes to this project will be documented in this file. +## [1.1.37] - 2026-03-12 + +### Features +- **bundle-update**: Add `resetToBuiltInBundle()` API to clear the current bundle version preference, reverting to built-in JS bundle on next restart + +### Chores +- Bump all native modules and views to 1.1.37 + ## [1.1.36] - 2026-03-10 ### Features From 7b67dc9c05c409fdba6a698ced6a196a2d28dd05 Mon Sep 17 00:00:00 2001 From: huhuanming Date: Fri, 13 Mar 2026 23:29:04 +0800 Subject: [PATCH 03/14] feat: add react-native-scroll-guard module Native view component that prevents parent PagerView from intercepting child ScrollView gestures. Uses requireGestureRecognizerToFail on iOS and requestDisallowInterceptTouchEvent on Android. Supports horizontal, vertical, and both directions. Includes example test page. --- example/react-native/package.json | 1 + .../pages/ScrollGuardTestPage.tsx | 242 ++++++++++++++++++ example/react-native/route.tsx | 9 + .../ScrollGuard.podspec | 29 +++ .../android/CMakeLists.txt | 24 ++ .../android/build.gradle | 124 +++++++++ .../android/src/main/AndroidManifest.xml | 2 + .../android/src/main/cpp/cpp-adapter.cpp | 6 + .../margelo/nitro/scrollguard/ScrollGuard.kt | 117 +++++++++ .../nitro/scrollguard/ScrollGuardPackage.kt | 29 +++ .../ios/ScrollGuard.swift | 132 ++++++++++ .../react-native-scroll-guard/nitro.json | 17 ++ .../nitrogen/generated/.gitattributes | 1 + .../android/c++/JHybridScrollGuardSpec.cpp | 59 +++++ .../android/c++/JHybridScrollGuardSpec.hpp | 66 +++++ .../android/c++/JScrollGuardDirection.hpp | 62 +++++ .../views/JHybridScrollGuardStateUpdater.cpp | 56 ++++ .../views/JHybridScrollGuardStateUpdater.hpp | 49 ++++ .../scrollguard/HybridScrollGuardSpec.kt | 59 +++++ .../nitro/scrollguard/ScrollGuardDirection.kt | 22 ++ .../nitro/scrollguard/scrollguardOnLoad.kt | 35 +++ .../views/HybridScrollGuardManager.kt | 50 ++++ .../views/HybridScrollGuardStateUpdater.kt | 23 ++ .../android/scrollguard+autolinking.cmake | 83 ++++++ .../android/scrollguard+autolinking.gradle | 27 ++ .../generated/android/scrollguardOnLoad.cpp | 46 ++++ .../generated/android/scrollguardOnLoad.hpp | 25 ++ .../generated/ios/ScrollGuard+autolinking.rb | 60 +++++ .../ios/ScrollGuard-Swift-Cxx-Bridge.cpp | 33 +++ .../ios/ScrollGuard-Swift-Cxx-Bridge.hpp | 59 +++++ .../ios/ScrollGuard-Swift-Cxx-Umbrella.hpp | 45 ++++ .../generated/ios/ScrollGuardAutolinking.mm | 33 +++ .../ios/ScrollGuardAutolinking.swift | 25 ++ .../ios/c++/HybridScrollGuardSpecSwift.cpp | 11 + .../ios/c++/HybridScrollGuardSpecSwift.hpp | 77 ++++++ .../c++/views/HybridScrollGuardComponent.mm | 96 +++++++ .../ios/swift/HybridScrollGuardSpec.swift | 56 ++++ .../ios/swift/HybridScrollGuardSpec_cxx.swift | 146 +++++++++++ .../ios/swift/ScrollGuardDirection.swift | 44 ++++ .../shared/c++/HybridScrollGuardSpec.cpp | 22 ++ .../shared/c++/HybridScrollGuardSpec.hpp | 65 +++++ .../shared/c++/ScrollGuardDirection.hpp | 80 ++++++ .../c++/views/HybridScrollGuardComponent.cpp | 87 +++++++ .../c++/views/HybridScrollGuardComponent.hpp | 108 ++++++++ .../shared/json/ScrollGuardConfig.json | 10 + .../react-native-scroll-guard/package.json | 105 ++++++++ .../src/ScrollGuard.nitro.ts | 25 ++ .../react-native-scroll-guard/src/index.tsx | 11 + .../tsconfig.build.json | 4 + .../react-native-scroll-guard/tsconfig.json | 30 +++ yarn.lock | 23 +- 51 files changed, 2648 insertions(+), 2 deletions(-) create mode 100644 example/react-native/pages/ScrollGuardTestPage.tsx create mode 100644 native-views/react-native-scroll-guard/ScrollGuard.podspec create mode 100644 native-views/react-native-scroll-guard/android/CMakeLists.txt create mode 100644 native-views/react-native-scroll-guard/android/build.gradle create mode 100644 native-views/react-native-scroll-guard/android/src/main/AndroidManifest.xml create mode 100644 native-views/react-native-scroll-guard/android/src/main/cpp/cpp-adapter.cpp create mode 100644 native-views/react-native-scroll-guard/android/src/main/java/com/margelo/nitro/scrollguard/ScrollGuard.kt create mode 100644 native-views/react-native-scroll-guard/android/src/main/java/com/margelo/nitro/scrollguard/ScrollGuardPackage.kt create mode 100644 native-views/react-native-scroll-guard/ios/ScrollGuard.swift create mode 100644 native-views/react-native-scroll-guard/nitro.json create mode 100644 native-views/react-native-scroll-guard/nitrogen/generated/.gitattributes create mode 100644 native-views/react-native-scroll-guard/nitrogen/generated/android/c++/JHybridScrollGuardSpec.cpp create mode 100644 native-views/react-native-scroll-guard/nitrogen/generated/android/c++/JHybridScrollGuardSpec.hpp create mode 100644 native-views/react-native-scroll-guard/nitrogen/generated/android/c++/JScrollGuardDirection.hpp create mode 100644 native-views/react-native-scroll-guard/nitrogen/generated/android/c++/views/JHybridScrollGuardStateUpdater.cpp create mode 100644 native-views/react-native-scroll-guard/nitrogen/generated/android/c++/views/JHybridScrollGuardStateUpdater.hpp create mode 100644 native-views/react-native-scroll-guard/nitrogen/generated/android/kotlin/com/margelo/nitro/scrollguard/HybridScrollGuardSpec.kt create mode 100644 native-views/react-native-scroll-guard/nitrogen/generated/android/kotlin/com/margelo/nitro/scrollguard/ScrollGuardDirection.kt create mode 100644 native-views/react-native-scroll-guard/nitrogen/generated/android/kotlin/com/margelo/nitro/scrollguard/scrollguardOnLoad.kt create mode 100644 native-views/react-native-scroll-guard/nitrogen/generated/android/kotlin/com/margelo/nitro/scrollguard/views/HybridScrollGuardManager.kt create mode 100644 native-views/react-native-scroll-guard/nitrogen/generated/android/kotlin/com/margelo/nitro/scrollguard/views/HybridScrollGuardStateUpdater.kt create mode 100644 native-views/react-native-scroll-guard/nitrogen/generated/android/scrollguard+autolinking.cmake create mode 100644 native-views/react-native-scroll-guard/nitrogen/generated/android/scrollguard+autolinking.gradle create mode 100644 native-views/react-native-scroll-guard/nitrogen/generated/android/scrollguardOnLoad.cpp create mode 100644 native-views/react-native-scroll-guard/nitrogen/generated/android/scrollguardOnLoad.hpp create mode 100644 native-views/react-native-scroll-guard/nitrogen/generated/ios/ScrollGuard+autolinking.rb create mode 100644 native-views/react-native-scroll-guard/nitrogen/generated/ios/ScrollGuard-Swift-Cxx-Bridge.cpp create mode 100644 native-views/react-native-scroll-guard/nitrogen/generated/ios/ScrollGuard-Swift-Cxx-Bridge.hpp create mode 100644 native-views/react-native-scroll-guard/nitrogen/generated/ios/ScrollGuard-Swift-Cxx-Umbrella.hpp create mode 100644 native-views/react-native-scroll-guard/nitrogen/generated/ios/ScrollGuardAutolinking.mm create mode 100644 native-views/react-native-scroll-guard/nitrogen/generated/ios/ScrollGuardAutolinking.swift create mode 100644 native-views/react-native-scroll-guard/nitrogen/generated/ios/c++/HybridScrollGuardSpecSwift.cpp create mode 100644 native-views/react-native-scroll-guard/nitrogen/generated/ios/c++/HybridScrollGuardSpecSwift.hpp create mode 100644 native-views/react-native-scroll-guard/nitrogen/generated/ios/c++/views/HybridScrollGuardComponent.mm create mode 100644 native-views/react-native-scroll-guard/nitrogen/generated/ios/swift/HybridScrollGuardSpec.swift create mode 100644 native-views/react-native-scroll-guard/nitrogen/generated/ios/swift/HybridScrollGuardSpec_cxx.swift create mode 100644 native-views/react-native-scroll-guard/nitrogen/generated/ios/swift/ScrollGuardDirection.swift create mode 100644 native-views/react-native-scroll-guard/nitrogen/generated/shared/c++/HybridScrollGuardSpec.cpp create mode 100644 native-views/react-native-scroll-guard/nitrogen/generated/shared/c++/HybridScrollGuardSpec.hpp create mode 100644 native-views/react-native-scroll-guard/nitrogen/generated/shared/c++/ScrollGuardDirection.hpp create mode 100644 native-views/react-native-scroll-guard/nitrogen/generated/shared/c++/views/HybridScrollGuardComponent.cpp create mode 100644 native-views/react-native-scroll-guard/nitrogen/generated/shared/c++/views/HybridScrollGuardComponent.hpp create mode 100644 native-views/react-native-scroll-guard/nitrogen/generated/shared/json/ScrollGuardConfig.json create mode 100644 native-views/react-native-scroll-guard/package.json create mode 100644 native-views/react-native-scroll-guard/src/ScrollGuard.nitro.ts create mode 100644 native-views/react-native-scroll-guard/src/index.tsx create mode 100644 native-views/react-native-scroll-guard/tsconfig.build.json create mode 100644 native-views/react-native-scroll-guard/tsconfig.json diff --git a/example/react-native/package.json b/example/react-native/package.json index 54ce241..af78529 100644 --- a/example/react-native/package.json +++ b/example/react-native/package.json @@ -23,6 +23,7 @@ "@onekeyfe/react-native-lite-card": "workspace:*", "@onekeyfe/react-native-native-logger": "workspace:*", "@onekeyfe/react-native-pager-view": "workspace:*", + "@onekeyfe/react-native-scroll-guard": "workspace:*", "@onekeyfe/react-native-perf-memory": "workspace:*", "@onekeyfe/react-native-skeleton": "workspace:*", "@onekeyfe/react-native-splash-screen": "workspace:*", diff --git a/example/react-native/pages/ScrollGuardTestPage.tsx b/example/react-native/pages/ScrollGuardTestPage.tsx new file mode 100644 index 0000000..9f8adcd --- /dev/null +++ b/example/react-native/pages/ScrollGuardTestPage.tsx @@ -0,0 +1,242 @@ +import React, { useState } from 'react'; +import { ScrollView, StyleSheet, Text, View } from 'react-native'; +import PagerView, { type PagerViewOnPageSelectedEvent } from '@onekeyfe/react-native-pager-view'; +import { ScrollGuardView } from '@onekeyfe/react-native-scroll-guard'; +import { TestButton, TestPageBase } from './TestPageBase'; + +const PAGER_PAGES = [ + { key: 'market', title: 'Market', color: '#E8F1FF' }, + { key: 'earn', title: 'Earn', color: '#EAF9F1' }, + { key: 'browser', title: 'Browser', color: '#FFF6E5' }, +] as const; + +const BANNER_ITEMS = Array.from({ length: 8 }, (_, i) => ({ + key: `banner-${i}`, + title: `Category ${i + 1}`, + value: `+${(Math.random() * 10).toFixed(2)}%`, + color: `hsl(${i * 45}, 60%, 92%)`, +})); + +function BannerCard({ title, value, color }: { title: string; value: string; color: string }) { + return ( + + {title} + {value} + + ); +} + +function HorizontalBanner({ guarded }: { guarded: boolean }) { + const content = ( + + {BANNER_ITEMS.map((item) => ( + + ))} + + ); + + if (guarded) { + return ( + + {content} + + ); + } + + return content; +} + +export function ScrollGuardTestPage() { + const [currentPage, setCurrentPage] = useState(0); + const [guardEnabled, setGuardEnabled] = useState(true); + + const handlePageSelected = (event: PagerViewOnPageSelectedEvent) => { + setCurrentPage(event.nativeEvent.position); + }; + + return ( + + + Horizontal ScrollView inside PagerView + + The banner area contains a horizontal ScrollView. Without ScrollGuard, + scrolling to the edge of the banner triggers the outer PagerView to swipe. + + + + + + Current Page + {PAGER_PAGES[currentPage]?.title} + + + ScrollGuard + + {guardEnabled ? 'ON' : 'OFF'} + + + + + setGuardEnabled((prev) => !prev)} + /> + + + {PAGER_PAGES.map((page) => ( + + {page.title} + + + + {guardEnabled ? 'Guarded Banner (scroll freely)' : 'Unguarded Banner (triggers pager at edge)'} + + + + + + Scroll the banner to the edge, then keep swiping.{'\n'} + {guardEnabled + ? 'With ScrollGuard: pager stays on this page.' + : 'Without ScrollGuard: pager swipes to next page.'} + + + ))} + + + + How to test + + 1. Scroll the banner cards horizontally to the right edge{'\n'} + 2. Keep swiping left — observe if the outer pager switches{'\n'} + 3. Toggle ScrollGuard OFF and repeat to see the difference{'\n'} + 4. Verify vertical scrolling still works (scroll this page) + + + + ); +} + +const styles = StyleSheet.create({ + headerCard: { + backgroundColor: '#FFFFFF', + borderRadius: 12, + padding: 16, + gap: 8, + }, + headerTitle: { + fontSize: 16, + fontWeight: '700', + color: '#111111', + }, + headerSubtitle: { + fontSize: 13, + color: '#666666', + lineHeight: 18, + }, + statusRow: { + flexDirection: 'row', + gap: 12, + }, + statusItem: { + flex: 1, + backgroundColor: '#FFFFFF', + borderRadius: 12, + padding: 16, + alignItems: 'center', + gap: 4, + }, + statusLabel: { + fontSize: 12, + color: '#8E8E93', + fontWeight: '500', + }, + statusValue: { + fontSize: 18, + fontWeight: '700', + color: '#111111', + }, + pagerView: { + height: 360, + borderRadius: 12, + overflow: 'hidden', + }, + page: { + flex: 1, + paddingHorizontal: 16, + paddingVertical: 20, + gap: 12, + }, + pageTitle: { + fontSize: 22, + fontWeight: '700', + color: '#111111', + textAlign: 'center', + }, + bannerSection: { + gap: 8, + }, + sectionLabel: { + fontSize: 13, + fontWeight: '600', + color: '#555555', + }, + guardWrapper: { + // ScrollGuardView needs no special styling — it's a transparent wrapper + }, + bannerContainer: { + paddingVertical: 8, + paddingHorizontal: 4, + gap: 10, + }, + bannerCard: { + width: 120, + height: 80, + borderRadius: 12, + padding: 12, + justifyContent: 'space-between', + }, + bannerTitle: { + fontSize: 14, + fontWeight: '600', + color: '#333333', + }, + bannerValue: { + fontSize: 16, + fontWeight: '700', + color: '#34C759', + }, + pageHint: { + fontSize: 12, + color: '#444444', + textAlign: 'center', + lineHeight: 18, + marginTop: 4, + }, + instructionCard: { + backgroundColor: '#FFFFFF', + borderRadius: 12, + padding: 16, + gap: 8, + }, + instructionTitle: { + fontSize: 15, + fontWeight: '700', + color: '#111111', + }, + instructionText: { + fontSize: 13, + color: '#555555', + lineHeight: 20, + }, +}); diff --git a/example/react-native/route.tsx b/example/react-native/route.tsx index 791fd97..524284e 100644 --- a/example/react-native/route.tsx +++ b/example/react-native/route.tsx @@ -14,6 +14,7 @@ import { DeviceUtilsTestPage } from './pages/DeviceUtilsTestPage'; import { SkeletonTestPage } from './pages/SkeletonTestPage'; import { NativeLoggerTestPage } from './pages/NativeLoggerTestPage'; import { PagerViewTestPage } from './pages/PagerViewTestPage'; +import { ScrollGuardTestPage } from './pages/ScrollGuardTestPage'; import { PerfMemoryTestPage } from './pages/PerfMemoryTestPage'; import { BundleUpdateTestPage } from './pages/BundleUpdateTestPage'; import { AppUpdateTestPage } from './pages/AppUpdateTestPage'; @@ -45,6 +46,7 @@ export type RootStackParamList = { NativeLogger: undefined; PagerView: undefined; PerfMemory: undefined; + ScrollGuard: undefined; Skeleton: undefined; SplashScreen: undefined; TabView: undefined; @@ -134,6 +136,12 @@ const modules: { screen: keyof RootStackParamList; name: string; description: st description: 'Read process memory usage (RSS) for performance monitoring', icon: '📊', }, + { + screen: 'ScrollGuard', + name: 'Scroll Guard', + description: 'Prevent parent PagerView from intercepting child ScrollView gestures', + icon: '🛡️', + }, { screen: 'Skeleton', name: 'Skeleton View', @@ -340,6 +348,7 @@ export function AppNavigator() { + diff --git a/native-views/react-native-scroll-guard/ScrollGuard.podspec b/native-views/react-native-scroll-guard/ScrollGuard.podspec new file mode 100644 index 0000000..c0fe299 --- /dev/null +++ b/native-views/react-native-scroll-guard/ScrollGuard.podspec @@ -0,0 +1,29 @@ +require "json" + +package = JSON.parse(File.read(File.join(__dir__, "package.json"))) + +Pod::Spec.new do |s| + s.name = "ScrollGuard" + s.version = package["version"] + s.summary = package["description"] + s.homepage = package["homepage"] + s.license = package["license"] + s.authors = package["author"] + + s.platforms = { :ios => min_ios_version_supported } + s.source = { :git => "https://github.com/OneKeyHQ/app-modules.git", :tag => "#{s.version}" } + + s.source_files = [ + "ios/**/*.{swift}", + "ios/**/*.{m,mm}", + "cpp/**/*.{hpp,cpp}", + ] + + s.dependency 'React-jsi' + s.dependency 'React-callinvoker' + + load 'nitrogen/generated/ios/ScrollGuard+autolinking.rb' + add_nitrogen_files(s) + + install_modules_dependencies(s) +end diff --git a/native-views/react-native-scroll-guard/android/CMakeLists.txt b/native-views/react-native-scroll-guard/android/CMakeLists.txt new file mode 100644 index 0000000..b085650 --- /dev/null +++ b/native-views/react-native-scroll-guard/android/CMakeLists.txt @@ -0,0 +1,24 @@ +project(scrollguard) +cmake_minimum_required(VERSION 3.9.0) + +set(PACKAGE_NAME scrollguard) +set(CMAKE_VERBOSE_MAKEFILE ON) +set(CMAKE_CXX_STANDARD 20) + +# Define C++ library and add all sources +add_library(${PACKAGE_NAME} SHARED src/main/cpp/cpp-adapter.cpp) + +# Add Nitrogen specs +include(${CMAKE_SOURCE_DIR}/../nitrogen/generated/android/scrollguard+autolinking.cmake) + +# Set up local includes +include_directories("src/main/cpp" "../cpp") + +find_library(LOG_LIB log) + +# Link all libraries together +target_link_libraries( + ${PACKAGE_NAME} + ${LOG_LIB} + android +) diff --git a/native-views/react-native-scroll-guard/android/build.gradle b/native-views/react-native-scroll-guard/android/build.gradle new file mode 100644 index 0000000..ec70f60 --- /dev/null +++ b/native-views/react-native-scroll-guard/android/build.gradle @@ -0,0 +1,124 @@ +buildscript { + ext.getExtOrDefault = {name -> + return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['ScrollGuard_' + name] + } + + repositories { + google() + mavenCentral() + } + + dependencies { + classpath "com.android.tools.build:gradle:8.7.2" + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${getExtOrDefault('kotlinVersion')}" + } +} + +def reactNativeArchitectures() { + def value = rootProject.getProperties().get("reactNativeArchitectures") + return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"] +} + +apply plugin: "com.android.library" +apply plugin: "kotlin-android" +apply from: '../nitrogen/generated/android/scrollguard+autolinking.gradle' + +apply plugin: "com.facebook.react" + +def getExtOrIntegerDefault(name) { + return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["ScrollGuard_" + name]).toInteger() +} + +android { + namespace "com.margelo.nitro.scrollguard" + + compileSdkVersion getExtOrIntegerDefault("compileSdkVersion") + + defaultConfig { + minSdkVersion getExtOrIntegerDefault("minSdkVersion") + targetSdkVersion getExtOrIntegerDefault("targetSdkVersion") + + externalNativeBuild { + cmake { + cppFlags "-frtti -fexceptions -Wall -fstack-protector-all" + arguments "-DANDROID_STL=c++_shared", "-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON" + abiFilters (*reactNativeArchitectures()) + + buildTypes { + debug { + cppFlags "-O1 -g" + } + release { + cppFlags "-O2" + } + } + } + } + } + + externalNativeBuild { + cmake { + path "CMakeLists.txt" + } + } + + packagingOptions { + excludes = [ + "META-INF", + "META-INF/**", + "**/libc++_shared.so", + "**/libfbjni.so", + "**/libjsi.so", + "**/libfolly_json.so", + "**/libfolly_runtime.so", + "**/libglog.so", + "**/libhermes.so", + "**/libhermes-executor-debug.so", + "**/libhermes_executor.so", + "**/libreactnative.so", + "**/libreactnativejni.so", + "**/libturbomodulejsijni.so", + ] + } + + buildFeatures { + prefab true + } + + buildTypes { + release { + minifyEnabled false + } + } + + lintOptions { + disable "GradleCompatible" + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + sourceSets { + main { + java.srcDirs += [ + "generated/java", + "generated/jni" + ] + } + } +} + +repositories { + mavenCentral() + google() +} + +def kotlin_version = getExtOrDefault("kotlinVersion") + +dependencies { + implementation "com.facebook.react:react-android" + implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" + implementation project(":react-native-nitro-modules") +} diff --git a/native-views/react-native-scroll-guard/android/src/main/AndroidManifest.xml b/native-views/react-native-scroll-guard/android/src/main/AndroidManifest.xml new file mode 100644 index 0000000..a2f47b6 --- /dev/null +++ b/native-views/react-native-scroll-guard/android/src/main/AndroidManifest.xml @@ -0,0 +1,2 @@ + + diff --git a/native-views/react-native-scroll-guard/android/src/main/cpp/cpp-adapter.cpp b/native-views/react-native-scroll-guard/android/src/main/cpp/cpp-adapter.cpp new file mode 100644 index 0000000..cea4c00 --- /dev/null +++ b/native-views/react-native-scroll-guard/android/src/main/cpp/cpp-adapter.cpp @@ -0,0 +1,6 @@ +#include +#include "scrollguardOnLoad.hpp" + +JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void*) { + return margelo::nitro::scrollguard::initialize(vm); +} diff --git a/native-views/react-native-scroll-guard/android/src/main/java/com/margelo/nitro/scrollguard/ScrollGuard.kt b/native-views/react-native-scroll-guard/android/src/main/java/com/margelo/nitro/scrollguard/ScrollGuard.kt new file mode 100644 index 0000000..9170d59 --- /dev/null +++ b/native-views/react-native-scroll-guard/android/src/main/java/com/margelo/nitro/scrollguard/ScrollGuard.kt @@ -0,0 +1,117 @@ +package com.margelo.nitro.scrollguard + +import android.content.Context +import android.view.MotionEvent +import android.view.View +import android.view.ViewConfiguration +import android.widget.FrameLayout +import com.facebook.proguard.annotations.DoNotStrip +import com.facebook.react.uimanager.ThemedReactContext +import kotlin.math.absoluteValue + +@DoNotStrip +class HybridScrollGuard(val context: ThemedReactContext) : HybridScrollGuardSpec() { + + override val view: View = ScrollGuardFrameLayout(context) + + override var direction: ScrollGuardDirection? = ScrollGuardDirection.HORIZONTAL + set(value) { + field = value + (view as ScrollGuardFrameLayout).guardDirection = value ?: ScrollGuardDirection.HORIZONTAL + } +} + +/** + * A native FrameLayout that prevents ancestor ViewPager2 (PagerView) from + * intercepting touch events that belong to child scrollable views. + * + * Mechanism: On ACTION_DOWN, immediately calls requestDisallowInterceptTouchEvent(true) + * to prevent all ancestors from intercepting. On ACTION_MOVE, checks the gesture + * direction and only keeps blocking for the guarded direction. Vertical gestures + * are released so the page can still scroll vertically. + */ +class ScrollGuardFrameLayout(context: Context) : FrameLayout(context) { + + var guardDirection: ScrollGuardDirection = ScrollGuardDirection.HORIZONTAL + + private var initialX = 0f + private var initialY = 0f + private val touchSlop = ViewConfiguration.get(context).scaledTouchSlop + private var directionDecided = false + + override fun onInterceptTouchEvent(ev: MotionEvent): Boolean { + when (ev.action) { + MotionEvent.ACTION_DOWN -> { + initialX = ev.x + initialY = ev.y + directionDecided = false + // Immediately prevent all ancestors (including ViewPager2) from intercepting. + // This is critical: ViewPager2's onInterceptTouchEvent runs in the same + // touch dispatch pass, so we must disallow BEFORE it gets a chance to decide. + parent?.requestDisallowInterceptTouchEvent(true) + } + MotionEvent.ACTION_MOVE -> { + if (!directionDecided) { + val dx = (ev.x - initialX).absoluteValue + val dy = (ev.y - initialY).absoluteValue + + if (dx > touchSlop || dy > touchSlop) { + directionDecided = true + val isHorizontalGesture = dx > dy + + val shouldBlock = when (guardDirection) { + ScrollGuardDirection.HORIZONTAL -> isHorizontalGesture + ScrollGuardDirection.VERTICAL -> !isHorizontalGesture + ScrollGuardDirection.BOTH -> true + } + + if (shouldBlock) { + // Guarded direction: keep blocking ancestors + parent?.requestDisallowInterceptTouchEvent(true) + } else { + // Non-guarded direction: release to ancestors + // (e.g., allow vertical scrolling of collapsible tabs) + parent?.requestDisallowInterceptTouchEvent(false) + } + } + } + } + MotionEvent.ACTION_UP, + MotionEvent.ACTION_CANCEL -> { + directionDecided = false + } + } + // Never intercept: let children (ScrollView/FlatList) handle touches normally + return false + } + + /** + * Re-assert disallow after child dispatch. + * + * This handles the case where a deeply-nested NestedScrollableHost (from another + * PagerView) calls requestDisallowInterceptTouchEvent(false) during its own + * dispatchTouchEvent, which would propagate up and override our earlier disallow. + */ + override fun dispatchTouchEvent(ev: MotionEvent): Boolean { + val handled = super.dispatchTouchEvent(ev) + + if (ev.action == MotionEvent.ACTION_MOVE && directionDecided) { + val dx = (ev.x - initialX).absoluteValue + val dy = (ev.y - initialY).absoluteValue + val isHorizontalGesture = dx > dy + + val shouldBlock = when (guardDirection) { + ScrollGuardDirection.HORIZONTAL -> isHorizontalGesture + ScrollGuardDirection.VERTICAL -> !isHorizontalGesture + ScrollGuardDirection.BOTH -> true + } + + if (shouldBlock) { + // Re-assert after child dispatch to prevent override + parent?.requestDisallowInterceptTouchEvent(true) + } + } + + return handled + } +} diff --git a/native-views/react-native-scroll-guard/android/src/main/java/com/margelo/nitro/scrollguard/ScrollGuardPackage.kt b/native-views/react-native-scroll-guard/android/src/main/java/com/margelo/nitro/scrollguard/ScrollGuardPackage.kt new file mode 100644 index 0000000..c479518 --- /dev/null +++ b/native-views/react-native-scroll-guard/android/src/main/java/com/margelo/nitro/scrollguard/ScrollGuardPackage.kt @@ -0,0 +1,29 @@ +package com.margelo.nitro.scrollguard + +import com.facebook.react.BaseReactPackage +import com.facebook.react.bridge.NativeModule +import com.facebook.react.bridge.ReactApplicationContext +import com.facebook.react.module.model.ReactModuleInfoProvider +import com.facebook.react.uimanager.ViewManager + +import com.margelo.nitro.scrollguard.views.HybridScrollGuardManager + +class ScrollGuardPackage : BaseReactPackage() { + override fun getModule(name: String, reactContext: ReactApplicationContext): NativeModule? { + return null + } + + override fun getReactModuleInfoProvider(): ReactModuleInfoProvider { + return ReactModuleInfoProvider { HashMap() } + } + + override fun createViewManagers(reactContext: ReactApplicationContext): List> { + return listOf(HybridScrollGuardManager()) + } + + companion object { + init { + System.loadLibrary("scrollguard") + } + } +} diff --git a/native-views/react-native-scroll-guard/ios/ScrollGuard.swift b/native-views/react-native-scroll-guard/ios/ScrollGuard.swift new file mode 100644 index 0000000..a6972b6 --- /dev/null +++ b/native-views/react-native-scroll-guard/ios/ScrollGuard.swift @@ -0,0 +1,132 @@ +import Foundation +import UIKit + +class HybridScrollGuard: HybridScrollGuardSpec { + + var view: UIView = ScrollGuardView() + + var direction: ScrollGuardDirection? = .horizontal { + didSet { + (view as? ScrollGuardView)?.guardDirection = direction ?? .horizontal + } + } + + override init() { + super.init() + } +} + +// MARK: - ScrollGuardView + +/// A native UIView wrapper that prevents ancestor UIPageViewController (PagerView) +/// from intercepting scroll gestures that belong to child UIScrollViews. +/// +/// Mechanism: When this view is added to the hierarchy, it walks up the view tree +/// to find the nearest paging UIScrollView (owned by UIPageViewController). +/// It then sets up `requireGestureRecognizerToFail` so the pager's pan gesture +/// must wait for child scroll view gestures to fail before it can activate. +class ScrollGuardView: UIView { + + var guardDirection: ScrollGuardDirection = .horizontal { + didSet { + setNeedsSetup() + } + } + + private var hasSetup = false + private var observedScrollViews: [UIScrollView] = [] + + override func didMoveToWindow() { + super.didMoveToWindow() + if window != nil { + // Delay setup to ensure child scroll views are mounted + DispatchQueue.main.async { [weak self] in + self?.setupGestureBlocking() + } + } else { + teardownGestureBlocking() + } + } + + override func layoutSubviews() { + super.layoutSubviews() + if !hasSetup && window != nil { + setupGestureBlocking() + } + } + + private func setNeedsSetup() { + hasSetup = false + if window != nil { + DispatchQueue.main.async { [weak self] in + self?.setupGestureBlocking() + } + } + } + + private func setupGestureBlocking() { + // Tear down previous state + teardownGestureBlocking() + + // 1. Find the nearest ancestor paging UIScrollView (UIPageViewController's internal scroll view) + guard let pagerScrollView = findAncestorPagingScrollView() else { return } + + // 2. Find all descendant UIScrollViews + let childScrollViews = findDescendantScrollViews(in: self) + if childScrollViews.isEmpty { return } + + // 3. Set up gesture dependency: + // pager's panGestureRecognizer requires child scroll view's pan to fail first. + // This means: as long as the child scroll view's gesture is active (even at edge), + // the pager cannot begin its gesture. + let blockHorizontal = guardDirection == .horizontal || guardDirection == .both + let blockVertical = guardDirection == .vertical || guardDirection == .both + + for childSV in childScrollViews { + let isChildHorizontal = childSV.contentSize.width > childSV.bounds.width + let isChildVertical = childSV.contentSize.height > childSV.bounds.height + + let shouldBlock = (blockHorizontal && isChildHorizontal) || (blockVertical && isChildVertical) + if shouldBlock { + pagerScrollView.panGestureRecognizer.require(toFail: childSV.panGestureRecognizer) + observedScrollViews.append(childSV) + } + } + + hasSetup = true + } + + private func teardownGestureBlocking() { + // iOS does not provide a public API to remove `requireGestureRecognizerToFail` + // relationships. They are automatically cleaned up when the gesture recognizer + // is deallocated. For dynamic scenarios, we rely on the scroll views being + // re-created (which happens naturally in React Native). + observedScrollViews.removeAll() + hasSetup = false + } + + /// Walk up the view hierarchy to find the nearest UIScrollView with isPagingEnabled + /// (this is the internal scroll view of UIPageViewController) + private func findAncestorPagingScrollView() -> UIScrollView? { + var current: UIView? = superview + while let v = current { + if let sv = v as? UIScrollView, sv.isPagingEnabled { + return sv + } + current = v.superview + } + return nil + } + + /// Recursively find all UIScrollViews in the subtree + private func findDescendantScrollViews(in view: UIView) -> [UIScrollView] { + var result: [UIScrollView] = [] + for subview in view.subviews { + if let sv = subview as? UIScrollView { + result.append(sv) + } + result.append(contentsOf: findDescendantScrollViews(in: subview)) + } + return result + } +} diff --git a/native-views/react-native-scroll-guard/nitro.json b/native-views/react-native-scroll-guard/nitro.json new file mode 100644 index 0000000..c49fedc --- /dev/null +++ b/native-views/react-native-scroll-guard/nitro.json @@ -0,0 +1,17 @@ +{ + "cxxNamespace": ["scrollguard"], + "ios": { + "iosModuleName": "ScrollGuard" + }, + "android": { + "androidNamespace": ["scrollguard"], + "androidCxxLibName": "scrollguard" + }, + "autolinking": { + "ScrollGuard": { + "swift": "HybridScrollGuard", + "kotlin": "HybridScrollGuard" + } + }, + "ignorePaths": ["node_modules"] +} diff --git a/native-views/react-native-scroll-guard/nitrogen/generated/.gitattributes b/native-views/react-native-scroll-guard/nitrogen/generated/.gitattributes new file mode 100644 index 0000000..fb7a0d5 --- /dev/null +++ b/native-views/react-native-scroll-guard/nitrogen/generated/.gitattributes @@ -0,0 +1 @@ +** linguist-generated=true diff --git a/native-views/react-native-scroll-guard/nitrogen/generated/android/c++/JHybridScrollGuardSpec.cpp b/native-views/react-native-scroll-guard/nitrogen/generated/android/c++/JHybridScrollGuardSpec.cpp new file mode 100644 index 0000000..67c81ec --- /dev/null +++ b/native-views/react-native-scroll-guard/nitrogen/generated/android/c++/JHybridScrollGuardSpec.cpp @@ -0,0 +1,59 @@ +/// +/// JHybridScrollGuardSpec.cpp +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/mrousavy/nitro +/// Copyright © 2026 Marc Rousavy @ Margelo +/// + +#include "JHybridScrollGuardSpec.hpp" + +// Forward declaration of `ScrollGuardDirection` to properly resolve imports. +namespace margelo::nitro::scrollguard { enum class ScrollGuardDirection; } + +#include "ScrollGuardDirection.hpp" +#include +#include "JScrollGuardDirection.hpp" + +namespace margelo::nitro::scrollguard { + + jni::local_ref JHybridScrollGuardSpec::initHybrid(jni::alias_ref jThis) { + return makeCxxInstance(jThis); + } + + void JHybridScrollGuardSpec::registerNatives() { + registerHybrid({ + makeNativeMethod("initHybrid", JHybridScrollGuardSpec::initHybrid), + }); + } + + size_t JHybridScrollGuardSpec::getExternalMemorySize() noexcept { + static const auto method = javaClassStatic()->getMethod("getMemorySize"); + return method(_javaPart); + } + + void JHybridScrollGuardSpec::dispose() noexcept { + static const auto method = javaClassStatic()->getMethod("dispose"); + method(_javaPart); + } + + std::string JHybridScrollGuardSpec::toString() { + static const auto method = javaClassStatic()->getMethod("toString"); + auto javaString = method(_javaPart); + return javaString->toStdString(); + } + + // Properties + std::optional JHybridScrollGuardSpec::getDirection() { + static const auto method = javaClassStatic()->getMethod()>("getDirection"); + auto __result = method(_javaPart); + return __result != nullptr ? std::make_optional(__result->toCpp()) : std::nullopt; + } + void JHybridScrollGuardSpec::setDirection(std::optional direction) { + static const auto method = javaClassStatic()->getMethod /* direction */)>("setDirection"); + method(_javaPart, direction.has_value() ? JScrollGuardDirection::fromCpp(direction.value()) : nullptr); + } + + // Methods + + +} // namespace margelo::nitro::scrollguard diff --git a/native-views/react-native-scroll-guard/nitrogen/generated/android/c++/JHybridScrollGuardSpec.hpp b/native-views/react-native-scroll-guard/nitrogen/generated/android/c++/JHybridScrollGuardSpec.hpp new file mode 100644 index 0000000..40d1db5 --- /dev/null +++ b/native-views/react-native-scroll-guard/nitrogen/generated/android/c++/JHybridScrollGuardSpec.hpp @@ -0,0 +1,66 @@ +/// +/// HybridScrollGuardSpec.hpp +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/mrousavy/nitro +/// Copyright © 2026 Marc Rousavy @ Margelo +/// + +#pragma once + +#include +#include +#include "HybridScrollGuardSpec.hpp" + + + + +namespace margelo::nitro::scrollguard { + + using namespace facebook; + + class JHybridScrollGuardSpec: public jni::HybridClass, + public virtual HybridScrollGuardSpec { + public: + static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/scrollguard/HybridScrollGuardSpec;"; + static jni::local_ref initHybrid(jni::alias_ref jThis); + static void registerNatives(); + + protected: + // C++ constructor (called from Java via `initHybrid()`) + explicit JHybridScrollGuardSpec(jni::alias_ref jThis) : + HybridObject(HybridScrollGuardSpec::TAG), + HybridBase(jThis), + _javaPart(jni::make_global(jThis)) {} + + public: + ~JHybridScrollGuardSpec() override { + // Hermes GC can destroy JS objects on a non-JNI Thread. + jni::ThreadScope::WithClassLoader([&] { _javaPart.reset(); }); + } + + public: + size_t getExternalMemorySize() noexcept override; + void dispose() noexcept override; + std::string toString() override; + + public: + inline const jni::global_ref& getJavaPart() const noexcept { + return _javaPart; + } + + public: + // Properties + std::optional getDirection() override; + void setDirection(std::optional direction) override; + + public: + // Methods + + + private: + friend HybridBase; + using HybridBase::HybridBase; + jni::global_ref _javaPart; + }; + +} // namespace margelo::nitro::scrollguard diff --git a/native-views/react-native-scroll-guard/nitrogen/generated/android/c++/JScrollGuardDirection.hpp b/native-views/react-native-scroll-guard/nitrogen/generated/android/c++/JScrollGuardDirection.hpp new file mode 100644 index 0000000..797687c --- /dev/null +++ b/native-views/react-native-scroll-guard/nitrogen/generated/android/c++/JScrollGuardDirection.hpp @@ -0,0 +1,62 @@ +/// +/// JScrollGuardDirection.hpp +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/mrousavy/nitro +/// Copyright © 2026 Marc Rousavy @ Margelo +/// + +#pragma once + +#include +#include "ScrollGuardDirection.hpp" + +namespace margelo::nitro::scrollguard { + + using namespace facebook; + + /** + * The C++ JNI bridge between the C++ enum "ScrollGuardDirection" and the the Kotlin enum "ScrollGuardDirection". + */ + struct JScrollGuardDirection final: public jni::JavaClass { + public: + static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/scrollguard/ScrollGuardDirection;"; + + public: + /** + * Convert this Java/Kotlin-based enum to the C++ enum ScrollGuardDirection. + */ + [[maybe_unused]] + [[nodiscard]] + ScrollGuardDirection toCpp() const { + static const auto clazz = javaClassStatic(); + static const auto fieldOrdinal = clazz->getField("value"); + int ordinal = this->getFieldValue(fieldOrdinal); + return static_cast(ordinal); + } + + public: + /** + * Create a Java/Kotlin-based enum with the given C++ enum's value. + */ + [[maybe_unused]] + static jni::alias_ref fromCpp(ScrollGuardDirection value) { + static const auto clazz = javaClassStatic(); + static const auto fieldHORIZONTAL = clazz->getStaticField("HORIZONTAL"); + static const auto fieldVERTICAL = clazz->getStaticField("VERTICAL"); + static const auto fieldBOTH = clazz->getStaticField("BOTH"); + + switch (value) { + case ScrollGuardDirection::HORIZONTAL: + return clazz->getStaticFieldValue(fieldHORIZONTAL); + case ScrollGuardDirection::VERTICAL: + return clazz->getStaticFieldValue(fieldVERTICAL); + case ScrollGuardDirection::BOTH: + return clazz->getStaticFieldValue(fieldBOTH); + default: + std::string stringValue = std::to_string(static_cast(value)); + throw std::invalid_argument("Invalid enum value (" + stringValue + "!"); + } + } + }; + +} // namespace margelo::nitro::scrollguard diff --git a/native-views/react-native-scroll-guard/nitrogen/generated/android/c++/views/JHybridScrollGuardStateUpdater.cpp b/native-views/react-native-scroll-guard/nitrogen/generated/android/c++/views/JHybridScrollGuardStateUpdater.cpp new file mode 100644 index 0000000..21575ab --- /dev/null +++ b/native-views/react-native-scroll-guard/nitrogen/generated/android/c++/views/JHybridScrollGuardStateUpdater.cpp @@ -0,0 +1,56 @@ +/// +/// JHybridScrollGuardStateUpdater.cpp +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/mrousavy/nitro +/// Copyright © 2026 Marc Rousavy @ Margelo +/// + +#include "JHybridScrollGuardStateUpdater.hpp" +#include "views/HybridScrollGuardComponent.hpp" +#include + +namespace margelo::nitro::scrollguard::views { + +using namespace facebook; +using ConcreteStateData = react::ConcreteState; + +void JHybridScrollGuardStateUpdater::updateViewProps(jni::alias_ref /* class */, + jni::alias_ref javaView, + jni::alias_ref stateWrapperInterface) { + JHybridScrollGuardSpec* view = javaView->cthis(); + + // Get concrete StateWrapperImpl from passed StateWrapper interface object + jobject rawStateWrapper = stateWrapperInterface.get(); + if (!stateWrapperInterface->isInstanceOf(react::StateWrapperImpl::javaClassStatic())) { + throw std::runtime_error("StateWrapper is not a StateWrapperImpl"); + } + auto stateWrapper = jni::alias_ref{ + static_cast(rawStateWrapper)}; + + std::shared_ptr state = stateWrapper->cthis()->getState(); + auto concreteState = std::dynamic_pointer_cast(state); + const HybridScrollGuardState& data = concreteState->getData(); + const std::optional& maybeProps = data.getProps(); + if (!maybeProps.has_value()) { + // Props aren't set yet! + throw std::runtime_error("HybridScrollGuardState's data doesn't contain any props!"); + } + const HybridScrollGuardProps& props = maybeProps.value(); + if (props.direction.isDirty) { + view->setDirection(props.direction.value); + // TODO: Set isDirty = false + } + + // Update hybridRef if it changed + if (props.hybridRef.isDirty) { + // hybridRef changed - call it with new this + const auto& maybeFunc = props.hybridRef.value; + if (maybeFunc.has_value()) { + std::shared_ptr shared = javaView->cthis()->shared_cast(); + maybeFunc.value()(shared); + } + // TODO: Set isDirty = false + } +} + +} // namespace margelo::nitro::scrollguard::views diff --git a/native-views/react-native-scroll-guard/nitrogen/generated/android/c++/views/JHybridScrollGuardStateUpdater.hpp b/native-views/react-native-scroll-guard/nitrogen/generated/android/c++/views/JHybridScrollGuardStateUpdater.hpp new file mode 100644 index 0000000..2550605 --- /dev/null +++ b/native-views/react-native-scroll-guard/nitrogen/generated/android/c++/views/JHybridScrollGuardStateUpdater.hpp @@ -0,0 +1,49 @@ +/// +/// JHybridScrollGuardStateUpdater.hpp +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/mrousavy/nitro +/// Copyright © 2026 Marc Rousavy @ Margelo +/// + +#pragma once + +#ifndef RN_SERIALIZABLE_STATE +#error scrollguard was compiled without the 'RN_SERIALIZABLE_STATE' flag. This flag is required for Nitro Views - set it in your CMakeLists! +#endif + +#include +#include +#include +#include +#include +#include +#include "JHybridScrollGuardSpec.hpp" +#include "views/HybridScrollGuardComponent.hpp" + +namespace margelo::nitro::scrollguard::views { + +using namespace facebook; + +class JHybridScrollGuardStateUpdater: public jni::JavaClass { +public: + static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/scrollguard/views/HybridScrollGuardStateUpdater;"; + +public: + static void updateViewProps(jni::alias_ref /* class */, + jni::alias_ref view, + jni::alias_ref stateWrapperInterface); + +public: + static void registerNatives() { + // Register JNI calls + javaClassStatic()->registerNatives({ + makeNativeMethod("updateViewProps", JHybridScrollGuardStateUpdater::updateViewProps), + }); + // Register React Native view component descriptor + auto provider = react::concreteComponentDescriptorProvider(); + auto providerRegistry = react::CoreComponentsRegistry::sharedProviderRegistry(); + providerRegistry->add(provider); + } +}; + +} // namespace margelo::nitro::scrollguard::views diff --git a/native-views/react-native-scroll-guard/nitrogen/generated/android/kotlin/com/margelo/nitro/scrollguard/HybridScrollGuardSpec.kt b/native-views/react-native-scroll-guard/nitrogen/generated/android/kotlin/com/margelo/nitro/scrollguard/HybridScrollGuardSpec.kt new file mode 100644 index 0000000..17bccb7 --- /dev/null +++ b/native-views/react-native-scroll-guard/nitrogen/generated/android/kotlin/com/margelo/nitro/scrollguard/HybridScrollGuardSpec.kt @@ -0,0 +1,59 @@ +/// +/// HybridScrollGuardSpec.kt +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/mrousavy/nitro +/// Copyright © 2026 Marc Rousavy @ Margelo +/// + +package com.margelo.nitro.scrollguard + +import androidx.annotation.Keep +import com.facebook.jni.HybridData +import com.facebook.proguard.annotations.DoNotStrip +import com.margelo.nitro.views.HybridView + +/** + * A Kotlin class representing the ScrollGuard HybridObject. + * Implement this abstract class to create Kotlin-based instances of ScrollGuard. + */ +@DoNotStrip +@Keep +@Suppress( + "KotlinJniMissingFunction", "unused", + "RedundantSuppression", "RedundantUnitReturnType", "SimpleRedundantLet", + "LocalVariableName", "PropertyName", "PrivatePropertyName", "FunctionName" +) +abstract class HybridScrollGuardSpec: HybridView() { + @DoNotStrip + private var mHybridData: HybridData = initHybrid() + + init { + super.updateNative(mHybridData) + } + + override fun updateNative(hybridData: HybridData) { + mHybridData = hybridData + super.updateNative(hybridData) + } + + // Default implementation of `HybridObject.toString()` + override fun toString(): String { + return "[HybridObject ScrollGuard]" + } + + // Properties + @get:DoNotStrip + @get:Keep + @set:DoNotStrip + @set:Keep + abstract var direction: ScrollGuardDirection? + + // Methods + + + private external fun initHybrid(): HybridData + + companion object { + protected const val TAG = "HybridScrollGuardSpec" + } +} diff --git a/native-views/react-native-scroll-guard/nitrogen/generated/android/kotlin/com/margelo/nitro/scrollguard/ScrollGuardDirection.kt b/native-views/react-native-scroll-guard/nitrogen/generated/android/kotlin/com/margelo/nitro/scrollguard/ScrollGuardDirection.kt new file mode 100644 index 0000000..38678a5 --- /dev/null +++ b/native-views/react-native-scroll-guard/nitrogen/generated/android/kotlin/com/margelo/nitro/scrollguard/ScrollGuardDirection.kt @@ -0,0 +1,22 @@ +/// +/// ScrollGuardDirection.kt +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/mrousavy/nitro +/// Copyright © 2026 Marc Rousavy @ Margelo +/// + +package com.margelo.nitro.scrollguard + +import androidx.annotation.Keep +import com.facebook.proguard.annotations.DoNotStrip + +/** + * Represents the JavaScript enum/union "ScrollGuardDirection". + */ +@DoNotStrip +@Keep +enum class ScrollGuardDirection(@DoNotStrip @Keep val value: Int) { + HORIZONTAL(0), + VERTICAL(1), + BOTH(2); +} diff --git a/native-views/react-native-scroll-guard/nitrogen/generated/android/kotlin/com/margelo/nitro/scrollguard/scrollguardOnLoad.kt b/native-views/react-native-scroll-guard/nitrogen/generated/android/kotlin/com/margelo/nitro/scrollguard/scrollguardOnLoad.kt new file mode 100644 index 0000000..c6c0116 --- /dev/null +++ b/native-views/react-native-scroll-guard/nitrogen/generated/android/kotlin/com/margelo/nitro/scrollguard/scrollguardOnLoad.kt @@ -0,0 +1,35 @@ +/// +/// scrollguardOnLoad.kt +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/mrousavy/nitro +/// Copyright © 2026 Marc Rousavy @ Margelo +/// + +package com.margelo.nitro.scrollguard + +import android.util.Log + +internal class scrollguardOnLoad { + companion object { + private const val TAG = "scrollguardOnLoad" + private var didLoad = false + /** + * Initializes the native part of "scrollguard". + * This method is idempotent and can be called more than once. + */ + @JvmStatic + fun initializeNative() { + if (didLoad) return + try { + Log.i(TAG, "Loading scrollguard C++ library...") + System.loadLibrary("scrollguard") + Log.i(TAG, "Successfully loaded scrollguard C++ library!") + didLoad = true + } catch (e: Error) { + Log.e(TAG, "Failed to load scrollguard C++ library! Is it properly installed and linked? " + + "Is the name correct? (see `CMakeLists.txt`, at `add_library(...)`)", e) + throw e + } + } + } +} diff --git a/native-views/react-native-scroll-guard/nitrogen/generated/android/kotlin/com/margelo/nitro/scrollguard/views/HybridScrollGuardManager.kt b/native-views/react-native-scroll-guard/nitrogen/generated/android/kotlin/com/margelo/nitro/scrollguard/views/HybridScrollGuardManager.kt new file mode 100644 index 0000000..0a4a476 --- /dev/null +++ b/native-views/react-native-scroll-guard/nitrogen/generated/android/kotlin/com/margelo/nitro/scrollguard/views/HybridScrollGuardManager.kt @@ -0,0 +1,50 @@ +/// +/// HybridScrollGuardManager.kt +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/mrousavy/nitro +/// Copyright © 2026 Marc Rousavy @ Margelo +/// + +package com.margelo.nitro.scrollguard.views + +import android.view.View +import com.facebook.react.uimanager.ReactStylesDiffMap +import com.facebook.react.uimanager.SimpleViewManager +import com.facebook.react.uimanager.StateWrapper +import com.facebook.react.uimanager.ThemedReactContext +import com.margelo.nitro.scrollguard.* + +/** + * Represents the React Native `ViewManager` for the "ScrollGuard" Nitro HybridView. + */ +open class HybridScrollGuardManager: SimpleViewManager() { + private val views = hashMapOf() + + override fun getName(): String { + return "ScrollGuard" + } + + override fun createViewInstance(reactContext: ThemedReactContext): View { + val hybridView = HybridScrollGuard(reactContext) + val view = hybridView.view + views[view] = hybridView + return view + } + + override fun onDropViewInstance(view: View) { + super.onDropViewInstance(view) + views.remove(view) + } + + override fun updateState(view: View, props: ReactStylesDiffMap, stateWrapper: StateWrapper): Any? { + val hybridView = views[view] ?: throw Error("Couldn't find view $view in local views table!") + + // 1. Update each prop individually + hybridView.beforeUpdate() + HybridScrollGuardStateUpdater.updateViewProps(hybridView, stateWrapper) + hybridView.afterUpdate() + + // 2. Continue in base View props + return super.updateState(view, props, stateWrapper) + } +} diff --git a/native-views/react-native-scroll-guard/nitrogen/generated/android/kotlin/com/margelo/nitro/scrollguard/views/HybridScrollGuardStateUpdater.kt b/native-views/react-native-scroll-guard/nitrogen/generated/android/kotlin/com/margelo/nitro/scrollguard/views/HybridScrollGuardStateUpdater.kt new file mode 100644 index 0000000..d248b3a --- /dev/null +++ b/native-views/react-native-scroll-guard/nitrogen/generated/android/kotlin/com/margelo/nitro/scrollguard/views/HybridScrollGuardStateUpdater.kt @@ -0,0 +1,23 @@ +/// +/// HybridScrollGuardStateUpdater.kt +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/mrousavy/nitro +/// Copyright © 2026 Marc Rousavy @ Margelo +/// + +package com.margelo.nitro.scrollguard.views + +import com.facebook.react.uimanager.StateWrapper +import com.margelo.nitro.scrollguard.* + +internal class HybridScrollGuardStateUpdater { + companion object { + /** + * Updates the props for [view] through C++. + * The [state] prop is expected to contain [view]'s props as wrapped Fabric state. + */ + @Suppress("KotlinJniMissingFunction") + @JvmStatic + external fun updateViewProps(view: HybridScrollGuardSpec, state: StateWrapper) + } +} diff --git a/native-views/react-native-scroll-guard/nitrogen/generated/android/scrollguard+autolinking.cmake b/native-views/react-native-scroll-guard/nitrogen/generated/android/scrollguard+autolinking.cmake new file mode 100644 index 0000000..2a14bdd --- /dev/null +++ b/native-views/react-native-scroll-guard/nitrogen/generated/android/scrollguard+autolinking.cmake @@ -0,0 +1,83 @@ +# +# scrollguard+autolinking.cmake +# This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +# https://github.com/mrousavy/nitro +# Copyright © 2026 Marc Rousavy @ Margelo +# + +# This is a CMake file that adds all files generated by Nitrogen +# to the current CMake project. +# +# To use it, add this to your CMakeLists.txt: +# ```cmake +# include(${CMAKE_SOURCE_DIR}/../nitrogen/generated/android/scrollguard+autolinking.cmake) +# ``` + +# Define a flag to check if we are building properly +add_definitions(-DBUILDING_SCROLLGUARD_WITH_GENERATED_CMAKE_PROJECT) + +# Enable Raw Props parsing in react-native (for Nitro Views) +add_definitions(-DRN_SERIALIZABLE_STATE) + +# Add all headers that were generated by Nitrogen +include_directories( + "../nitrogen/generated/shared/c++" + "../nitrogen/generated/android/c++" + "../nitrogen/generated/android/" +) + +# Add all .cpp sources that were generated by Nitrogen +target_sources( + # CMake project name (Android C++ library name) + scrollguard PRIVATE + # Autolinking Setup + ../nitrogen/generated/android/scrollguardOnLoad.cpp + # Shared Nitrogen C++ sources + ../nitrogen/generated/shared/c++/HybridScrollGuardSpec.cpp + ../nitrogen/generated/shared/c++/views/HybridScrollGuardComponent.cpp + # Android-specific Nitrogen C++ sources + ../nitrogen/generated/android/c++/JHybridScrollGuardSpec.cpp + ../nitrogen/generated/android/c++/views/JHybridScrollGuardStateUpdater.cpp +) + +# From node_modules/react-native/ReactAndroid/cmake-utils/folly-flags.cmake +# Used in node_modules/react-native/ReactAndroid/cmake-utils/ReactNative-application.cmake +target_compile_definitions( + scrollguard PRIVATE + -DFOLLY_NO_CONFIG=1 + -DFOLLY_HAVE_CLOCK_GETTIME=1 + -DFOLLY_USE_LIBCPP=1 + -DFOLLY_CFG_NO_COROUTINES=1 + -DFOLLY_MOBILE=1 + -DFOLLY_HAVE_RECVMMSG=1 + -DFOLLY_HAVE_PTHREAD=1 + # Once we target android-23 above, we can comment + # the following line. NDK uses GNU style stderror_r() after API 23. + -DFOLLY_HAVE_XSI_STRERROR_R=1 +) + +# Add all libraries required by the generated specs +find_package(fbjni REQUIRED) # <-- Used for communication between Java <-> C++ +find_package(ReactAndroid REQUIRED) # <-- Used to set up React Native bindings (e.g. CallInvoker/TurboModule) +find_package(react-native-nitro-modules REQUIRED) # <-- Used to create all HybridObjects and use the Nitro core library + +# Link all libraries together +target_link_libraries( + scrollguard + fbjni::fbjni # <-- Facebook C++ JNI helpers + ReactAndroid::jsi # <-- RN: JSI + react-native-nitro-modules::NitroModules # <-- NitroModules Core :) +) + +# Link react-native (different prefab between RN 0.75 and RN 0.76) +if(ReactAndroid_VERSION_MINOR GREATER_EQUAL 76) + target_link_libraries( + scrollguard + ReactAndroid::reactnative # <-- RN: Native Modules umbrella prefab + ) +else() + target_link_libraries( + scrollguard + ReactAndroid::react_nativemodule_core # <-- RN: TurboModules Core + ) +endif() diff --git a/native-views/react-native-scroll-guard/nitrogen/generated/android/scrollguard+autolinking.gradle b/native-views/react-native-scroll-guard/nitrogen/generated/android/scrollguard+autolinking.gradle new file mode 100644 index 0000000..4919b89 --- /dev/null +++ b/native-views/react-native-scroll-guard/nitrogen/generated/android/scrollguard+autolinking.gradle @@ -0,0 +1,27 @@ +/// +/// scrollguard+autolinking.gradle +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/mrousavy/nitro +/// Copyright © 2026 Marc Rousavy @ Margelo +/// + +/// This is a Gradle file that adds all files generated by Nitrogen +/// to the current Gradle project. +/// +/// To use it, add this to your build.gradle: +/// ```gradle +/// apply from: '../nitrogen/generated/android/scrollguard+autolinking.gradle' +/// ``` + +logger.warn("[NitroModules] 🔥 scrollguard is boosted by nitro!") + +android { + sourceSets { + main { + java.srcDirs += [ + // Nitrogen files + "${project.projectDir}/../nitrogen/generated/android/kotlin" + ] + } + } +} diff --git a/native-views/react-native-scroll-guard/nitrogen/generated/android/scrollguardOnLoad.cpp b/native-views/react-native-scroll-guard/nitrogen/generated/android/scrollguardOnLoad.cpp new file mode 100644 index 0000000..cae7801 --- /dev/null +++ b/native-views/react-native-scroll-guard/nitrogen/generated/android/scrollguardOnLoad.cpp @@ -0,0 +1,46 @@ +/// +/// scrollguardOnLoad.cpp +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/mrousavy/nitro +/// Copyright © 2026 Marc Rousavy @ Margelo +/// + +#ifndef BUILDING_SCROLLGUARD_WITH_GENERATED_CMAKE_PROJECT +#error scrollguardOnLoad.cpp is not being built with the autogenerated CMakeLists.txt project. Is a different CMakeLists.txt building this? +#endif + +#include "scrollguardOnLoad.hpp" + +#include +#include +#include + +#include "JHybridScrollGuardSpec.hpp" +#include "views/JHybridScrollGuardStateUpdater.hpp" +#include + +namespace margelo::nitro::scrollguard { + +int initialize(JavaVM* vm) { + using namespace margelo::nitro; + using namespace margelo::nitro::scrollguard; + using namespace facebook; + + return facebook::jni::initialize(vm, [] { + // Register native JNI methods + margelo::nitro::scrollguard::JHybridScrollGuardSpec::registerNatives(); + margelo::nitro::scrollguard::views::JHybridScrollGuardStateUpdater::registerNatives(); + + // Register Nitro Hybrid Objects + HybridObjectRegistry::registerHybridObjectConstructor( + "ScrollGuard", + []() -> std::shared_ptr { + static DefaultConstructableObject object("com/margelo/nitro/scrollguard/HybridScrollGuard"); + auto instance = object.create(); + return instance->cthis()->shared(); + } + ); + }); +} + +} // namespace margelo::nitro::scrollguard diff --git a/native-views/react-native-scroll-guard/nitrogen/generated/android/scrollguardOnLoad.hpp b/native-views/react-native-scroll-guard/nitrogen/generated/android/scrollguardOnLoad.hpp new file mode 100644 index 0000000..9e629ca --- /dev/null +++ b/native-views/react-native-scroll-guard/nitrogen/generated/android/scrollguardOnLoad.hpp @@ -0,0 +1,25 @@ +/// +/// scrollguardOnLoad.hpp +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/mrousavy/nitro +/// Copyright © 2026 Marc Rousavy @ Margelo +/// + +#include +#include + +namespace margelo::nitro::scrollguard { + + /** + * Initializes the native (C++) part of scrollguard, and autolinks all Hybrid Objects. + * Call this in your `JNI_OnLoad` function (probably inside `cpp-adapter.cpp`). + * Example: + * ```cpp (cpp-adapter.cpp) + * JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void*) { + * return margelo::nitro::scrollguard::initialize(vm); + * } + * ``` + */ + int initialize(JavaVM* vm); + +} // namespace margelo::nitro::scrollguard diff --git a/native-views/react-native-scroll-guard/nitrogen/generated/ios/ScrollGuard+autolinking.rb b/native-views/react-native-scroll-guard/nitrogen/generated/ios/ScrollGuard+autolinking.rb new file mode 100644 index 0000000..c58fc77 --- /dev/null +++ b/native-views/react-native-scroll-guard/nitrogen/generated/ios/ScrollGuard+autolinking.rb @@ -0,0 +1,60 @@ +# +# ScrollGuard+autolinking.rb +# This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +# https://github.com/mrousavy/nitro +# Copyright © 2026 Marc Rousavy @ Margelo +# + +# This is a Ruby script that adds all files generated by Nitrogen +# to the given podspec. +# +# To use it, add this to your .podspec: +# ```ruby +# Pod::Spec.new do |spec| +# # ... +# +# # Add all files generated by Nitrogen +# load 'nitrogen/generated/ios/ScrollGuard+autolinking.rb' +# add_nitrogen_files(spec) +# end +# ``` + +def add_nitrogen_files(spec) + Pod::UI.puts "[NitroModules] 🔥 ScrollGuard is boosted by nitro!" + + spec.dependency "NitroModules" + + current_source_files = Array(spec.attributes_hash['source_files']) + spec.source_files = current_source_files + [ + # Generated cross-platform specs + "nitrogen/generated/shared/**/*.{h,hpp,c,cpp,swift}", + # Generated bridges for the cross-platform specs + "nitrogen/generated/ios/**/*.{h,hpp,c,cpp,mm,swift}", + ] + + current_public_header_files = Array(spec.attributes_hash['public_header_files']) + spec.public_header_files = current_public_header_files + [ + # Generated specs + "nitrogen/generated/shared/**/*.{h,hpp}", + # Swift to C++ bridging helpers + "nitrogen/generated/ios/ScrollGuard-Swift-Cxx-Bridge.hpp" + ] + + current_private_header_files = Array(spec.attributes_hash['private_header_files']) + spec.private_header_files = current_private_header_files + [ + # iOS specific specs + "nitrogen/generated/ios/c++/**/*.{h,hpp}", + # Views are framework-specific and should be private + "nitrogen/generated/shared/**/views/**/*" + ] + + current_pod_target_xcconfig = spec.attributes_hash['pod_target_xcconfig'] || {} + spec.pod_target_xcconfig = current_pod_target_xcconfig.merge({ + # Use C++ 20 + "CLANG_CXX_LANGUAGE_STANDARD" => "c++20", + # Enables C++ <-> Swift interop (by default it's only C) + "SWIFT_OBJC_INTEROP_MODE" => "objcxx", + # Enables stricter modular headers + "DEFINES_MODULE" => "YES", + }) +end diff --git a/native-views/react-native-scroll-guard/nitrogen/generated/ios/ScrollGuard-Swift-Cxx-Bridge.cpp b/native-views/react-native-scroll-guard/nitrogen/generated/ios/ScrollGuard-Swift-Cxx-Bridge.cpp new file mode 100644 index 0000000..9d19a72 --- /dev/null +++ b/native-views/react-native-scroll-guard/nitrogen/generated/ios/ScrollGuard-Swift-Cxx-Bridge.cpp @@ -0,0 +1,33 @@ +/// +/// ScrollGuard-Swift-Cxx-Bridge.cpp +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/mrousavy/nitro +/// Copyright © 2026 Marc Rousavy @ Margelo +/// + +#include "ScrollGuard-Swift-Cxx-Bridge.hpp" + +// Include C++ implementation defined types +#include "HybridScrollGuardSpecSwift.hpp" +#include "ScrollGuard-Swift-Cxx-Umbrella.hpp" +#include + +namespace margelo::nitro::scrollguard::bridge::swift { + + // pragma MARK: std::shared_ptr + std::shared_ptr create_std__shared_ptr_HybridScrollGuardSpec_(void* NON_NULL swiftUnsafePointer) noexcept { + ScrollGuard::HybridScrollGuardSpec_cxx swiftPart = ScrollGuard::HybridScrollGuardSpec_cxx::fromUnsafe(swiftUnsafePointer); + return std::make_shared(swiftPart); + } + void* NON_NULL get_std__shared_ptr_HybridScrollGuardSpec_(std__shared_ptr_HybridScrollGuardSpec_ cppType) { + std::shared_ptr swiftWrapper = std::dynamic_pointer_cast(cppType); + #ifdef NITRO_DEBUG + if (swiftWrapper == nullptr) [[unlikely]] { + throw std::runtime_error("Class \"HybridScrollGuardSpec\" is not implemented in Swift!"); + } + #endif + ScrollGuard::HybridScrollGuardSpec_cxx& swiftPart = swiftWrapper->getSwiftPart(); + return swiftPart.toUnsafe(); + } + +} // namespace margelo::nitro::scrollguard::bridge::swift diff --git a/native-views/react-native-scroll-guard/nitrogen/generated/ios/ScrollGuard-Swift-Cxx-Bridge.hpp b/native-views/react-native-scroll-guard/nitrogen/generated/ios/ScrollGuard-Swift-Cxx-Bridge.hpp new file mode 100644 index 0000000..b88ea20 --- /dev/null +++ b/native-views/react-native-scroll-guard/nitrogen/generated/ios/ScrollGuard-Swift-Cxx-Bridge.hpp @@ -0,0 +1,59 @@ +/// +/// ScrollGuard-Swift-Cxx-Bridge.hpp +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/mrousavy/nitro +/// Copyright © 2026 Marc Rousavy @ Margelo +/// + +#pragma once + +// Forward declarations of C++ defined types +// Forward declaration of `HybridScrollGuardSpec` to properly resolve imports. +namespace margelo::nitro::scrollguard { class HybridScrollGuardSpec; } +// Forward declaration of `ScrollGuardDirection` to properly resolve imports. +namespace margelo::nitro::scrollguard { enum class ScrollGuardDirection; } + +// Forward declarations of Swift defined types +// Forward declaration of `HybridScrollGuardSpec_cxx` to properly resolve imports. +namespace ScrollGuard { class HybridScrollGuardSpec_cxx; } + +// Include C++ defined types +#include "HybridScrollGuardSpec.hpp" +#include "ScrollGuardDirection.hpp" +#include +#include + +/** + * Contains specialized versions of C++ templated types so they can be accessed from Swift, + * as well as helper functions to interact with those C++ types from Swift. + */ +namespace margelo::nitro::scrollguard::bridge::swift { + + // pragma MARK: std::optional + /** + * Specialized version of `std::optional`. + */ + using std__optional_ScrollGuardDirection_ = std::optional; + inline std::optional create_std__optional_ScrollGuardDirection_(const ScrollGuardDirection& value) noexcept { + return std::optional(value); + } + inline bool has_value_std__optional_ScrollGuardDirection_(const std::optional& optional) noexcept { + return optional.has_value(); + } + inline ScrollGuardDirection get_std__optional_ScrollGuardDirection_(const std::optional& optional) noexcept { + return *optional; + } + + // pragma MARK: std::shared_ptr + /** + * Specialized version of `std::shared_ptr`. + */ + using std__shared_ptr_HybridScrollGuardSpec_ = std::shared_ptr; + std::shared_ptr create_std__shared_ptr_HybridScrollGuardSpec_(void* NON_NULL swiftUnsafePointer) noexcept; + void* NON_NULL get_std__shared_ptr_HybridScrollGuardSpec_(std__shared_ptr_HybridScrollGuardSpec_ cppType); + + // pragma MARK: std::weak_ptr + using std__weak_ptr_HybridScrollGuardSpec_ = std::weak_ptr; + inline std__weak_ptr_HybridScrollGuardSpec_ weakify_std__shared_ptr_HybridScrollGuardSpec_(const std::shared_ptr& strong) noexcept { return strong; } + +} // namespace margelo::nitro::scrollguard::bridge::swift diff --git a/native-views/react-native-scroll-guard/nitrogen/generated/ios/ScrollGuard-Swift-Cxx-Umbrella.hpp b/native-views/react-native-scroll-guard/nitrogen/generated/ios/ScrollGuard-Swift-Cxx-Umbrella.hpp new file mode 100644 index 0000000..5005e8b --- /dev/null +++ b/native-views/react-native-scroll-guard/nitrogen/generated/ios/ScrollGuard-Swift-Cxx-Umbrella.hpp @@ -0,0 +1,45 @@ +/// +/// ScrollGuard-Swift-Cxx-Umbrella.hpp +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/mrousavy/nitro +/// Copyright © 2026 Marc Rousavy @ Margelo +/// + +#pragma once + +// Forward declarations of C++ defined types +// Forward declaration of `HybridScrollGuardSpec` to properly resolve imports. +namespace margelo::nitro::scrollguard { class HybridScrollGuardSpec; } +// Forward declaration of `ScrollGuardDirection` to properly resolve imports. +namespace margelo::nitro::scrollguard { enum class ScrollGuardDirection; } + +// Include C++ defined types +#include "HybridScrollGuardSpec.hpp" +#include "ScrollGuardDirection.hpp" +#include +#include + +// C++ helpers for Swift +#include "ScrollGuard-Swift-Cxx-Bridge.hpp" + +// Common C++ types used in Swift +#include +#include +#include +#include + +// Forward declarations of Swift defined types +// Forward declaration of `HybridScrollGuardSpec_cxx` to properly resolve imports. +namespace ScrollGuard { class HybridScrollGuardSpec_cxx; } + +// Include Swift defined types +#if __has_include("ScrollGuard-Swift.h") +// This header is generated by Xcode/Swift on every app build. +// If it cannot be found, make sure the Swift module's name (= podspec name) is actually "ScrollGuard". +#include "ScrollGuard-Swift.h" +// Same as above, but used when building with frameworks (`use_frameworks`) +#elif __has_include() +#include +#else +#error ScrollGuard's autogenerated Swift header cannot be found! Make sure the Swift module's name (= podspec name) is actually "ScrollGuard", and try building the app first. +#endif diff --git a/native-views/react-native-scroll-guard/nitrogen/generated/ios/ScrollGuardAutolinking.mm b/native-views/react-native-scroll-guard/nitrogen/generated/ios/ScrollGuardAutolinking.mm new file mode 100644 index 0000000..8a40d3f --- /dev/null +++ b/native-views/react-native-scroll-guard/nitrogen/generated/ios/ScrollGuardAutolinking.mm @@ -0,0 +1,33 @@ +/// +/// ScrollGuardAutolinking.mm +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/mrousavy/nitro +/// Copyright © 2026 Marc Rousavy @ Margelo +/// + +#import +#import +#import "ScrollGuard-Swift-Cxx-Umbrella.hpp" +#import + +#include "HybridScrollGuardSpecSwift.hpp" + +@interface ScrollGuardAutolinking : NSObject +@end + +@implementation ScrollGuardAutolinking + ++ (void) load { + using namespace margelo::nitro; + using namespace margelo::nitro::scrollguard; + + HybridObjectRegistry::registerHybridObjectConstructor( + "ScrollGuard", + []() -> std::shared_ptr { + std::shared_ptr hybridObject = ScrollGuard::ScrollGuardAutolinking::createScrollGuard(); + return hybridObject; + } + ); +} + +@end diff --git a/native-views/react-native-scroll-guard/nitrogen/generated/ios/ScrollGuardAutolinking.swift b/native-views/react-native-scroll-guard/nitrogen/generated/ios/ScrollGuardAutolinking.swift new file mode 100644 index 0000000..418c9fd --- /dev/null +++ b/native-views/react-native-scroll-guard/nitrogen/generated/ios/ScrollGuardAutolinking.swift @@ -0,0 +1,25 @@ +/// +/// ScrollGuardAutolinking.swift +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/mrousavy/nitro +/// Copyright © 2026 Marc Rousavy @ Margelo +/// + +public final class ScrollGuardAutolinking { + public typealias bridge = margelo.nitro.scrollguard.bridge.swift + + /** + * Creates an instance of a Swift class that implements `HybridScrollGuardSpec`, + * and wraps it in a Swift class that can directly interop with C++ (`HybridScrollGuardSpec_cxx`) + * + * This is generated by Nitrogen and will initialize the class specified + * in the `"autolinking"` property of `nitro.json` (in this case, `HybridScrollGuard`). + */ + public static func createScrollGuard() -> bridge.std__shared_ptr_HybridScrollGuardSpec_ { + let hybridObject = HybridScrollGuard() + return { () -> bridge.std__shared_ptr_HybridScrollGuardSpec_ in + let __cxxWrapped = hybridObject.getCxxWrapper() + return __cxxWrapped.getCxxPart() + }() + } +} diff --git a/native-views/react-native-scroll-guard/nitrogen/generated/ios/c++/HybridScrollGuardSpecSwift.cpp b/native-views/react-native-scroll-guard/nitrogen/generated/ios/c++/HybridScrollGuardSpecSwift.cpp new file mode 100644 index 0000000..cc884b3 --- /dev/null +++ b/native-views/react-native-scroll-guard/nitrogen/generated/ios/c++/HybridScrollGuardSpecSwift.cpp @@ -0,0 +1,11 @@ +/// +/// HybridScrollGuardSpecSwift.cpp +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/mrousavy/nitro +/// Copyright © 2026 Marc Rousavy @ Margelo +/// + +#include "HybridScrollGuardSpecSwift.hpp" + +namespace margelo::nitro::scrollguard { +} // namespace margelo::nitro::scrollguard diff --git a/native-views/react-native-scroll-guard/nitrogen/generated/ios/c++/HybridScrollGuardSpecSwift.hpp b/native-views/react-native-scroll-guard/nitrogen/generated/ios/c++/HybridScrollGuardSpecSwift.hpp new file mode 100644 index 0000000..a04e1ca --- /dev/null +++ b/native-views/react-native-scroll-guard/nitrogen/generated/ios/c++/HybridScrollGuardSpecSwift.hpp @@ -0,0 +1,77 @@ +/// +/// HybridScrollGuardSpecSwift.hpp +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/mrousavy/nitro +/// Copyright © 2026 Marc Rousavy @ Margelo +/// + +#pragma once + +#include "HybridScrollGuardSpec.hpp" + +// Forward declaration of `HybridScrollGuardSpec_cxx` to properly resolve imports. +namespace ScrollGuard { class HybridScrollGuardSpec_cxx; } + +// Forward declaration of `ScrollGuardDirection` to properly resolve imports. +namespace margelo::nitro::scrollguard { enum class ScrollGuardDirection; } + +#include "ScrollGuardDirection.hpp" +#include + +#include "ScrollGuard-Swift-Cxx-Umbrella.hpp" + +namespace margelo::nitro::scrollguard { + + /** + * The C++ part of HybridScrollGuardSpec_cxx.swift. + * + * HybridScrollGuardSpecSwift (C++) accesses HybridScrollGuardSpec_cxx (Swift), and might + * contain some additional bridging code for C++ <> Swift interop. + * + * Since this obviously introduces an overhead, I hope at some point in + * the future, HybridScrollGuardSpec_cxx can directly inherit from the C++ class HybridScrollGuardSpec + * to simplify the whole structure and memory management. + */ + class HybridScrollGuardSpecSwift: public virtual HybridScrollGuardSpec { + public: + // Constructor from a Swift instance + explicit HybridScrollGuardSpecSwift(const ScrollGuard::HybridScrollGuardSpec_cxx& swiftPart): + HybridObject(HybridScrollGuardSpec::TAG), + _swiftPart(swiftPart) { } + + public: + // Get the Swift part + inline ScrollGuard::HybridScrollGuardSpec_cxx& getSwiftPart() noexcept { + return _swiftPart; + } + + public: + inline size_t getExternalMemorySize() noexcept override { + return _swiftPart.getMemorySize(); + } + void dispose() noexcept override { + _swiftPart.dispose(); + } + std::string toString() override { + return _swiftPart.toString(); + } + + public: + // Properties + inline std::optional getDirection() noexcept override { + auto __result = _swiftPart.getDirection(); + return __result; + } + inline void setDirection(std::optional direction) noexcept override { + _swiftPart.setDirection(direction); + } + + public: + // Methods + + + private: + ScrollGuard::HybridScrollGuardSpec_cxx _swiftPart; + }; + +} // namespace margelo::nitro::scrollguard diff --git a/native-views/react-native-scroll-guard/nitrogen/generated/ios/c++/views/HybridScrollGuardComponent.mm b/native-views/react-native-scroll-guard/nitrogen/generated/ios/c++/views/HybridScrollGuardComponent.mm new file mode 100644 index 0000000..fdb3bdc --- /dev/null +++ b/native-views/react-native-scroll-guard/nitrogen/generated/ios/c++/views/HybridScrollGuardComponent.mm @@ -0,0 +1,96 @@ +/// +/// HybridScrollGuardComponent.mm +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/mrousavy/nitro +/// Copyright © 2026 Marc Rousavy @ Margelo +/// + +#import "HybridScrollGuardComponent.hpp" +#import +#import +#import +#import +#import +#import +#import + +#import "HybridScrollGuardSpecSwift.hpp" +#import "ScrollGuard-Swift-Cxx-Umbrella.hpp" + +using namespace facebook; +using namespace margelo::nitro::scrollguard; +using namespace margelo::nitro::scrollguard::views; + +/** + * Represents the React Native View holder for the Nitro "ScrollGuard" HybridView. + */ +@interface HybridScrollGuardComponent: RCTViewComponentView +@end + +@implementation HybridScrollGuardComponent { + std::shared_ptr _hybridView; +} + ++ (void) load { + [super load]; + [RCTComponentViewFactory.currentComponentViewFactory registerComponentViewClass:[HybridScrollGuardComponent class]]; +} + ++ (react::ComponentDescriptorProvider) componentDescriptorProvider { + return react::concreteComponentDescriptorProvider(); +} + +- (instancetype) init { + if (self = [super init]) { + std::shared_ptr hybridView = ScrollGuard::ScrollGuardAutolinking::createScrollGuard(); + _hybridView = std::dynamic_pointer_cast(hybridView); + [self updateView]; + } + return self; +} + +- (void) updateView { + // 1. Get Swift part + ScrollGuard::HybridScrollGuardSpec_cxx& swiftPart = _hybridView->getSwiftPart(); + + // 2. Get UIView* + void* viewUnsafe = swiftPart.getView(); + UIView* view = (__bridge_transfer UIView*) viewUnsafe; + + // 3. Update RCTViewComponentView's [contentView] + [self setContentView:view]; +} + +- (void) updateProps:(const std::shared_ptr&)props + oldProps:(const std::shared_ptr&)oldProps { + // 1. Downcast props + const auto& newViewPropsConst = *std::static_pointer_cast(props); + auto& newViewProps = const_cast(newViewPropsConst); + ScrollGuard::HybridScrollGuardSpec_cxx& swiftPart = _hybridView->getSwiftPart(); + + // 2. Update each prop individually + swiftPart.beforeUpdate(); + + // direction: optional + if (newViewProps.direction.isDirty) { + swiftPart.setDirection(newViewProps.direction.value); + newViewProps.direction.isDirty = false; + } + + swiftPart.afterUpdate(); + + // 3. Update hybridRef if it changed + if (newViewProps.hybridRef.isDirty) { + // hybridRef changed - call it with new this + const auto& maybeFunc = newViewProps.hybridRef.value; + if (maybeFunc.has_value()) { + maybeFunc.value()(_hybridView); + } + newViewProps.hybridRef.isDirty = false; + } + + // 4. Continue in base class + [super updateProps:props oldProps:oldProps]; +} + +@end diff --git a/native-views/react-native-scroll-guard/nitrogen/generated/ios/swift/HybridScrollGuardSpec.swift b/native-views/react-native-scroll-guard/nitrogen/generated/ios/swift/HybridScrollGuardSpec.swift new file mode 100644 index 0000000..904b4f6 --- /dev/null +++ b/native-views/react-native-scroll-guard/nitrogen/generated/ios/swift/HybridScrollGuardSpec.swift @@ -0,0 +1,56 @@ +/// +/// HybridScrollGuardSpec.swift +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/mrousavy/nitro +/// Copyright © 2026 Marc Rousavy @ Margelo +/// + +import Foundation +import NitroModules + +/// See ``HybridScrollGuardSpec`` +public protocol HybridScrollGuardSpec_protocol: HybridObject, HybridView { + // Properties + var direction: ScrollGuardDirection? { get set } + + // Methods + +} + +public extension HybridScrollGuardSpec_protocol { + /// Default implementation of ``HybridObject.toString`` + func toString() -> String { + return "[HybridObject ScrollGuard]" + } +} + +/// See ``HybridScrollGuardSpec`` +open class HybridScrollGuardSpec_base { + private weak var cxxWrapper: HybridScrollGuardSpec_cxx? = nil + public init() { } + public func getCxxWrapper() -> HybridScrollGuardSpec_cxx { + #if DEBUG + guard self is HybridScrollGuardSpec else { + fatalError("`self` is not a `HybridScrollGuardSpec`! Did you accidentally inherit from `HybridScrollGuardSpec_base` instead of `HybridScrollGuardSpec`?") + } + #endif + if let cxxWrapper = self.cxxWrapper { + return cxxWrapper + } else { + let cxxWrapper = HybridScrollGuardSpec_cxx(self as! HybridScrollGuardSpec) + self.cxxWrapper = cxxWrapper + return cxxWrapper + } + } +} + +/** + * A Swift base-protocol representing the ScrollGuard HybridObject. + * Implement this protocol to create Swift-based instances of ScrollGuard. + * ```swift + * class HybridScrollGuard : HybridScrollGuardSpec { + * // ... + * } + * ``` + */ +public typealias HybridScrollGuardSpec = HybridScrollGuardSpec_protocol & HybridScrollGuardSpec_base diff --git a/native-views/react-native-scroll-guard/nitrogen/generated/ios/swift/HybridScrollGuardSpec_cxx.swift b/native-views/react-native-scroll-guard/nitrogen/generated/ios/swift/HybridScrollGuardSpec_cxx.swift new file mode 100644 index 0000000..9bc1294 --- /dev/null +++ b/native-views/react-native-scroll-guard/nitrogen/generated/ios/swift/HybridScrollGuardSpec_cxx.swift @@ -0,0 +1,146 @@ +/// +/// HybridScrollGuardSpec_cxx.swift +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/mrousavy/nitro +/// Copyright © 2026 Marc Rousavy @ Margelo +/// + +import Foundation +import NitroModules + +/** + * A class implementation that bridges HybridScrollGuardSpec over to C++. + * In C++, we cannot use Swift protocols - so we need to wrap it in a class to make it strongly defined. + * + * Also, some Swift types need to be bridged with special handling: + * - Enums need to be wrapped in Structs, otherwise they cannot be accessed bi-directionally (Swift bug: https://github.com/swiftlang/swift/issues/75330) + * - Other HybridObjects need to be wrapped/unwrapped from the Swift TCxx wrapper + * - Throwing methods need to be wrapped with a Result type, as exceptions cannot be propagated to C++ + */ +open class HybridScrollGuardSpec_cxx { + /** + * The Swift <> C++ bridge's namespace (`margelo::nitro::scrollguard::bridge::swift`) + * from `ScrollGuard-Swift-Cxx-Bridge.hpp`. + * This contains specialized C++ templates, and C++ helper functions that can be accessed from Swift. + */ + public typealias bridge = margelo.nitro.scrollguard.bridge.swift + + /** + * Holds an instance of the `HybridScrollGuardSpec` Swift protocol. + */ + private var __implementation: any HybridScrollGuardSpec + + /** + * Holds a weak pointer to the C++ class that wraps the Swift class. + */ + private var __cxxPart: bridge.std__weak_ptr_HybridScrollGuardSpec_ + + /** + * Create a new `HybridScrollGuardSpec_cxx` that wraps the given `HybridScrollGuardSpec`. + * All properties and methods bridge to C++ types. + */ + public init(_ implementation: any HybridScrollGuardSpec) { + self.__implementation = implementation + self.__cxxPart = .init() + /* no base class */ + } + + /** + * Get the actual `HybridScrollGuardSpec` instance this class wraps. + */ + @inline(__always) + public func getHybridScrollGuardSpec() -> any HybridScrollGuardSpec { + return __implementation + } + + /** + * Casts this instance to a retained unsafe raw pointer. + * This acquires one additional strong reference on the object! + */ + public func toUnsafe() -> UnsafeMutableRawPointer { + return Unmanaged.passRetained(self).toOpaque() + } + + /** + * Casts an unsafe pointer to a `HybridScrollGuardSpec_cxx`. + * The pointer has to be a retained opaque `Unmanaged`. + * This removes one strong reference from the object! + */ + public class func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> HybridScrollGuardSpec_cxx { + return Unmanaged.fromOpaque(pointer).takeRetainedValue() + } + + /** + * Gets (or creates) the C++ part of this Hybrid Object. + * The C++ part is a `std::shared_ptr`. + */ + public func getCxxPart() -> bridge.std__shared_ptr_HybridScrollGuardSpec_ { + let cachedCxxPart = self.__cxxPart.lock() + if Bool(fromCxx: cachedCxxPart) { + return cachedCxxPart + } else { + let newCxxPart = bridge.create_std__shared_ptr_HybridScrollGuardSpec_(self.toUnsafe()) + __cxxPart = bridge.weakify_std__shared_ptr_HybridScrollGuardSpec_(newCxxPart) + return newCxxPart + } + } + + + + /** + * Get the memory size of the Swift class (plus size of any other allocations) + * so the JS VM can properly track it and garbage-collect the JS object if needed. + */ + @inline(__always) + public var memorySize: Int { + return MemoryHelper.getSizeOf(self.__implementation) + self.__implementation.memorySize + } + + /** + * Call dispose() on the Swift class. + * This _may_ be called manually from JS. + */ + @inline(__always) + public func dispose() { + self.__implementation.dispose() + } + + /** + * Call toString() on the Swift class. + */ + @inline(__always) + public func toString() -> String { + return self.__implementation.toString() + } + + // Properties + public final var direction: bridge.std__optional_ScrollGuardDirection_ { + @inline(__always) + get { + return { () -> bridge.std__optional_ScrollGuardDirection_ in + if let __unwrappedValue = self.__implementation.direction { + return bridge.create_std__optional_ScrollGuardDirection_(__unwrappedValue) + } else { + return .init() + } + }() + } + @inline(__always) + set { + self.__implementation.direction = newValue.value + } + } + + // Methods + public final func getView() -> UnsafeMutableRawPointer { + return Unmanaged.passRetained(__implementation.view).toOpaque() + } + + public final func beforeUpdate() { + __implementation.beforeUpdate() + } + + public final func afterUpdate() { + __implementation.afterUpdate() + } +} diff --git a/native-views/react-native-scroll-guard/nitrogen/generated/ios/swift/ScrollGuardDirection.swift b/native-views/react-native-scroll-guard/nitrogen/generated/ios/swift/ScrollGuardDirection.swift new file mode 100644 index 0000000..66d2452 --- /dev/null +++ b/native-views/react-native-scroll-guard/nitrogen/generated/ios/swift/ScrollGuardDirection.swift @@ -0,0 +1,44 @@ +/// +/// ScrollGuardDirection.swift +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/mrousavy/nitro +/// Copyright © 2026 Marc Rousavy @ Margelo +/// + +/** + * Represents the JS union `ScrollGuardDirection`, backed by a C++ enum. + */ +public typealias ScrollGuardDirection = margelo.nitro.scrollguard.ScrollGuardDirection + +public extension ScrollGuardDirection { + /** + * Get a ScrollGuardDirection for the given String value, or + * return `nil` if the given value was invalid/unknown. + */ + init?(fromString string: String) { + switch string { + case "horizontal": + self = .horizontal + case "vertical": + self = .vertical + case "both": + self = .both + default: + return nil + } + } + + /** + * Get the String value this ScrollGuardDirection represents. + */ + var stringValue: String { + switch self { + case .horizontal: + return "horizontal" + case .vertical: + return "vertical" + case .both: + return "both" + } + } +} diff --git a/native-views/react-native-scroll-guard/nitrogen/generated/shared/c++/HybridScrollGuardSpec.cpp b/native-views/react-native-scroll-guard/nitrogen/generated/shared/c++/HybridScrollGuardSpec.cpp new file mode 100644 index 0000000..bee575f --- /dev/null +++ b/native-views/react-native-scroll-guard/nitrogen/generated/shared/c++/HybridScrollGuardSpec.cpp @@ -0,0 +1,22 @@ +/// +/// HybridScrollGuardSpec.cpp +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/mrousavy/nitro +/// Copyright © 2026 Marc Rousavy @ Margelo +/// + +#include "HybridScrollGuardSpec.hpp" + +namespace margelo::nitro::scrollguard { + + void HybridScrollGuardSpec::loadHybridMethods() { + // load base methods/properties + HybridObject::loadHybridMethods(); + // load custom methods/properties + registerHybrids(this, [](Prototype& prototype) { + prototype.registerHybridGetter("direction", &HybridScrollGuardSpec::getDirection); + prototype.registerHybridSetter("direction", &HybridScrollGuardSpec::setDirection); + }); + } + +} // namespace margelo::nitro::scrollguard diff --git a/native-views/react-native-scroll-guard/nitrogen/generated/shared/c++/HybridScrollGuardSpec.hpp b/native-views/react-native-scroll-guard/nitrogen/generated/shared/c++/HybridScrollGuardSpec.hpp new file mode 100644 index 0000000..00ffcf6 --- /dev/null +++ b/native-views/react-native-scroll-guard/nitrogen/generated/shared/c++/HybridScrollGuardSpec.hpp @@ -0,0 +1,65 @@ +/// +/// HybridScrollGuardSpec.hpp +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/mrousavy/nitro +/// Copyright © 2026 Marc Rousavy @ Margelo +/// + +#pragma once + +#if __has_include() +#include +#else +#error NitroModules cannot be found! Are you sure you installed NitroModules properly? +#endif + +// Forward declaration of `ScrollGuardDirection` to properly resolve imports. +namespace margelo::nitro::scrollguard { enum class ScrollGuardDirection; } + +#include "ScrollGuardDirection.hpp" +#include + +namespace margelo::nitro::scrollguard { + + using namespace margelo::nitro; + + /** + * An abstract base class for `ScrollGuard` + * Inherit this class to create instances of `HybridScrollGuardSpec` in C++. + * You must explicitly call `HybridObject`'s constructor yourself, because it is virtual. + * @example + * ```cpp + * class HybridScrollGuard: public HybridScrollGuardSpec { + * public: + * HybridScrollGuard(...): HybridObject(TAG) { ... } + * // ... + * }; + * ``` + */ + class HybridScrollGuardSpec: public virtual HybridObject { + public: + // Constructor + explicit HybridScrollGuardSpec(): HybridObject(TAG) { } + + // Destructor + ~HybridScrollGuardSpec() override = default; + + public: + // Properties + virtual std::optional getDirection() = 0; + virtual void setDirection(std::optional direction) = 0; + + public: + // Methods + + + protected: + // Hybrid Setup + void loadHybridMethods() override; + + protected: + // Tag for logging + static constexpr auto TAG = "ScrollGuard"; + }; + +} // namespace margelo::nitro::scrollguard diff --git a/native-views/react-native-scroll-guard/nitrogen/generated/shared/c++/ScrollGuardDirection.hpp b/native-views/react-native-scroll-guard/nitrogen/generated/shared/c++/ScrollGuardDirection.hpp new file mode 100644 index 0000000..78fe5a4 --- /dev/null +++ b/native-views/react-native-scroll-guard/nitrogen/generated/shared/c++/ScrollGuardDirection.hpp @@ -0,0 +1,80 @@ +/// +/// ScrollGuardDirection.hpp +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/mrousavy/nitro +/// Copyright © 2026 Marc Rousavy @ Margelo +/// + +#pragma once + +#if __has_include() +#include +#else +#error NitroModules cannot be found! Are you sure you installed NitroModules properly? +#endif +#if __has_include() +#include +#else +#error NitroModules cannot be found! Are you sure you installed NitroModules properly? +#endif +#if __has_include() +#include +#else +#error NitroModules cannot be found! Are you sure you installed NitroModules properly? +#endif + +namespace margelo::nitro::scrollguard { + + /** + * An enum which can be represented as a JavaScript union (ScrollGuardDirection). + */ + enum class ScrollGuardDirection { + HORIZONTAL SWIFT_NAME(horizontal) = 0, + VERTICAL SWIFT_NAME(vertical) = 1, + BOTH SWIFT_NAME(both) = 2, + } CLOSED_ENUM; + +} // namespace margelo::nitro::scrollguard + +namespace margelo::nitro { + + // C++ ScrollGuardDirection <> JS ScrollGuardDirection (union) + template <> + struct JSIConverter final { + static inline margelo::nitro::scrollguard::ScrollGuardDirection fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { + std::string unionValue = JSIConverter::fromJSI(runtime, arg); + switch (hashString(unionValue.c_str(), unionValue.size())) { + case hashString("horizontal"): return margelo::nitro::scrollguard::ScrollGuardDirection::HORIZONTAL; + case hashString("vertical"): return margelo::nitro::scrollguard::ScrollGuardDirection::VERTICAL; + case hashString("both"): return margelo::nitro::scrollguard::ScrollGuardDirection::BOTH; + default: [[unlikely]] + throw std::invalid_argument("Cannot convert \"" + unionValue + "\" to enum ScrollGuardDirection - invalid value!"); + } + } + static inline jsi::Value toJSI(jsi::Runtime& runtime, margelo::nitro::scrollguard::ScrollGuardDirection arg) { + switch (arg) { + case margelo::nitro::scrollguard::ScrollGuardDirection::HORIZONTAL: return JSIConverter::toJSI(runtime, "horizontal"); + case margelo::nitro::scrollguard::ScrollGuardDirection::VERTICAL: return JSIConverter::toJSI(runtime, "vertical"); + case margelo::nitro::scrollguard::ScrollGuardDirection::BOTH: return JSIConverter::toJSI(runtime, "both"); + default: [[unlikely]] + throw std::invalid_argument("Cannot convert ScrollGuardDirection to JS - invalid value: " + + std::to_string(static_cast(arg)) + "!"); + } + } + static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) { + if (!value.isString()) { + return false; + } + std::string unionValue = JSIConverter::fromJSI(runtime, value); + switch (hashString(unionValue.c_str(), unionValue.size())) { + case hashString("horizontal"): + case hashString("vertical"): + case hashString("both"): + return true; + default: + return false; + } + } + }; + +} // namespace margelo::nitro diff --git a/native-views/react-native-scroll-guard/nitrogen/generated/shared/c++/views/HybridScrollGuardComponent.cpp b/native-views/react-native-scroll-guard/nitrogen/generated/shared/c++/views/HybridScrollGuardComponent.cpp new file mode 100644 index 0000000..9a43af7 --- /dev/null +++ b/native-views/react-native-scroll-guard/nitrogen/generated/shared/c++/views/HybridScrollGuardComponent.cpp @@ -0,0 +1,87 @@ +/// +/// HybridScrollGuardComponent.cpp +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/mrousavy/nitro +/// Copyright © 2026 Marc Rousavy @ Margelo +/// + +#include "HybridScrollGuardComponent.hpp" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace margelo::nitro::scrollguard::views { + + extern const char HybridScrollGuardComponentName[] = "ScrollGuard"; + + HybridScrollGuardProps::HybridScrollGuardProps(const react::PropsParserContext& context, + const HybridScrollGuardProps& sourceProps, + const react::RawProps& rawProps): + react::ViewProps(context, sourceProps, rawProps, filterObjectKeys), + direction([&]() -> CachedProp> { + try { + const react::RawValue* rawValue = rawProps.at("direction", nullptr, nullptr); + if (rawValue == nullptr) return sourceProps.direction; + const auto& [runtime, value] = (std::pair)*rawValue; + return CachedProp>::fromRawValue(*runtime, value, sourceProps.direction); + } catch (const std::exception& exc) { + throw std::runtime_error(std::string("ScrollGuard.direction: ") + exc.what()); + } + }()), + hybridRef([&]() -> CachedProp& /* ref */)>>> { + try { + const react::RawValue* rawValue = rawProps.at("hybridRef", nullptr, nullptr); + if (rawValue == nullptr) return sourceProps.hybridRef; + const auto& [runtime, value] = (std::pair)*rawValue; + return CachedProp& /* ref */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, "f"), sourceProps.hybridRef); + } catch (const std::exception& exc) { + throw std::runtime_error(std::string("ScrollGuard.hybridRef: ") + exc.what()); + } + }()) { } + + HybridScrollGuardProps::HybridScrollGuardProps(const HybridScrollGuardProps& other): + react::ViewProps(), + direction(other.direction), + hybridRef(other.hybridRef) { } + + bool HybridScrollGuardProps::filterObjectKeys(const std::string& propName) { + switch (hashString(propName)) { + case hashString("direction"): return true; + case hashString("hybridRef"): return true; + default: return false; + } + } + + HybridScrollGuardComponentDescriptor::HybridScrollGuardComponentDescriptor(const react::ComponentDescriptorParameters& parameters) + : ConcreteComponentDescriptor(parameters, + react::RawPropsParser(/* enableJsiParser */ true)) {} + + std::shared_ptr HybridScrollGuardComponentDescriptor::cloneProps(const react::PropsParserContext& context, + const std::shared_ptr& props, + react::RawProps rawProps) const { + // 1. Prepare raw props parser + rawProps.parse(rawPropsParser_); + // 2. Copy props with Nitro's cached copy constructor + return HybridScrollGuardShadowNode::Props(context, /* & */ rawProps, props); + } + +#ifdef ANDROID + void HybridScrollGuardComponentDescriptor::adopt(react::ShadowNode& shadowNode) const { + // This is called immediately after `ShadowNode` is created, cloned or in progress. + // On Android, we need to wrap props in our state, which gets routed through Java and later unwrapped in JNI/C++. + auto& concreteShadowNode = dynamic_cast(shadowNode); + const HybridScrollGuardProps& props = concreteShadowNode.getConcreteProps(); + HybridScrollGuardState state; + state.setProps(props); + concreteShadowNode.setStateData(std::move(state)); + } +#endif + +} // namespace margelo::nitro::scrollguard::views diff --git a/native-views/react-native-scroll-guard/nitrogen/generated/shared/c++/views/HybridScrollGuardComponent.hpp b/native-views/react-native-scroll-guard/nitrogen/generated/shared/c++/views/HybridScrollGuardComponent.hpp new file mode 100644 index 0000000..c489f1f --- /dev/null +++ b/native-views/react-native-scroll-guard/nitrogen/generated/shared/c++/views/HybridScrollGuardComponent.hpp @@ -0,0 +1,108 @@ +/// +/// HybridScrollGuardComponent.hpp +/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. +/// https://github.com/mrousavy/nitro +/// Copyright © 2026 Marc Rousavy @ Margelo +/// + +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "ScrollGuardDirection.hpp" +#include +#include +#include "HybridScrollGuardSpec.hpp" +#include + +namespace margelo::nitro::scrollguard::views { + + using namespace facebook; + + /** + * The name of the actual native View. + */ + extern const char HybridScrollGuardComponentName[]; + + /** + * Props for the "ScrollGuard" View. + */ + class HybridScrollGuardProps final: public react::ViewProps { + public: + HybridScrollGuardProps() = default; + HybridScrollGuardProps(const HybridScrollGuardProps&); + HybridScrollGuardProps(const react::PropsParserContext& context, + const HybridScrollGuardProps& sourceProps, + const react::RawProps& rawProps); + + public: + CachedProp> direction; + CachedProp& /* ref */)>>> hybridRef; + + private: + static bool filterObjectKeys(const std::string& propName); + }; + + /** + * State for the "ScrollGuard" View. + */ + class HybridScrollGuardState final { + public: + HybridScrollGuardState() = default; + + public: + void setProps(const HybridScrollGuardProps& props) { _props.emplace(props); } + const std::optional& getProps() const { return _props; } + + public: +#ifdef ANDROID + HybridScrollGuardState(const HybridScrollGuardState& /* previousState */, folly::dynamic /* data */) {} + folly::dynamic getDynamic() const { + throw std::runtime_error("HybridScrollGuardState does not support folly!"); + } + react::MapBuffer getMapBuffer() const { + throw std::runtime_error("HybridScrollGuardState does not support MapBuffer!"); + }; +#endif + + private: + std::optional _props; + }; + + /** + * The Shadow Node for the "ScrollGuard" View. + */ + using HybridScrollGuardShadowNode = react::ConcreteViewShadowNode; + + /** + * The Component Descriptor for the "ScrollGuard" View. + */ + class HybridScrollGuardComponentDescriptor final: public react::ConcreteComponentDescriptor { + public: + HybridScrollGuardComponentDescriptor(const react::ComponentDescriptorParameters& parameters); + + public: + /** + * A faster path for cloning props - reuses the caching logic from `HybridScrollGuardProps`. + */ + std::shared_ptr cloneProps(const react::PropsParserContext& context, + const std::shared_ptr& props, + react::RawProps rawProps) const override; +#ifdef ANDROID + void adopt(react::ShadowNode& shadowNode) const override; +#endif + }; + + /* The actual view for "ScrollGuard" needs to be implemented in platform-specific code. */ + +} // namespace margelo::nitro::scrollguard::views diff --git a/native-views/react-native-scroll-guard/nitrogen/generated/shared/json/ScrollGuardConfig.json b/native-views/react-native-scroll-guard/nitrogen/generated/shared/json/ScrollGuardConfig.json new file mode 100644 index 0000000..0b4aae9 --- /dev/null +++ b/native-views/react-native-scroll-guard/nitrogen/generated/shared/json/ScrollGuardConfig.json @@ -0,0 +1,10 @@ +{ + "uiViewClassName": "ScrollGuard", + "supportsRawText": false, + "bubblingEventTypes": {}, + "directEventTypes": {}, + "validAttributes": { + "direction": true, + "hybridRef": true + } +} diff --git a/native-views/react-native-scroll-guard/package.json b/native-views/react-native-scroll-guard/package.json new file mode 100644 index 0000000..342ee55 --- /dev/null +++ b/native-views/react-native-scroll-guard/package.json @@ -0,0 +1,105 @@ +{ + "name": "@onekeyfe/react-native-scroll-guard", + "version": "0.1.0", + "description": "A native view wrapper that prevents parent scrollable containers (PagerView/ViewPager2) from intercepting child scroll gestures", + "main": "./lib/module/index.js", + "types": "./lib/typescript/src/index.d.ts", + "exports": { + ".": { + "source": "./src/index.tsx", + "types": "./lib/typescript/src/index.d.ts", + "default": "./lib/module/index.js" + }, + "./package.json": "./package.json" + }, + "files": [ + "src", + "lib", + "android", + "ios", + "cpp", + "nitrogen", + "nitro.json", + "*.podspec", + "react-native.config.js", + "!ios/build", + "!android/build", + "!android/gradle", + "!android/gradlew", + "!android/gradlew.bat", + "!android/local.properties", + "!**/__tests__", + "!**/__fixtures__", + "!**/__mocks__", + "!**/.*" + ], + "scripts": { + "clean": "del-cli android/build lib", + "prepare": "rm -rf lib && bob build && cp -r nitrogen lib/nitrogen", + "nitrogen": "nitrogen", + "typecheck": "tsc", + "release": "yarn nitrogen && yarn prepare && npm whoami && npm publish --access public" + }, + "keywords": [ + "react-native", + "ios", + "android", + "gesture", + "scroll", + "pager" + ], + "repository": { + "type": "git", + "url": "git+https://github.com/OneKeyHQ/app-modules.git" + }, + "author": "@onekeyfe (https://github.com/OneKeyHQ/app-modules)", + "license": "MIT", + "publishConfig": { + "registry": "https://registry.npmjs.org/" + }, + "devDependencies": { + "@react-native/babel-preset": "0.83.0", + "del-cli": "^6.0.0", + "nitrogen": "0.31.10", + "react": "19.2.0", + "react-native": "0.83.0", + "react-native-builder-bob": "^0.40.13", + "react-native-nitro-modules": "0.33.2", + "typescript": "^5.9.2" + }, + "peerDependencies": { + "react": "*", + "react-native": "*", + "react-native-nitro-modules": "0.33.2" + }, + "packageManager": "yarn@4.11.0", + "react-native-builder-bob": { + "source": "src", + "output": "lib", + "targets": [ + [ + "custom", + { + "script": "nitrogen", + "clean": "nitrogen/" + } + ], + [ + "module", + { + "esm": true + } + ], + [ + "typescript", + { + "project": "tsconfig.build.json" + } + ] + ] + }, + "create-react-native-library": { + "type": "nitro-view", + "languages": "kotlin-swift" + } +} diff --git a/native-views/react-native-scroll-guard/src/ScrollGuard.nitro.ts b/native-views/react-native-scroll-guard/src/ScrollGuard.nitro.ts new file mode 100644 index 0000000..6d9e51a --- /dev/null +++ b/native-views/react-native-scroll-guard/src/ScrollGuard.nitro.ts @@ -0,0 +1,25 @@ +import type { + HybridView, + HybridViewMethods, + HybridViewProps, +} from 'react-native-nitro-modules'; + +export enum ScrollGuardDirection { + HORIZONTAL = 'horizontal', + VERTICAL = 'vertical', + BOTH = 'both', +} + +export interface ScrollGuardProps extends HybridViewProps { + /** + * The scroll direction to guard. + * - HORIZONTAL: block parent from intercepting horizontal gestures (default) + * - VERTICAL: block parent from intercepting vertical gestures + * - BOTH: block both directions + */ + direction?: ScrollGuardDirection; +} + +export interface ScrollGuardMethods extends HybridViewMethods {} + +export type ScrollGuard = HybridView; diff --git a/native-views/react-native-scroll-guard/src/index.tsx b/native-views/react-native-scroll-guard/src/index.tsx new file mode 100644 index 0000000..44dfe97 --- /dev/null +++ b/native-views/react-native-scroll-guard/src/index.tsx @@ -0,0 +1,11 @@ +import { getHostComponent } from 'react-native-nitro-modules'; +const ScrollGuardConfig = require('../nitrogen/generated/shared/json/ScrollGuardConfig.json'); +import type { ScrollGuardMethods, ScrollGuardProps } from './ScrollGuard.nitro'; +export { ScrollGuardDirection } from './ScrollGuard.nitro'; + +export const ScrollGuardView = getHostComponent< + ScrollGuardProps, + ScrollGuardMethods +>('ScrollGuard', () => ScrollGuardConfig); + +export type { ScrollGuardProps, ScrollGuardMethods }; diff --git a/native-views/react-native-scroll-guard/tsconfig.build.json b/native-views/react-native-scroll-guard/tsconfig.build.json new file mode 100644 index 0000000..3c0636a --- /dev/null +++ b/native-views/react-native-scroll-guard/tsconfig.build.json @@ -0,0 +1,4 @@ +{ + "extends": "./tsconfig", + "exclude": ["example", "lib"] +} diff --git a/native-views/react-native-scroll-guard/tsconfig.json b/native-views/react-native-scroll-guard/tsconfig.json new file mode 100644 index 0000000..ad47b60 --- /dev/null +++ b/native-views/react-native-scroll-guard/tsconfig.json @@ -0,0 +1,30 @@ +{ + "compilerOptions": { + "rootDir": ".", + "paths": { + "react-native-scroll-guard": ["./src/index"] + }, + "allowUnreachableCode": false, + "allowUnusedLabels": false, + "customConditions": ["react-native-strict-api"], + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "jsx": "react-jsx", + "lib": ["ESNext"], + "module": "ESNext", + "moduleResolution": "bundler", + "noEmit": true, + "noFallthroughCasesInSwitch": true, + "noImplicitReturns": true, + "noImplicitUseStrict": false, + "noStrictGenericChecks": false, + "noUncheckedIndexedAccess": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "resolveJsonModule": true, + "skipLibCheck": true, + "strict": true, + "target": "ESNext", + "verbatimModuleSyntax": true + } +} diff --git a/yarn.lock b/yarn.lock index b5eef0b..981be69 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3266,6 +3266,25 @@ __metadata: languageName: unknown linkType: soft +"@onekeyfe/react-native-scroll-guard@workspace:native-views/react-native-scroll-guard": + version: 0.0.0-use.local + resolution: "@onekeyfe/react-native-scroll-guard@workspace:native-views/react-native-scroll-guard" + dependencies: + "@react-native/babel-preset": "npm:0.83.0" + del-cli: "npm:^6.0.0" + nitrogen: "npm:0.31.10" + react: "npm:19.2.0" + react-native: "npm:0.83.0" + react-native-builder-bob: "npm:^0.40.13" + react-native-nitro-modules: "npm:0.33.2" + typescript: "npm:^5.9.2" + peerDependencies: + react: "*" + react-native: "*" + react-native-nitro-modules: 0.33.2 + languageName: unknown + linkType: soft + "@onekeyfe/react-native-skeleton@workspace:*, @onekeyfe/react-native-skeleton@workspace:native-views/react-native-skeleton": version: 0.0.0-use.local resolution: "@onekeyfe/react-native-skeleton@workspace:native-views/react-native-skeleton" @@ -12593,11 +12612,11 @@ __metadata: "typescript@patch:typescript@npm%3A^5.8.3#optional!builtin, typescript@patch:typescript@npm%3A^5.9.2#optional!builtin": version: 5.9.3 - resolution: "typescript@patch:typescript@npm%3A5.9.3#optional!builtin::version=5.9.3&hash=d69c25" + resolution: "typescript@patch:typescript@npm%3A5.9.3#optional!builtin::version=5.9.3&hash=5786d5" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 10/5d416ad4f2ea564f515a3f919e901edbfa4b497cc17dd325c5726046c3eef7ed22d1f59c787267d478311f6f0a265ff790f8a6c7e9df3ea3471458f5ec81e8b7 + checksum: 10/696e1b017bc2635f4e0c94eb4435357701008e2f272f553d06e35b494b8ddc60aa221145e286c28ace0c89ee32827a28c2040e3a69bdc108b1a5dc8fb40b72e3 languageName: node linkType: hard From 6fa90b86b6b1240c0ff2856cb01c7a81c05b8266 Mon Sep 17 00:00:00 2001 From: huhuanming Date: Fri, 13 Mar 2026 23:31:39 +0800 Subject: [PATCH 04/14] Create .gitignore --- .../react-native-scroll-guard/.gitignore | 81 +++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 native-views/react-native-scroll-guard/.gitignore diff --git a/native-views/react-native-scroll-guard/.gitignore b/native-views/react-native-scroll-guard/.gitignore new file mode 100644 index 0000000..3df57f4 --- /dev/null +++ b/native-views/react-native-scroll-guard/.gitignore @@ -0,0 +1,81 @@ +node_modules +__generated__ + +.expo-shared +.expo +.DS_Store +.idea/ +.vscode/ +.chat/ +.claude/PRPs +.claude/settings.local.json +.clauderc +.tmp/ + +dist +build-electron +.next +build +*.tsbuildinfo +yarn-error.log + +.pnp.* +.yarn/* +!.yarn/patches +!.yarn/plugins +!.yarn/releases +!.yarn/sdks +!.yarn/versions + +.env +webpack.config.preview.json +webpack.config.preview.devServer.json + +*.jks +*.p8 +*.p12 +*.key +*.mobileprovision +*.orig.* +web-build/ +# !/apps/web-embed/web-build/ +/inpage-provider-bak + +### VisualStudioCode ### +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +!.vscode/*.code-snippets + +### VisualStudioCode Patch ### +# Ignore all local history of files +.history +.ionide + +# Support for Project snippet scope +.vscode/*.code-snippets + +# Ignore code-workspaces +*.code-workspace + +# Ignore yalc +.yalc/ +yalc.lock + +stats.json +stats.html +.java-version +.eslintcache +tsconfig.tsbuildinfo + +test-report.html + +# Temporary files created by Metro to check the health of the file watcher +.metro-health-check* + +# Ignore tamagui config file +.tamagui +scripts/nitro-view/template/android/.gradle +lib \ No newline at end of file From 91b2e037ce7e1bdb1946c98b540ce787b7e49ca4 Mon Sep 17 00:00:00 2001 From: huhuanming Date: Fri, 13 Mar 2026 23:32:39 +0800 Subject: [PATCH 05/14] Update package.json --- native-views/react-native-scroll-guard/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/native-views/react-native-scroll-guard/package.json b/native-views/react-native-scroll-guard/package.json index 342ee55..d4db646 100644 --- a/native-views/react-native-scroll-guard/package.json +++ b/native-views/react-native-scroll-guard/package.json @@ -48,6 +48,7 @@ "scroll", "pager" ], + "homepage": "https://github.com/OneKeyHQ/app-modules#readme", "repository": { "type": "git", "url": "git+https://github.com/OneKeyHQ/app-modules.git" From 670ea2ea4e22f497f9a0a46dda28a912bed2d615 Mon Sep 17 00:00:00 2001 From: huhuanming Date: Sat, 14 Mar 2026 00:30:26 +0800 Subject: [PATCH 06/14] fix(scroll-guard): iOS gesture blocking reliability - Nitro host views render React children as native siblings, not subviews. Override hitTest to return nil (pass-through) and find sibling ScrollView. - Use two-layer blocking: touch detector (LongPress with 0 delay) disables pager on touch-down instantly; blocker pan + require(toFail:) as backup. - Disable bounces on example banner ScrollView to prevent edge scroll leak. - Add homepage field to package.json for podspec validation. - Persist blocker across pager page transitions to avoid first-touch delay. --- example/react-native/ios/Podfile.lock | 102 +++++--- .../pages/ScrollGuardTestPage.tsx | 1 + .../ios/ScrollGuard.swift | 241 +++++++++++++----- 3 files changed, 246 insertions(+), 98 deletions(-) diff --git a/example/react-native/ios/Podfile.lock b/example/react-native/ios/Podfile.lock index 14460e9..095c22c 100644 --- a/example/react-native/ios/Podfile.lock +++ b/example/react-native/ios/Podfile.lock @@ -1,5 +1,5 @@ PODS: - - AutoSizeInput (1.1.35): + - AutoSizeInput (1.1.37): - boost - DoubleConversion - fast_float @@ -29,7 +29,7 @@ PODS: - ReactCommon/turbomodule/core - SocketRocket - Yoga - - BackgroundThread (1.1.35): + - BackgroundThread (1.1.37): - boost - DoubleConversion - fast_float @@ -59,7 +59,7 @@ PODS: - SocketRocket - Yoga - boost (1.84.0) - - CloudKitModule (1.1.35): + - CloudKitModule (1.1.37): - boost - DoubleConversion - fast_float @@ -101,7 +101,7 @@ PODS: - hermes-engine (0.14.0): - hermes-engine/Pre-built (= 0.14.0) - hermes-engine/Pre-built (0.14.0) - - KeychainModule (1.1.35): + - KeychainModule (1.1.37): - boost - DoubleConversion - fast_float @@ -2079,7 +2079,7 @@ PODS: - React-RCTFBReactNativeSpec - ReactCommon/turbomodule/core - SocketRocket - - react-native-pager-view (1.1.35): + - react-native-pager-view (1.1.37): - boost - DoubleConversion - fast_float @@ -2194,7 +2194,7 @@ PODS: - ReactCommon/turbomodule/core - SocketRocket - Yoga - - react-native-tab-view (1.1.35): + - react-native-tab-view (1.1.37): - boost - DoubleConversion - fast_float @@ -2212,7 +2212,7 @@ PODS: - React-graphics - React-ImageManager - React-jsi - - react-native-tab-view/common (= 1.1.35) + - react-native-tab-view/common (= 1.1.37) - React-NativeModulesApple - React-RCTFabric - React-renderercss @@ -2223,7 +2223,7 @@ PODS: - ReactCommon/turbomodule/core - SocketRocket - Yoga - - react-native-tab-view/common (1.1.35): + - react-native-tab-view/common (1.1.37): - boost - DoubleConversion - fast_float @@ -2808,7 +2808,7 @@ PODS: - React-perflogger (= 0.83.0) - React-utils (= 0.83.0) - SocketRocket - - ReactNativeAppUpdate (1.1.35): + - ReactNativeAppUpdate (1.1.37): - boost - DoubleConversion - fast_float @@ -2839,7 +2839,7 @@ PODS: - ReactNativeNativeLogger - SocketRocket - Yoga - - ReactNativeBundleUpdate (1.1.35): + - ReactNativeBundleUpdate (1.1.37): - boost - DoubleConversion - fast_float @@ -2872,7 +2872,7 @@ PODS: - SocketRocket - SSZipArchive (~> 2.4) - Yoga - - ReactNativeCheckBiometricAuthChanged (1.1.35): + - ReactNativeCheckBiometricAuthChanged (1.1.37): - boost - DoubleConversion - fast_float @@ -2903,7 +2903,7 @@ PODS: - ReactNativeNativeLogger - SocketRocket - Yoga - - ReactNativeDeviceUtils (1.1.35): + - ReactNativeDeviceUtils (1.1.37): - boost - DoubleConversion - fast_float @@ -2934,7 +2934,7 @@ PODS: - ReactNativeNativeLogger - SocketRocket - Yoga - - ReactNativeGetRandomValues (1.1.35): + - ReactNativeGetRandomValues (1.1.37): - boost - DoubleConversion - fast_float @@ -2965,7 +2965,7 @@ PODS: - ReactNativeNativeLogger - SocketRocket - Yoga - - ReactNativeLiteCard (1.1.35): + - ReactNativeLiteCard (1.1.37): - boost - DoubleConversion - fast_float @@ -2994,7 +2994,7 @@ PODS: - ReactNativeNativeLogger - SocketRocket - Yoga - - ReactNativeNativeLogger (1.1.35): + - ReactNativeNativeLogger (1.1.37): - boost - CocoaLumberjack/Swift (~> 3.8) - DoubleConversion @@ -3025,7 +3025,7 @@ PODS: - ReactCommon/turbomodule/core - SocketRocket - Yoga - - ReactNativePerfMemory (1.1.35): + - ReactNativePerfMemory (1.1.37): - boost - DoubleConversion - fast_float @@ -3056,7 +3056,7 @@ PODS: - ReactNativeNativeLogger - SocketRocket - Yoga - - ReactNativeSplashScreen (1.1.35): + - ReactNativeSplashScreen (1.1.37): - boost - DoubleConversion - fast_float @@ -3146,7 +3146,37 @@ PODS: - ReactCommon/turbomodule/core - SocketRocket - Yoga - - Skeleton (1.1.35): + - ScrollGuard (0.1.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - NitroModules + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-callinvoker + - React-Core + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-ImageManager + - React-jsi + - React-NativeModulesApple + - React-RCTFabric + - React-renderercss + - React-rendererdebug + - React-utils + - ReactCodegen + - ReactCommon/turbomodule/bridging + - ReactCommon/turbomodule/core + - SocketRocket + - Yoga + - Skeleton (1.1.37): - boost - DoubleConversion - fast_float @@ -3277,6 +3307,7 @@ DEPENDENCIES: - "ReactNativePerfMemory (from `../../../node_modules/@onekeyfe/react-native-perf-memory`)" - "ReactNativeSplashScreen (from `../../../node_modules/@onekeyfe/react-native-splash-screen`)" - RNScreens (from `../../../node_modules/react-native-screens`) + - "ScrollGuard (from `../../../node_modules/@onekeyfe/react-native-scroll-guard`)" - "Skeleton (from `../../../node_modules/@onekeyfe/react-native-skeleton`)" - SocketRocket (~> 0.7.1) - Yoga (from `../../../node_modules/react-native/ReactCommon/yoga`) @@ -3481,16 +3512,18 @@ EXTERNAL SOURCES: :path: "../../../node_modules/@onekeyfe/react-native-splash-screen" RNScreens: :path: "../../../node_modules/react-native-screens" + ScrollGuard: + :path: "../../../node_modules/@onekeyfe/react-native-scroll-guard" Skeleton: :path: "../../../node_modules/@onekeyfe/react-native-skeleton" Yoga: :path: "../../../node_modules/react-native/ReactCommon/yoga" SPEC CHECKSUMS: - AutoSizeInput: aec6059c3f30b1ff144d9e4ce57e5de35bb20ade - BackgroundThread: 2b24f19a73ead04ee942dbdab768469a30efb3a7 + AutoSizeInput: e9c8048921c7650c5ba8de7df1e3b8483816bbcd + BackgroundThread: decbbbae37a9753bc11b4d212b803b6f816c01d8 boost: 7e761d76ca2ce687f7cc98e698152abd03a18f90 - CloudKitModule: 3cc682bc9ec6d744baf6d19bd8a4fea50413dddc + CloudKitModule: e3e86a266b3eba5da57a0c544a78662736c6d98c CocoaLumberjack: 5644158777912b7de7469fa881f8a3f259c2512a DoubleConversion: cb417026b2400c8f53ae97020b2be961b59470cb fast_float: b32c788ed9c6a8c584d114d0047beda9664e7cc6 @@ -3498,7 +3531,7 @@ SPEC CHECKSUMS: fmt: a40bb5bd0294ea969aaaba240a927bd33d878cdd glog: 5683914934d5b6e4240e497e0f4a3b42d1854183 hermes-engine: 70fdc9d0bb0d8532e0411dcb21e53ce5a160960a - KeychainModule: 9d66c18c962aa0dded8381837ac14301802df4a8 + KeychainModule: 0632fd39966443f95723c147dc09260738304a8b MMKV: 1a8e7dbce7f9cad02c52e1b1091d07bd843aefaf MMKVCore: f2dd4c9befea04277a55e84e7812f930537993df NitroMmkv: 0be91455465952f2b943f753b9ee7df028d89e5c @@ -3539,9 +3572,9 @@ SPEC CHECKSUMS: React-logger: 9e597cbeda7b8cc8aa8fb93860dade97190f69cc React-Mapbuffer: 20046c0447efaa7aace0b76085aa9bb35b0e8105 React-microtasksnativemodule: 0e837de56519c92d8a2e3097717df9497feb33cb - react-native-pager-view: 7f72086be2ac2f86585eb4a926b8f2dec004f5a4 + react-native-pager-view: 974f0f019398f2ecb290813f516f4aff4323bcfa react-native-safe-area-context: c00143b4823773bba23f2f19f85663ae89ceb460 - react-native-tab-view: 0776740aa714950db8081b7dad5e2ead72dd2c9e + react-native-tab-view: 086ceab177015b7e9a3f3311ec68ce5266b0d05f React-NativeModulesApple: 1a378198515f8e825c5931a7613e98da69320cee React-networking: bfd1695ada5a57023006ce05823ac5391c3ce072 React-oscompat: aedc0afbded67280de6bb6bfac8cfde0389e2b33 @@ -3575,17 +3608,18 @@ SPEC CHECKSUMS: ReactAppDependencyProvider: ebcf3a78dc1bcdf054c9e8d309244bade6b31568 ReactCodegen: 554b421c45b7df35ac791da1b734335470b55fcc ReactCommon: 424cc34cf5055d69a3dcf02f3436481afb8b0f6f - ReactNativeAppUpdate: 3be2a7a25c7fcad44ea97ae8f1f32f1826ed5734 - ReactNativeBundleUpdate: b66bc7d310cdf9b4c668b85e4de765e955407069 - ReactNativeCheckBiometricAuthChanged: 3e5d63c1d83e88d6d0d7ddc924158c86a11aea1c - ReactNativeDeviceUtils: 57d10630250a0924105a81825a4fca4fbfe7bfee - ReactNativeGetRandomValues: 31634da5685e2cd35b795c40b5565cc894b08b42 - ReactNativeLiteCard: 5925c04a3444c3284a47721b4a1e7737ed2ad63a - ReactNativeNativeLogger: e4cba8af0154ae7f253056a7190fe17cbb8b98e9 - ReactNativePerfMemory: 84882dc009f62092e2e825d06afefc4c93ce6611 - ReactNativeSplashScreen: 71c5816681045f705705859336702431bce526f5 + ReactNativeAppUpdate: 842a850b1401010494878864d0478b57c5dfc5bd + ReactNativeBundleUpdate: 8659a3a64d662cfe651d4528028b8079a3e6a0c1 + ReactNativeCheckBiometricAuthChanged: c9c55befec4bf21c294479e19db63a1e3f1b7bea + ReactNativeDeviceUtils: de3ff506c33c4bc775e785e1e58afd80020a538c + ReactNativeGetRandomValues: 55821009e6d90903e3823d28acbc047ae01d9455 + ReactNativeLiteCard: 94a953c1c216614793f0501f17b96a002cddf76f + ReactNativeNativeLogger: 5b058630963f29d67580f4f18873e0ed6de77f78 + ReactNativePerfMemory: 37600dfacbddd821eddae626657a1e964a983083 + ReactNativeSplashScreen: 755662bfc17f362fc9456ce2ac8056903e132903 RNScreens: 7f643ee0fd1407dc5085c7795460bd93da113b8f - Skeleton: 35cf368c86a53a63016a7100bbfe46ec964e3b84 + ScrollGuard: 98ea193d9702aa6cbf8bbf67ff06bb17f3995f9b + Skeleton: 8e9eaadf000433e82dd908b1f0efdde149aaf144 SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748 SSZipArchive: fe6a26b2a54d5a0890f2567b5cc6de5caa600aef Yoga: 6ca93c8c13f56baeec55eb608577619b17a4d64e diff --git a/example/react-native/pages/ScrollGuardTestPage.tsx b/example/react-native/pages/ScrollGuardTestPage.tsx index 9f8adcd..8062d3c 100644 --- a/example/react-native/pages/ScrollGuardTestPage.tsx +++ b/example/react-native/pages/ScrollGuardTestPage.tsx @@ -31,6 +31,7 @@ function HorizontalBanner({ guarded }: { guarded: boolean }) { {BANNER_ITEMS.map((item) => ( diff --git a/native-views/react-native-scroll-guard/ios/ScrollGuard.swift b/native-views/react-native-scroll-guard/ios/ScrollGuard.swift index a6972b6..856bec0 100644 --- a/native-views/react-native-scroll-guard/ios/ScrollGuard.swift +++ b/native-views/react-native-scroll-guard/ios/ScrollGuard.swift @@ -18,45 +18,65 @@ class HybridScrollGuard: HybridScrollGuardSpec { // MARK: - ScrollGuardView -/// A native UIView wrapper that prevents ancestor UIPageViewController (PagerView) -/// from intercepting scroll gestures that belong to child UIScrollViews. +/// Prevents ancestor PagerView from intercepting scroll gestures belonging to +/// a sibling UIScrollView. /// -/// Mechanism: When this view is added to the hierarchy, it walks up the view tree -/// to find the nearest paging UIScrollView (owned by UIPageViewController). -/// It then sets up `requireGestureRecognizerToFail` so the pager's pan gesture -/// must wait for child scroll view gestures to fail before it can activate. -class ScrollGuardView: UIView { +/// Two-layer blocking strategy: +/// 1. A "touch detector" (UILongPressGestureRecognizer with minimumPressDuration=0) +/// fires on touch-down IMMEDIATELY — before any pan gesture — and disables the +/// pager's isScrollEnabled. This eliminates first-touch-after-page-transition bugs. +/// 2. A "blocker" UIPanGestureRecognizer with require(toFail:) for belt-and-suspenders. +/// +/// Both gestures live on the CHILD ScrollView (Nitro host views render React +/// children as native siblings, not subviews). +class ScrollGuardView: UIView, UIGestureRecognizerDelegate { var guardDirection: ScrollGuardDirection = .horizontal { didSet { - setNeedsSetup() + invalidateSetup() } } - private var hasSetup = false - private var observedScrollViews: [UIScrollView] = [] + private weak var connectedPager: UIScrollView? + private weak var connectedChild: UIScrollView? + private var blockerGesture: UIPanGestureRecognizer? + private var touchDetector: UILongPressGestureRecognizer? + private var pagerScrollEnabledOriginal: Bool = true + + deinit { + cleanupConnection() + } + + // MARK: - Touch pass-through + + override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? { + return nil + } + + // MARK: - Lifecycle override func didMoveToWindow() { super.didMoveToWindow() if window != nil { - // Delay setup to ensure child scroll views are mounted - DispatchQueue.main.async { [weak self] in - self?.setupGestureBlocking() + setupGestureBlocking() + if connectedChild == nil { + DispatchQueue.main.async { [weak self] in + self?.setupGestureBlocking() + } } - } else { - teardownGestureBlocking() } + // Do NOT clean up on window=nil — child persists across pager transitions. } override func layoutSubviews() { super.layoutSubviews() - if !hasSetup && window != nil { + if connectedChild == nil && window != nil { setupGestureBlocking() } } - private func setNeedsSetup() { - hasSetup = false + private func invalidateSetup() { + cleanupConnection() if window != nil { DispatchQueue.main.async { [weak self] in self?.setupGestureBlocking() @@ -64,69 +84,162 @@ class ScrollGuardView: UIView { } } + private func cleanupConnection() { + if let child = connectedChild { + if let blocker = blockerGesture { child.removeGestureRecognizer(blocker) } + if let detector = touchDetector { child.removeGestureRecognizer(detector) } + } + // Restore pager scrolling if we disabled it + if let pager = connectedPager { + pager.isScrollEnabled = pagerScrollEnabledOriginal + } + blockerGesture = nil + touchDetector = nil + connectedPager = nil + connectedChild = nil + } + + // MARK: - Setup + private func setupGestureBlocking() { - // Tear down previous state - teardownGestureBlocking() - - // 1. Find the nearest ancestor paging UIScrollView (UIPageViewController's internal scroll view) - guard let pagerScrollView = findAncestorPagingScrollView() else { return } - - // 2. Find all descendant UIScrollViews - let childScrollViews = findDescendantScrollViews(in: self) - if childScrollViews.isEmpty { return } - - // 3. Set up gesture dependency: - // pager's panGestureRecognizer requires child scroll view's pan to fail first. - // This means: as long as the child scroll view's gesture is active (even at edge), - // the pager cannot begin its gesture. - let blockHorizontal = guardDirection == .horizontal || guardDirection == .both - let blockVertical = guardDirection == .vertical || guardDirection == .both - - for childSV in childScrollViews { - let isChildHorizontal = childSV.contentSize.width > childSV.bounds.width - let isChildVertical = childSV.contentSize.height > childSV.bounds.height - - let shouldBlock = (blockHorizontal && isChildHorizontal) || (blockVertical && isChildVertical) - if shouldBlock { - pagerScrollView.panGestureRecognizer.require(toFail: childSV.panGestureRecognizer) - observedScrollViews.append(childSV) + guard window != nil else { return } + guard let pagerSV = findAncestorPagingScrollView() else { return } + guard let childSV = findSiblingScrollView() else { return } + + // Skip if already connected to the same child with gestures still attached + if connectedChild === childSV, + let blocker = blockerGesture, + let detector = touchDetector, + childSV.gestureRecognizers?.contains(blocker) == true, + childSV.gestureRecognizers?.contains(detector) == true { + return + } + + cleanupConnection() + + // 1) Touch detector — fires on touch-down BEFORE any pan gesture. + // Immediately disables pager scrolling so it can't intercept. + let detector = UILongPressGestureRecognizer(target: self, action: #selector(handleTouchDetected(_:))) + detector.minimumPressDuration = 0 + detector.cancelsTouchesInView = false + detector.delaysTouchesBegan = false + detector.delaysTouchesEnded = false + detector.delegate = self + childSV.addGestureRecognizer(detector) + + // 2) Blocker pan gesture — belt-and-suspenders with require(toFail:). + let blocker = UIPanGestureRecognizer(target: self, action: #selector(handleBlockerPan(_:))) + blocker.cancelsTouchesInView = false + blocker.delaysTouchesBegan = false + blocker.delaysTouchesEnded = false + blocker.delegate = self + childSV.addGestureRecognizer(blocker) + + // All pager gestures require blocker to fail + if let pagerGestures = pagerSV.gestureRecognizers { + for gesture in pagerGestures { + gesture.require(toFail: blocker) } } - hasSetup = true + blockerGesture = blocker + touchDetector = detector + connectedPager = pagerSV + connectedChild = childSV + pagerScrollEnabledOriginal = pagerSV.isScrollEnabled + + print("[ScrollGuard] setup OK - child=\(type(of: childSV)), pager gestures blocked: \(pagerSV.gestureRecognizers?.count ?? 0)") + } + + // MARK: - Touch detector handler + + @objc private func handleTouchDetected(_ gesture: UILongPressGestureRecognizer) { + guard let pager = connectedPager else { return } + switch gesture.state { + case .began: + // Touch down — immediately disable pager + pagerScrollEnabledOriginal = pager.isScrollEnabled + pager.isScrollEnabled = false + case .ended, .cancelled, .failed: + // Touch up — restore pager + pager.isScrollEnabled = pagerScrollEnabledOriginal + default: + break + } + } + + // MARK: - Blocker pan handler + + @objc private func handleBlockerPan(_ gesture: UIPanGestureRecognizer) { + // Empty — exists only for require(toFail:) blocking } - private func teardownGestureBlocking() { - // iOS does not provide a public API to remove `requireGestureRecognizerToFail` - // relationships. They are automatically cleaned up when the gesture recognizer - // is deallocated. For dynamic scenarios, we rely on the scroll views being - // re-created (which happens naturally in React Native). - observedScrollViews.removeAll() - hasSetup = false + // MARK: - UIGestureRecognizerDelegate + + func gestureRecognizer( + _ gestureRecognizer: UIGestureRecognizer, + shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer + ) -> Bool { + return true } - /// Walk up the view hierarchy to find the nearest UIScrollView with isPagingEnabled - /// (this is the internal scroll view of UIPageViewController) + override func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> Bool { + // Touch detector always begins (it handles all touches in the child area) + if gestureRecognizer === touchDetector { return true } + + // Blocker only begins for guarded direction + guard gestureRecognizer === blockerGesture, + let pan = gestureRecognizer as? UIPanGestureRecognizer else { + return true + } + let velocity = pan.velocity(in: pan.view) + switch guardDirection { + case .horizontal: + return abs(velocity.x) > abs(velocity.y) + case .vertical: + return abs(velocity.y) > abs(velocity.x) + case .both: + return true + } + } + + // MARK: - View hierarchy search + private func findAncestorPagingScrollView() -> UIScrollView? { var current: UIView? = superview while let v = current { - if let sv = v as? UIScrollView, sv.isPagingEnabled { - return sv - } + if let sv = v as? UIScrollView, sv.isPagingEnabled { return sv } current = v.superview } return nil } - /// Recursively find all UIScrollViews in the subtree - private func findDescendantScrollViews(in view: UIView) -> [UIScrollView] { - var result: [UIScrollView] = [] - for subview in view.subviews { - if let sv = subview as? UIScrollView { - result.append(sv) + private func findSiblingScrollView() -> UIScrollView? { + guard let parent = superview else { return nil } + + var foundSelf = false + for subview in parent.subviews { + if subview === self { foundSelf = true; continue } + if foundSelf { + if let sv = findFirstScrollView(in: subview) { return sv } + } + } + + let myFrame = self.frame + for subview in parent.subviews { + if subview === self { continue } + if subview.frame.intersects(myFrame) { + if let sv = findFirstScrollView(in: subview) { return sv } } - result.append(contentsOf: findDescendantScrollViews(in: subview)) } - return result + return nil + } + + private func findFirstScrollView(in view: UIView) -> UIScrollView? { + if let sv = view as? UIScrollView { return sv } + for subview in view.subviews { + if let sv = findFirstScrollView(in: subview) { return sv } + } + return nil } } From 9b77fdbaed9ef20718e14a066bd584994abca76c Mon Sep 17 00:00:00 2001 From: huhuanming Date: Sat, 14 Mar 2026 00:34:36 +0800 Subject: [PATCH 07/14] Update ScrollGuard.swift --- native-views/react-native-scroll-guard/ios/ScrollGuard.swift | 2 -- 1 file changed, 2 deletions(-) diff --git a/native-views/react-native-scroll-guard/ios/ScrollGuard.swift b/native-views/react-native-scroll-guard/ios/ScrollGuard.swift index 856bec0..f6f2f4d 100644 --- a/native-views/react-native-scroll-guard/ios/ScrollGuard.swift +++ b/native-views/react-native-scroll-guard/ios/ScrollGuard.swift @@ -147,8 +147,6 @@ class ScrollGuardView: UIView, UIGestureRecognizerDelegate { connectedPager = pagerSV connectedChild = childSV pagerScrollEnabledOriginal = pagerSV.isScrollEnabled - - print("[ScrollGuard] setup OK - child=\(type(of: childSV)), pager gestures blocked: \(pagerSV.gestureRecognizers?.count ?? 0)") } // MARK: - Touch detector handler From 4dcf45eb32869bd6b78ba6718d69b3c35a400acd Mon Sep 17 00:00:00 2001 From: huhuanming Date: Sat, 14 Mar 2026 00:43:15 +0800 Subject: [PATCH 08/14] chore: add nitrogen/ to .gitignore and remove tracked nitrogen files Remove 476 auto-generated nitrogen files from git tracking across all modules. Add nitrogen/ ignore rule to pager-view, scroll-guard, and tab-view .gitignore files. Also simplify scroll-guard .gitignore. --- .../nitrogen/generated/.gitattributes | 1 - .../android/c++/JHybridNativeLoggerSpec.cpp | 99 -- .../android/c++/JHybridNativeLoggerSpec.hpp | 68 -- .../nativelogger/HybridNativeLoggerSpec.kt | 70 -- .../nitro/nativelogger/nativeloggerOnLoad.kt | 35 - .../android/nativelogger+autolinking.cmake | 81 -- .../android/nativelogger+autolinking.gradle | 27 - .../generated/android/nativeloggerOnLoad.cpp | 44 - .../generated/android/nativeloggerOnLoad.hpp | 25 - .../ReactNativeNativeLogger+autolinking.rb | 60 -- ...actNativeNativeLogger-Swift-Cxx-Bridge.cpp | 57 -- ...actNativeNativeLogger-Swift-Cxx-Bridge.hpp | 184 ---- ...tNativeNativeLogger-Swift-Cxx-Umbrella.hpp | 46 - .../ios/ReactNativeNativeLoggerAutolinking.mm | 33 - .../ReactNativeNativeLoggerAutolinking.swift | 25 - .../ios/c++/HybridNativeLoggerSpecSwift.cpp | 11 - .../ios/c++/HybridNativeLoggerSpecSwift.hpp | 100 -- .../generated/ios/swift/Func_void.swift | 47 - .../swift/Func_void_std__exception_ptr.swift | 47 - .../Func_void_std__vector_std__string_.swift | 47 - .../ios/swift/HybridNativeLoggerSpec.swift | 59 -- .../swift/HybridNativeLoggerSpec_cxx.swift | 186 ---- .../shared/c++/HybridNativeLoggerSpec.cpp | 24 - .../shared/c++/HybridNativeLoggerSpec.hpp | 67 -- .../nitrogen/generated/.gitattributes | 1 - .../android/c++/JAppUpdateDownloadParams.hpp | 65 -- .../android/c++/JAppUpdateFileParams.hpp | 57 -- .../generated/android/c++/JDownloadEvent.hpp | 65 -- .../android/c++/JFunc_void_DownloadEvent.hpp | 78 -- .../c++/JHybridReactNativeAppUpdateSpec.cpp | 199 ---- .../c++/JHybridReactNativeAppUpdateSpec.hpp | 75 -- .../AppUpdateDownloadParams.kt | 44 - .../AppUpdateFileParams.kt | 38 - .../reactnativeappupdate/DownloadEvent.kt | 44 - .../Func_void_DownloadEvent.kt | 80 -- .../HybridReactNativeAppUpdateSpec.kt | 103 --- .../reactnativeappupdateOnLoad.kt | 35 - .../reactnativeappupdate+autolinking.cmake | 81 -- .../reactnativeappupdate+autolinking.gradle | 27 - .../android/reactnativeappupdateOnLoad.cpp | 46 - .../android/reactnativeappupdateOnLoad.hpp | 25 - .../ios/ReactNativeAppUpdate+autolinking.rb | 60 -- .../ReactNativeAppUpdate-Swift-Cxx-Bridge.cpp | 65 -- .../ReactNativeAppUpdate-Swift-Cxx-Bridge.hpp | 206 ----- ...eactNativeAppUpdate-Swift-Cxx-Umbrella.hpp | 55 -- .../ios/ReactNativeAppUpdateAutolinking.mm | 33 - .../ios/ReactNativeAppUpdateAutolinking.swift | 25 - .../HybridReactNativeAppUpdateSpecSwift.cpp | 11 - .../HybridReactNativeAppUpdateSpecSwift.hpp | 164 ---- .../ios/swift/AppUpdateDownloadParams.swift | 58 -- .../ios/swift/AppUpdateFileParams.swift | 36 - .../generated/ios/swift/DownloadEvent.swift | 58 -- .../generated/ios/swift/Func_void.swift | 47 - .../ios/swift/Func_void_DownloadEvent.swift | 47 - .../generated/ios/swift/Func_void_bool.swift | 47 - .../swift/Func_void_std__exception_ptr.swift | 47 - .../HybridReactNativeAppUpdateSpec.swift | 66 -- .../HybridReactNativeAppUpdateSpec_cxx.swift | 311 ------- .../shared/c++/AppUpdateDownloadParams.hpp | 83 -- .../shared/c++/AppUpdateFileParams.hpp | 75 -- .../generated/shared/c++/DownloadEvent.hpp | 83 -- .../c++/HybridReactNativeAppUpdateSpec.cpp | 31 - .../c++/HybridReactNativeAppUpdateSpec.hpp | 81 -- .../nitrogen/generated/.gitattributes | 1 - .../generated/android/c++/JAscFileInfo.hpp | 65 -- .../android/c++/JBundleDownloadASCParams.hpp | 77 -- .../android/c++/JBundleDownloadEvent.hpp | 65 -- .../android/c++/JBundleDownloadParams.hpp | 73 -- .../android/c++/JBundleDownloadResult.hpp | 73 -- .../android/c++/JBundleInstallParams.hpp | 69 -- .../android/c++/JBundleSwitchParams.hpp | 65 -- .../android/c++/JBundleVerifyASCParams.hpp | 73 -- .../android/c++/JBundleVerifyParams.hpp | 69 -- .../android/c++/JFallbackBundleInfo.hpp | 65 -- .../c++/JFunc_void_BundleDownloadEvent.hpp | 78 -- .../JHybridReactNativeBundleUpdateSpec.cpp | 527 ----------- .../JHybridReactNativeBundleUpdateSpec.hpp | 93 -- .../android/c++/JLocalBundleInfo.hpp | 61 -- .../generated/android/c++/JTestResult.hpp | 61 -- .../reactnativebundleupdate/AscFileInfo.kt | 44 - .../BundleDownloadASCParams.kt | 53 -- .../BundleDownloadEvent.kt | 44 - .../BundleDownloadParams.kt | 50 - .../BundleDownloadResult.kt | 50 - .../BundleInstallParams.kt | 47 - .../BundleSwitchParams.kt | 44 - .../BundleVerifyASCParams.kt | 50 - .../BundleVerifyParams.kt | 47 - .../FallbackBundleInfo.kt | 44 - .../Func_void_BundleDownloadEvent.kt | 80 -- .../HybridReactNativeBundleUpdateSpec.kt | 175 ---- .../LocalBundleInfo.kt | 41 - .../reactnativebundleupdate/TestResult.kt | 41 - .../reactnativebundleupdateOnLoad.kt | 35 - .../reactnativebundleupdate+autolinking.cmake | 81 -- ...reactnativebundleupdate+autolinking.gradle | 27 - .../android/reactnativebundleupdateOnLoad.cpp | 46 - .../android/reactnativebundleupdateOnLoad.hpp | 25 - .../ReactNativeBundleUpdate+autolinking.rb | 60 -- ...actNativeBundleUpdate-Swift-Cxx-Bridge.cpp | 113 --- ...actNativeBundleUpdate-Swift-Cxx-Bridge.hpp | 522 ----------- ...tNativeBundleUpdate-Swift-Cxx-Umbrella.hpp | 83 -- .../ios/ReactNativeBundleUpdateAutolinking.mm | 33 - .../ReactNativeBundleUpdateAutolinking.swift | 25 - ...HybridReactNativeBundleUpdateSpecSwift.cpp | 11 - ...HybridReactNativeBundleUpdateSpecSwift.hpp | 336 ------- .../generated/ios/swift/AscFileInfo.swift | 58 -- .../ios/swift/BundleDownloadASCParams.swift | 91 -- .../ios/swift/BundleDownloadEvent.swift | 58 -- .../ios/swift/BundleDownloadParams.swift | 80 -- .../ios/swift/BundleDownloadResult.swift | 80 -- .../ios/swift/BundleInstallParams.swift | 69 -- .../ios/swift/BundleSwitchParams.swift | 58 -- .../ios/swift/BundleVerifyASCParams.swift | 80 -- .../ios/swift/BundleVerifyParams.swift | 69 -- .../ios/swift/FallbackBundleInfo.swift | 58 -- .../generated/ios/swift/Func_void.swift | 47 - .../swift/Func_void_BundleDownloadEvent.swift | 47 - .../Func_void_BundleDownloadResult.swift | 47 - .../ios/swift/Func_void_TestResult.swift | 47 - .../generated/ios/swift/Func_void_bool.swift | 47 - .../swift/Func_void_std__exception_ptr.swift | 47 - .../ios/swift/Func_void_std__string.swift | 47 - .../Func_void_std__vector_AscFileInfo_.swift | 47 - ...void_std__vector_FallbackBundleInfo_.swift | 47 - ...nc_void_std__vector_LocalBundleInfo_.swift | 47 - .../HybridReactNativeBundleUpdateSpec.swift | 84 -- ...ybridReactNativeBundleUpdateSpec_cxx.swift | 657 ------------- .../generated/ios/swift/LocalBundleInfo.swift | 47 - .../generated/ios/swift/TestResult.swift | 47 - .../generated/shared/c++/AscFileInfo.hpp | 83 -- .../shared/c++/BundleDownloadASCParams.hpp | 95 -- .../shared/c++/BundleDownloadEvent.hpp | 83 -- .../shared/c++/BundleDownloadParams.hpp | 91 -- .../shared/c++/BundleDownloadResult.hpp | 91 -- .../shared/c++/BundleInstallParams.hpp | 87 -- .../shared/c++/BundleSwitchParams.hpp | 83 -- .../shared/c++/BundleVerifyASCParams.hpp | 91 -- .../shared/c++/BundleVerifyParams.hpp | 87 -- .../shared/c++/FallbackBundleInfo.hpp | 83 -- .../c++/HybridReactNativeBundleUpdateSpec.cpp | 49 - .../c++/HybridReactNativeBundleUpdateSpec.hpp | 128 --- .../generated/shared/c++/LocalBundleInfo.hpp | 79 -- .../generated/shared/c++/TestResult.hpp | 79 -- .../nitrogen/generated/.gitattributes | 1 - ...actNativeCheckBiometricAuthChangedSpec.cpp | 64 -- ...actNativeCheckBiometricAuthChangedSpec.hpp | 65 -- ...eactNativeCheckBiometricAuthChangedSpec.kt | 58 -- ...ctnativecheckbiometricauthchangedOnLoad.kt | 35 - ...heckbiometricauthchanged+autolinking.cmake | 81 -- ...eckbiometricauthchanged+autolinking.gradle | 27 - ...tnativecheckbiometricauthchangedOnLoad.cpp | 44 - ...tnativecheckbiometricauthchangedOnLoad.hpp | 25 - ...veCheckBiometricAuthChanged+autolinking.rb | 60 -- ...kBiometricAuthChanged-Swift-Cxx-Bridge.cpp | 49 - ...kBiometricAuthChanged-Swift-Cxx-Bridge.hpp | 110 --- ...iometricAuthChanged-Swift-Cxx-Umbrella.hpp | 44 - ...iveCheckBiometricAuthChangedAutolinking.mm | 33 - ...CheckBiometricAuthChangedAutolinking.swift | 25 - ...tiveCheckBiometricAuthChangedSpecSwift.cpp | 11 - ...tiveCheckBiometricAuthChangedSpecSwift.hpp | 76 -- .../generated/ios/swift/Func_void_bool.swift | 47 - .../swift/Func_void_std__exception_ptr.swift | 47 - ...tNativeCheckBiometricAuthChangedSpec.swift | 56 -- ...iveCheckBiometricAuthChangedSpec_cxx.swift | 138 --- ...actNativeCheckBiometricAuthChangedSpec.cpp | 21 - ...actNativeCheckBiometricAuthChangedSpec.hpp | 62 -- .../nitrogen/generated/.gitattributes | 1 - .../android/c++/JAccountInfoResult.hpp | 66 -- .../android/c++/JDeleteRecordParams.hpp | 61 -- .../android/c++/JFetchRecordParams.hpp | 61 -- .../android/c++/JHybridCloudKitModuleSpec.cpp | 201 ---- .../android/c++/JHybridCloudKitModuleSpec.hpp | 71 -- .../android/c++/JQueryRecordsParams.hpp | 57 -- .../android/c++/JQueryRecordsResult.hpp | 78 -- .../android/c++/JRecordExistsParams.hpp | 61 -- .../generated/android/c++/JRecordResult.hpp | 77 -- .../android/c++/JSaveRecordParams.hpp | 69 -- .../android/c++/JSaveRecordResult.hpp | 61 -- .../c++/JVariant_NullType_RecordResult.cpp | 26 - .../c++/JVariant_NullType_RecordResult.hpp | 72 -- .../android/cloudkitmodule+autolinking.cmake | 82 -- .../android/cloudkitmodule+autolinking.gradle | 27 - .../android/cloudkitmoduleOnLoad.cpp | 44 - .../android/cloudkitmoduleOnLoad.hpp | 25 - .../nitro/cloudkitmodule/AccountInfoResult.kt | 44 - .../cloudkitmodule/DeleteRecordParams.kt | 41 - .../nitro/cloudkitmodule/FetchRecordParams.kt | 41 - .../HybridCloudKitModuleSpec.kt | 83 -- .../cloudkitmodule/QueryRecordsParams.kt | 38 - .../cloudkitmodule/QueryRecordsResult.kt | 38 - .../cloudkitmodule/RecordExistsParams.kt | 41 - .../nitro/cloudkitmodule/RecordResult.kt | 53 -- .../nitro/cloudkitmodule/SaveRecordParams.kt | 47 - .../nitro/cloudkitmodule/SaveRecordResult.kt | 41 - .../Variant_NullType_RecordResult.kt | 59 -- .../cloudkitmodule/cloudkitmoduleOnLoad.kt | 35 - .../ios/CloudKitModule+autolinking.rb | 60 -- .../ios/CloudKitModule-Swift-Cxx-Bridge.cpp | 89 -- .../ios/CloudKitModule-Swift-Cxx-Bridge.hpp | 397 -------- .../ios/CloudKitModule-Swift-Cxx-Umbrella.hpp | 76 -- .../ios/CloudKitModuleAutolinking.mm | 33 - .../ios/CloudKitModuleAutolinking.swift | 25 - .../ios/c++/HybridCloudKitModuleSpecSwift.cpp | 11 - .../ios/c++/HybridCloudKitModuleSpecSwift.hpp | 155 ---- .../ios/swift/AccountInfoResult.swift | 77 -- .../ios/swift/DeleteRecordParams.swift | 47 - .../ios/swift/FetchRecordParams.swift | 47 - .../generated/ios/swift/Func_void.swift | 47 - .../swift/Func_void_AccountInfoResult.swift | 47 - .../swift/Func_void_QueryRecordsResult.swift | 47 - .../swift/Func_void_SaveRecordResult.swift | 47 - .../generated/ios/swift/Func_void_bool.swift | 47 - .../swift/Func_void_std__exception_ptr.swift | 47 - ...riant_nitro__NullType__RecordResult_.swift | 59 -- .../ios/swift/HybridCloudKitModuleSpec.swift | 62 -- .../swift/HybridCloudKitModuleSpec_cxx.swift | 259 ------ .../ios/swift/QueryRecordsParams.swift | 36 - .../ios/swift/QueryRecordsResult.swift | 48 - .../ios/swift/RecordExistsParams.swift | 47 - .../generated/ios/swift/RecordResult.swift | 91 -- .../ios/swift/SaveRecordParams.swift | 69 -- .../ios/swift/SaveRecordResult.swift | 47 - .../swift/Variant_NullType_RecordResult.swift | 18 - .../shared/c++/AccountInfoResult.hpp | 84 -- .../shared/c++/DeleteRecordParams.hpp | 79 -- .../shared/c++/FetchRecordParams.hpp | 79 -- .../shared/c++/HybridCloudKitModuleSpec.cpp | 27 - .../shared/c++/HybridCloudKitModuleSpec.hpp | 96 -- .../shared/c++/QueryRecordsParams.hpp | 75 -- .../shared/c++/QueryRecordsResult.hpp | 77 -- .../shared/c++/RecordExistsParams.hpp | 79 -- .../generated/shared/c++/RecordResult.hpp | 95 -- .../generated/shared/c++/SaveRecordParams.hpp | 87 -- .../generated/shared/c++/SaveRecordResult.hpp | 79 -- .../nitrogen/generated/.gitattributes | 1 - .../android/c++/JDualScreenInfoRect.hpp | 69 -- .../generated/android/c++/JFunc_void_bool.hpp | 75 -- .../android/c++/JGooglePlayServicesStatus.hpp | 61 -- .../c++/JHybridReactNativeDeviceUtilsSpec.cpp | 276 ------ .../c++/JHybridReactNativeDeviceUtilsSpec.hpp | 82 -- .../generated/android/c++/JLaunchOptions.hpp | 62 -- .../android/c++/JUserInterfaceStyle.hpp | 62 -- .../android/c++/JWebViewPackageInfo.hpp | 65 -- .../DualScreenInfoRect.kt | 47 - .../reactnativedeviceutils/Func_void_bool.kt | 80 -- .../GooglePlayServicesStatus.kt | 41 - .../HybridReactNativeDeviceUtilsSpec.kt | 131 --- .../reactnativedeviceutils/LaunchOptions.kt | 41 - .../UserInterfaceStyle.kt | 22 - .../WebViewPackageInfo.kt | 44 - .../reactnativedeviceutilsOnLoad.kt | 35 - .../reactnativedeviceutils+autolinking.cmake | 81 -- .../reactnativedeviceutils+autolinking.gradle | 27 - .../android/reactnativedeviceutilsOnLoad.cpp | 46 - .../android/reactnativedeviceutilsOnLoad.hpp | 25 - .../ios/ReactNativeDeviceUtils+autolinking.rb | 60 -- ...eactNativeDeviceUtils-Swift-Cxx-Bridge.cpp | 113 --- ...eactNativeDeviceUtils-Swift-Cxx-Bridge.hpp | 522 ----------- ...ctNativeDeviceUtils-Swift-Cxx-Umbrella.hpp | 63 -- .../ios/ReactNativeDeviceUtilsAutolinking.mm | 33 - .../ReactNativeDeviceUtilsAutolinking.swift | 25 - .../HybridReactNativeDeviceUtilsSpecSwift.cpp | 11 - .../HybridReactNativeDeviceUtilsSpecSwift.hpp | 220 ----- .../ios/swift/DualScreenInfoRect.swift | 69 -- .../generated/ios/swift/Func_void.swift | 47 - .../swift/Func_void_DualScreenInfoRect.swift | 47 - .../Func_void_GooglePlayServicesStatus.swift | 47 - .../ios/swift/Func_void_LaunchOptions.swift | 47 - .../swift/Func_void_WebViewPackageInfo.swift | 47 - .../generated/ios/swift/Func_void_bool.swift | 47 - .../ios/swift/Func_void_double.swift | 47 - .../swift/Func_void_std__exception_ptr.swift | 47 - .../ios/swift/Func_void_std__string.swift | 47 - ...void_std__vector_DualScreenInfoRect_.swift | 47 - .../ios/swift/GooglePlayServicesStatus.swift | 47 - .../HybridReactNativeDeviceUtilsSpec.swift | 73 -- ...HybridReactNativeDeviceUtilsSpec_cxx.swift | 411 --------- .../generated/ios/swift/LaunchOptions.swift | 66 -- .../ios/swift/UserInterfaceStyle.swift | 44 - .../ios/swift/WebViewPackageInfo.swift | 58 -- .../shared/c++/DualScreenInfoRect.hpp | 87 -- .../shared/c++/GooglePlayServicesStatus.hpp | 79 -- .../c++/HybridReactNativeDeviceUtilsSpec.cpp | 38 - .../c++/HybridReactNativeDeviceUtilsSpec.hpp | 96 -- .../generated/shared/c++/LaunchOptions.hpp | 80 -- .../shared/c++/UserInterfaceStyle.hpp | 80 -- .../shared/c++/WebViewPackageInfo.hpp | 83 -- .../nitrogen/generated/.gitattributes | 1 - .../JHybridReactNativeGetRandomValuesSpec.cpp | 52 -- .../JHybridReactNativeGetRandomValuesSpec.hpp | 65 -- .../HybridReactNativeGetRandomValuesSpec.kt | 57 -- .../reactnativegetrandomvaluesOnLoad.kt | 35 - ...actnativegetrandomvalues+autolinking.cmake | 81 -- ...ctnativegetrandomvalues+autolinking.gradle | 27 - .../reactnativegetrandomvaluesOnLoad.cpp | 44 - .../reactnativegetrandomvaluesOnLoad.hpp | 25 - .../ReactNativeGetRandomValues+autolinking.rb | 60 -- ...NativeGetRandomValues-Swift-Cxx-Bridge.cpp | 33 - ...NativeGetRandomValues-Swift-Cxx-Bridge.hpp | 52 -- ...tiveGetRandomValues-Swift-Cxx-Umbrella.hpp | 44 - .../ReactNativeGetRandomValuesAutolinking.mm | 33 - ...eactNativeGetRandomValuesAutolinking.swift | 25 - ...ridReactNativeGetRandomValuesSpecSwift.cpp | 11 - ...ridReactNativeGetRandomValuesSpecSwift.hpp | 76 -- ...HybridReactNativeGetRandomValuesSpec.swift | 56 -- ...idReactNativeGetRandomValuesSpec_cxx.swift | 131 --- .../HybridReactNativeGetRandomValuesSpec.cpp | 21 - .../HybridReactNativeGetRandomValuesSpec.hpp | 62 -- .../nitrogen/generated/.gitattributes | 1 - .../generated/android/c++/JGetItemParams.hpp | 57 -- .../generated/android/c++/JGetItemResult.hpp | 61 -- .../generated/android/c++/JHasItemParams.hpp | 57 -- .../android/c++/JHybridKeychainModuleSpec.cpp | 151 --- .../android/c++/JHybridKeychainModuleSpec.hpp | 69 -- .../android/c++/JRemoveItemParams.hpp | 57 -- .../generated/android/c++/JSetItemParams.hpp | 74 -- .../c++/JVariant_NullType_GetItemResult.cpp | 26 - .../c++/JVariant_NullType_GetItemResult.hpp | 72 -- .../android/keychainmodule+autolinking.cmake | 82 -- .../android/keychainmodule+autolinking.gradle | 27 - .../android/keychainmoduleOnLoad.cpp | 44 - .../android/keychainmoduleOnLoad.hpp | 25 - .../nitro/keychainmodule/GetItemParams.kt | 38 - .../nitro/keychainmodule/GetItemResult.kt | 41 - .../nitro/keychainmodule/HasItemParams.kt | 38 - .../HybridKeychainModuleSpec.kt | 75 -- .../nitro/keychainmodule/RemoveItemParams.kt | 38 - .../nitro/keychainmodule/SetItemParams.kt | 50 - .../Variant_NullType_GetItemResult.kt | 59 -- .../keychainmodule/keychainmoduleOnLoad.kt | 35 - .../ios/KeychainModule+autolinking.rb | 60 -- .../ios/KeychainModule-Swift-Cxx-Bridge.cpp | 65 -- .../ios/KeychainModule-Swift-Cxx-Bridge.hpp | 262 ------ .../ios/KeychainModule-Swift-Cxx-Umbrella.hpp | 63 -- .../ios/KeychainModuleAutolinking.mm | 33 - .../ios/KeychainModuleAutolinking.swift | 25 - .../ios/c++/HybridKeychainModuleSpecSwift.cpp | 11 - .../ios/c++/HybridKeychainModuleSpecSwift.hpp | 126 --- .../generated/ios/swift/Func_void.swift | 47 - .../generated/ios/swift/Func_void_bool.swift | 47 - .../swift/Func_void_std__exception_ptr.swift | 47 - ...iant_nitro__NullType__GetItemResult_.swift | 59 -- .../generated/ios/swift/GetItemParams.swift | 36 - .../generated/ios/swift/GetItemResult.swift | 47 - .../generated/ios/swift/HasItemParams.swift | 36 - .../ios/swift/HybridKeychainModuleSpec.swift | 60 -- .../swift/HybridKeychainModuleSpec_cxx.swift | 221 ----- .../ios/swift/RemoveItemParams.swift | 36 - .../generated/ios/swift/SetItemParams.swift | 137 --- .../Variant_NullType_GetItemResult.swift | 18 - .../generated/shared/c++/GetItemParams.hpp | 75 -- .../generated/shared/c++/GetItemResult.hpp | 79 -- .../generated/shared/c++/HasItemParams.hpp | 75 -- .../shared/c++/HybridKeychainModuleSpec.cpp | 25 - .../shared/c++/HybridKeychainModuleSpec.hpp | 82 -- .../generated/shared/c++/RemoveItemParams.hpp | 75 -- .../generated/shared/c++/SetItemParams.hpp | 92 -- .../nitrogen/generated/.gitattributes | 1 - .../c++/JHybridReactNativePerfMemorySpec.cpp | 67 -- .../c++/JHybridReactNativePerfMemorySpec.hpp | 65 -- .../generated/android/c++/JMemoryUsage.hpp | 57 -- .../HybridReactNativePerfMemorySpec.kt | 58 -- .../reactnativeperfmemory/MemoryUsage.kt | 38 - .../reactnativeperfmemoryOnLoad.kt | 35 - .../reactnativeperfmemory+autolinking.cmake | 81 -- .../reactnativeperfmemory+autolinking.gradle | 27 - .../android/reactnativeperfmemoryOnLoad.cpp | 44 - .../android/reactnativeperfmemoryOnLoad.hpp | 25 - .../ios/ReactNativePerfMemory+autolinking.rb | 60 -- ...ReactNativePerfMemory-Swift-Cxx-Bridge.cpp | 49 - ...ReactNativePerfMemory-Swift-Cxx-Bridge.hpp | 113 --- ...actNativePerfMemory-Swift-Cxx-Umbrella.hpp | 47 - .../ios/ReactNativePerfMemoryAutolinking.mm | 33 - .../ReactNativePerfMemoryAutolinking.swift | 25 - .../HybridReactNativePerfMemorySpecSwift.cpp | 11 - .../HybridReactNativePerfMemorySpecSwift.hpp | 78 -- .../ios/swift/Func_void_MemoryUsage.swift | 47 - .../swift/Func_void_std__exception_ptr.swift | 47 - .../HybridReactNativePerfMemorySpec.swift | 56 -- .../HybridReactNativePerfMemorySpec_cxx.swift | 138 --- .../generated/ios/swift/MemoryUsage.swift | 36 - .../c++/HybridReactNativePerfMemorySpec.cpp | 21 - .../c++/HybridReactNativePerfMemorySpec.hpp | 64 -- .../generated/shared/c++/MemoryUsage.hpp | 75 -- .../nitrogen/generated/.gitattributes | 1 - .../JHybridReactNativeSplashScreenSpec.cpp | 80 -- .../JHybridReactNativeSplashScreenSpec.hpp | 66 -- .../HybridReactNativeSplashScreenSpec.kt | 62 -- .../reactnativesplashscreenOnLoad.kt | 35 - .../reactnativesplashscreen+autolinking.cmake | 81 -- ...reactnativesplashscreen+autolinking.gradle | 27 - .../android/reactnativesplashscreenOnLoad.cpp | 44 - .../android/reactnativesplashscreenOnLoad.hpp | 25 - .../ReactNativeSplashScreen+autolinking.rb | 60 -- ...actNativeSplashScreen-Swift-Cxx-Bridge.cpp | 49 - ...actNativeSplashScreen-Swift-Cxx-Bridge.hpp | 110 --- ...tNativeSplashScreen-Swift-Cxx-Umbrella.hpp | 44 - .../ios/ReactNativeSplashScreenAutolinking.mm | 33 - .../ReactNativeSplashScreenAutolinking.swift | 25 - ...HybridReactNativeSplashScreenSpecSwift.cpp | 11 - ...HybridReactNativeSplashScreenSpecSwift.hpp | 84 -- .../generated/ios/swift/Func_void_bool.swift | 47 - .../swift/Func_void_std__exception_ptr.swift | 47 - .../HybridReactNativeSplashScreenSpec.swift | 57 -- ...ybridReactNativeSplashScreenSpec_cxx.swift | 157 ---- .../c++/HybridReactNativeSplashScreenSpec.cpp | 22 - .../c++/HybridReactNativeSplashScreenSpec.hpp | 63 -- .../nitrogen/generated/.gitattributes | 1 - .../android/autosizeinput+autolinking.cmake | 83 -- .../android/autosizeinput+autolinking.gradle | 27 - .../generated/android/autosizeinputOnLoad.cpp | 50 - .../generated/android/autosizeinputOnLoad.hpp | 25 - .../generated/android/c++/JFunc_void.hpp | 75 -- .../android/c++/JFunc_void_std__string.hpp | 76 -- .../android/c++/JHybridAutoSizeInputSpec.cpp | 353 ------- .../android/c++/JHybridAutoSizeInputSpec.hpp | 125 --- .../JHybridAutoSizeInputStateUpdater.cpp | 172 ---- .../JHybridAutoSizeInputStateUpdater.hpp | 49 - .../margelo/nitro/autosizeinput/Func_void.kt | 80 -- .../autosizeinput/Func_void_std__string.kt | 80 -- .../autosizeinput/HybridAutoSizeInputSpec.kt | 263 ------ .../autosizeinput/autosizeinputOnLoad.kt | 35 - .../views/HybridAutoSizeInputManager.kt | 50 - .../views/HybridAutoSizeInputStateUpdater.kt | 23 - .../ios/AutoSizeInput+autolinking.rb | 60 -- .../ios/AutoSizeInput-Swift-Cxx-Bridge.cpp | 49 - .../ios/AutoSizeInput-Swift-Cxx-Bridge.hpp | 173 ---- .../ios/AutoSizeInput-Swift-Cxx-Umbrella.hpp | 46 - .../generated/ios/AutoSizeInputAutolinking.mm | 33 - .../ios/AutoSizeInputAutolinking.swift | 25 - .../ios/c++/HybridAutoSizeInputSpecSwift.cpp | 11 - .../ios/c++/HybridAutoSizeInputSpecSwift.hpp | 291 ------ .../c++/views/HybridAutoSizeInputComponent.mm | 241 ----- .../generated/ios/swift/Func_void.swift | 47 - .../ios/swift/Func_void_std__string.swift | 47 - .../ios/swift/HybridAutoSizeInputSpec.swift | 86 -- .../swift/HybridAutoSizeInputSpec_cxx.swift | 860 ------------------ .../shared/c++/HybridAutoSizeInputSpec.cpp | 82 -- .../shared/c++/HybridAutoSizeInputSpec.hpp | 124 --- .../views/HybridAutoSizeInputComponent.cpp | 435 --------- .../views/HybridAutoSizeInputComponent.hpp | 137 --- .../shared/json/AutoSizeInputConfig.json | 39 - .../react-native-pager-view/.gitignore | 3 + .../react-native-scroll-guard/.gitignore | 84 +- .../nitrogen/generated/.gitattributes | 1 - .../android/c++/JHybridScrollGuardSpec.cpp | 59 -- .../android/c++/JHybridScrollGuardSpec.hpp | 66 -- .../android/c++/JScrollGuardDirection.hpp | 62 -- .../views/JHybridScrollGuardStateUpdater.cpp | 56 -- .../views/JHybridScrollGuardStateUpdater.hpp | 49 - .../scrollguard/HybridScrollGuardSpec.kt | 59 -- .../nitro/scrollguard/ScrollGuardDirection.kt | 22 - .../nitro/scrollguard/scrollguardOnLoad.kt | 35 - .../views/HybridScrollGuardManager.kt | 50 - .../views/HybridScrollGuardStateUpdater.kt | 23 - .../android/scrollguard+autolinking.cmake | 83 -- .../android/scrollguard+autolinking.gradle | 27 - .../generated/android/scrollguardOnLoad.cpp | 46 - .../generated/android/scrollguardOnLoad.hpp | 25 - .../generated/ios/ScrollGuard+autolinking.rb | 60 -- .../ios/ScrollGuard-Swift-Cxx-Bridge.cpp | 33 - .../ios/ScrollGuard-Swift-Cxx-Bridge.hpp | 59 -- .../ios/ScrollGuard-Swift-Cxx-Umbrella.hpp | 45 - .../generated/ios/ScrollGuardAutolinking.mm | 33 - .../ios/ScrollGuardAutolinking.swift | 25 - .../ios/c++/HybridScrollGuardSpecSwift.cpp | 11 - .../ios/c++/HybridScrollGuardSpecSwift.hpp | 77 -- .../c++/views/HybridScrollGuardComponent.mm | 96 -- .../ios/swift/HybridScrollGuardSpec.swift | 56 -- .../ios/swift/HybridScrollGuardSpec_cxx.swift | 146 --- .../ios/swift/ScrollGuardDirection.swift | 44 - .../shared/c++/HybridScrollGuardSpec.cpp | 22 - .../shared/c++/HybridScrollGuardSpec.hpp | 65 -- .../shared/c++/ScrollGuardDirection.hpp | 80 -- .../c++/views/HybridScrollGuardComponent.cpp | 87 -- .../c++/views/HybridScrollGuardComponent.hpp | 108 --- .../shared/json/ScrollGuardConfig.json | 10 - native-views/react-native-tab-view/.gitignore | 3 + 479 files changed, 10 insertions(+), 33993 deletions(-) delete mode 100644 native-modules/native-logger/nitrogen/generated/.gitattributes delete mode 100644 native-modules/native-logger/nitrogen/generated/android/c++/JHybridNativeLoggerSpec.cpp delete mode 100644 native-modules/native-logger/nitrogen/generated/android/c++/JHybridNativeLoggerSpec.hpp delete mode 100644 native-modules/native-logger/nitrogen/generated/android/kotlin/com/margelo/nitro/nativelogger/HybridNativeLoggerSpec.kt delete mode 100644 native-modules/native-logger/nitrogen/generated/android/kotlin/com/margelo/nitro/nativelogger/nativeloggerOnLoad.kt delete mode 100644 native-modules/native-logger/nitrogen/generated/android/nativelogger+autolinking.cmake delete mode 100644 native-modules/native-logger/nitrogen/generated/android/nativelogger+autolinking.gradle delete mode 100644 native-modules/native-logger/nitrogen/generated/android/nativeloggerOnLoad.cpp delete mode 100644 native-modules/native-logger/nitrogen/generated/android/nativeloggerOnLoad.hpp delete mode 100644 native-modules/native-logger/nitrogen/generated/ios/ReactNativeNativeLogger+autolinking.rb delete mode 100644 native-modules/native-logger/nitrogen/generated/ios/ReactNativeNativeLogger-Swift-Cxx-Bridge.cpp delete mode 100644 native-modules/native-logger/nitrogen/generated/ios/ReactNativeNativeLogger-Swift-Cxx-Bridge.hpp delete mode 100644 native-modules/native-logger/nitrogen/generated/ios/ReactNativeNativeLogger-Swift-Cxx-Umbrella.hpp delete mode 100644 native-modules/native-logger/nitrogen/generated/ios/ReactNativeNativeLoggerAutolinking.mm delete mode 100644 native-modules/native-logger/nitrogen/generated/ios/ReactNativeNativeLoggerAutolinking.swift delete mode 100644 native-modules/native-logger/nitrogen/generated/ios/c++/HybridNativeLoggerSpecSwift.cpp delete mode 100644 native-modules/native-logger/nitrogen/generated/ios/c++/HybridNativeLoggerSpecSwift.hpp delete mode 100644 native-modules/native-logger/nitrogen/generated/ios/swift/Func_void.swift delete mode 100644 native-modules/native-logger/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift delete mode 100644 native-modules/native-logger/nitrogen/generated/ios/swift/Func_void_std__vector_std__string_.swift delete mode 100644 native-modules/native-logger/nitrogen/generated/ios/swift/HybridNativeLoggerSpec.swift delete mode 100644 native-modules/native-logger/nitrogen/generated/ios/swift/HybridNativeLoggerSpec_cxx.swift delete mode 100644 native-modules/native-logger/nitrogen/generated/shared/c++/HybridNativeLoggerSpec.cpp delete mode 100644 native-modules/native-logger/nitrogen/generated/shared/c++/HybridNativeLoggerSpec.hpp delete mode 100644 native-modules/react-native-app-update/nitrogen/generated/.gitattributes delete mode 100644 native-modules/react-native-app-update/nitrogen/generated/android/c++/JAppUpdateDownloadParams.hpp delete mode 100644 native-modules/react-native-app-update/nitrogen/generated/android/c++/JAppUpdateFileParams.hpp delete mode 100644 native-modules/react-native-app-update/nitrogen/generated/android/c++/JDownloadEvent.hpp delete mode 100644 native-modules/react-native-app-update/nitrogen/generated/android/c++/JFunc_void_DownloadEvent.hpp delete mode 100644 native-modules/react-native-app-update/nitrogen/generated/android/c++/JHybridReactNativeAppUpdateSpec.cpp delete mode 100644 native-modules/react-native-app-update/nitrogen/generated/android/c++/JHybridReactNativeAppUpdateSpec.hpp delete mode 100644 native-modules/react-native-app-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativeappupdate/AppUpdateDownloadParams.kt delete mode 100644 native-modules/react-native-app-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativeappupdate/AppUpdateFileParams.kt delete mode 100644 native-modules/react-native-app-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativeappupdate/DownloadEvent.kt delete mode 100644 native-modules/react-native-app-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativeappupdate/Func_void_DownloadEvent.kt delete mode 100644 native-modules/react-native-app-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativeappupdate/HybridReactNativeAppUpdateSpec.kt delete mode 100644 native-modules/react-native-app-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativeappupdate/reactnativeappupdateOnLoad.kt delete mode 100644 native-modules/react-native-app-update/nitrogen/generated/android/reactnativeappupdate+autolinking.cmake delete mode 100644 native-modules/react-native-app-update/nitrogen/generated/android/reactnativeappupdate+autolinking.gradle delete mode 100644 native-modules/react-native-app-update/nitrogen/generated/android/reactnativeappupdateOnLoad.cpp delete mode 100644 native-modules/react-native-app-update/nitrogen/generated/android/reactnativeappupdateOnLoad.hpp delete mode 100644 native-modules/react-native-app-update/nitrogen/generated/ios/ReactNativeAppUpdate+autolinking.rb delete mode 100644 native-modules/react-native-app-update/nitrogen/generated/ios/ReactNativeAppUpdate-Swift-Cxx-Bridge.cpp delete mode 100644 native-modules/react-native-app-update/nitrogen/generated/ios/ReactNativeAppUpdate-Swift-Cxx-Bridge.hpp delete mode 100644 native-modules/react-native-app-update/nitrogen/generated/ios/ReactNativeAppUpdate-Swift-Cxx-Umbrella.hpp delete mode 100644 native-modules/react-native-app-update/nitrogen/generated/ios/ReactNativeAppUpdateAutolinking.mm delete mode 100644 native-modules/react-native-app-update/nitrogen/generated/ios/ReactNativeAppUpdateAutolinking.swift delete mode 100644 native-modules/react-native-app-update/nitrogen/generated/ios/c++/HybridReactNativeAppUpdateSpecSwift.cpp delete mode 100644 native-modules/react-native-app-update/nitrogen/generated/ios/c++/HybridReactNativeAppUpdateSpecSwift.hpp delete mode 100644 native-modules/react-native-app-update/nitrogen/generated/ios/swift/AppUpdateDownloadParams.swift delete mode 100644 native-modules/react-native-app-update/nitrogen/generated/ios/swift/AppUpdateFileParams.swift delete mode 100644 native-modules/react-native-app-update/nitrogen/generated/ios/swift/DownloadEvent.swift delete mode 100644 native-modules/react-native-app-update/nitrogen/generated/ios/swift/Func_void.swift delete mode 100644 native-modules/react-native-app-update/nitrogen/generated/ios/swift/Func_void_DownloadEvent.swift delete mode 100644 native-modules/react-native-app-update/nitrogen/generated/ios/swift/Func_void_bool.swift delete mode 100644 native-modules/react-native-app-update/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift delete mode 100644 native-modules/react-native-app-update/nitrogen/generated/ios/swift/HybridReactNativeAppUpdateSpec.swift delete mode 100644 native-modules/react-native-app-update/nitrogen/generated/ios/swift/HybridReactNativeAppUpdateSpec_cxx.swift delete mode 100644 native-modules/react-native-app-update/nitrogen/generated/shared/c++/AppUpdateDownloadParams.hpp delete mode 100644 native-modules/react-native-app-update/nitrogen/generated/shared/c++/AppUpdateFileParams.hpp delete mode 100644 native-modules/react-native-app-update/nitrogen/generated/shared/c++/DownloadEvent.hpp delete mode 100644 native-modules/react-native-app-update/nitrogen/generated/shared/c++/HybridReactNativeAppUpdateSpec.cpp delete mode 100644 native-modules/react-native-app-update/nitrogen/generated/shared/c++/HybridReactNativeAppUpdateSpec.hpp delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/.gitattributes delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/android/c++/JAscFileInfo.hpp delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/android/c++/JBundleDownloadASCParams.hpp delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/android/c++/JBundleDownloadEvent.hpp delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/android/c++/JBundleDownloadParams.hpp delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/android/c++/JBundleDownloadResult.hpp delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/android/c++/JBundleInstallParams.hpp delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/android/c++/JBundleSwitchParams.hpp delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/android/c++/JBundleVerifyASCParams.hpp delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/android/c++/JBundleVerifyParams.hpp delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/android/c++/JFallbackBundleInfo.hpp delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/android/c++/JFunc_void_BundleDownloadEvent.hpp delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/android/c++/JHybridReactNativeBundleUpdateSpec.cpp delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/android/c++/JHybridReactNativeBundleUpdateSpec.hpp delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/android/c++/JLocalBundleInfo.hpp delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/android/c++/JTestResult.hpp delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/AscFileInfo.kt delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/BundleDownloadASCParams.kt delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/BundleDownloadEvent.kt delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/BundleDownloadParams.kt delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/BundleDownloadResult.kt delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/BundleInstallParams.kt delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/BundleSwitchParams.kt delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/BundleVerifyASCParams.kt delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/BundleVerifyParams.kt delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/FallbackBundleInfo.kt delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/Func_void_BundleDownloadEvent.kt delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/HybridReactNativeBundleUpdateSpec.kt delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/LocalBundleInfo.kt delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/TestResult.kt delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/reactnativebundleupdateOnLoad.kt delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/android/reactnativebundleupdate+autolinking.cmake delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/android/reactnativebundleupdate+autolinking.gradle delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/android/reactnativebundleupdateOnLoad.cpp delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/android/reactnativebundleupdateOnLoad.hpp delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/ios/ReactNativeBundleUpdate+autolinking.rb delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/ios/ReactNativeBundleUpdate-Swift-Cxx-Bridge.cpp delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/ios/ReactNativeBundleUpdate-Swift-Cxx-Bridge.hpp delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/ios/ReactNativeBundleUpdate-Swift-Cxx-Umbrella.hpp delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/ios/ReactNativeBundleUpdateAutolinking.mm delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/ios/ReactNativeBundleUpdateAutolinking.swift delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/ios/c++/HybridReactNativeBundleUpdateSpecSwift.cpp delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/ios/c++/HybridReactNativeBundleUpdateSpecSwift.hpp delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/AscFileInfo.swift delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/BundleDownloadASCParams.swift delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/BundleDownloadEvent.swift delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/BundleDownloadParams.swift delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/BundleDownloadResult.swift delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/BundleInstallParams.swift delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/BundleSwitchParams.swift delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/BundleVerifyASCParams.swift delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/BundleVerifyParams.swift delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/FallbackBundleInfo.swift delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/Func_void.swift delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/Func_void_BundleDownloadEvent.swift delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/Func_void_BundleDownloadResult.swift delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/Func_void_TestResult.swift delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/Func_void_bool.swift delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/Func_void_std__string.swift delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/Func_void_std__vector_AscFileInfo_.swift delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/Func_void_std__vector_FallbackBundleInfo_.swift delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/Func_void_std__vector_LocalBundleInfo_.swift delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/HybridReactNativeBundleUpdateSpec.swift delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/HybridReactNativeBundleUpdateSpec_cxx.swift delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/LocalBundleInfo.swift delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/TestResult.swift delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/shared/c++/AscFileInfo.hpp delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/shared/c++/BundleDownloadASCParams.hpp delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/shared/c++/BundleDownloadEvent.hpp delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/shared/c++/BundleDownloadParams.hpp delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/shared/c++/BundleDownloadResult.hpp delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/shared/c++/BundleInstallParams.hpp delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/shared/c++/BundleSwitchParams.hpp delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/shared/c++/BundleVerifyASCParams.hpp delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/shared/c++/BundleVerifyParams.hpp delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/shared/c++/FallbackBundleInfo.hpp delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/shared/c++/HybridReactNativeBundleUpdateSpec.cpp delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/shared/c++/HybridReactNativeBundleUpdateSpec.hpp delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/shared/c++/LocalBundleInfo.hpp delete mode 100644 native-modules/react-native-bundle-update/nitrogen/generated/shared/c++/TestResult.hpp delete mode 100644 native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/.gitattributes delete mode 100644 native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/android/c++/JHybridReactNativeCheckBiometricAuthChangedSpec.cpp delete mode 100644 native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/android/c++/JHybridReactNativeCheckBiometricAuthChangedSpec.hpp delete mode 100644 native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/android/kotlin/com/margelo/nitro/onekeyfe/reactnativecheckbiometricauthchanged/HybridReactNativeCheckBiometricAuthChangedSpec.kt delete mode 100644 native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/android/kotlin/com/margelo/nitro/onekeyfe/reactnativecheckbiometricauthchanged/onekeyfe_reactnativecheckbiometricauthchangedOnLoad.kt delete mode 100644 native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/android/onekeyfe_reactnativecheckbiometricauthchanged+autolinking.cmake delete mode 100644 native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/android/onekeyfe_reactnativecheckbiometricauthchanged+autolinking.gradle delete mode 100644 native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/android/onekeyfe_reactnativecheckbiometricauthchangedOnLoad.cpp delete mode 100644 native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/android/onekeyfe_reactnativecheckbiometricauthchangedOnLoad.hpp delete mode 100644 native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/ios/ReactNativeCheckBiometricAuthChanged+autolinking.rb delete mode 100644 native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/ios/ReactNativeCheckBiometricAuthChanged-Swift-Cxx-Bridge.cpp delete mode 100644 native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/ios/ReactNativeCheckBiometricAuthChanged-Swift-Cxx-Bridge.hpp delete mode 100644 native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/ios/ReactNativeCheckBiometricAuthChanged-Swift-Cxx-Umbrella.hpp delete mode 100644 native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/ios/ReactNativeCheckBiometricAuthChangedAutolinking.mm delete mode 100644 native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/ios/ReactNativeCheckBiometricAuthChangedAutolinking.swift delete mode 100644 native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/ios/c++/HybridReactNativeCheckBiometricAuthChangedSpecSwift.cpp delete mode 100644 native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/ios/c++/HybridReactNativeCheckBiometricAuthChangedSpecSwift.hpp delete mode 100644 native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/ios/swift/Func_void_bool.swift delete mode 100644 native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift delete mode 100644 native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/ios/swift/HybridReactNativeCheckBiometricAuthChangedSpec.swift delete mode 100644 native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/ios/swift/HybridReactNativeCheckBiometricAuthChangedSpec_cxx.swift delete mode 100644 native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/shared/c++/HybridReactNativeCheckBiometricAuthChangedSpec.cpp delete mode 100644 native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/shared/c++/HybridReactNativeCheckBiometricAuthChangedSpec.hpp delete mode 100644 native-modules/react-native-cloud-kit-module/nitrogen/generated/.gitattributes delete mode 100644 native-modules/react-native-cloud-kit-module/nitrogen/generated/android/c++/JAccountInfoResult.hpp delete mode 100644 native-modules/react-native-cloud-kit-module/nitrogen/generated/android/c++/JDeleteRecordParams.hpp delete mode 100644 native-modules/react-native-cloud-kit-module/nitrogen/generated/android/c++/JFetchRecordParams.hpp delete mode 100644 native-modules/react-native-cloud-kit-module/nitrogen/generated/android/c++/JHybridCloudKitModuleSpec.cpp delete mode 100644 native-modules/react-native-cloud-kit-module/nitrogen/generated/android/c++/JHybridCloudKitModuleSpec.hpp delete mode 100644 native-modules/react-native-cloud-kit-module/nitrogen/generated/android/c++/JQueryRecordsParams.hpp delete mode 100644 native-modules/react-native-cloud-kit-module/nitrogen/generated/android/c++/JQueryRecordsResult.hpp delete mode 100644 native-modules/react-native-cloud-kit-module/nitrogen/generated/android/c++/JRecordExistsParams.hpp delete mode 100644 native-modules/react-native-cloud-kit-module/nitrogen/generated/android/c++/JRecordResult.hpp delete mode 100644 native-modules/react-native-cloud-kit-module/nitrogen/generated/android/c++/JSaveRecordParams.hpp delete mode 100644 native-modules/react-native-cloud-kit-module/nitrogen/generated/android/c++/JSaveRecordResult.hpp delete mode 100644 native-modules/react-native-cloud-kit-module/nitrogen/generated/android/c++/JVariant_NullType_RecordResult.cpp delete mode 100644 native-modules/react-native-cloud-kit-module/nitrogen/generated/android/c++/JVariant_NullType_RecordResult.hpp delete mode 100644 native-modules/react-native-cloud-kit-module/nitrogen/generated/android/cloudkitmodule+autolinking.cmake delete mode 100644 native-modules/react-native-cloud-kit-module/nitrogen/generated/android/cloudkitmodule+autolinking.gradle delete mode 100644 native-modules/react-native-cloud-kit-module/nitrogen/generated/android/cloudkitmoduleOnLoad.cpp delete mode 100644 native-modules/react-native-cloud-kit-module/nitrogen/generated/android/cloudkitmoduleOnLoad.hpp delete mode 100644 native-modules/react-native-cloud-kit-module/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/AccountInfoResult.kt delete mode 100644 native-modules/react-native-cloud-kit-module/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/DeleteRecordParams.kt delete mode 100644 native-modules/react-native-cloud-kit-module/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/FetchRecordParams.kt delete mode 100644 native-modules/react-native-cloud-kit-module/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/HybridCloudKitModuleSpec.kt delete mode 100644 native-modules/react-native-cloud-kit-module/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/QueryRecordsParams.kt delete mode 100644 native-modules/react-native-cloud-kit-module/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/QueryRecordsResult.kt delete mode 100644 native-modules/react-native-cloud-kit-module/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/RecordExistsParams.kt delete mode 100644 native-modules/react-native-cloud-kit-module/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/RecordResult.kt delete mode 100644 native-modules/react-native-cloud-kit-module/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/SaveRecordParams.kt delete mode 100644 native-modules/react-native-cloud-kit-module/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/SaveRecordResult.kt delete mode 100644 native-modules/react-native-cloud-kit-module/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/Variant_NullType_RecordResult.kt delete mode 100644 native-modules/react-native-cloud-kit-module/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/cloudkitmoduleOnLoad.kt delete mode 100644 native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/CloudKitModule+autolinking.rb delete mode 100644 native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/CloudKitModule-Swift-Cxx-Bridge.cpp delete mode 100644 native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/CloudKitModule-Swift-Cxx-Bridge.hpp delete mode 100644 native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/CloudKitModule-Swift-Cxx-Umbrella.hpp delete mode 100644 native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/CloudKitModuleAutolinking.mm delete mode 100644 native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/CloudKitModuleAutolinking.swift delete mode 100644 native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/c++/HybridCloudKitModuleSpecSwift.cpp delete mode 100644 native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/c++/HybridCloudKitModuleSpecSwift.hpp delete mode 100644 native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/swift/AccountInfoResult.swift delete mode 100644 native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/swift/DeleteRecordParams.swift delete mode 100644 native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/swift/FetchRecordParams.swift delete mode 100644 native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/swift/Func_void.swift delete mode 100644 native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/swift/Func_void_AccountInfoResult.swift delete mode 100644 native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/swift/Func_void_QueryRecordsResult.swift delete mode 100644 native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/swift/Func_void_SaveRecordResult.swift delete mode 100644 native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/swift/Func_void_bool.swift delete mode 100644 native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift delete mode 100644 native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/swift/Func_void_std__variant_nitro__NullType__RecordResult_.swift delete mode 100644 native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/swift/HybridCloudKitModuleSpec.swift delete mode 100644 native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/swift/HybridCloudKitModuleSpec_cxx.swift delete mode 100644 native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/swift/QueryRecordsParams.swift delete mode 100644 native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/swift/QueryRecordsResult.swift delete mode 100644 native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/swift/RecordExistsParams.swift delete mode 100644 native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/swift/RecordResult.swift delete mode 100644 native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/swift/SaveRecordParams.swift delete mode 100644 native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/swift/SaveRecordResult.swift delete mode 100644 native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/swift/Variant_NullType_RecordResult.swift delete mode 100644 native-modules/react-native-cloud-kit-module/nitrogen/generated/shared/c++/AccountInfoResult.hpp delete mode 100644 native-modules/react-native-cloud-kit-module/nitrogen/generated/shared/c++/DeleteRecordParams.hpp delete mode 100644 native-modules/react-native-cloud-kit-module/nitrogen/generated/shared/c++/FetchRecordParams.hpp delete mode 100644 native-modules/react-native-cloud-kit-module/nitrogen/generated/shared/c++/HybridCloudKitModuleSpec.cpp delete mode 100644 native-modules/react-native-cloud-kit-module/nitrogen/generated/shared/c++/HybridCloudKitModuleSpec.hpp delete mode 100644 native-modules/react-native-cloud-kit-module/nitrogen/generated/shared/c++/QueryRecordsParams.hpp delete mode 100644 native-modules/react-native-cloud-kit-module/nitrogen/generated/shared/c++/QueryRecordsResult.hpp delete mode 100644 native-modules/react-native-cloud-kit-module/nitrogen/generated/shared/c++/RecordExistsParams.hpp delete mode 100644 native-modules/react-native-cloud-kit-module/nitrogen/generated/shared/c++/RecordResult.hpp delete mode 100644 native-modules/react-native-cloud-kit-module/nitrogen/generated/shared/c++/SaveRecordParams.hpp delete mode 100644 native-modules/react-native-cloud-kit-module/nitrogen/generated/shared/c++/SaveRecordResult.hpp delete mode 100644 native-modules/react-native-device-utils/nitrogen/generated/.gitattributes delete mode 100644 native-modules/react-native-device-utils/nitrogen/generated/android/c++/JDualScreenInfoRect.hpp delete mode 100644 native-modules/react-native-device-utils/nitrogen/generated/android/c++/JFunc_void_bool.hpp delete mode 100644 native-modules/react-native-device-utils/nitrogen/generated/android/c++/JGooglePlayServicesStatus.hpp delete mode 100644 native-modules/react-native-device-utils/nitrogen/generated/android/c++/JHybridReactNativeDeviceUtilsSpec.cpp delete mode 100644 native-modules/react-native-device-utils/nitrogen/generated/android/c++/JHybridReactNativeDeviceUtilsSpec.hpp delete mode 100644 native-modules/react-native-device-utils/nitrogen/generated/android/c++/JLaunchOptions.hpp delete mode 100644 native-modules/react-native-device-utils/nitrogen/generated/android/c++/JUserInterfaceStyle.hpp delete mode 100644 native-modules/react-native-device-utils/nitrogen/generated/android/c++/JWebViewPackageInfo.hpp delete mode 100644 native-modules/react-native-device-utils/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativedeviceutils/DualScreenInfoRect.kt delete mode 100644 native-modules/react-native-device-utils/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativedeviceutils/Func_void_bool.kt delete mode 100644 native-modules/react-native-device-utils/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativedeviceutils/GooglePlayServicesStatus.kt delete mode 100644 native-modules/react-native-device-utils/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativedeviceutils/HybridReactNativeDeviceUtilsSpec.kt delete mode 100644 native-modules/react-native-device-utils/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativedeviceutils/LaunchOptions.kt delete mode 100644 native-modules/react-native-device-utils/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativedeviceutils/UserInterfaceStyle.kt delete mode 100644 native-modules/react-native-device-utils/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativedeviceutils/WebViewPackageInfo.kt delete mode 100644 native-modules/react-native-device-utils/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativedeviceutils/reactnativedeviceutilsOnLoad.kt delete mode 100644 native-modules/react-native-device-utils/nitrogen/generated/android/reactnativedeviceutils+autolinking.cmake delete mode 100644 native-modules/react-native-device-utils/nitrogen/generated/android/reactnativedeviceutils+autolinking.gradle delete mode 100644 native-modules/react-native-device-utils/nitrogen/generated/android/reactnativedeviceutilsOnLoad.cpp delete mode 100644 native-modules/react-native-device-utils/nitrogen/generated/android/reactnativedeviceutilsOnLoad.hpp delete mode 100644 native-modules/react-native-device-utils/nitrogen/generated/ios/ReactNativeDeviceUtils+autolinking.rb delete mode 100644 native-modules/react-native-device-utils/nitrogen/generated/ios/ReactNativeDeviceUtils-Swift-Cxx-Bridge.cpp delete mode 100644 native-modules/react-native-device-utils/nitrogen/generated/ios/ReactNativeDeviceUtils-Swift-Cxx-Bridge.hpp delete mode 100644 native-modules/react-native-device-utils/nitrogen/generated/ios/ReactNativeDeviceUtils-Swift-Cxx-Umbrella.hpp delete mode 100644 native-modules/react-native-device-utils/nitrogen/generated/ios/ReactNativeDeviceUtilsAutolinking.mm delete mode 100644 native-modules/react-native-device-utils/nitrogen/generated/ios/ReactNativeDeviceUtilsAutolinking.swift delete mode 100644 native-modules/react-native-device-utils/nitrogen/generated/ios/c++/HybridReactNativeDeviceUtilsSpecSwift.cpp delete mode 100644 native-modules/react-native-device-utils/nitrogen/generated/ios/c++/HybridReactNativeDeviceUtilsSpecSwift.hpp delete mode 100644 native-modules/react-native-device-utils/nitrogen/generated/ios/swift/DualScreenInfoRect.swift delete mode 100644 native-modules/react-native-device-utils/nitrogen/generated/ios/swift/Func_void.swift delete mode 100644 native-modules/react-native-device-utils/nitrogen/generated/ios/swift/Func_void_DualScreenInfoRect.swift delete mode 100644 native-modules/react-native-device-utils/nitrogen/generated/ios/swift/Func_void_GooglePlayServicesStatus.swift delete mode 100644 native-modules/react-native-device-utils/nitrogen/generated/ios/swift/Func_void_LaunchOptions.swift delete mode 100644 native-modules/react-native-device-utils/nitrogen/generated/ios/swift/Func_void_WebViewPackageInfo.swift delete mode 100644 native-modules/react-native-device-utils/nitrogen/generated/ios/swift/Func_void_bool.swift delete mode 100644 native-modules/react-native-device-utils/nitrogen/generated/ios/swift/Func_void_double.swift delete mode 100644 native-modules/react-native-device-utils/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift delete mode 100644 native-modules/react-native-device-utils/nitrogen/generated/ios/swift/Func_void_std__string.swift delete mode 100644 native-modules/react-native-device-utils/nitrogen/generated/ios/swift/Func_void_std__vector_DualScreenInfoRect_.swift delete mode 100644 native-modules/react-native-device-utils/nitrogen/generated/ios/swift/GooglePlayServicesStatus.swift delete mode 100644 native-modules/react-native-device-utils/nitrogen/generated/ios/swift/HybridReactNativeDeviceUtilsSpec.swift delete mode 100644 native-modules/react-native-device-utils/nitrogen/generated/ios/swift/HybridReactNativeDeviceUtilsSpec_cxx.swift delete mode 100644 native-modules/react-native-device-utils/nitrogen/generated/ios/swift/LaunchOptions.swift delete mode 100644 native-modules/react-native-device-utils/nitrogen/generated/ios/swift/UserInterfaceStyle.swift delete mode 100644 native-modules/react-native-device-utils/nitrogen/generated/ios/swift/WebViewPackageInfo.swift delete mode 100644 native-modules/react-native-device-utils/nitrogen/generated/shared/c++/DualScreenInfoRect.hpp delete mode 100644 native-modules/react-native-device-utils/nitrogen/generated/shared/c++/GooglePlayServicesStatus.hpp delete mode 100644 native-modules/react-native-device-utils/nitrogen/generated/shared/c++/HybridReactNativeDeviceUtilsSpec.cpp delete mode 100644 native-modules/react-native-device-utils/nitrogen/generated/shared/c++/HybridReactNativeDeviceUtilsSpec.hpp delete mode 100644 native-modules/react-native-device-utils/nitrogen/generated/shared/c++/LaunchOptions.hpp delete mode 100644 native-modules/react-native-device-utils/nitrogen/generated/shared/c++/UserInterfaceStyle.hpp delete mode 100644 native-modules/react-native-device-utils/nitrogen/generated/shared/c++/WebViewPackageInfo.hpp delete mode 100644 native-modules/react-native-get-random-values/nitrogen/generated/.gitattributes delete mode 100644 native-modules/react-native-get-random-values/nitrogen/generated/android/c++/JHybridReactNativeGetRandomValuesSpec.cpp delete mode 100644 native-modules/react-native-get-random-values/nitrogen/generated/android/c++/JHybridReactNativeGetRandomValuesSpec.hpp delete mode 100644 native-modules/react-native-get-random-values/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativegetrandomvalues/HybridReactNativeGetRandomValuesSpec.kt delete mode 100644 native-modules/react-native-get-random-values/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativegetrandomvalues/reactnativegetrandomvaluesOnLoad.kt delete mode 100644 native-modules/react-native-get-random-values/nitrogen/generated/android/reactnativegetrandomvalues+autolinking.cmake delete mode 100644 native-modules/react-native-get-random-values/nitrogen/generated/android/reactnativegetrandomvalues+autolinking.gradle delete mode 100644 native-modules/react-native-get-random-values/nitrogen/generated/android/reactnativegetrandomvaluesOnLoad.cpp delete mode 100644 native-modules/react-native-get-random-values/nitrogen/generated/android/reactnativegetrandomvaluesOnLoad.hpp delete mode 100644 native-modules/react-native-get-random-values/nitrogen/generated/ios/ReactNativeGetRandomValues+autolinking.rb delete mode 100644 native-modules/react-native-get-random-values/nitrogen/generated/ios/ReactNativeGetRandomValues-Swift-Cxx-Bridge.cpp delete mode 100644 native-modules/react-native-get-random-values/nitrogen/generated/ios/ReactNativeGetRandomValues-Swift-Cxx-Bridge.hpp delete mode 100644 native-modules/react-native-get-random-values/nitrogen/generated/ios/ReactNativeGetRandomValues-Swift-Cxx-Umbrella.hpp delete mode 100644 native-modules/react-native-get-random-values/nitrogen/generated/ios/ReactNativeGetRandomValuesAutolinking.mm delete mode 100644 native-modules/react-native-get-random-values/nitrogen/generated/ios/ReactNativeGetRandomValuesAutolinking.swift delete mode 100644 native-modules/react-native-get-random-values/nitrogen/generated/ios/c++/HybridReactNativeGetRandomValuesSpecSwift.cpp delete mode 100644 native-modules/react-native-get-random-values/nitrogen/generated/ios/c++/HybridReactNativeGetRandomValuesSpecSwift.hpp delete mode 100644 native-modules/react-native-get-random-values/nitrogen/generated/ios/swift/HybridReactNativeGetRandomValuesSpec.swift delete mode 100644 native-modules/react-native-get-random-values/nitrogen/generated/ios/swift/HybridReactNativeGetRandomValuesSpec_cxx.swift delete mode 100644 native-modules/react-native-get-random-values/nitrogen/generated/shared/c++/HybridReactNativeGetRandomValuesSpec.cpp delete mode 100644 native-modules/react-native-get-random-values/nitrogen/generated/shared/c++/HybridReactNativeGetRandomValuesSpec.hpp delete mode 100644 native-modules/react-native-keychain-module/nitrogen/generated/.gitattributes delete mode 100644 native-modules/react-native-keychain-module/nitrogen/generated/android/c++/JGetItemParams.hpp delete mode 100644 native-modules/react-native-keychain-module/nitrogen/generated/android/c++/JGetItemResult.hpp delete mode 100644 native-modules/react-native-keychain-module/nitrogen/generated/android/c++/JHasItemParams.hpp delete mode 100644 native-modules/react-native-keychain-module/nitrogen/generated/android/c++/JHybridKeychainModuleSpec.cpp delete mode 100644 native-modules/react-native-keychain-module/nitrogen/generated/android/c++/JHybridKeychainModuleSpec.hpp delete mode 100644 native-modules/react-native-keychain-module/nitrogen/generated/android/c++/JRemoveItemParams.hpp delete mode 100644 native-modules/react-native-keychain-module/nitrogen/generated/android/c++/JSetItemParams.hpp delete mode 100644 native-modules/react-native-keychain-module/nitrogen/generated/android/c++/JVariant_NullType_GetItemResult.cpp delete mode 100644 native-modules/react-native-keychain-module/nitrogen/generated/android/c++/JVariant_NullType_GetItemResult.hpp delete mode 100644 native-modules/react-native-keychain-module/nitrogen/generated/android/keychainmodule+autolinking.cmake delete mode 100644 native-modules/react-native-keychain-module/nitrogen/generated/android/keychainmodule+autolinking.gradle delete mode 100644 native-modules/react-native-keychain-module/nitrogen/generated/android/keychainmoduleOnLoad.cpp delete mode 100644 native-modules/react-native-keychain-module/nitrogen/generated/android/keychainmoduleOnLoad.hpp delete mode 100644 native-modules/react-native-keychain-module/nitrogen/generated/android/kotlin/com/margelo/nitro/keychainmodule/GetItemParams.kt delete mode 100644 native-modules/react-native-keychain-module/nitrogen/generated/android/kotlin/com/margelo/nitro/keychainmodule/GetItemResult.kt delete mode 100644 native-modules/react-native-keychain-module/nitrogen/generated/android/kotlin/com/margelo/nitro/keychainmodule/HasItemParams.kt delete mode 100644 native-modules/react-native-keychain-module/nitrogen/generated/android/kotlin/com/margelo/nitro/keychainmodule/HybridKeychainModuleSpec.kt delete mode 100644 native-modules/react-native-keychain-module/nitrogen/generated/android/kotlin/com/margelo/nitro/keychainmodule/RemoveItemParams.kt delete mode 100644 native-modules/react-native-keychain-module/nitrogen/generated/android/kotlin/com/margelo/nitro/keychainmodule/SetItemParams.kt delete mode 100644 native-modules/react-native-keychain-module/nitrogen/generated/android/kotlin/com/margelo/nitro/keychainmodule/Variant_NullType_GetItemResult.kt delete mode 100644 native-modules/react-native-keychain-module/nitrogen/generated/android/kotlin/com/margelo/nitro/keychainmodule/keychainmoduleOnLoad.kt delete mode 100644 native-modules/react-native-keychain-module/nitrogen/generated/ios/KeychainModule+autolinking.rb delete mode 100644 native-modules/react-native-keychain-module/nitrogen/generated/ios/KeychainModule-Swift-Cxx-Bridge.cpp delete mode 100644 native-modules/react-native-keychain-module/nitrogen/generated/ios/KeychainModule-Swift-Cxx-Bridge.hpp delete mode 100644 native-modules/react-native-keychain-module/nitrogen/generated/ios/KeychainModule-Swift-Cxx-Umbrella.hpp delete mode 100644 native-modules/react-native-keychain-module/nitrogen/generated/ios/KeychainModuleAutolinking.mm delete mode 100644 native-modules/react-native-keychain-module/nitrogen/generated/ios/KeychainModuleAutolinking.swift delete mode 100644 native-modules/react-native-keychain-module/nitrogen/generated/ios/c++/HybridKeychainModuleSpecSwift.cpp delete mode 100644 native-modules/react-native-keychain-module/nitrogen/generated/ios/c++/HybridKeychainModuleSpecSwift.hpp delete mode 100644 native-modules/react-native-keychain-module/nitrogen/generated/ios/swift/Func_void.swift delete mode 100644 native-modules/react-native-keychain-module/nitrogen/generated/ios/swift/Func_void_bool.swift delete mode 100644 native-modules/react-native-keychain-module/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift delete mode 100644 native-modules/react-native-keychain-module/nitrogen/generated/ios/swift/Func_void_std__variant_nitro__NullType__GetItemResult_.swift delete mode 100644 native-modules/react-native-keychain-module/nitrogen/generated/ios/swift/GetItemParams.swift delete mode 100644 native-modules/react-native-keychain-module/nitrogen/generated/ios/swift/GetItemResult.swift delete mode 100644 native-modules/react-native-keychain-module/nitrogen/generated/ios/swift/HasItemParams.swift delete mode 100644 native-modules/react-native-keychain-module/nitrogen/generated/ios/swift/HybridKeychainModuleSpec.swift delete mode 100644 native-modules/react-native-keychain-module/nitrogen/generated/ios/swift/HybridKeychainModuleSpec_cxx.swift delete mode 100644 native-modules/react-native-keychain-module/nitrogen/generated/ios/swift/RemoveItemParams.swift delete mode 100644 native-modules/react-native-keychain-module/nitrogen/generated/ios/swift/SetItemParams.swift delete mode 100644 native-modules/react-native-keychain-module/nitrogen/generated/ios/swift/Variant_NullType_GetItemResult.swift delete mode 100644 native-modules/react-native-keychain-module/nitrogen/generated/shared/c++/GetItemParams.hpp delete mode 100644 native-modules/react-native-keychain-module/nitrogen/generated/shared/c++/GetItemResult.hpp delete mode 100644 native-modules/react-native-keychain-module/nitrogen/generated/shared/c++/HasItemParams.hpp delete mode 100644 native-modules/react-native-keychain-module/nitrogen/generated/shared/c++/HybridKeychainModuleSpec.cpp delete mode 100644 native-modules/react-native-keychain-module/nitrogen/generated/shared/c++/HybridKeychainModuleSpec.hpp delete mode 100644 native-modules/react-native-keychain-module/nitrogen/generated/shared/c++/RemoveItemParams.hpp delete mode 100644 native-modules/react-native-keychain-module/nitrogen/generated/shared/c++/SetItemParams.hpp delete mode 100644 native-modules/react-native-perf-memory/nitrogen/generated/.gitattributes delete mode 100644 native-modules/react-native-perf-memory/nitrogen/generated/android/c++/JHybridReactNativePerfMemorySpec.cpp delete mode 100644 native-modules/react-native-perf-memory/nitrogen/generated/android/c++/JHybridReactNativePerfMemorySpec.hpp delete mode 100644 native-modules/react-native-perf-memory/nitrogen/generated/android/c++/JMemoryUsage.hpp delete mode 100644 native-modules/react-native-perf-memory/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativeperfmemory/HybridReactNativePerfMemorySpec.kt delete mode 100644 native-modules/react-native-perf-memory/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativeperfmemory/MemoryUsage.kt delete mode 100644 native-modules/react-native-perf-memory/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativeperfmemory/reactnativeperfmemoryOnLoad.kt delete mode 100644 native-modules/react-native-perf-memory/nitrogen/generated/android/reactnativeperfmemory+autolinking.cmake delete mode 100644 native-modules/react-native-perf-memory/nitrogen/generated/android/reactnativeperfmemory+autolinking.gradle delete mode 100644 native-modules/react-native-perf-memory/nitrogen/generated/android/reactnativeperfmemoryOnLoad.cpp delete mode 100644 native-modules/react-native-perf-memory/nitrogen/generated/android/reactnativeperfmemoryOnLoad.hpp delete mode 100644 native-modules/react-native-perf-memory/nitrogen/generated/ios/ReactNativePerfMemory+autolinking.rb delete mode 100644 native-modules/react-native-perf-memory/nitrogen/generated/ios/ReactNativePerfMemory-Swift-Cxx-Bridge.cpp delete mode 100644 native-modules/react-native-perf-memory/nitrogen/generated/ios/ReactNativePerfMemory-Swift-Cxx-Bridge.hpp delete mode 100644 native-modules/react-native-perf-memory/nitrogen/generated/ios/ReactNativePerfMemory-Swift-Cxx-Umbrella.hpp delete mode 100644 native-modules/react-native-perf-memory/nitrogen/generated/ios/ReactNativePerfMemoryAutolinking.mm delete mode 100644 native-modules/react-native-perf-memory/nitrogen/generated/ios/ReactNativePerfMemoryAutolinking.swift delete mode 100644 native-modules/react-native-perf-memory/nitrogen/generated/ios/c++/HybridReactNativePerfMemorySpecSwift.cpp delete mode 100644 native-modules/react-native-perf-memory/nitrogen/generated/ios/c++/HybridReactNativePerfMemorySpecSwift.hpp delete mode 100644 native-modules/react-native-perf-memory/nitrogen/generated/ios/swift/Func_void_MemoryUsage.swift delete mode 100644 native-modules/react-native-perf-memory/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift delete mode 100644 native-modules/react-native-perf-memory/nitrogen/generated/ios/swift/HybridReactNativePerfMemorySpec.swift delete mode 100644 native-modules/react-native-perf-memory/nitrogen/generated/ios/swift/HybridReactNativePerfMemorySpec_cxx.swift delete mode 100644 native-modules/react-native-perf-memory/nitrogen/generated/ios/swift/MemoryUsage.swift delete mode 100644 native-modules/react-native-perf-memory/nitrogen/generated/shared/c++/HybridReactNativePerfMemorySpec.cpp delete mode 100644 native-modules/react-native-perf-memory/nitrogen/generated/shared/c++/HybridReactNativePerfMemorySpec.hpp delete mode 100644 native-modules/react-native-perf-memory/nitrogen/generated/shared/c++/MemoryUsage.hpp delete mode 100644 native-modules/react-native-splash-screen/nitrogen/generated/.gitattributes delete mode 100644 native-modules/react-native-splash-screen/nitrogen/generated/android/c++/JHybridReactNativeSplashScreenSpec.cpp delete mode 100644 native-modules/react-native-splash-screen/nitrogen/generated/android/c++/JHybridReactNativeSplashScreenSpec.hpp delete mode 100644 native-modules/react-native-splash-screen/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativesplashscreen/HybridReactNativeSplashScreenSpec.kt delete mode 100644 native-modules/react-native-splash-screen/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativesplashscreen/reactnativesplashscreenOnLoad.kt delete mode 100644 native-modules/react-native-splash-screen/nitrogen/generated/android/reactnativesplashscreen+autolinking.cmake delete mode 100644 native-modules/react-native-splash-screen/nitrogen/generated/android/reactnativesplashscreen+autolinking.gradle delete mode 100644 native-modules/react-native-splash-screen/nitrogen/generated/android/reactnativesplashscreenOnLoad.cpp delete mode 100644 native-modules/react-native-splash-screen/nitrogen/generated/android/reactnativesplashscreenOnLoad.hpp delete mode 100644 native-modules/react-native-splash-screen/nitrogen/generated/ios/ReactNativeSplashScreen+autolinking.rb delete mode 100644 native-modules/react-native-splash-screen/nitrogen/generated/ios/ReactNativeSplashScreen-Swift-Cxx-Bridge.cpp delete mode 100644 native-modules/react-native-splash-screen/nitrogen/generated/ios/ReactNativeSplashScreen-Swift-Cxx-Bridge.hpp delete mode 100644 native-modules/react-native-splash-screen/nitrogen/generated/ios/ReactNativeSplashScreen-Swift-Cxx-Umbrella.hpp delete mode 100644 native-modules/react-native-splash-screen/nitrogen/generated/ios/ReactNativeSplashScreenAutolinking.mm delete mode 100644 native-modules/react-native-splash-screen/nitrogen/generated/ios/ReactNativeSplashScreenAutolinking.swift delete mode 100644 native-modules/react-native-splash-screen/nitrogen/generated/ios/c++/HybridReactNativeSplashScreenSpecSwift.cpp delete mode 100644 native-modules/react-native-splash-screen/nitrogen/generated/ios/c++/HybridReactNativeSplashScreenSpecSwift.hpp delete mode 100644 native-modules/react-native-splash-screen/nitrogen/generated/ios/swift/Func_void_bool.swift delete mode 100644 native-modules/react-native-splash-screen/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift delete mode 100644 native-modules/react-native-splash-screen/nitrogen/generated/ios/swift/HybridReactNativeSplashScreenSpec.swift delete mode 100644 native-modules/react-native-splash-screen/nitrogen/generated/ios/swift/HybridReactNativeSplashScreenSpec_cxx.swift delete mode 100644 native-modules/react-native-splash-screen/nitrogen/generated/shared/c++/HybridReactNativeSplashScreenSpec.cpp delete mode 100644 native-modules/react-native-splash-screen/nitrogen/generated/shared/c++/HybridReactNativeSplashScreenSpec.hpp delete mode 100644 native-views/react-native-auto-size-input/nitrogen/generated/.gitattributes delete mode 100644 native-views/react-native-auto-size-input/nitrogen/generated/android/autosizeinput+autolinking.cmake delete mode 100644 native-views/react-native-auto-size-input/nitrogen/generated/android/autosizeinput+autolinking.gradle delete mode 100644 native-views/react-native-auto-size-input/nitrogen/generated/android/autosizeinputOnLoad.cpp delete mode 100644 native-views/react-native-auto-size-input/nitrogen/generated/android/autosizeinputOnLoad.hpp delete mode 100644 native-views/react-native-auto-size-input/nitrogen/generated/android/c++/JFunc_void.hpp delete mode 100644 native-views/react-native-auto-size-input/nitrogen/generated/android/c++/JFunc_void_std__string.hpp delete mode 100644 native-views/react-native-auto-size-input/nitrogen/generated/android/c++/JHybridAutoSizeInputSpec.cpp delete mode 100644 native-views/react-native-auto-size-input/nitrogen/generated/android/c++/JHybridAutoSizeInputSpec.hpp delete mode 100644 native-views/react-native-auto-size-input/nitrogen/generated/android/c++/views/JHybridAutoSizeInputStateUpdater.cpp delete mode 100644 native-views/react-native-auto-size-input/nitrogen/generated/android/c++/views/JHybridAutoSizeInputStateUpdater.hpp delete mode 100644 native-views/react-native-auto-size-input/nitrogen/generated/android/kotlin/com/margelo/nitro/autosizeinput/Func_void.kt delete mode 100644 native-views/react-native-auto-size-input/nitrogen/generated/android/kotlin/com/margelo/nitro/autosizeinput/Func_void_std__string.kt delete mode 100644 native-views/react-native-auto-size-input/nitrogen/generated/android/kotlin/com/margelo/nitro/autosizeinput/HybridAutoSizeInputSpec.kt delete mode 100644 native-views/react-native-auto-size-input/nitrogen/generated/android/kotlin/com/margelo/nitro/autosizeinput/autosizeinputOnLoad.kt delete mode 100644 native-views/react-native-auto-size-input/nitrogen/generated/android/kotlin/com/margelo/nitro/autosizeinput/views/HybridAutoSizeInputManager.kt delete mode 100644 native-views/react-native-auto-size-input/nitrogen/generated/android/kotlin/com/margelo/nitro/autosizeinput/views/HybridAutoSizeInputStateUpdater.kt delete mode 100644 native-views/react-native-auto-size-input/nitrogen/generated/ios/AutoSizeInput+autolinking.rb delete mode 100644 native-views/react-native-auto-size-input/nitrogen/generated/ios/AutoSizeInput-Swift-Cxx-Bridge.cpp delete mode 100644 native-views/react-native-auto-size-input/nitrogen/generated/ios/AutoSizeInput-Swift-Cxx-Bridge.hpp delete mode 100644 native-views/react-native-auto-size-input/nitrogen/generated/ios/AutoSizeInput-Swift-Cxx-Umbrella.hpp delete mode 100644 native-views/react-native-auto-size-input/nitrogen/generated/ios/AutoSizeInputAutolinking.mm delete mode 100644 native-views/react-native-auto-size-input/nitrogen/generated/ios/AutoSizeInputAutolinking.swift delete mode 100644 native-views/react-native-auto-size-input/nitrogen/generated/ios/c++/HybridAutoSizeInputSpecSwift.cpp delete mode 100644 native-views/react-native-auto-size-input/nitrogen/generated/ios/c++/HybridAutoSizeInputSpecSwift.hpp delete mode 100644 native-views/react-native-auto-size-input/nitrogen/generated/ios/c++/views/HybridAutoSizeInputComponent.mm delete mode 100644 native-views/react-native-auto-size-input/nitrogen/generated/ios/swift/Func_void.swift delete mode 100644 native-views/react-native-auto-size-input/nitrogen/generated/ios/swift/Func_void_std__string.swift delete mode 100644 native-views/react-native-auto-size-input/nitrogen/generated/ios/swift/HybridAutoSizeInputSpec.swift delete mode 100644 native-views/react-native-auto-size-input/nitrogen/generated/ios/swift/HybridAutoSizeInputSpec_cxx.swift delete mode 100644 native-views/react-native-auto-size-input/nitrogen/generated/shared/c++/HybridAutoSizeInputSpec.cpp delete mode 100644 native-views/react-native-auto-size-input/nitrogen/generated/shared/c++/HybridAutoSizeInputSpec.hpp delete mode 100644 native-views/react-native-auto-size-input/nitrogen/generated/shared/c++/views/HybridAutoSizeInputComponent.cpp delete mode 100644 native-views/react-native-auto-size-input/nitrogen/generated/shared/c++/views/HybridAutoSizeInputComponent.hpp delete mode 100644 native-views/react-native-auto-size-input/nitrogen/generated/shared/json/AutoSizeInputConfig.json delete mode 100644 native-views/react-native-scroll-guard/nitrogen/generated/.gitattributes delete mode 100644 native-views/react-native-scroll-guard/nitrogen/generated/android/c++/JHybridScrollGuardSpec.cpp delete mode 100644 native-views/react-native-scroll-guard/nitrogen/generated/android/c++/JHybridScrollGuardSpec.hpp delete mode 100644 native-views/react-native-scroll-guard/nitrogen/generated/android/c++/JScrollGuardDirection.hpp delete mode 100644 native-views/react-native-scroll-guard/nitrogen/generated/android/c++/views/JHybridScrollGuardStateUpdater.cpp delete mode 100644 native-views/react-native-scroll-guard/nitrogen/generated/android/c++/views/JHybridScrollGuardStateUpdater.hpp delete mode 100644 native-views/react-native-scroll-guard/nitrogen/generated/android/kotlin/com/margelo/nitro/scrollguard/HybridScrollGuardSpec.kt delete mode 100644 native-views/react-native-scroll-guard/nitrogen/generated/android/kotlin/com/margelo/nitro/scrollguard/ScrollGuardDirection.kt delete mode 100644 native-views/react-native-scroll-guard/nitrogen/generated/android/kotlin/com/margelo/nitro/scrollguard/scrollguardOnLoad.kt delete mode 100644 native-views/react-native-scroll-guard/nitrogen/generated/android/kotlin/com/margelo/nitro/scrollguard/views/HybridScrollGuardManager.kt delete mode 100644 native-views/react-native-scroll-guard/nitrogen/generated/android/kotlin/com/margelo/nitro/scrollguard/views/HybridScrollGuardStateUpdater.kt delete mode 100644 native-views/react-native-scroll-guard/nitrogen/generated/android/scrollguard+autolinking.cmake delete mode 100644 native-views/react-native-scroll-guard/nitrogen/generated/android/scrollguard+autolinking.gradle delete mode 100644 native-views/react-native-scroll-guard/nitrogen/generated/android/scrollguardOnLoad.cpp delete mode 100644 native-views/react-native-scroll-guard/nitrogen/generated/android/scrollguardOnLoad.hpp delete mode 100644 native-views/react-native-scroll-guard/nitrogen/generated/ios/ScrollGuard+autolinking.rb delete mode 100644 native-views/react-native-scroll-guard/nitrogen/generated/ios/ScrollGuard-Swift-Cxx-Bridge.cpp delete mode 100644 native-views/react-native-scroll-guard/nitrogen/generated/ios/ScrollGuard-Swift-Cxx-Bridge.hpp delete mode 100644 native-views/react-native-scroll-guard/nitrogen/generated/ios/ScrollGuard-Swift-Cxx-Umbrella.hpp delete mode 100644 native-views/react-native-scroll-guard/nitrogen/generated/ios/ScrollGuardAutolinking.mm delete mode 100644 native-views/react-native-scroll-guard/nitrogen/generated/ios/ScrollGuardAutolinking.swift delete mode 100644 native-views/react-native-scroll-guard/nitrogen/generated/ios/c++/HybridScrollGuardSpecSwift.cpp delete mode 100644 native-views/react-native-scroll-guard/nitrogen/generated/ios/c++/HybridScrollGuardSpecSwift.hpp delete mode 100644 native-views/react-native-scroll-guard/nitrogen/generated/ios/c++/views/HybridScrollGuardComponent.mm delete mode 100644 native-views/react-native-scroll-guard/nitrogen/generated/ios/swift/HybridScrollGuardSpec.swift delete mode 100644 native-views/react-native-scroll-guard/nitrogen/generated/ios/swift/HybridScrollGuardSpec_cxx.swift delete mode 100644 native-views/react-native-scroll-guard/nitrogen/generated/ios/swift/ScrollGuardDirection.swift delete mode 100644 native-views/react-native-scroll-guard/nitrogen/generated/shared/c++/HybridScrollGuardSpec.cpp delete mode 100644 native-views/react-native-scroll-guard/nitrogen/generated/shared/c++/HybridScrollGuardSpec.hpp delete mode 100644 native-views/react-native-scroll-guard/nitrogen/generated/shared/c++/ScrollGuardDirection.hpp delete mode 100644 native-views/react-native-scroll-guard/nitrogen/generated/shared/c++/views/HybridScrollGuardComponent.cpp delete mode 100644 native-views/react-native-scroll-guard/nitrogen/generated/shared/c++/views/HybridScrollGuardComponent.hpp delete mode 100644 native-views/react-native-scroll-guard/nitrogen/generated/shared/json/ScrollGuardConfig.json diff --git a/native-modules/native-logger/nitrogen/generated/.gitattributes b/native-modules/native-logger/nitrogen/generated/.gitattributes deleted file mode 100644 index fb7a0d5..0000000 --- a/native-modules/native-logger/nitrogen/generated/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -** linguist-generated=true diff --git a/native-modules/native-logger/nitrogen/generated/android/c++/JHybridNativeLoggerSpec.cpp b/native-modules/native-logger/nitrogen/generated/android/c++/JHybridNativeLoggerSpec.cpp deleted file mode 100644 index 7298c4d..0000000 --- a/native-modules/native-logger/nitrogen/generated/android/c++/JHybridNativeLoggerSpec.cpp +++ /dev/null @@ -1,99 +0,0 @@ -/// -/// JHybridNativeLoggerSpec.cpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#include "JHybridNativeLoggerSpec.hpp" - - - -#include -#include -#include -#include - -namespace margelo::nitro::nativelogger { - - jni::local_ref JHybridNativeLoggerSpec::initHybrid(jni::alias_ref jThis) { - return makeCxxInstance(jThis); - } - - void JHybridNativeLoggerSpec::registerNatives() { - registerHybrid({ - makeNativeMethod("initHybrid", JHybridNativeLoggerSpec::initHybrid), - }); - } - - size_t JHybridNativeLoggerSpec::getExternalMemorySize() noexcept { - static const auto method = javaClassStatic()->getMethod("getMemorySize"); - return method(_javaPart); - } - - void JHybridNativeLoggerSpec::dispose() noexcept { - static const auto method = javaClassStatic()->getMethod("dispose"); - method(_javaPart); - } - - std::string JHybridNativeLoggerSpec::toString() { - static const auto method = javaClassStatic()->getMethod("toString"); - auto javaString = method(_javaPart); - return javaString->toStdString(); - } - - // Properties - - - // Methods - void JHybridNativeLoggerSpec::write(double level, const std::string& msg) { - static const auto method = javaClassStatic()->getMethod /* msg */)>("write"); - method(_javaPart, level, jni::make_jstring(msg)); - } - std::string JHybridNativeLoggerSpec::getLogDirectory() { - static const auto method = javaClassStatic()->getMethod()>("getLogDirectory"); - auto __result = method(_javaPart); - return __result->toStdString(); - } - std::shared_ptr>> JHybridNativeLoggerSpec::getLogFilePaths() { - static const auto method = javaClassStatic()->getMethod()>("getLogFilePaths"); - auto __result = method(_javaPart); - return [&]() { - auto __promise = Promise>::create(); - __result->cthis()->addOnResolvedListener([=](const jni::alias_ref& __boxedResult) { - auto __result = jni::static_ref_cast>(__boxedResult); - __promise->resolve([&]() { - size_t __size = __result->size(); - std::vector __vector; - __vector.reserve(__size); - for (size_t __i = 0; __i < __size; __i++) { - auto __element = __result->getElement(__i); - __vector.push_back(__element->toStdString()); - } - return __vector; - }()); - }); - __result->cthis()->addOnRejectedListener([=](const jni::alias_ref& __throwable) { - jni::JniException __jniError(__throwable); - __promise->reject(std::make_exception_ptr(__jniError)); - }); - return __promise; - }(); - } - std::shared_ptr> JHybridNativeLoggerSpec::deleteLogFiles() { - static const auto method = javaClassStatic()->getMethod()>("deleteLogFiles"); - auto __result = method(_javaPart); - return [&]() { - auto __promise = Promise::create(); - __result->cthis()->addOnResolvedListener([=](const jni::alias_ref& /* unit */) { - __promise->resolve(); - }); - __result->cthis()->addOnRejectedListener([=](const jni::alias_ref& __throwable) { - jni::JniException __jniError(__throwable); - __promise->reject(std::make_exception_ptr(__jniError)); - }); - return __promise; - }(); - } - -} // namespace margelo::nitro::nativelogger diff --git a/native-modules/native-logger/nitrogen/generated/android/c++/JHybridNativeLoggerSpec.hpp b/native-modules/native-logger/nitrogen/generated/android/c++/JHybridNativeLoggerSpec.hpp deleted file mode 100644 index ba513c6..0000000 --- a/native-modules/native-logger/nitrogen/generated/android/c++/JHybridNativeLoggerSpec.hpp +++ /dev/null @@ -1,68 +0,0 @@ -/// -/// HybridNativeLoggerSpec.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#include -#include -#include "HybridNativeLoggerSpec.hpp" - - - - -namespace margelo::nitro::nativelogger { - - using namespace facebook; - - class JHybridNativeLoggerSpec: public jni::HybridClass, - public virtual HybridNativeLoggerSpec { - public: - static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/nativelogger/HybridNativeLoggerSpec;"; - static jni::local_ref initHybrid(jni::alias_ref jThis); - static void registerNatives(); - - protected: - // C++ constructor (called from Java via `initHybrid()`) - explicit JHybridNativeLoggerSpec(jni::alias_ref jThis) : - HybridObject(HybridNativeLoggerSpec::TAG), - HybridBase(jThis), - _javaPart(jni::make_global(jThis)) {} - - public: - ~JHybridNativeLoggerSpec() override { - // Hermes GC can destroy JS objects on a non-JNI Thread. - jni::ThreadScope::WithClassLoader([&] { _javaPart.reset(); }); - } - - public: - size_t getExternalMemorySize() noexcept override; - void dispose() noexcept override; - std::string toString() override; - - public: - inline const jni::global_ref& getJavaPart() const noexcept { - return _javaPart; - } - - public: - // Properties - - - public: - // Methods - void write(double level, const std::string& msg) override; - std::string getLogDirectory() override; - std::shared_ptr>> getLogFilePaths() override; - std::shared_ptr> deleteLogFiles() override; - - private: - friend HybridBase; - using HybridBase::HybridBase; - jni::global_ref _javaPart; - }; - -} // namespace margelo::nitro::nativelogger diff --git a/native-modules/native-logger/nitrogen/generated/android/kotlin/com/margelo/nitro/nativelogger/HybridNativeLoggerSpec.kt b/native-modules/native-logger/nitrogen/generated/android/kotlin/com/margelo/nitro/nativelogger/HybridNativeLoggerSpec.kt deleted file mode 100644 index 757d74e..0000000 --- a/native-modules/native-logger/nitrogen/generated/android/kotlin/com/margelo/nitro/nativelogger/HybridNativeLoggerSpec.kt +++ /dev/null @@ -1,70 +0,0 @@ -/// -/// HybridNativeLoggerSpec.kt -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -package com.margelo.nitro.nativelogger - -import androidx.annotation.Keep -import com.facebook.jni.HybridData -import com.facebook.proguard.annotations.DoNotStrip -import com.margelo.nitro.core.Promise -import com.margelo.nitro.core.HybridObject - -/** - * A Kotlin class representing the NativeLogger HybridObject. - * Implement this abstract class to create Kotlin-based instances of NativeLogger. - */ -@DoNotStrip -@Keep -@Suppress( - "KotlinJniMissingFunction", "unused", - "RedundantSuppression", "RedundantUnitReturnType", "SimpleRedundantLet", - "LocalVariableName", "PropertyName", "PrivatePropertyName", "FunctionName" -) -abstract class HybridNativeLoggerSpec: HybridObject() { - @DoNotStrip - private var mHybridData: HybridData = initHybrid() - - init { - super.updateNative(mHybridData) - } - - override fun updateNative(hybridData: HybridData) { - mHybridData = hybridData - super.updateNative(hybridData) - } - - // Default implementation of `HybridObject.toString()` - override fun toString(): String { - return "[HybridObject NativeLogger]" - } - - // Properties - - - // Methods - @DoNotStrip - @Keep - abstract fun write(level: Double, msg: String): Unit - - @DoNotStrip - @Keep - abstract fun getLogDirectory(): String - - @DoNotStrip - @Keep - abstract fun getLogFilePaths(): Promise> - - @DoNotStrip - @Keep - abstract fun deleteLogFiles(): Promise - - private external fun initHybrid(): HybridData - - companion object { - protected const val TAG = "HybridNativeLoggerSpec" - } -} diff --git a/native-modules/native-logger/nitrogen/generated/android/kotlin/com/margelo/nitro/nativelogger/nativeloggerOnLoad.kt b/native-modules/native-logger/nitrogen/generated/android/kotlin/com/margelo/nitro/nativelogger/nativeloggerOnLoad.kt deleted file mode 100644 index 4ab15ae..0000000 --- a/native-modules/native-logger/nitrogen/generated/android/kotlin/com/margelo/nitro/nativelogger/nativeloggerOnLoad.kt +++ /dev/null @@ -1,35 +0,0 @@ -/// -/// nativeloggerOnLoad.kt -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -package com.margelo.nitro.nativelogger - -import android.util.Log - -internal class nativeloggerOnLoad { - companion object { - private const val TAG = "nativeloggerOnLoad" - private var didLoad = false - /** - * Initializes the native part of "nativelogger". - * This method is idempotent and can be called more than once. - */ - @JvmStatic - fun initializeNative() { - if (didLoad) return - try { - Log.i(TAG, "Loading nativelogger C++ library...") - System.loadLibrary("nativelogger") - Log.i(TAG, "Successfully loaded nativelogger C++ library!") - didLoad = true - } catch (e: Error) { - Log.e(TAG, "Failed to load nativelogger C++ library! Is it properly installed and linked? " + - "Is the name correct? (see `CMakeLists.txt`, at `add_library(...)`)", e) - throw e - } - } - } -} diff --git a/native-modules/native-logger/nitrogen/generated/android/nativelogger+autolinking.cmake b/native-modules/native-logger/nitrogen/generated/android/nativelogger+autolinking.cmake deleted file mode 100644 index 3708d6c..0000000 --- a/native-modules/native-logger/nitrogen/generated/android/nativelogger+autolinking.cmake +++ /dev/null @@ -1,81 +0,0 @@ -# -# nativelogger+autolinking.cmake -# This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -# https://github.com/mrousavy/nitro -# Copyright © 2026 Marc Rousavy @ Margelo -# - -# This is a CMake file that adds all files generated by Nitrogen -# to the current CMake project. -# -# To use it, add this to your CMakeLists.txt: -# ```cmake -# include(${CMAKE_SOURCE_DIR}/../nitrogen/generated/android/nativelogger+autolinking.cmake) -# ``` - -# Define a flag to check if we are building properly -add_definitions(-DBUILDING_NATIVELOGGER_WITH_GENERATED_CMAKE_PROJECT) - -# Enable Raw Props parsing in react-native (for Nitro Views) -add_definitions(-DRN_SERIALIZABLE_STATE) - -# Add all headers that were generated by Nitrogen -include_directories( - "../nitrogen/generated/shared/c++" - "../nitrogen/generated/android/c++" - "../nitrogen/generated/android/" -) - -# Add all .cpp sources that were generated by Nitrogen -target_sources( - # CMake project name (Android C++ library name) - nativelogger PRIVATE - # Autolinking Setup - ../nitrogen/generated/android/nativeloggerOnLoad.cpp - # Shared Nitrogen C++ sources - ../nitrogen/generated/shared/c++/HybridNativeLoggerSpec.cpp - # Android-specific Nitrogen C++ sources - ../nitrogen/generated/android/c++/JHybridNativeLoggerSpec.cpp -) - -# From node_modules/react-native/ReactAndroid/cmake-utils/folly-flags.cmake -# Used in node_modules/react-native/ReactAndroid/cmake-utils/ReactNative-application.cmake -target_compile_definitions( - nativelogger PRIVATE - -DFOLLY_NO_CONFIG=1 - -DFOLLY_HAVE_CLOCK_GETTIME=1 - -DFOLLY_USE_LIBCPP=1 - -DFOLLY_CFG_NO_COROUTINES=1 - -DFOLLY_MOBILE=1 - -DFOLLY_HAVE_RECVMMSG=1 - -DFOLLY_HAVE_PTHREAD=1 - # Once we target android-23 above, we can comment - # the following line. NDK uses GNU style stderror_r() after API 23. - -DFOLLY_HAVE_XSI_STRERROR_R=1 -) - -# Add all libraries required by the generated specs -find_package(fbjni REQUIRED) # <-- Used for communication between Java <-> C++ -find_package(ReactAndroid REQUIRED) # <-- Used to set up React Native bindings (e.g. CallInvoker/TurboModule) -find_package(react-native-nitro-modules REQUIRED) # <-- Used to create all HybridObjects and use the Nitro core library - -# Link all libraries together -target_link_libraries( - nativelogger - fbjni::fbjni # <-- Facebook C++ JNI helpers - ReactAndroid::jsi # <-- RN: JSI - react-native-nitro-modules::NitroModules # <-- NitroModules Core :) -) - -# Link react-native (different prefab between RN 0.75 and RN 0.76) -if(ReactAndroid_VERSION_MINOR GREATER_EQUAL 76) - target_link_libraries( - nativelogger - ReactAndroid::reactnative # <-- RN: Native Modules umbrella prefab - ) -else() - target_link_libraries( - nativelogger - ReactAndroid::react_nativemodule_core # <-- RN: TurboModules Core - ) -endif() diff --git a/native-modules/native-logger/nitrogen/generated/android/nativelogger+autolinking.gradle b/native-modules/native-logger/nitrogen/generated/android/nativelogger+autolinking.gradle deleted file mode 100644 index 1dc4380..0000000 --- a/native-modules/native-logger/nitrogen/generated/android/nativelogger+autolinking.gradle +++ /dev/null @@ -1,27 +0,0 @@ -/// -/// nativelogger+autolinking.gradle -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -/// This is a Gradle file that adds all files generated by Nitrogen -/// to the current Gradle project. -/// -/// To use it, add this to your build.gradle: -/// ```gradle -/// apply from: '../nitrogen/generated/android/nativelogger+autolinking.gradle' -/// ``` - -logger.warn("[NitroModules] 🔥 nativelogger is boosted by nitro!") - -android { - sourceSets { - main { - java.srcDirs += [ - // Nitrogen files - "${project.projectDir}/../nitrogen/generated/android/kotlin" - ] - } - } -} diff --git a/native-modules/native-logger/nitrogen/generated/android/nativeloggerOnLoad.cpp b/native-modules/native-logger/nitrogen/generated/android/nativeloggerOnLoad.cpp deleted file mode 100644 index eb508d9..0000000 --- a/native-modules/native-logger/nitrogen/generated/android/nativeloggerOnLoad.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/// -/// nativeloggerOnLoad.cpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#ifndef BUILDING_NATIVELOGGER_WITH_GENERATED_CMAKE_PROJECT -#error nativeloggerOnLoad.cpp is not being built with the autogenerated CMakeLists.txt project. Is a different CMakeLists.txt building this? -#endif - -#include "nativeloggerOnLoad.hpp" - -#include -#include -#include - -#include "JHybridNativeLoggerSpec.hpp" -#include - -namespace margelo::nitro::nativelogger { - -int initialize(JavaVM* vm) { - using namespace margelo::nitro; - using namespace margelo::nitro::nativelogger; - using namespace facebook; - - return facebook::jni::initialize(vm, [] { - // Register native JNI methods - margelo::nitro::nativelogger::JHybridNativeLoggerSpec::registerNatives(); - - // Register Nitro Hybrid Objects - HybridObjectRegistry::registerHybridObjectConstructor( - "NativeLogger", - []() -> std::shared_ptr { - static DefaultConstructableObject object("com/margelo/nitro/nativelogger/NativeLogger"); - auto instance = object.create(); - return instance->cthis()->shared(); - } - ); - }); -} - -} // namespace margelo::nitro::nativelogger diff --git a/native-modules/native-logger/nitrogen/generated/android/nativeloggerOnLoad.hpp b/native-modules/native-logger/nitrogen/generated/android/nativeloggerOnLoad.hpp deleted file mode 100644 index 8575210..0000000 --- a/native-modules/native-logger/nitrogen/generated/android/nativeloggerOnLoad.hpp +++ /dev/null @@ -1,25 +0,0 @@ -/// -/// nativeloggerOnLoad.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#include -#include - -namespace margelo::nitro::nativelogger { - - /** - * Initializes the native (C++) part of nativelogger, and autolinks all Hybrid Objects. - * Call this in your `JNI_OnLoad` function (probably inside `cpp-adapter.cpp`). - * Example: - * ```cpp (cpp-adapter.cpp) - * JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void*) { - * return margelo::nitro::nativelogger::initialize(vm); - * } - * ``` - */ - int initialize(JavaVM* vm); - -} // namespace margelo::nitro::nativelogger diff --git a/native-modules/native-logger/nitrogen/generated/ios/ReactNativeNativeLogger+autolinking.rb b/native-modules/native-logger/nitrogen/generated/ios/ReactNativeNativeLogger+autolinking.rb deleted file mode 100644 index 86b779e..0000000 --- a/native-modules/native-logger/nitrogen/generated/ios/ReactNativeNativeLogger+autolinking.rb +++ /dev/null @@ -1,60 +0,0 @@ -# -# ReactNativeNativeLogger+autolinking.rb -# This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -# https://github.com/mrousavy/nitro -# Copyright © 2026 Marc Rousavy @ Margelo -# - -# This is a Ruby script that adds all files generated by Nitrogen -# to the given podspec. -# -# To use it, add this to your .podspec: -# ```ruby -# Pod::Spec.new do |spec| -# # ... -# -# # Add all files generated by Nitrogen -# load 'nitrogen/generated/ios/ReactNativeNativeLogger+autolinking.rb' -# add_nitrogen_files(spec) -# end -# ``` - -def add_nitrogen_files(spec) - Pod::UI.puts "[NitroModules] 🔥 ReactNativeNativeLogger is boosted by nitro!" - - spec.dependency "NitroModules" - - current_source_files = Array(spec.attributes_hash['source_files']) - spec.source_files = current_source_files + [ - # Generated cross-platform specs - "nitrogen/generated/shared/**/*.{h,hpp,c,cpp,swift}", - # Generated bridges for the cross-platform specs - "nitrogen/generated/ios/**/*.{h,hpp,c,cpp,mm,swift}", - ] - - current_public_header_files = Array(spec.attributes_hash['public_header_files']) - spec.public_header_files = current_public_header_files + [ - # Generated specs - "nitrogen/generated/shared/**/*.{h,hpp}", - # Swift to C++ bridging helpers - "nitrogen/generated/ios/ReactNativeNativeLogger-Swift-Cxx-Bridge.hpp" - ] - - current_private_header_files = Array(spec.attributes_hash['private_header_files']) - spec.private_header_files = current_private_header_files + [ - # iOS specific specs - "nitrogen/generated/ios/c++/**/*.{h,hpp}", - # Views are framework-specific and should be private - "nitrogen/generated/shared/**/views/**/*" - ] - - current_pod_target_xcconfig = spec.attributes_hash['pod_target_xcconfig'] || {} - spec.pod_target_xcconfig = current_pod_target_xcconfig.merge({ - # Use C++ 20 - "CLANG_CXX_LANGUAGE_STANDARD" => "c++20", - # Enables C++ <-> Swift interop (by default it's only C) - "SWIFT_OBJC_INTEROP_MODE" => "objcxx", - # Enables stricter modular headers - "DEFINES_MODULE" => "YES", - }) -end diff --git a/native-modules/native-logger/nitrogen/generated/ios/ReactNativeNativeLogger-Swift-Cxx-Bridge.cpp b/native-modules/native-logger/nitrogen/generated/ios/ReactNativeNativeLogger-Swift-Cxx-Bridge.cpp deleted file mode 100644 index ef80613..0000000 --- a/native-modules/native-logger/nitrogen/generated/ios/ReactNativeNativeLogger-Swift-Cxx-Bridge.cpp +++ /dev/null @@ -1,57 +0,0 @@ -/// -/// ReactNativeNativeLogger-Swift-Cxx-Bridge.cpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#include "ReactNativeNativeLogger-Swift-Cxx-Bridge.hpp" - -// Include C++ implementation defined types -#include "HybridNativeLoggerSpecSwift.hpp" -#include "ReactNativeNativeLogger-Swift-Cxx-Umbrella.hpp" -#include - -namespace margelo::nitro::nativelogger::bridge::swift { - - // pragma MARK: std::function& /* result */)> - Func_void_std__vector_std__string_ create_Func_void_std__vector_std__string_(void* NON_NULL swiftClosureWrapper) noexcept { - auto swiftClosure = ReactNativeNativeLogger::Func_void_std__vector_std__string_::fromUnsafe(swiftClosureWrapper); - return [swiftClosure = std::move(swiftClosure)](const std::vector& result) mutable -> void { - swiftClosure.call(result); - }; - } - - // pragma MARK: std::function - Func_void_std__exception_ptr create_Func_void_std__exception_ptr(void* NON_NULL swiftClosureWrapper) noexcept { - auto swiftClosure = ReactNativeNativeLogger::Func_void_std__exception_ptr::fromUnsafe(swiftClosureWrapper); - return [swiftClosure = std::move(swiftClosure)](const std::exception_ptr& error) mutable -> void { - swiftClosure.call(error); - }; - } - - // pragma MARK: std::function - Func_void create_Func_void(void* NON_NULL swiftClosureWrapper) noexcept { - auto swiftClosure = ReactNativeNativeLogger::Func_void::fromUnsafe(swiftClosureWrapper); - return [swiftClosure = std::move(swiftClosure)]() mutable -> void { - swiftClosure.call(); - }; - } - - // pragma MARK: std::shared_ptr - std::shared_ptr create_std__shared_ptr_HybridNativeLoggerSpec_(void* NON_NULL swiftUnsafePointer) noexcept { - ReactNativeNativeLogger::HybridNativeLoggerSpec_cxx swiftPart = ReactNativeNativeLogger::HybridNativeLoggerSpec_cxx::fromUnsafe(swiftUnsafePointer); - return std::make_shared(swiftPart); - } - void* NON_NULL get_std__shared_ptr_HybridNativeLoggerSpec_(std__shared_ptr_HybridNativeLoggerSpec_ cppType) { - std::shared_ptr swiftWrapper = std::dynamic_pointer_cast(cppType); - #ifdef NITRO_DEBUG - if (swiftWrapper == nullptr) [[unlikely]] { - throw std::runtime_error("Class \"HybridNativeLoggerSpec\" is not implemented in Swift!"); - } - #endif - ReactNativeNativeLogger::HybridNativeLoggerSpec_cxx& swiftPart = swiftWrapper->getSwiftPart(); - return swiftPart.toUnsafe(); - } - -} // namespace margelo::nitro::nativelogger::bridge::swift diff --git a/native-modules/native-logger/nitrogen/generated/ios/ReactNativeNativeLogger-Swift-Cxx-Bridge.hpp b/native-modules/native-logger/nitrogen/generated/ios/ReactNativeNativeLogger-Swift-Cxx-Bridge.hpp deleted file mode 100644 index eafd2d0..0000000 --- a/native-modules/native-logger/nitrogen/generated/ios/ReactNativeNativeLogger-Swift-Cxx-Bridge.hpp +++ /dev/null @@ -1,184 +0,0 @@ -/// -/// ReactNativeNativeLogger-Swift-Cxx-Bridge.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -// Forward declarations of C++ defined types -// Forward declaration of `HybridNativeLoggerSpec` to properly resolve imports. -namespace margelo::nitro::nativelogger { class HybridNativeLoggerSpec; } - -// Forward declarations of Swift defined types -// Forward declaration of `HybridNativeLoggerSpec_cxx` to properly resolve imports. -namespace ReactNativeNativeLogger { class HybridNativeLoggerSpec_cxx; } - -// Include C++ defined types -#include "HybridNativeLoggerSpec.hpp" -#include -#include -#include -#include -#include -#include -#include -#include - -/** - * Contains specialized versions of C++ templated types so they can be accessed from Swift, - * as well as helper functions to interact with those C++ types from Swift. - */ -namespace margelo::nitro::nativelogger::bridge::swift { - - // pragma MARK: std::vector - /** - * Specialized version of `std::vector`. - */ - using std__vector_std__string_ = std::vector; - inline std::vector create_std__vector_std__string_(size_t size) noexcept { - std::vector vector; - vector.reserve(size); - return vector; - } - - // pragma MARK: std::shared_ptr>> - /** - * Specialized version of `std::shared_ptr>>`. - */ - using std__shared_ptr_Promise_std__vector_std__string___ = std::shared_ptr>>; - inline std::shared_ptr>> create_std__shared_ptr_Promise_std__vector_std__string___() noexcept { - return Promise>::create(); - } - inline PromiseHolder> wrap_std__shared_ptr_Promise_std__vector_std__string___(std::shared_ptr>> promise) noexcept { - return PromiseHolder>(std::move(promise)); - } - - // pragma MARK: std::function& /* result */)> - /** - * Specialized version of `std::function&)>`. - */ - using Func_void_std__vector_std__string_ = std::function& /* result */)>; - /** - * Wrapper class for a `std::function& / * result * /)>`, this can be used from Swift. - */ - class Func_void_std__vector_std__string__Wrapper final { - public: - explicit Func_void_std__vector_std__string__Wrapper(std::function& /* result */)>&& func): _function(std::make_unique& /* result */)>>(std::move(func))) {} - inline void call(std::vector result) const noexcept { - _function->operator()(result); - } - private: - std::unique_ptr& /* result */)>> _function; - } SWIFT_NONCOPYABLE; - Func_void_std__vector_std__string_ create_Func_void_std__vector_std__string_(void* NON_NULL swiftClosureWrapper) noexcept; - inline Func_void_std__vector_std__string__Wrapper wrap_Func_void_std__vector_std__string_(Func_void_std__vector_std__string_ value) noexcept { - return Func_void_std__vector_std__string__Wrapper(std::move(value)); - } - - // pragma MARK: std::function - /** - * Specialized version of `std::function`. - */ - using Func_void_std__exception_ptr = std::function; - /** - * Wrapper class for a `std::function`, this can be used from Swift. - */ - class Func_void_std__exception_ptr_Wrapper final { - public: - explicit Func_void_std__exception_ptr_Wrapper(std::function&& func): _function(std::make_unique>(std::move(func))) {} - inline void call(std::exception_ptr error) const noexcept { - _function->operator()(error); - } - private: - std::unique_ptr> _function; - } SWIFT_NONCOPYABLE; - Func_void_std__exception_ptr create_Func_void_std__exception_ptr(void* NON_NULL swiftClosureWrapper) noexcept; - inline Func_void_std__exception_ptr_Wrapper wrap_Func_void_std__exception_ptr(Func_void_std__exception_ptr value) noexcept { - return Func_void_std__exception_ptr_Wrapper(std::move(value)); - } - - // pragma MARK: std::shared_ptr> - /** - * Specialized version of `std::shared_ptr>`. - */ - using std__shared_ptr_Promise_void__ = std::shared_ptr>; - inline std::shared_ptr> create_std__shared_ptr_Promise_void__() noexcept { - return Promise::create(); - } - inline PromiseHolder wrap_std__shared_ptr_Promise_void__(std::shared_ptr> promise) noexcept { - return PromiseHolder(std::move(promise)); - } - - // pragma MARK: std::function - /** - * Specialized version of `std::function`. - */ - using Func_void = std::function; - /** - * Wrapper class for a `std::function`, this can be used from Swift. - */ - class Func_void_Wrapper final { - public: - explicit Func_void_Wrapper(std::function&& func): _function(std::make_unique>(std::move(func))) {} - inline void call() const noexcept { - _function->operator()(); - } - private: - std::unique_ptr> _function; - } SWIFT_NONCOPYABLE; - Func_void create_Func_void(void* NON_NULL swiftClosureWrapper) noexcept; - inline Func_void_Wrapper wrap_Func_void(Func_void value) noexcept { - return Func_void_Wrapper(std::move(value)); - } - - // pragma MARK: std::shared_ptr - /** - * Specialized version of `std::shared_ptr`. - */ - using std__shared_ptr_HybridNativeLoggerSpec_ = std::shared_ptr; - std::shared_ptr create_std__shared_ptr_HybridNativeLoggerSpec_(void* NON_NULL swiftUnsafePointer) noexcept; - void* NON_NULL get_std__shared_ptr_HybridNativeLoggerSpec_(std__shared_ptr_HybridNativeLoggerSpec_ cppType); - - // pragma MARK: std::weak_ptr - using std__weak_ptr_HybridNativeLoggerSpec_ = std::weak_ptr; - inline std__weak_ptr_HybridNativeLoggerSpec_ weakify_std__shared_ptr_HybridNativeLoggerSpec_(const std::shared_ptr& strong) noexcept { return strong; } - - // pragma MARK: Result - using Result_void_ = Result; - inline Result_void_ create_Result_void_() noexcept { - return Result::withValue(); - } - inline Result_void_ create_Result_void_(const std::exception_ptr& error) noexcept { - return Result::withError(error); - } - - // pragma MARK: Result - using Result_std__string_ = Result; - inline Result_std__string_ create_Result_std__string_(const std::string& value) noexcept { - return Result::withValue(value); - } - inline Result_std__string_ create_Result_std__string_(const std::exception_ptr& error) noexcept { - return Result::withError(error); - } - - // pragma MARK: Result>>> - using Result_std__shared_ptr_Promise_std__vector_std__string____ = Result>>>; - inline Result_std__shared_ptr_Promise_std__vector_std__string____ create_Result_std__shared_ptr_Promise_std__vector_std__string____(const std::shared_ptr>>& value) noexcept { - return Result>>>::withValue(value); - } - inline Result_std__shared_ptr_Promise_std__vector_std__string____ create_Result_std__shared_ptr_Promise_std__vector_std__string____(const std::exception_ptr& error) noexcept { - return Result>>>::withError(error); - } - - // pragma MARK: Result>> - using Result_std__shared_ptr_Promise_void___ = Result>>; - inline Result_std__shared_ptr_Promise_void___ create_Result_std__shared_ptr_Promise_void___(const std::shared_ptr>& value) noexcept { - return Result>>::withValue(value); - } - inline Result_std__shared_ptr_Promise_void___ create_Result_std__shared_ptr_Promise_void___(const std::exception_ptr& error) noexcept { - return Result>>::withError(error); - } - -} // namespace margelo::nitro::nativelogger::bridge::swift diff --git a/native-modules/native-logger/nitrogen/generated/ios/ReactNativeNativeLogger-Swift-Cxx-Umbrella.hpp b/native-modules/native-logger/nitrogen/generated/ios/ReactNativeNativeLogger-Swift-Cxx-Umbrella.hpp deleted file mode 100644 index e9c1320..0000000 --- a/native-modules/native-logger/nitrogen/generated/ios/ReactNativeNativeLogger-Swift-Cxx-Umbrella.hpp +++ /dev/null @@ -1,46 +0,0 @@ -/// -/// ReactNativeNativeLogger-Swift-Cxx-Umbrella.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -// Forward declarations of C++ defined types -// Forward declaration of `HybridNativeLoggerSpec` to properly resolve imports. -namespace margelo::nitro::nativelogger { class HybridNativeLoggerSpec; } - -// Include C++ defined types -#include "HybridNativeLoggerSpec.hpp" -#include -#include -#include -#include -#include -#include - -// C++ helpers for Swift -#include "ReactNativeNativeLogger-Swift-Cxx-Bridge.hpp" - -// Common C++ types used in Swift -#include -#include -#include -#include - -// Forward declarations of Swift defined types -// Forward declaration of `HybridNativeLoggerSpec_cxx` to properly resolve imports. -namespace ReactNativeNativeLogger { class HybridNativeLoggerSpec_cxx; } - -// Include Swift defined types -#if __has_include("ReactNativeNativeLogger-Swift.h") -// This header is generated by Xcode/Swift on every app build. -// If it cannot be found, make sure the Swift module's name (= podspec name) is actually "ReactNativeNativeLogger". -#include "ReactNativeNativeLogger-Swift.h" -// Same as above, but used when building with frameworks (`use_frameworks`) -#elif __has_include() -#include -#else -#error ReactNativeNativeLogger's autogenerated Swift header cannot be found! Make sure the Swift module's name (= podspec name) is actually "ReactNativeNativeLogger", and try building the app first. -#endif diff --git a/native-modules/native-logger/nitrogen/generated/ios/ReactNativeNativeLoggerAutolinking.mm b/native-modules/native-logger/nitrogen/generated/ios/ReactNativeNativeLoggerAutolinking.mm deleted file mode 100644 index f558f30..0000000 --- a/native-modules/native-logger/nitrogen/generated/ios/ReactNativeNativeLoggerAutolinking.mm +++ /dev/null @@ -1,33 +0,0 @@ -/// -/// ReactNativeNativeLoggerAutolinking.mm -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#import -#import -#import "ReactNativeNativeLogger-Swift-Cxx-Umbrella.hpp" -#import - -#include "HybridNativeLoggerSpecSwift.hpp" - -@interface ReactNativeNativeLoggerAutolinking : NSObject -@end - -@implementation ReactNativeNativeLoggerAutolinking - -+ (void) load { - using namespace margelo::nitro; - using namespace margelo::nitro::nativelogger; - - HybridObjectRegistry::registerHybridObjectConstructor( - "NativeLogger", - []() -> std::shared_ptr { - std::shared_ptr hybridObject = ReactNativeNativeLogger::ReactNativeNativeLoggerAutolinking::createNativeLogger(); - return hybridObject; - } - ); -} - -@end diff --git a/native-modules/native-logger/nitrogen/generated/ios/ReactNativeNativeLoggerAutolinking.swift b/native-modules/native-logger/nitrogen/generated/ios/ReactNativeNativeLoggerAutolinking.swift deleted file mode 100644 index c8c7478..0000000 --- a/native-modules/native-logger/nitrogen/generated/ios/ReactNativeNativeLoggerAutolinking.swift +++ /dev/null @@ -1,25 +0,0 @@ -/// -/// ReactNativeNativeLoggerAutolinking.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -public final class ReactNativeNativeLoggerAutolinking { - public typealias bridge = margelo.nitro.nativelogger.bridge.swift - - /** - * Creates an instance of a Swift class that implements `HybridNativeLoggerSpec`, - * and wraps it in a Swift class that can directly interop with C++ (`HybridNativeLoggerSpec_cxx`) - * - * This is generated by Nitrogen and will initialize the class specified - * in the `"autolinking"` property of `nitro.json` (in this case, `NativeLogger`). - */ - public static func createNativeLogger() -> bridge.std__shared_ptr_HybridNativeLoggerSpec_ { - let hybridObject = NativeLogger() - return { () -> bridge.std__shared_ptr_HybridNativeLoggerSpec_ in - let __cxxWrapped = hybridObject.getCxxWrapper() - return __cxxWrapped.getCxxPart() - }() - } -} diff --git a/native-modules/native-logger/nitrogen/generated/ios/c++/HybridNativeLoggerSpecSwift.cpp b/native-modules/native-logger/nitrogen/generated/ios/c++/HybridNativeLoggerSpecSwift.cpp deleted file mode 100644 index 3950924..0000000 --- a/native-modules/native-logger/nitrogen/generated/ios/c++/HybridNativeLoggerSpecSwift.cpp +++ /dev/null @@ -1,11 +0,0 @@ -/// -/// HybridNativeLoggerSpecSwift.cpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#include "HybridNativeLoggerSpecSwift.hpp" - -namespace margelo::nitro::nativelogger { -} // namespace margelo::nitro::nativelogger diff --git a/native-modules/native-logger/nitrogen/generated/ios/c++/HybridNativeLoggerSpecSwift.hpp b/native-modules/native-logger/nitrogen/generated/ios/c++/HybridNativeLoggerSpecSwift.hpp deleted file mode 100644 index 1412944..0000000 --- a/native-modules/native-logger/nitrogen/generated/ios/c++/HybridNativeLoggerSpecSwift.hpp +++ /dev/null @@ -1,100 +0,0 @@ -/// -/// HybridNativeLoggerSpecSwift.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#include "HybridNativeLoggerSpec.hpp" - -// Forward declaration of `HybridNativeLoggerSpec_cxx` to properly resolve imports. -namespace ReactNativeNativeLogger { class HybridNativeLoggerSpec_cxx; } - - - -#include -#include -#include - -#include "ReactNativeNativeLogger-Swift-Cxx-Umbrella.hpp" - -namespace margelo::nitro::nativelogger { - - /** - * The C++ part of HybridNativeLoggerSpec_cxx.swift. - * - * HybridNativeLoggerSpecSwift (C++) accesses HybridNativeLoggerSpec_cxx (Swift), and might - * contain some additional bridging code for C++ <> Swift interop. - * - * Since this obviously introduces an overhead, I hope at some point in - * the future, HybridNativeLoggerSpec_cxx can directly inherit from the C++ class HybridNativeLoggerSpec - * to simplify the whole structure and memory management. - */ - class HybridNativeLoggerSpecSwift: public virtual HybridNativeLoggerSpec { - public: - // Constructor from a Swift instance - explicit HybridNativeLoggerSpecSwift(const ReactNativeNativeLogger::HybridNativeLoggerSpec_cxx& swiftPart): - HybridObject(HybridNativeLoggerSpec::TAG), - _swiftPart(swiftPart) { } - - public: - // Get the Swift part - inline ReactNativeNativeLogger::HybridNativeLoggerSpec_cxx& getSwiftPart() noexcept { - return _swiftPart; - } - - public: - inline size_t getExternalMemorySize() noexcept override { - return _swiftPart.getMemorySize(); - } - void dispose() noexcept override { - _swiftPart.dispose(); - } - std::string toString() override { - return _swiftPart.toString(); - } - - public: - // Properties - - - public: - // Methods - inline void write(double level, const std::string& msg) override { - auto __result = _swiftPart.write(std::forward(level), msg); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - } - inline std::string getLogDirectory() override { - auto __result = _swiftPart.getLogDirectory(); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - auto __value = std::move(__result.value()); - return __value; - } - inline std::shared_ptr>> getLogFilePaths() override { - auto __result = _swiftPart.getLogFilePaths(); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - auto __value = std::move(__result.value()); - return __value; - } - inline std::shared_ptr> deleteLogFiles() override { - auto __result = _swiftPart.deleteLogFiles(); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - auto __value = std::move(__result.value()); - return __value; - } - - private: - ReactNativeNativeLogger::HybridNativeLoggerSpec_cxx _swiftPart; - }; - -} // namespace margelo::nitro::nativelogger diff --git a/native-modules/native-logger/nitrogen/generated/ios/swift/Func_void.swift b/native-modules/native-logger/nitrogen/generated/ios/swift/Func_void.swift deleted file mode 100644 index f3dd315..0000000 --- a/native-modules/native-logger/nitrogen/generated/ios/swift/Func_void.swift +++ /dev/null @@ -1,47 +0,0 @@ -/// -/// Func_void.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Wraps a Swift `() -> Void` as a class. - * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`. - */ -public final class Func_void { - public typealias bridge = margelo.nitro.nativelogger.bridge.swift - - private let closure: () -> Void - - public init(_ closure: @escaping () -> Void) { - self.closure = closure - } - - @inline(__always) - public func call() -> Void { - self.closure() - } - - /** - * Casts this instance to a retained unsafe raw pointer. - * This acquires one additional strong reference on the object! - */ - @inline(__always) - public func toUnsafe() -> UnsafeMutableRawPointer { - return Unmanaged.passRetained(self).toOpaque() - } - - /** - * Casts an unsafe pointer to a `Func_void`. - * The pointer has to be a retained opaque `Unmanaged`. - * This removes one strong reference from the object! - */ - @inline(__always) - public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void { - return Unmanaged.fromOpaque(pointer).takeRetainedValue() - } -} diff --git a/native-modules/native-logger/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift b/native-modules/native-logger/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift deleted file mode 100644 index 18121ca..0000000 --- a/native-modules/native-logger/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +++ /dev/null @@ -1,47 +0,0 @@ -/// -/// Func_void_std__exception_ptr.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Wraps a Swift `(_ error: Error) -> Void` as a class. - * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`. - */ -public final class Func_void_std__exception_ptr { - public typealias bridge = margelo.nitro.nativelogger.bridge.swift - - private let closure: (_ error: Error) -> Void - - public init(_ closure: @escaping (_ error: Error) -> Void) { - self.closure = closure - } - - @inline(__always) - public func call(error: std.exception_ptr) -> Void { - self.closure(RuntimeError.from(cppError: error)) - } - - /** - * Casts this instance to a retained unsafe raw pointer. - * This acquires one additional strong reference on the object! - */ - @inline(__always) - public func toUnsafe() -> UnsafeMutableRawPointer { - return Unmanaged.passRetained(self).toOpaque() - } - - /** - * Casts an unsafe pointer to a `Func_void_std__exception_ptr`. - * The pointer has to be a retained opaque `Unmanaged`. - * This removes one strong reference from the object! - */ - @inline(__always) - public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_std__exception_ptr { - return Unmanaged.fromOpaque(pointer).takeRetainedValue() - } -} diff --git a/native-modules/native-logger/nitrogen/generated/ios/swift/Func_void_std__vector_std__string_.swift b/native-modules/native-logger/nitrogen/generated/ios/swift/Func_void_std__vector_std__string_.swift deleted file mode 100644 index d07f3f0..0000000 --- a/native-modules/native-logger/nitrogen/generated/ios/swift/Func_void_std__vector_std__string_.swift +++ /dev/null @@ -1,47 +0,0 @@ -/// -/// Func_void_std__vector_std__string_.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Wraps a Swift `(_ value: [String]) -> Void` as a class. - * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`. - */ -public final class Func_void_std__vector_std__string_ { - public typealias bridge = margelo.nitro.nativelogger.bridge.swift - - private let closure: (_ value: [String]) -> Void - - public init(_ closure: @escaping (_ value: [String]) -> Void) { - self.closure = closure - } - - @inline(__always) - public func call(value: bridge.std__vector_std__string_) -> Void { - self.closure(value.map({ __item in String(__item) })) - } - - /** - * Casts this instance to a retained unsafe raw pointer. - * This acquires one additional strong reference on the object! - */ - @inline(__always) - public func toUnsafe() -> UnsafeMutableRawPointer { - return Unmanaged.passRetained(self).toOpaque() - } - - /** - * Casts an unsafe pointer to a `Func_void_std__vector_std__string_`. - * The pointer has to be a retained opaque `Unmanaged`. - * This removes one strong reference from the object! - */ - @inline(__always) - public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_std__vector_std__string_ { - return Unmanaged.fromOpaque(pointer).takeRetainedValue() - } -} diff --git a/native-modules/native-logger/nitrogen/generated/ios/swift/HybridNativeLoggerSpec.swift b/native-modules/native-logger/nitrogen/generated/ios/swift/HybridNativeLoggerSpec.swift deleted file mode 100644 index 1b27c96..0000000 --- a/native-modules/native-logger/nitrogen/generated/ios/swift/HybridNativeLoggerSpec.swift +++ /dev/null @@ -1,59 +0,0 @@ -/// -/// HybridNativeLoggerSpec.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/// See ``HybridNativeLoggerSpec`` -public protocol HybridNativeLoggerSpec_protocol: HybridObject { - // Properties - - - // Methods - func write(level: Double, msg: String) throws -> Void - func getLogDirectory() throws -> String - func getLogFilePaths() throws -> Promise<[String]> - func deleteLogFiles() throws -> Promise -} - -public extension HybridNativeLoggerSpec_protocol { - /// Default implementation of ``HybridObject.toString`` - func toString() -> String { - return "[HybridObject NativeLogger]" - } -} - -/// See ``HybridNativeLoggerSpec`` -open class HybridNativeLoggerSpec_base { - private weak var cxxWrapper: HybridNativeLoggerSpec_cxx? = nil - public init() { } - public func getCxxWrapper() -> HybridNativeLoggerSpec_cxx { - #if DEBUG - guard self is HybridNativeLoggerSpec else { - fatalError("`self` is not a `HybridNativeLoggerSpec`! Did you accidentally inherit from `HybridNativeLoggerSpec_base` instead of `HybridNativeLoggerSpec`?") - } - #endif - if let cxxWrapper = self.cxxWrapper { - return cxxWrapper - } else { - let cxxWrapper = HybridNativeLoggerSpec_cxx(self as! HybridNativeLoggerSpec) - self.cxxWrapper = cxxWrapper - return cxxWrapper - } - } -} - -/** - * A Swift base-protocol representing the NativeLogger HybridObject. - * Implement this protocol to create Swift-based instances of NativeLogger. - * ```swift - * class HybridNativeLogger : HybridNativeLoggerSpec { - * // ... - * } - * ``` - */ -public typealias HybridNativeLoggerSpec = HybridNativeLoggerSpec_protocol & HybridNativeLoggerSpec_base diff --git a/native-modules/native-logger/nitrogen/generated/ios/swift/HybridNativeLoggerSpec_cxx.swift b/native-modules/native-logger/nitrogen/generated/ios/swift/HybridNativeLoggerSpec_cxx.swift deleted file mode 100644 index 16caad0..0000000 --- a/native-modules/native-logger/nitrogen/generated/ios/swift/HybridNativeLoggerSpec_cxx.swift +++ /dev/null @@ -1,186 +0,0 @@ -/// -/// HybridNativeLoggerSpec_cxx.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * A class implementation that bridges HybridNativeLoggerSpec over to C++. - * In C++, we cannot use Swift protocols - so we need to wrap it in a class to make it strongly defined. - * - * Also, some Swift types need to be bridged with special handling: - * - Enums need to be wrapped in Structs, otherwise they cannot be accessed bi-directionally (Swift bug: https://github.com/swiftlang/swift/issues/75330) - * - Other HybridObjects need to be wrapped/unwrapped from the Swift TCxx wrapper - * - Throwing methods need to be wrapped with a Result type, as exceptions cannot be propagated to C++ - */ -open class HybridNativeLoggerSpec_cxx { - /** - * The Swift <> C++ bridge's namespace (`margelo::nitro::nativelogger::bridge::swift`) - * from `ReactNativeNativeLogger-Swift-Cxx-Bridge.hpp`. - * This contains specialized C++ templates, and C++ helper functions that can be accessed from Swift. - */ - public typealias bridge = margelo.nitro.nativelogger.bridge.swift - - /** - * Holds an instance of the `HybridNativeLoggerSpec` Swift protocol. - */ - private var __implementation: any HybridNativeLoggerSpec - - /** - * Holds a weak pointer to the C++ class that wraps the Swift class. - */ - private var __cxxPart: bridge.std__weak_ptr_HybridNativeLoggerSpec_ - - /** - * Create a new `HybridNativeLoggerSpec_cxx` that wraps the given `HybridNativeLoggerSpec`. - * All properties and methods bridge to C++ types. - */ - public init(_ implementation: any HybridNativeLoggerSpec) { - self.__implementation = implementation - self.__cxxPart = .init() - /* no base class */ - } - - /** - * Get the actual `HybridNativeLoggerSpec` instance this class wraps. - */ - @inline(__always) - public func getHybridNativeLoggerSpec() -> any HybridNativeLoggerSpec { - return __implementation - } - - /** - * Casts this instance to a retained unsafe raw pointer. - * This acquires one additional strong reference on the object! - */ - public func toUnsafe() -> UnsafeMutableRawPointer { - return Unmanaged.passRetained(self).toOpaque() - } - - /** - * Casts an unsafe pointer to a `HybridNativeLoggerSpec_cxx`. - * The pointer has to be a retained opaque `Unmanaged`. - * This removes one strong reference from the object! - */ - public class func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> HybridNativeLoggerSpec_cxx { - return Unmanaged.fromOpaque(pointer).takeRetainedValue() - } - - /** - * Gets (or creates) the C++ part of this Hybrid Object. - * The C++ part is a `std::shared_ptr`. - */ - public func getCxxPart() -> bridge.std__shared_ptr_HybridNativeLoggerSpec_ { - let cachedCxxPart = self.__cxxPart.lock() - if Bool(fromCxx: cachedCxxPart) { - return cachedCxxPart - } else { - let newCxxPart = bridge.create_std__shared_ptr_HybridNativeLoggerSpec_(self.toUnsafe()) - __cxxPart = bridge.weakify_std__shared_ptr_HybridNativeLoggerSpec_(newCxxPart) - return newCxxPart - } - } - - - - /** - * Get the memory size of the Swift class (plus size of any other allocations) - * so the JS VM can properly track it and garbage-collect the JS object if needed. - */ - @inline(__always) - public var memorySize: Int { - return MemoryHelper.getSizeOf(self.__implementation) + self.__implementation.memorySize - } - - /** - * Call dispose() on the Swift class. - * This _may_ be called manually from JS. - */ - @inline(__always) - public func dispose() { - self.__implementation.dispose() - } - - /** - * Call toString() on the Swift class. - */ - @inline(__always) - public func toString() -> String { - return self.__implementation.toString() - } - - // Properties - - - // Methods - @inline(__always) - public final func write(level: Double, msg: std.string) -> bridge.Result_void_ { - do { - try self.__implementation.write(level: level, msg: String(msg)) - return bridge.create_Result_void_() - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_void_(__exceptionPtr) - } - } - - @inline(__always) - public final func getLogDirectory() -> bridge.Result_std__string_ { - do { - let __result = try self.__implementation.getLogDirectory() - let __resultCpp = std.string(__result) - return bridge.create_Result_std__string_(__resultCpp) - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_std__string_(__exceptionPtr) - } - } - - @inline(__always) - public final func getLogFilePaths() -> bridge.Result_std__shared_ptr_Promise_std__vector_std__string____ { - do { - let __result = try self.__implementation.getLogFilePaths() - let __resultCpp = { () -> bridge.std__shared_ptr_Promise_std__vector_std__string___ in - let __promise = bridge.create_std__shared_ptr_Promise_std__vector_std__string___() - let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_std__vector_std__string___(__promise) - __result - .then({ __result in __promiseHolder.resolve({ () -> bridge.std__vector_std__string_ in - var __vector = bridge.create_std__vector_std__string_(__result.count) - for __item in __result { - __vector.push_back(std.string(__item)) - } - return __vector - }()) }) - .catch({ __error in __promiseHolder.reject(__error.toCpp()) }) - return __promise - }() - return bridge.create_Result_std__shared_ptr_Promise_std__vector_std__string____(__resultCpp) - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_std__shared_ptr_Promise_std__vector_std__string____(__exceptionPtr) - } - } - - @inline(__always) - public final func deleteLogFiles() -> bridge.Result_std__shared_ptr_Promise_void___ { - do { - let __result = try self.__implementation.deleteLogFiles() - let __resultCpp = { () -> bridge.std__shared_ptr_Promise_void__ in - let __promise = bridge.create_std__shared_ptr_Promise_void__() - let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_void__(__promise) - __result - .then({ __result in __promiseHolder.resolve() }) - .catch({ __error in __promiseHolder.reject(__error.toCpp()) }) - return __promise - }() - return bridge.create_Result_std__shared_ptr_Promise_void___(__resultCpp) - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_std__shared_ptr_Promise_void___(__exceptionPtr) - } - } -} diff --git a/native-modules/native-logger/nitrogen/generated/shared/c++/HybridNativeLoggerSpec.cpp b/native-modules/native-logger/nitrogen/generated/shared/c++/HybridNativeLoggerSpec.cpp deleted file mode 100644 index 8fc3047..0000000 --- a/native-modules/native-logger/nitrogen/generated/shared/c++/HybridNativeLoggerSpec.cpp +++ /dev/null @@ -1,24 +0,0 @@ -/// -/// HybridNativeLoggerSpec.cpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#include "HybridNativeLoggerSpec.hpp" - -namespace margelo::nitro::nativelogger { - - void HybridNativeLoggerSpec::loadHybridMethods() { - // load base methods/properties - HybridObject::loadHybridMethods(); - // load custom methods/properties - registerHybrids(this, [](Prototype& prototype) { - prototype.registerHybridMethod("write", &HybridNativeLoggerSpec::write); - prototype.registerHybridMethod("getLogDirectory", &HybridNativeLoggerSpec::getLogDirectory); - prototype.registerHybridMethod("getLogFilePaths", &HybridNativeLoggerSpec::getLogFilePaths); - prototype.registerHybridMethod("deleteLogFiles", &HybridNativeLoggerSpec::deleteLogFiles); - }); - } - -} // namespace margelo::nitro::nativelogger diff --git a/native-modules/native-logger/nitrogen/generated/shared/c++/HybridNativeLoggerSpec.hpp b/native-modules/native-logger/nitrogen/generated/shared/c++/HybridNativeLoggerSpec.hpp deleted file mode 100644 index fb1463b..0000000 --- a/native-modules/native-logger/nitrogen/generated/shared/c++/HybridNativeLoggerSpec.hpp +++ /dev/null @@ -1,67 +0,0 @@ -/// -/// HybridNativeLoggerSpec.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif - - - -#include -#include -#include - -namespace margelo::nitro::nativelogger { - - using namespace margelo::nitro; - - /** - * An abstract base class for `NativeLogger` - * Inherit this class to create instances of `HybridNativeLoggerSpec` in C++. - * You must explicitly call `HybridObject`'s constructor yourself, because it is virtual. - * @example - * ```cpp - * class HybridNativeLogger: public HybridNativeLoggerSpec { - * public: - * HybridNativeLogger(...): HybridObject(TAG) { ... } - * // ... - * }; - * ``` - */ - class HybridNativeLoggerSpec: public virtual HybridObject { - public: - // Constructor - explicit HybridNativeLoggerSpec(): HybridObject(TAG) { } - - // Destructor - ~HybridNativeLoggerSpec() override = default; - - public: - // Properties - - - public: - // Methods - virtual void write(double level, const std::string& msg) = 0; - virtual std::string getLogDirectory() = 0; - virtual std::shared_ptr>> getLogFilePaths() = 0; - virtual std::shared_ptr> deleteLogFiles() = 0; - - protected: - // Hybrid Setup - void loadHybridMethods() override; - - protected: - // Tag for logging - static constexpr auto TAG = "NativeLogger"; - }; - -} // namespace margelo::nitro::nativelogger diff --git a/native-modules/react-native-app-update/nitrogen/generated/.gitattributes b/native-modules/react-native-app-update/nitrogen/generated/.gitattributes deleted file mode 100644 index fb7a0d5..0000000 --- a/native-modules/react-native-app-update/nitrogen/generated/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -** linguist-generated=true diff --git a/native-modules/react-native-app-update/nitrogen/generated/android/c++/JAppUpdateDownloadParams.hpp b/native-modules/react-native-app-update/nitrogen/generated/android/c++/JAppUpdateDownloadParams.hpp deleted file mode 100644 index 9cfdb7c..0000000 --- a/native-modules/react-native-app-update/nitrogen/generated/android/c++/JAppUpdateDownloadParams.hpp +++ /dev/null @@ -1,65 +0,0 @@ -/// -/// JAppUpdateDownloadParams.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#include -#include "AppUpdateDownloadParams.hpp" - -#include - -namespace margelo::nitro::reactnativeappupdate { - - using namespace facebook; - - /** - * The C++ JNI bridge between the C++ struct "AppUpdateDownloadParams" and the the Kotlin data class "AppUpdateDownloadParams". - */ - struct JAppUpdateDownloadParams final: public jni::JavaClass { - public: - static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/reactnativeappupdate/AppUpdateDownloadParams;"; - - public: - /** - * Convert this Java/Kotlin-based struct to the C++ struct AppUpdateDownloadParams by copying all values to C++. - */ - [[maybe_unused]] - [[nodiscard]] - AppUpdateDownloadParams toCpp() const { - static const auto clazz = javaClassStatic(); - static const auto fieldDownloadUrl = clazz->getField("downloadUrl"); - jni::local_ref downloadUrl = this->getFieldValue(fieldDownloadUrl); - static const auto fieldNotificationTitle = clazz->getField("notificationTitle"); - jni::local_ref notificationTitle = this->getFieldValue(fieldNotificationTitle); - static const auto fieldFileSize = clazz->getField("fileSize"); - double fileSize = this->getFieldValue(fieldFileSize); - return AppUpdateDownloadParams( - downloadUrl->toStdString(), - notificationTitle->toStdString(), - fileSize - ); - } - - public: - /** - * Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java. - */ - [[maybe_unused]] - static jni::local_ref fromCpp(const AppUpdateDownloadParams& value) { - using JSignature = JAppUpdateDownloadParams(jni::alias_ref, jni::alias_ref, double); - static const auto clazz = javaClassStatic(); - static const auto create = clazz->getStaticMethod("fromCpp"); - return create( - clazz, - jni::make_jstring(value.downloadUrl), - jni::make_jstring(value.notificationTitle), - value.fileSize - ); - } - }; - -} // namespace margelo::nitro::reactnativeappupdate diff --git a/native-modules/react-native-app-update/nitrogen/generated/android/c++/JAppUpdateFileParams.hpp b/native-modules/react-native-app-update/nitrogen/generated/android/c++/JAppUpdateFileParams.hpp deleted file mode 100644 index bbecd30..0000000 --- a/native-modules/react-native-app-update/nitrogen/generated/android/c++/JAppUpdateFileParams.hpp +++ /dev/null @@ -1,57 +0,0 @@ -/// -/// JAppUpdateFileParams.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#include -#include "AppUpdateFileParams.hpp" - -#include - -namespace margelo::nitro::reactnativeappupdate { - - using namespace facebook; - - /** - * The C++ JNI bridge between the C++ struct "AppUpdateFileParams" and the the Kotlin data class "AppUpdateFileParams". - */ - struct JAppUpdateFileParams final: public jni::JavaClass { - public: - static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/reactnativeappupdate/AppUpdateFileParams;"; - - public: - /** - * Convert this Java/Kotlin-based struct to the C++ struct AppUpdateFileParams by copying all values to C++. - */ - [[maybe_unused]] - [[nodiscard]] - AppUpdateFileParams toCpp() const { - static const auto clazz = javaClassStatic(); - static const auto fieldDownloadUrl = clazz->getField("downloadUrl"); - jni::local_ref downloadUrl = this->getFieldValue(fieldDownloadUrl); - return AppUpdateFileParams( - downloadUrl->toStdString() - ); - } - - public: - /** - * Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java. - */ - [[maybe_unused]] - static jni::local_ref fromCpp(const AppUpdateFileParams& value) { - using JSignature = JAppUpdateFileParams(jni::alias_ref); - static const auto clazz = javaClassStatic(); - static const auto create = clazz->getStaticMethod("fromCpp"); - return create( - clazz, - jni::make_jstring(value.downloadUrl) - ); - } - }; - -} // namespace margelo::nitro::reactnativeappupdate diff --git a/native-modules/react-native-app-update/nitrogen/generated/android/c++/JDownloadEvent.hpp b/native-modules/react-native-app-update/nitrogen/generated/android/c++/JDownloadEvent.hpp deleted file mode 100644 index f2e2488..0000000 --- a/native-modules/react-native-app-update/nitrogen/generated/android/c++/JDownloadEvent.hpp +++ /dev/null @@ -1,65 +0,0 @@ -/// -/// JDownloadEvent.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#include -#include "DownloadEvent.hpp" - -#include - -namespace margelo::nitro::reactnativeappupdate { - - using namespace facebook; - - /** - * The C++ JNI bridge between the C++ struct "DownloadEvent" and the the Kotlin data class "DownloadEvent". - */ - struct JDownloadEvent final: public jni::JavaClass { - public: - static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/reactnativeappupdate/DownloadEvent;"; - - public: - /** - * Convert this Java/Kotlin-based struct to the C++ struct DownloadEvent by copying all values to C++. - */ - [[maybe_unused]] - [[nodiscard]] - DownloadEvent toCpp() const { - static const auto clazz = javaClassStatic(); - static const auto fieldType = clazz->getField("type"); - jni::local_ref type = this->getFieldValue(fieldType); - static const auto fieldProgress = clazz->getField("progress"); - double progress = this->getFieldValue(fieldProgress); - static const auto fieldMessage = clazz->getField("message"); - jni::local_ref message = this->getFieldValue(fieldMessage); - return DownloadEvent( - type->toStdString(), - progress, - message->toStdString() - ); - } - - public: - /** - * Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java. - */ - [[maybe_unused]] - static jni::local_ref fromCpp(const DownloadEvent& value) { - using JSignature = JDownloadEvent(jni::alias_ref, double, jni::alias_ref); - static const auto clazz = javaClassStatic(); - static const auto create = clazz->getStaticMethod("fromCpp"); - return create( - clazz, - jni::make_jstring(value.type), - value.progress, - jni::make_jstring(value.message) - ); - } - }; - -} // namespace margelo::nitro::reactnativeappupdate diff --git a/native-modules/react-native-app-update/nitrogen/generated/android/c++/JFunc_void_DownloadEvent.hpp b/native-modules/react-native-app-update/nitrogen/generated/android/c++/JFunc_void_DownloadEvent.hpp deleted file mode 100644 index 07cfd9b..0000000 --- a/native-modules/react-native-app-update/nitrogen/generated/android/c++/JFunc_void_DownloadEvent.hpp +++ /dev/null @@ -1,78 +0,0 @@ -/// -/// JFunc_void_DownloadEvent.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#include -#include - -#include "DownloadEvent.hpp" -#include -#include -#include "JDownloadEvent.hpp" -#include - -namespace margelo::nitro::reactnativeappupdate { - - using namespace facebook; - - /** - * Represents the Java/Kotlin callback `(event: DownloadEvent) -> Unit`. - * This can be passed around between C++ and Java/Kotlin. - */ - struct JFunc_void_DownloadEvent: public jni::JavaClass { - public: - static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/reactnativeappupdate/Func_void_DownloadEvent;"; - - public: - /** - * Invokes the function this `JFunc_void_DownloadEvent` instance holds through JNI. - */ - void invoke(const DownloadEvent& event) const { - static const auto method = javaClassStatic()->getMethod /* event */)>("invoke"); - method(self(), JDownloadEvent::fromCpp(event)); - } - }; - - /** - * An implementation of Func_void_DownloadEvent that is backed by a C++ implementation (using `std::function<...>`) - */ - class JFunc_void_DownloadEvent_cxx final: public jni::HybridClass { - public: - static jni::local_ref fromCpp(const std::function& func) { - return JFunc_void_DownloadEvent_cxx::newObjectCxxArgs(func); - } - - public: - /** - * Invokes the C++ `std::function<...>` this `JFunc_void_DownloadEvent_cxx` instance holds. - */ - void invoke_cxx(jni::alias_ref event) { - _func(event->toCpp()); - } - - public: - [[nodiscard]] - inline const std::function& getFunction() const { - return _func; - } - - public: - static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/reactnativeappupdate/Func_void_DownloadEvent_cxx;"; - static void registerNatives() { - registerHybrid({makeNativeMethod("invoke_cxx", JFunc_void_DownloadEvent_cxx::invoke_cxx)}); - } - - private: - explicit JFunc_void_DownloadEvent_cxx(const std::function& func): _func(func) { } - - private: - friend HybridBase; - std::function _func; - }; - -} // namespace margelo::nitro::reactnativeappupdate diff --git a/native-modules/react-native-app-update/nitrogen/generated/android/c++/JHybridReactNativeAppUpdateSpec.cpp b/native-modules/react-native-app-update/nitrogen/generated/android/c++/JHybridReactNativeAppUpdateSpec.cpp deleted file mode 100644 index 28434ee..0000000 --- a/native-modules/react-native-app-update/nitrogen/generated/android/c++/JHybridReactNativeAppUpdateSpec.cpp +++ /dev/null @@ -1,199 +0,0 @@ -/// -/// JHybridReactNativeAppUpdateSpec.cpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#include "JHybridReactNativeAppUpdateSpec.hpp" - -// Forward declaration of `AppUpdateDownloadParams` to properly resolve imports. -namespace margelo::nitro::reactnativeappupdate { struct AppUpdateDownloadParams; } -// Forward declaration of `AppUpdateFileParams` to properly resolve imports. -namespace margelo::nitro::reactnativeappupdate { struct AppUpdateFileParams; } -// Forward declaration of `DownloadEvent` to properly resolve imports. -namespace margelo::nitro::reactnativeappupdate { struct DownloadEvent; } - -#include -#include -#include "AppUpdateDownloadParams.hpp" -#include "JAppUpdateDownloadParams.hpp" -#include -#include "AppUpdateFileParams.hpp" -#include "JAppUpdateFileParams.hpp" -#include "DownloadEvent.hpp" -#include -#include "JFunc_void_DownloadEvent.hpp" -#include -#include "JDownloadEvent.hpp" - -namespace margelo::nitro::reactnativeappupdate { - - jni::local_ref JHybridReactNativeAppUpdateSpec::initHybrid(jni::alias_ref jThis) { - return makeCxxInstance(jThis); - } - - void JHybridReactNativeAppUpdateSpec::registerNatives() { - registerHybrid({ - makeNativeMethod("initHybrid", JHybridReactNativeAppUpdateSpec::initHybrid), - }); - } - - size_t JHybridReactNativeAppUpdateSpec::getExternalMemorySize() noexcept { - static const auto method = javaClassStatic()->getMethod("getMemorySize"); - return method(_javaPart); - } - - void JHybridReactNativeAppUpdateSpec::dispose() noexcept { - static const auto method = javaClassStatic()->getMethod("dispose"); - method(_javaPart); - } - - std::string JHybridReactNativeAppUpdateSpec::toString() { - static const auto method = javaClassStatic()->getMethod("toString"); - auto javaString = method(_javaPart); - return javaString->toStdString(); - } - - // Properties - - - // Methods - std::shared_ptr> JHybridReactNativeAppUpdateSpec::downloadAPK(const AppUpdateDownloadParams& params) { - static const auto method = javaClassStatic()->getMethod(jni::alias_ref /* params */)>("downloadAPK"); - auto __result = method(_javaPart, JAppUpdateDownloadParams::fromCpp(params)); - return [&]() { - auto __promise = Promise::create(); - __result->cthis()->addOnResolvedListener([=](const jni::alias_ref& /* unit */) { - __promise->resolve(); - }); - __result->cthis()->addOnRejectedListener([=](const jni::alias_ref& __throwable) { - jni::JniException __jniError(__throwable); - __promise->reject(std::make_exception_ptr(__jniError)); - }); - return __promise; - }(); - } - std::shared_ptr> JHybridReactNativeAppUpdateSpec::downloadASC(const AppUpdateFileParams& params) { - static const auto method = javaClassStatic()->getMethod(jni::alias_ref /* params */)>("downloadASC"); - auto __result = method(_javaPart, JAppUpdateFileParams::fromCpp(params)); - return [&]() { - auto __promise = Promise::create(); - __result->cthis()->addOnResolvedListener([=](const jni::alias_ref& /* unit */) { - __promise->resolve(); - }); - __result->cthis()->addOnRejectedListener([=](const jni::alias_ref& __throwable) { - jni::JniException __jniError(__throwable); - __promise->reject(std::make_exception_ptr(__jniError)); - }); - return __promise; - }(); - } - std::shared_ptr> JHybridReactNativeAppUpdateSpec::verifyASC(const AppUpdateFileParams& params) { - static const auto method = javaClassStatic()->getMethod(jni::alias_ref /* params */)>("verifyASC"); - auto __result = method(_javaPart, JAppUpdateFileParams::fromCpp(params)); - return [&]() { - auto __promise = Promise::create(); - __result->cthis()->addOnResolvedListener([=](const jni::alias_ref& /* unit */) { - __promise->resolve(); - }); - __result->cthis()->addOnRejectedListener([=](const jni::alias_ref& __throwable) { - jni::JniException __jniError(__throwable); - __promise->reject(std::make_exception_ptr(__jniError)); - }); - return __promise; - }(); - } - std::shared_ptr> JHybridReactNativeAppUpdateSpec::verifyAPK(const AppUpdateFileParams& params) { - static const auto method = javaClassStatic()->getMethod(jni::alias_ref /* params */)>("verifyAPK"); - auto __result = method(_javaPart, JAppUpdateFileParams::fromCpp(params)); - return [&]() { - auto __promise = Promise::create(); - __result->cthis()->addOnResolvedListener([=](const jni::alias_ref& /* unit */) { - __promise->resolve(); - }); - __result->cthis()->addOnRejectedListener([=](const jni::alias_ref& __throwable) { - jni::JniException __jniError(__throwable); - __promise->reject(std::make_exception_ptr(__jniError)); - }); - return __promise; - }(); - } - std::shared_ptr> JHybridReactNativeAppUpdateSpec::installAPK(const AppUpdateFileParams& params) { - static const auto method = javaClassStatic()->getMethod(jni::alias_ref /* params */)>("installAPK"); - auto __result = method(_javaPart, JAppUpdateFileParams::fromCpp(params)); - return [&]() { - auto __promise = Promise::create(); - __result->cthis()->addOnResolvedListener([=](const jni::alias_ref& /* unit */) { - __promise->resolve(); - }); - __result->cthis()->addOnRejectedListener([=](const jni::alias_ref& __throwable) { - jni::JniException __jniError(__throwable); - __promise->reject(std::make_exception_ptr(__jniError)); - }); - return __promise; - }(); - } - std::shared_ptr> JHybridReactNativeAppUpdateSpec::clearCache() { - static const auto method = javaClassStatic()->getMethod()>("clearCache"); - auto __result = method(_javaPart); - return [&]() { - auto __promise = Promise::create(); - __result->cthis()->addOnResolvedListener([=](const jni::alias_ref& /* unit */) { - __promise->resolve(); - }); - __result->cthis()->addOnRejectedListener([=](const jni::alias_ref& __throwable) { - jni::JniException __jniError(__throwable); - __promise->reject(std::make_exception_ptr(__jniError)); - }); - return __promise; - }(); - } - std::shared_ptr> JHybridReactNativeAppUpdateSpec::testVerification() { - static const auto method = javaClassStatic()->getMethod()>("testVerification"); - auto __result = method(_javaPart); - return [&]() { - auto __promise = Promise::create(); - __result->cthis()->addOnResolvedListener([=](const jni::alias_ref& __boxedResult) { - auto __result = jni::static_ref_cast(__boxedResult); - __promise->resolve(static_cast(__result->value())); - }); - __result->cthis()->addOnRejectedListener([=](const jni::alias_ref& __throwable) { - jni::JniException __jniError(__throwable); - __promise->reject(std::make_exception_ptr(__jniError)); - }); - return __promise; - }(); - } - std::shared_ptr> JHybridReactNativeAppUpdateSpec::testSkipVerification() { - static const auto method = javaClassStatic()->getMethod()>("testSkipVerification"); - auto __result = method(_javaPart); - return [&]() { - auto __promise = Promise::create(); - __result->cthis()->addOnResolvedListener([=](const jni::alias_ref& __boxedResult) { - auto __result = jni::static_ref_cast(__boxedResult); - __promise->resolve(static_cast(__result->value())); - }); - __result->cthis()->addOnRejectedListener([=](const jni::alias_ref& __throwable) { - jni::JniException __jniError(__throwable); - __promise->reject(std::make_exception_ptr(__jniError)); - }); - return __promise; - }(); - } - bool JHybridReactNativeAppUpdateSpec::isSkipGpgVerificationAllowed() { - static const auto method = javaClassStatic()->getMethod("isSkipGpgVerificationAllowed"); - auto __result = method(_javaPart); - return static_cast(__result); - } - double JHybridReactNativeAppUpdateSpec::addDownloadListener(const std::function& callback) { - static const auto method = javaClassStatic()->getMethod /* callback */)>("addDownloadListener_cxx"); - auto __result = method(_javaPart, JFunc_void_DownloadEvent_cxx::fromCpp(callback)); - return __result; - } - void JHybridReactNativeAppUpdateSpec::removeDownloadListener(double id) { - static const auto method = javaClassStatic()->getMethod("removeDownloadListener"); - method(_javaPart, id); - } - -} // namespace margelo::nitro::reactnativeappupdate diff --git a/native-modules/react-native-app-update/nitrogen/generated/android/c++/JHybridReactNativeAppUpdateSpec.hpp b/native-modules/react-native-app-update/nitrogen/generated/android/c++/JHybridReactNativeAppUpdateSpec.hpp deleted file mode 100644 index b419f0f..0000000 --- a/native-modules/react-native-app-update/nitrogen/generated/android/c++/JHybridReactNativeAppUpdateSpec.hpp +++ /dev/null @@ -1,75 +0,0 @@ -/// -/// HybridReactNativeAppUpdateSpec.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#include -#include -#include "HybridReactNativeAppUpdateSpec.hpp" - - - - -namespace margelo::nitro::reactnativeappupdate { - - using namespace facebook; - - class JHybridReactNativeAppUpdateSpec: public jni::HybridClass, - public virtual HybridReactNativeAppUpdateSpec { - public: - static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/reactnativeappupdate/HybridReactNativeAppUpdateSpec;"; - static jni::local_ref initHybrid(jni::alias_ref jThis); - static void registerNatives(); - - protected: - // C++ constructor (called from Java via `initHybrid()`) - explicit JHybridReactNativeAppUpdateSpec(jni::alias_ref jThis) : - HybridObject(HybridReactNativeAppUpdateSpec::TAG), - HybridBase(jThis), - _javaPart(jni::make_global(jThis)) {} - - public: - ~JHybridReactNativeAppUpdateSpec() override { - // Hermes GC can destroy JS objects on a non-JNI Thread. - jni::ThreadScope::WithClassLoader([&] { _javaPart.reset(); }); - } - - public: - size_t getExternalMemorySize() noexcept override; - void dispose() noexcept override; - std::string toString() override; - - public: - inline const jni::global_ref& getJavaPart() const noexcept { - return _javaPart; - } - - public: - // Properties - - - public: - // Methods - std::shared_ptr> downloadAPK(const AppUpdateDownloadParams& params) override; - std::shared_ptr> downloadASC(const AppUpdateFileParams& params) override; - std::shared_ptr> verifyASC(const AppUpdateFileParams& params) override; - std::shared_ptr> verifyAPK(const AppUpdateFileParams& params) override; - std::shared_ptr> installAPK(const AppUpdateFileParams& params) override; - std::shared_ptr> clearCache() override; - std::shared_ptr> testVerification() override; - std::shared_ptr> testSkipVerification() override; - bool isSkipGpgVerificationAllowed() override; - double addDownloadListener(const std::function& callback) override; - void removeDownloadListener(double id) override; - - private: - friend HybridBase; - using HybridBase::HybridBase; - jni::global_ref _javaPart; - }; - -} // namespace margelo::nitro::reactnativeappupdate diff --git a/native-modules/react-native-app-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativeappupdate/AppUpdateDownloadParams.kt b/native-modules/react-native-app-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativeappupdate/AppUpdateDownloadParams.kt deleted file mode 100644 index f273b9e..0000000 --- a/native-modules/react-native-app-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativeappupdate/AppUpdateDownloadParams.kt +++ /dev/null @@ -1,44 +0,0 @@ -/// -/// AppUpdateDownloadParams.kt -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -package com.margelo.nitro.reactnativeappupdate - -import androidx.annotation.Keep -import com.facebook.proguard.annotations.DoNotStrip - - -/** - * Represents the JavaScript object/struct "AppUpdateDownloadParams". - */ -@DoNotStrip -@Keep -data class AppUpdateDownloadParams( - @DoNotStrip - @Keep - val downloadUrl: String, - @DoNotStrip - @Keep - val notificationTitle: String, - @DoNotStrip - @Keep - val fileSize: Double -) { - /* primary constructor */ - - private companion object { - /** - * Constructor called from C++ - */ - @DoNotStrip - @Keep - @Suppress("unused") - @JvmStatic - private fun fromCpp(downloadUrl: String, notificationTitle: String, fileSize: Double): AppUpdateDownloadParams { - return AppUpdateDownloadParams(downloadUrl, notificationTitle, fileSize) - } - } -} diff --git a/native-modules/react-native-app-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativeappupdate/AppUpdateFileParams.kt b/native-modules/react-native-app-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativeappupdate/AppUpdateFileParams.kt deleted file mode 100644 index 38c0a61..0000000 --- a/native-modules/react-native-app-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativeappupdate/AppUpdateFileParams.kt +++ /dev/null @@ -1,38 +0,0 @@ -/// -/// AppUpdateFileParams.kt -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -package com.margelo.nitro.reactnativeappupdate - -import androidx.annotation.Keep -import com.facebook.proguard.annotations.DoNotStrip - - -/** - * Represents the JavaScript object/struct "AppUpdateFileParams". - */ -@DoNotStrip -@Keep -data class AppUpdateFileParams( - @DoNotStrip - @Keep - val downloadUrl: String -) { - /* primary constructor */ - - private companion object { - /** - * Constructor called from C++ - */ - @DoNotStrip - @Keep - @Suppress("unused") - @JvmStatic - private fun fromCpp(downloadUrl: String): AppUpdateFileParams { - return AppUpdateFileParams(downloadUrl) - } - } -} diff --git a/native-modules/react-native-app-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativeappupdate/DownloadEvent.kt b/native-modules/react-native-app-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativeappupdate/DownloadEvent.kt deleted file mode 100644 index dd66748..0000000 --- a/native-modules/react-native-app-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativeappupdate/DownloadEvent.kt +++ /dev/null @@ -1,44 +0,0 @@ -/// -/// DownloadEvent.kt -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -package com.margelo.nitro.reactnativeappupdate - -import androidx.annotation.Keep -import com.facebook.proguard.annotations.DoNotStrip - - -/** - * Represents the JavaScript object/struct "DownloadEvent". - */ -@DoNotStrip -@Keep -data class DownloadEvent( - @DoNotStrip - @Keep - val type: String, - @DoNotStrip - @Keep - val progress: Double, - @DoNotStrip - @Keep - val message: String -) { - /* primary constructor */ - - private companion object { - /** - * Constructor called from C++ - */ - @DoNotStrip - @Keep - @Suppress("unused") - @JvmStatic - private fun fromCpp(type: String, progress: Double, message: String): DownloadEvent { - return DownloadEvent(type, progress, message) - } - } -} diff --git a/native-modules/react-native-app-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativeappupdate/Func_void_DownloadEvent.kt b/native-modules/react-native-app-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativeappupdate/Func_void_DownloadEvent.kt deleted file mode 100644 index 9238d10..0000000 --- a/native-modules/react-native-app-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativeappupdate/Func_void_DownloadEvent.kt +++ /dev/null @@ -1,80 +0,0 @@ -/// -/// Func_void_DownloadEvent.kt -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -package com.margelo.nitro.reactnativeappupdate - -import androidx.annotation.Keep -import com.facebook.jni.HybridData -import com.facebook.proguard.annotations.DoNotStrip -import dalvik.annotation.optimization.FastNative - - -/** - * Represents the JavaScript callback `(event: struct) => void`. - * This can be either implemented in C++ (in which case it might be a callback coming from JS), - * or in Kotlin/Java (in which case it is a native callback). - */ -@DoNotStrip -@Keep -@Suppress("ClassName", "RedundantUnitReturnType") -fun interface Func_void_DownloadEvent: (DownloadEvent) -> Unit { - /** - * Call the given JS callback. - * @throws Throwable if the JS function itself throws an error, or if the JS function/runtime has already been deleted. - */ - @DoNotStrip - @Keep - override fun invoke(event: DownloadEvent): Unit -} - -/** - * Represents the JavaScript callback `(event: struct) => void`. - * This is implemented in C++, via a `std::function<...>`. - * The callback might be coming from JS. - */ -@DoNotStrip -@Keep -@Suppress( - "KotlinJniMissingFunction", "unused", - "RedundantSuppression", "RedundantUnitReturnType", "FunctionName", - "ConvertSecondaryConstructorToPrimary", "ClassName", "LocalVariableName", -) -class Func_void_DownloadEvent_cxx: Func_void_DownloadEvent { - @DoNotStrip - @Keep - private val mHybridData: HybridData - - @DoNotStrip - @Keep - private constructor(hybridData: HybridData) { - mHybridData = hybridData - } - - @DoNotStrip - @Keep - override fun invoke(event: DownloadEvent): Unit - = invoke_cxx(event) - - @FastNative - private external fun invoke_cxx(event: DownloadEvent): Unit -} - -/** - * Represents the JavaScript callback `(event: struct) => void`. - * This is implemented in Java/Kotlin, via a `(DownloadEvent) -> Unit`. - * The callback is always coming from native. - */ -@DoNotStrip -@Keep -@Suppress("ClassName", "RedundantUnitReturnType", "unused") -class Func_void_DownloadEvent_java(private val function: (DownloadEvent) -> Unit): Func_void_DownloadEvent { - @DoNotStrip - @Keep - override fun invoke(event: DownloadEvent): Unit { - return this.function(event) - } -} diff --git a/native-modules/react-native-app-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativeappupdate/HybridReactNativeAppUpdateSpec.kt b/native-modules/react-native-app-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativeappupdate/HybridReactNativeAppUpdateSpec.kt deleted file mode 100644 index 178faab..0000000 --- a/native-modules/react-native-app-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativeappupdate/HybridReactNativeAppUpdateSpec.kt +++ /dev/null @@ -1,103 +0,0 @@ -/// -/// HybridReactNativeAppUpdateSpec.kt -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -package com.margelo.nitro.reactnativeappupdate - -import androidx.annotation.Keep -import com.facebook.jni.HybridData -import com.facebook.proguard.annotations.DoNotStrip -import com.margelo.nitro.core.Promise -import com.margelo.nitro.core.HybridObject - -/** - * A Kotlin class representing the ReactNativeAppUpdate HybridObject. - * Implement this abstract class to create Kotlin-based instances of ReactNativeAppUpdate. - */ -@DoNotStrip -@Keep -@Suppress( - "KotlinJniMissingFunction", "unused", - "RedundantSuppression", "RedundantUnitReturnType", "SimpleRedundantLet", - "LocalVariableName", "PropertyName", "PrivatePropertyName", "FunctionName" -) -abstract class HybridReactNativeAppUpdateSpec: HybridObject() { - @DoNotStrip - private var mHybridData: HybridData = initHybrid() - - init { - super.updateNative(mHybridData) - } - - override fun updateNative(hybridData: HybridData) { - mHybridData = hybridData - super.updateNative(hybridData) - } - - // Default implementation of `HybridObject.toString()` - override fun toString(): String { - return "[HybridObject ReactNativeAppUpdate]" - } - - // Properties - - - // Methods - @DoNotStrip - @Keep - abstract fun downloadAPK(params: AppUpdateDownloadParams): Promise - - @DoNotStrip - @Keep - abstract fun downloadASC(params: AppUpdateFileParams): Promise - - @DoNotStrip - @Keep - abstract fun verifyASC(params: AppUpdateFileParams): Promise - - @DoNotStrip - @Keep - abstract fun verifyAPK(params: AppUpdateFileParams): Promise - - @DoNotStrip - @Keep - abstract fun installAPK(params: AppUpdateFileParams): Promise - - @DoNotStrip - @Keep - abstract fun clearCache(): Promise - - @DoNotStrip - @Keep - abstract fun testVerification(): Promise - - @DoNotStrip - @Keep - abstract fun testSkipVerification(): Promise - - @DoNotStrip - @Keep - abstract fun isSkipGpgVerificationAllowed(): Boolean - - abstract fun addDownloadListener(callback: (event: DownloadEvent) -> Unit): Double - - @DoNotStrip - @Keep - private fun addDownloadListener_cxx(callback: Func_void_DownloadEvent): Double { - val __result = addDownloadListener(callback) - return __result - } - - @DoNotStrip - @Keep - abstract fun removeDownloadListener(id: Double): Unit - - private external fun initHybrid(): HybridData - - companion object { - protected const val TAG = "HybridReactNativeAppUpdateSpec" - } -} diff --git a/native-modules/react-native-app-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativeappupdate/reactnativeappupdateOnLoad.kt b/native-modules/react-native-app-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativeappupdate/reactnativeappupdateOnLoad.kt deleted file mode 100644 index 055d7d1..0000000 --- a/native-modules/react-native-app-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativeappupdate/reactnativeappupdateOnLoad.kt +++ /dev/null @@ -1,35 +0,0 @@ -/// -/// reactnativeappupdateOnLoad.kt -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -package com.margelo.nitro.reactnativeappupdate - -import android.util.Log - -internal class reactnativeappupdateOnLoad { - companion object { - private const val TAG = "reactnativeappupdateOnLoad" - private var didLoad = false - /** - * Initializes the native part of "reactnativeappupdate". - * This method is idempotent and can be called more than once. - */ - @JvmStatic - fun initializeNative() { - if (didLoad) return - try { - Log.i(TAG, "Loading reactnativeappupdate C++ library...") - System.loadLibrary("reactnativeappupdate") - Log.i(TAG, "Successfully loaded reactnativeappupdate C++ library!") - didLoad = true - } catch (e: Error) { - Log.e(TAG, "Failed to load reactnativeappupdate C++ library! Is it properly installed and linked? " + - "Is the name correct? (see `CMakeLists.txt`, at `add_library(...)`)", e) - throw e - } - } - } -} diff --git a/native-modules/react-native-app-update/nitrogen/generated/android/reactnativeappupdate+autolinking.cmake b/native-modules/react-native-app-update/nitrogen/generated/android/reactnativeappupdate+autolinking.cmake deleted file mode 100644 index 8a740ca..0000000 --- a/native-modules/react-native-app-update/nitrogen/generated/android/reactnativeappupdate+autolinking.cmake +++ /dev/null @@ -1,81 +0,0 @@ -# -# reactnativeappupdate+autolinking.cmake -# This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -# https://github.com/mrousavy/nitro -# Copyright © 2026 Marc Rousavy @ Margelo -# - -# This is a CMake file that adds all files generated by Nitrogen -# to the current CMake project. -# -# To use it, add this to your CMakeLists.txt: -# ```cmake -# include(${CMAKE_SOURCE_DIR}/../nitrogen/generated/android/reactnativeappupdate+autolinking.cmake) -# ``` - -# Define a flag to check if we are building properly -add_definitions(-DBUILDING_REACTNATIVEAPPUPDATE_WITH_GENERATED_CMAKE_PROJECT) - -# Enable Raw Props parsing in react-native (for Nitro Views) -add_definitions(-DRN_SERIALIZABLE_STATE) - -# Add all headers that were generated by Nitrogen -include_directories( - "../nitrogen/generated/shared/c++" - "../nitrogen/generated/android/c++" - "../nitrogen/generated/android/" -) - -# Add all .cpp sources that were generated by Nitrogen -target_sources( - # CMake project name (Android C++ library name) - reactnativeappupdate PRIVATE - # Autolinking Setup - ../nitrogen/generated/android/reactnativeappupdateOnLoad.cpp - # Shared Nitrogen C++ sources - ../nitrogen/generated/shared/c++/HybridReactNativeAppUpdateSpec.cpp - # Android-specific Nitrogen C++ sources - ../nitrogen/generated/android/c++/JHybridReactNativeAppUpdateSpec.cpp -) - -# From node_modules/react-native/ReactAndroid/cmake-utils/folly-flags.cmake -# Used in node_modules/react-native/ReactAndroid/cmake-utils/ReactNative-application.cmake -target_compile_definitions( - reactnativeappupdate PRIVATE - -DFOLLY_NO_CONFIG=1 - -DFOLLY_HAVE_CLOCK_GETTIME=1 - -DFOLLY_USE_LIBCPP=1 - -DFOLLY_CFG_NO_COROUTINES=1 - -DFOLLY_MOBILE=1 - -DFOLLY_HAVE_RECVMMSG=1 - -DFOLLY_HAVE_PTHREAD=1 - # Once we target android-23 above, we can comment - # the following line. NDK uses GNU style stderror_r() after API 23. - -DFOLLY_HAVE_XSI_STRERROR_R=1 -) - -# Add all libraries required by the generated specs -find_package(fbjni REQUIRED) # <-- Used for communication between Java <-> C++ -find_package(ReactAndroid REQUIRED) # <-- Used to set up React Native bindings (e.g. CallInvoker/TurboModule) -find_package(react-native-nitro-modules REQUIRED) # <-- Used to create all HybridObjects and use the Nitro core library - -# Link all libraries together -target_link_libraries( - reactnativeappupdate - fbjni::fbjni # <-- Facebook C++ JNI helpers - ReactAndroid::jsi # <-- RN: JSI - react-native-nitro-modules::NitroModules # <-- NitroModules Core :) -) - -# Link react-native (different prefab between RN 0.75 and RN 0.76) -if(ReactAndroid_VERSION_MINOR GREATER_EQUAL 76) - target_link_libraries( - reactnativeappupdate - ReactAndroid::reactnative # <-- RN: Native Modules umbrella prefab - ) -else() - target_link_libraries( - reactnativeappupdate - ReactAndroid::react_nativemodule_core # <-- RN: TurboModules Core - ) -endif() diff --git a/native-modules/react-native-app-update/nitrogen/generated/android/reactnativeappupdate+autolinking.gradle b/native-modules/react-native-app-update/nitrogen/generated/android/reactnativeappupdate+autolinking.gradle deleted file mode 100644 index 851b0ff..0000000 --- a/native-modules/react-native-app-update/nitrogen/generated/android/reactnativeappupdate+autolinking.gradle +++ /dev/null @@ -1,27 +0,0 @@ -/// -/// reactnativeappupdate+autolinking.gradle -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -/// This is a Gradle file that adds all files generated by Nitrogen -/// to the current Gradle project. -/// -/// To use it, add this to your build.gradle: -/// ```gradle -/// apply from: '../nitrogen/generated/android/reactnativeappupdate+autolinking.gradle' -/// ``` - -logger.warn("[NitroModules] 🔥 reactnativeappupdate is boosted by nitro!") - -android { - sourceSets { - main { - java.srcDirs += [ - // Nitrogen files - "${project.projectDir}/../nitrogen/generated/android/kotlin" - ] - } - } -} diff --git a/native-modules/react-native-app-update/nitrogen/generated/android/reactnativeappupdateOnLoad.cpp b/native-modules/react-native-app-update/nitrogen/generated/android/reactnativeappupdateOnLoad.cpp deleted file mode 100644 index cbd55c1..0000000 --- a/native-modules/react-native-app-update/nitrogen/generated/android/reactnativeappupdateOnLoad.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/// -/// reactnativeappupdateOnLoad.cpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#ifndef BUILDING_REACTNATIVEAPPUPDATE_WITH_GENERATED_CMAKE_PROJECT -#error reactnativeappupdateOnLoad.cpp is not being built with the autogenerated CMakeLists.txt project. Is a different CMakeLists.txt building this? -#endif - -#include "reactnativeappupdateOnLoad.hpp" - -#include -#include -#include - -#include "JHybridReactNativeAppUpdateSpec.hpp" -#include "JFunc_void_DownloadEvent.hpp" -#include - -namespace margelo::nitro::reactnativeappupdate { - -int initialize(JavaVM* vm) { - using namespace margelo::nitro; - using namespace margelo::nitro::reactnativeappupdate; - using namespace facebook; - - return facebook::jni::initialize(vm, [] { - // Register native JNI methods - margelo::nitro::reactnativeappupdate::JHybridReactNativeAppUpdateSpec::registerNatives(); - margelo::nitro::reactnativeappupdate::JFunc_void_DownloadEvent_cxx::registerNatives(); - - // Register Nitro Hybrid Objects - HybridObjectRegistry::registerHybridObjectConstructor( - "ReactNativeAppUpdate", - []() -> std::shared_ptr { - static DefaultConstructableObject object("com/margelo/nitro/reactnativeappupdate/ReactNativeAppUpdate"); - auto instance = object.create(); - return instance->cthis()->shared(); - } - ); - }); -} - -} // namespace margelo::nitro::reactnativeappupdate diff --git a/native-modules/react-native-app-update/nitrogen/generated/android/reactnativeappupdateOnLoad.hpp b/native-modules/react-native-app-update/nitrogen/generated/android/reactnativeappupdateOnLoad.hpp deleted file mode 100644 index 9d9ec13..0000000 --- a/native-modules/react-native-app-update/nitrogen/generated/android/reactnativeappupdateOnLoad.hpp +++ /dev/null @@ -1,25 +0,0 @@ -/// -/// reactnativeappupdateOnLoad.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#include -#include - -namespace margelo::nitro::reactnativeappupdate { - - /** - * Initializes the native (C++) part of reactnativeappupdate, and autolinks all Hybrid Objects. - * Call this in your `JNI_OnLoad` function (probably inside `cpp-adapter.cpp`). - * Example: - * ```cpp (cpp-adapter.cpp) - * JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void*) { - * return margelo::nitro::reactnativeappupdate::initialize(vm); - * } - * ``` - */ - int initialize(JavaVM* vm); - -} // namespace margelo::nitro::reactnativeappupdate diff --git a/native-modules/react-native-app-update/nitrogen/generated/ios/ReactNativeAppUpdate+autolinking.rb b/native-modules/react-native-app-update/nitrogen/generated/ios/ReactNativeAppUpdate+autolinking.rb deleted file mode 100644 index 437f941..0000000 --- a/native-modules/react-native-app-update/nitrogen/generated/ios/ReactNativeAppUpdate+autolinking.rb +++ /dev/null @@ -1,60 +0,0 @@ -# -# ReactNativeAppUpdate+autolinking.rb -# This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -# https://github.com/mrousavy/nitro -# Copyright © 2026 Marc Rousavy @ Margelo -# - -# This is a Ruby script that adds all files generated by Nitrogen -# to the given podspec. -# -# To use it, add this to your .podspec: -# ```ruby -# Pod::Spec.new do |spec| -# # ... -# -# # Add all files generated by Nitrogen -# load 'nitrogen/generated/ios/ReactNativeAppUpdate+autolinking.rb' -# add_nitrogen_files(spec) -# end -# ``` - -def add_nitrogen_files(spec) - Pod::UI.puts "[NitroModules] 🔥 ReactNativeAppUpdate is boosted by nitro!" - - spec.dependency "NitroModules" - - current_source_files = Array(spec.attributes_hash['source_files']) - spec.source_files = current_source_files + [ - # Generated cross-platform specs - "nitrogen/generated/shared/**/*.{h,hpp,c,cpp,swift}", - # Generated bridges for the cross-platform specs - "nitrogen/generated/ios/**/*.{h,hpp,c,cpp,mm,swift}", - ] - - current_public_header_files = Array(spec.attributes_hash['public_header_files']) - spec.public_header_files = current_public_header_files + [ - # Generated specs - "nitrogen/generated/shared/**/*.{h,hpp}", - # Swift to C++ bridging helpers - "nitrogen/generated/ios/ReactNativeAppUpdate-Swift-Cxx-Bridge.hpp" - ] - - current_private_header_files = Array(spec.attributes_hash['private_header_files']) - spec.private_header_files = current_private_header_files + [ - # iOS specific specs - "nitrogen/generated/ios/c++/**/*.{h,hpp}", - # Views are framework-specific and should be private - "nitrogen/generated/shared/**/views/**/*" - ] - - current_pod_target_xcconfig = spec.attributes_hash['pod_target_xcconfig'] || {} - spec.pod_target_xcconfig = current_pod_target_xcconfig.merge({ - # Use C++ 20 - "CLANG_CXX_LANGUAGE_STANDARD" => "c++20", - # Enables C++ <-> Swift interop (by default it's only C) - "SWIFT_OBJC_INTEROP_MODE" => "objcxx", - # Enables stricter modular headers - "DEFINES_MODULE" => "YES", - }) -end diff --git a/native-modules/react-native-app-update/nitrogen/generated/ios/ReactNativeAppUpdate-Swift-Cxx-Bridge.cpp b/native-modules/react-native-app-update/nitrogen/generated/ios/ReactNativeAppUpdate-Swift-Cxx-Bridge.cpp deleted file mode 100644 index 14888fb..0000000 --- a/native-modules/react-native-app-update/nitrogen/generated/ios/ReactNativeAppUpdate-Swift-Cxx-Bridge.cpp +++ /dev/null @@ -1,65 +0,0 @@ -/// -/// ReactNativeAppUpdate-Swift-Cxx-Bridge.cpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#include "ReactNativeAppUpdate-Swift-Cxx-Bridge.hpp" - -// Include C++ implementation defined types -#include "HybridReactNativeAppUpdateSpecSwift.hpp" -#include "ReactNativeAppUpdate-Swift-Cxx-Umbrella.hpp" -#include - -namespace margelo::nitro::reactnativeappupdate::bridge::swift { - - // pragma MARK: std::function - Func_void create_Func_void(void* NON_NULL swiftClosureWrapper) noexcept { - auto swiftClosure = ReactNativeAppUpdate::Func_void::fromUnsafe(swiftClosureWrapper); - return [swiftClosure = std::move(swiftClosure)]() mutable -> void { - swiftClosure.call(); - }; - } - - // pragma MARK: std::function - Func_void_std__exception_ptr create_Func_void_std__exception_ptr(void* NON_NULL swiftClosureWrapper) noexcept { - auto swiftClosure = ReactNativeAppUpdate::Func_void_std__exception_ptr::fromUnsafe(swiftClosureWrapper); - return [swiftClosure = std::move(swiftClosure)](const std::exception_ptr& error) mutable -> void { - swiftClosure.call(error); - }; - } - - // pragma MARK: std::function - Func_void_bool create_Func_void_bool(void* NON_NULL swiftClosureWrapper) noexcept { - auto swiftClosure = ReactNativeAppUpdate::Func_void_bool::fromUnsafe(swiftClosureWrapper); - return [swiftClosure = std::move(swiftClosure)](bool result) mutable -> void { - swiftClosure.call(result); - }; - } - - // pragma MARK: std::function - Func_void_DownloadEvent create_Func_void_DownloadEvent(void* NON_NULL swiftClosureWrapper) noexcept { - auto swiftClosure = ReactNativeAppUpdate::Func_void_DownloadEvent::fromUnsafe(swiftClosureWrapper); - return [swiftClosure = std::move(swiftClosure)](const DownloadEvent& event) mutable -> void { - swiftClosure.call(event); - }; - } - - // pragma MARK: std::shared_ptr - std::shared_ptr create_std__shared_ptr_HybridReactNativeAppUpdateSpec_(void* NON_NULL swiftUnsafePointer) noexcept { - ReactNativeAppUpdate::HybridReactNativeAppUpdateSpec_cxx swiftPart = ReactNativeAppUpdate::HybridReactNativeAppUpdateSpec_cxx::fromUnsafe(swiftUnsafePointer); - return std::make_shared(swiftPart); - } - void* NON_NULL get_std__shared_ptr_HybridReactNativeAppUpdateSpec_(std__shared_ptr_HybridReactNativeAppUpdateSpec_ cppType) { - std::shared_ptr swiftWrapper = std::dynamic_pointer_cast(cppType); - #ifdef NITRO_DEBUG - if (swiftWrapper == nullptr) [[unlikely]] { - throw std::runtime_error("Class \"HybridReactNativeAppUpdateSpec\" is not implemented in Swift!"); - } - #endif - ReactNativeAppUpdate::HybridReactNativeAppUpdateSpec_cxx& swiftPart = swiftWrapper->getSwiftPart(); - return swiftPart.toUnsafe(); - } - -} // namespace margelo::nitro::reactnativeappupdate::bridge::swift diff --git a/native-modules/react-native-app-update/nitrogen/generated/ios/ReactNativeAppUpdate-Swift-Cxx-Bridge.hpp b/native-modules/react-native-app-update/nitrogen/generated/ios/ReactNativeAppUpdate-Swift-Cxx-Bridge.hpp deleted file mode 100644 index 623996a..0000000 --- a/native-modules/react-native-app-update/nitrogen/generated/ios/ReactNativeAppUpdate-Swift-Cxx-Bridge.hpp +++ /dev/null @@ -1,206 +0,0 @@ -/// -/// ReactNativeAppUpdate-Swift-Cxx-Bridge.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -// Forward declarations of C++ defined types -// Forward declaration of `DownloadEvent` to properly resolve imports. -namespace margelo::nitro::reactnativeappupdate { struct DownloadEvent; } -// Forward declaration of `HybridReactNativeAppUpdateSpec` to properly resolve imports. -namespace margelo::nitro::reactnativeappupdate { class HybridReactNativeAppUpdateSpec; } - -// Forward declarations of Swift defined types -// Forward declaration of `HybridReactNativeAppUpdateSpec_cxx` to properly resolve imports. -namespace ReactNativeAppUpdate { class HybridReactNativeAppUpdateSpec_cxx; } - -// Include C++ defined types -#include "DownloadEvent.hpp" -#include "HybridReactNativeAppUpdateSpec.hpp" -#include -#include -#include -#include -#include -#include -#include - -/** - * Contains specialized versions of C++ templated types so they can be accessed from Swift, - * as well as helper functions to interact with those C++ types from Swift. - */ -namespace margelo::nitro::reactnativeappupdate::bridge::swift { - - // pragma MARK: std::shared_ptr> - /** - * Specialized version of `std::shared_ptr>`. - */ - using std__shared_ptr_Promise_void__ = std::shared_ptr>; - inline std::shared_ptr> create_std__shared_ptr_Promise_void__() noexcept { - return Promise::create(); - } - inline PromiseHolder wrap_std__shared_ptr_Promise_void__(std::shared_ptr> promise) noexcept { - return PromiseHolder(std::move(promise)); - } - - // pragma MARK: std::function - /** - * Specialized version of `std::function`. - */ - using Func_void = std::function; - /** - * Wrapper class for a `std::function`, this can be used from Swift. - */ - class Func_void_Wrapper final { - public: - explicit Func_void_Wrapper(std::function&& func): _function(std::make_unique>(std::move(func))) {} - inline void call() const noexcept { - _function->operator()(); - } - private: - std::unique_ptr> _function; - } SWIFT_NONCOPYABLE; - Func_void create_Func_void(void* NON_NULL swiftClosureWrapper) noexcept; - inline Func_void_Wrapper wrap_Func_void(Func_void value) noexcept { - return Func_void_Wrapper(std::move(value)); - } - - // pragma MARK: std::function - /** - * Specialized version of `std::function`. - */ - using Func_void_std__exception_ptr = std::function; - /** - * Wrapper class for a `std::function`, this can be used from Swift. - */ - class Func_void_std__exception_ptr_Wrapper final { - public: - explicit Func_void_std__exception_ptr_Wrapper(std::function&& func): _function(std::make_unique>(std::move(func))) {} - inline void call(std::exception_ptr error) const noexcept { - _function->operator()(error); - } - private: - std::unique_ptr> _function; - } SWIFT_NONCOPYABLE; - Func_void_std__exception_ptr create_Func_void_std__exception_ptr(void* NON_NULL swiftClosureWrapper) noexcept; - inline Func_void_std__exception_ptr_Wrapper wrap_Func_void_std__exception_ptr(Func_void_std__exception_ptr value) noexcept { - return Func_void_std__exception_ptr_Wrapper(std::move(value)); - } - - // pragma MARK: std::shared_ptr> - /** - * Specialized version of `std::shared_ptr>`. - */ - using std__shared_ptr_Promise_bool__ = std::shared_ptr>; - inline std::shared_ptr> create_std__shared_ptr_Promise_bool__() noexcept { - return Promise::create(); - } - inline PromiseHolder wrap_std__shared_ptr_Promise_bool__(std::shared_ptr> promise) noexcept { - return PromiseHolder(std::move(promise)); - } - - // pragma MARK: std::function - /** - * Specialized version of `std::function`. - */ - using Func_void_bool = std::function; - /** - * Wrapper class for a `std::function`, this can be used from Swift. - */ - class Func_void_bool_Wrapper final { - public: - explicit Func_void_bool_Wrapper(std::function&& func): _function(std::make_unique>(std::move(func))) {} - inline void call(bool result) const noexcept { - _function->operator()(result); - } - private: - std::unique_ptr> _function; - } SWIFT_NONCOPYABLE; - Func_void_bool create_Func_void_bool(void* NON_NULL swiftClosureWrapper) noexcept; - inline Func_void_bool_Wrapper wrap_Func_void_bool(Func_void_bool value) noexcept { - return Func_void_bool_Wrapper(std::move(value)); - } - - // pragma MARK: std::function - /** - * Specialized version of `std::function`. - */ - using Func_void_DownloadEvent = std::function; - /** - * Wrapper class for a `std::function`, this can be used from Swift. - */ - class Func_void_DownloadEvent_Wrapper final { - public: - explicit Func_void_DownloadEvent_Wrapper(std::function&& func): _function(std::make_unique>(std::move(func))) {} - inline void call(DownloadEvent event) const noexcept { - _function->operator()(event); - } - private: - std::unique_ptr> _function; - } SWIFT_NONCOPYABLE; - Func_void_DownloadEvent create_Func_void_DownloadEvent(void* NON_NULL swiftClosureWrapper) noexcept; - inline Func_void_DownloadEvent_Wrapper wrap_Func_void_DownloadEvent(Func_void_DownloadEvent value) noexcept { - return Func_void_DownloadEvent_Wrapper(std::move(value)); - } - - // pragma MARK: std::shared_ptr - /** - * Specialized version of `std::shared_ptr`. - */ - using std__shared_ptr_HybridReactNativeAppUpdateSpec_ = std::shared_ptr; - std::shared_ptr create_std__shared_ptr_HybridReactNativeAppUpdateSpec_(void* NON_NULL swiftUnsafePointer) noexcept; - void* NON_NULL get_std__shared_ptr_HybridReactNativeAppUpdateSpec_(std__shared_ptr_HybridReactNativeAppUpdateSpec_ cppType); - - // pragma MARK: std::weak_ptr - using std__weak_ptr_HybridReactNativeAppUpdateSpec_ = std::weak_ptr; - inline std__weak_ptr_HybridReactNativeAppUpdateSpec_ weakify_std__shared_ptr_HybridReactNativeAppUpdateSpec_(const std::shared_ptr& strong) noexcept { return strong; } - - // pragma MARK: Result>> - using Result_std__shared_ptr_Promise_void___ = Result>>; - inline Result_std__shared_ptr_Promise_void___ create_Result_std__shared_ptr_Promise_void___(const std::shared_ptr>& value) noexcept { - return Result>>::withValue(value); - } - inline Result_std__shared_ptr_Promise_void___ create_Result_std__shared_ptr_Promise_void___(const std::exception_ptr& error) noexcept { - return Result>>::withError(error); - } - - // pragma MARK: Result>> - using Result_std__shared_ptr_Promise_bool___ = Result>>; - inline Result_std__shared_ptr_Promise_bool___ create_Result_std__shared_ptr_Promise_bool___(const std::shared_ptr>& value) noexcept { - return Result>>::withValue(value); - } - inline Result_std__shared_ptr_Promise_bool___ create_Result_std__shared_ptr_Promise_bool___(const std::exception_ptr& error) noexcept { - return Result>>::withError(error); - } - - // pragma MARK: Result - using Result_bool_ = Result; - inline Result_bool_ create_Result_bool_(bool value) noexcept { - return Result::withValue(std::move(value)); - } - inline Result_bool_ create_Result_bool_(const std::exception_ptr& error) noexcept { - return Result::withError(error); - } - - // pragma MARK: Result - using Result_double_ = Result; - inline Result_double_ create_Result_double_(double value) noexcept { - return Result::withValue(std::move(value)); - } - inline Result_double_ create_Result_double_(const std::exception_ptr& error) noexcept { - return Result::withError(error); - } - - // pragma MARK: Result - using Result_void_ = Result; - inline Result_void_ create_Result_void_() noexcept { - return Result::withValue(); - } - inline Result_void_ create_Result_void_(const std::exception_ptr& error) noexcept { - return Result::withError(error); - } - -} // namespace margelo::nitro::reactnativeappupdate::bridge::swift diff --git a/native-modules/react-native-app-update/nitrogen/generated/ios/ReactNativeAppUpdate-Swift-Cxx-Umbrella.hpp b/native-modules/react-native-app-update/nitrogen/generated/ios/ReactNativeAppUpdate-Swift-Cxx-Umbrella.hpp deleted file mode 100644 index 8f93007..0000000 --- a/native-modules/react-native-app-update/nitrogen/generated/ios/ReactNativeAppUpdate-Swift-Cxx-Umbrella.hpp +++ /dev/null @@ -1,55 +0,0 @@ -/// -/// ReactNativeAppUpdate-Swift-Cxx-Umbrella.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -// Forward declarations of C++ defined types -// Forward declaration of `AppUpdateDownloadParams` to properly resolve imports. -namespace margelo::nitro::reactnativeappupdate { struct AppUpdateDownloadParams; } -// Forward declaration of `AppUpdateFileParams` to properly resolve imports. -namespace margelo::nitro::reactnativeappupdate { struct AppUpdateFileParams; } -// Forward declaration of `DownloadEvent` to properly resolve imports. -namespace margelo::nitro::reactnativeappupdate { struct DownloadEvent; } -// Forward declaration of `HybridReactNativeAppUpdateSpec` to properly resolve imports. -namespace margelo::nitro::reactnativeappupdate { class HybridReactNativeAppUpdateSpec; } - -// Include C++ defined types -#include "AppUpdateDownloadParams.hpp" -#include "AppUpdateFileParams.hpp" -#include "DownloadEvent.hpp" -#include "HybridReactNativeAppUpdateSpec.hpp" -#include -#include -#include -#include -#include -#include - -// C++ helpers for Swift -#include "ReactNativeAppUpdate-Swift-Cxx-Bridge.hpp" - -// Common C++ types used in Swift -#include -#include -#include -#include - -// Forward declarations of Swift defined types -// Forward declaration of `HybridReactNativeAppUpdateSpec_cxx` to properly resolve imports. -namespace ReactNativeAppUpdate { class HybridReactNativeAppUpdateSpec_cxx; } - -// Include Swift defined types -#if __has_include("ReactNativeAppUpdate-Swift.h") -// This header is generated by Xcode/Swift on every app build. -// If it cannot be found, make sure the Swift module's name (= podspec name) is actually "ReactNativeAppUpdate". -#include "ReactNativeAppUpdate-Swift.h" -// Same as above, but used when building with frameworks (`use_frameworks`) -#elif __has_include() -#include -#else -#error ReactNativeAppUpdate's autogenerated Swift header cannot be found! Make sure the Swift module's name (= podspec name) is actually "ReactNativeAppUpdate", and try building the app first. -#endif diff --git a/native-modules/react-native-app-update/nitrogen/generated/ios/ReactNativeAppUpdateAutolinking.mm b/native-modules/react-native-app-update/nitrogen/generated/ios/ReactNativeAppUpdateAutolinking.mm deleted file mode 100644 index 3efcd21..0000000 --- a/native-modules/react-native-app-update/nitrogen/generated/ios/ReactNativeAppUpdateAutolinking.mm +++ /dev/null @@ -1,33 +0,0 @@ -/// -/// ReactNativeAppUpdateAutolinking.mm -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#import -#import -#import "ReactNativeAppUpdate-Swift-Cxx-Umbrella.hpp" -#import - -#include "HybridReactNativeAppUpdateSpecSwift.hpp" - -@interface ReactNativeAppUpdateAutolinking : NSObject -@end - -@implementation ReactNativeAppUpdateAutolinking - -+ (void) load { - using namespace margelo::nitro; - using namespace margelo::nitro::reactnativeappupdate; - - HybridObjectRegistry::registerHybridObjectConstructor( - "ReactNativeAppUpdate", - []() -> std::shared_ptr { - std::shared_ptr hybridObject = ReactNativeAppUpdate::ReactNativeAppUpdateAutolinking::createReactNativeAppUpdate(); - return hybridObject; - } - ); -} - -@end diff --git a/native-modules/react-native-app-update/nitrogen/generated/ios/ReactNativeAppUpdateAutolinking.swift b/native-modules/react-native-app-update/nitrogen/generated/ios/ReactNativeAppUpdateAutolinking.swift deleted file mode 100644 index dc635fa..0000000 --- a/native-modules/react-native-app-update/nitrogen/generated/ios/ReactNativeAppUpdateAutolinking.swift +++ /dev/null @@ -1,25 +0,0 @@ -/// -/// ReactNativeAppUpdateAutolinking.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -public final class ReactNativeAppUpdateAutolinking { - public typealias bridge = margelo.nitro.reactnativeappupdate.bridge.swift - - /** - * Creates an instance of a Swift class that implements `HybridReactNativeAppUpdateSpec`, - * and wraps it in a Swift class that can directly interop with C++ (`HybridReactNativeAppUpdateSpec_cxx`) - * - * This is generated by Nitrogen and will initialize the class specified - * in the `"autolinking"` property of `nitro.json` (in this case, `ReactNativeAppUpdate`). - */ - public static func createReactNativeAppUpdate() -> bridge.std__shared_ptr_HybridReactNativeAppUpdateSpec_ { - let hybridObject = ReactNativeAppUpdate() - return { () -> bridge.std__shared_ptr_HybridReactNativeAppUpdateSpec_ in - let __cxxWrapped = hybridObject.getCxxWrapper() - return __cxxWrapped.getCxxPart() - }() - } -} diff --git a/native-modules/react-native-app-update/nitrogen/generated/ios/c++/HybridReactNativeAppUpdateSpecSwift.cpp b/native-modules/react-native-app-update/nitrogen/generated/ios/c++/HybridReactNativeAppUpdateSpecSwift.cpp deleted file mode 100644 index 08fe275..0000000 --- a/native-modules/react-native-app-update/nitrogen/generated/ios/c++/HybridReactNativeAppUpdateSpecSwift.cpp +++ /dev/null @@ -1,11 +0,0 @@ -/// -/// HybridReactNativeAppUpdateSpecSwift.cpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#include "HybridReactNativeAppUpdateSpecSwift.hpp" - -namespace margelo::nitro::reactnativeappupdate { -} // namespace margelo::nitro::reactnativeappupdate diff --git a/native-modules/react-native-app-update/nitrogen/generated/ios/c++/HybridReactNativeAppUpdateSpecSwift.hpp b/native-modules/react-native-app-update/nitrogen/generated/ios/c++/HybridReactNativeAppUpdateSpecSwift.hpp deleted file mode 100644 index 67f67f1..0000000 --- a/native-modules/react-native-app-update/nitrogen/generated/ios/c++/HybridReactNativeAppUpdateSpecSwift.hpp +++ /dev/null @@ -1,164 +0,0 @@ -/// -/// HybridReactNativeAppUpdateSpecSwift.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#include "HybridReactNativeAppUpdateSpec.hpp" - -// Forward declaration of `HybridReactNativeAppUpdateSpec_cxx` to properly resolve imports. -namespace ReactNativeAppUpdate { class HybridReactNativeAppUpdateSpec_cxx; } - -// Forward declaration of `AppUpdateDownloadParams` to properly resolve imports. -namespace margelo::nitro::reactnativeappupdate { struct AppUpdateDownloadParams; } -// Forward declaration of `AppUpdateFileParams` to properly resolve imports. -namespace margelo::nitro::reactnativeappupdate { struct AppUpdateFileParams; } -// Forward declaration of `DownloadEvent` to properly resolve imports. -namespace margelo::nitro::reactnativeappupdate { struct DownloadEvent; } - -#include -#include "AppUpdateDownloadParams.hpp" -#include -#include "AppUpdateFileParams.hpp" -#include "DownloadEvent.hpp" -#include - -#include "ReactNativeAppUpdate-Swift-Cxx-Umbrella.hpp" - -namespace margelo::nitro::reactnativeappupdate { - - /** - * The C++ part of HybridReactNativeAppUpdateSpec_cxx.swift. - * - * HybridReactNativeAppUpdateSpecSwift (C++) accesses HybridReactNativeAppUpdateSpec_cxx (Swift), and might - * contain some additional bridging code for C++ <> Swift interop. - * - * Since this obviously introduces an overhead, I hope at some point in - * the future, HybridReactNativeAppUpdateSpec_cxx can directly inherit from the C++ class HybridReactNativeAppUpdateSpec - * to simplify the whole structure and memory management. - */ - class HybridReactNativeAppUpdateSpecSwift: public virtual HybridReactNativeAppUpdateSpec { - public: - // Constructor from a Swift instance - explicit HybridReactNativeAppUpdateSpecSwift(const ReactNativeAppUpdate::HybridReactNativeAppUpdateSpec_cxx& swiftPart): - HybridObject(HybridReactNativeAppUpdateSpec::TAG), - _swiftPart(swiftPart) { } - - public: - // Get the Swift part - inline ReactNativeAppUpdate::HybridReactNativeAppUpdateSpec_cxx& getSwiftPart() noexcept { - return _swiftPart; - } - - public: - inline size_t getExternalMemorySize() noexcept override { - return _swiftPart.getMemorySize(); - } - void dispose() noexcept override { - _swiftPart.dispose(); - } - std::string toString() override { - return _swiftPart.toString(); - } - - public: - // Properties - - - public: - // Methods - inline std::shared_ptr> downloadAPK(const AppUpdateDownloadParams& params) override { - auto __result = _swiftPart.downloadAPK(std::forward(params)); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - auto __value = std::move(__result.value()); - return __value; - } - inline std::shared_ptr> downloadASC(const AppUpdateFileParams& params) override { - auto __result = _swiftPart.downloadASC(std::forward(params)); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - auto __value = std::move(__result.value()); - return __value; - } - inline std::shared_ptr> verifyASC(const AppUpdateFileParams& params) override { - auto __result = _swiftPart.verifyASC(std::forward(params)); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - auto __value = std::move(__result.value()); - return __value; - } - inline std::shared_ptr> verifyAPK(const AppUpdateFileParams& params) override { - auto __result = _swiftPart.verifyAPK(std::forward(params)); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - auto __value = std::move(__result.value()); - return __value; - } - inline std::shared_ptr> installAPK(const AppUpdateFileParams& params) override { - auto __result = _swiftPart.installAPK(std::forward(params)); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - auto __value = std::move(__result.value()); - return __value; - } - inline std::shared_ptr> clearCache() override { - auto __result = _swiftPart.clearCache(); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - auto __value = std::move(__result.value()); - return __value; - } - inline std::shared_ptr> testVerification() override { - auto __result = _swiftPart.testVerification(); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - auto __value = std::move(__result.value()); - return __value; - } - inline std::shared_ptr> testSkipVerification() override { - auto __result = _swiftPart.testSkipVerification(); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - auto __value = std::move(__result.value()); - return __value; - } - inline bool isSkipGpgVerificationAllowed() override { - auto __result = _swiftPart.isSkipGpgVerificationAllowed(); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - auto __value = std::move(__result.value()); - return __value; - } - inline double addDownloadListener(const std::function& callback) override { - auto __result = _swiftPart.addDownloadListener(callback); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - auto __value = std::move(__result.value()); - return __value; - } - inline void removeDownloadListener(double id) override { - auto __result = _swiftPart.removeDownloadListener(std::forward(id)); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - } - - private: - ReactNativeAppUpdate::HybridReactNativeAppUpdateSpec_cxx _swiftPart; - }; - -} // namespace margelo::nitro::reactnativeappupdate diff --git a/native-modules/react-native-app-update/nitrogen/generated/ios/swift/AppUpdateDownloadParams.swift b/native-modules/react-native-app-update/nitrogen/generated/ios/swift/AppUpdateDownloadParams.swift deleted file mode 100644 index 864c216..0000000 --- a/native-modules/react-native-app-update/nitrogen/generated/ios/swift/AppUpdateDownloadParams.swift +++ /dev/null @@ -1,58 +0,0 @@ -/// -/// AppUpdateDownloadParams.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Represents an instance of `AppUpdateDownloadParams`, backed by a C++ struct. - */ -public typealias AppUpdateDownloadParams = margelo.nitro.reactnativeappupdate.AppUpdateDownloadParams - -public extension AppUpdateDownloadParams { - private typealias bridge = margelo.nitro.reactnativeappupdate.bridge.swift - - /** - * Create a new instance of `AppUpdateDownloadParams`. - */ - init(downloadUrl: String, notificationTitle: String, fileSize: Double) { - self.init(std.string(downloadUrl), std.string(notificationTitle), fileSize) - } - - var downloadUrl: String { - @inline(__always) - get { - return String(self.__downloadUrl) - } - @inline(__always) - set { - self.__downloadUrl = std.string(newValue) - } - } - - var notificationTitle: String { - @inline(__always) - get { - return String(self.__notificationTitle) - } - @inline(__always) - set { - self.__notificationTitle = std.string(newValue) - } - } - - var fileSize: Double { - @inline(__always) - get { - return self.__fileSize - } - @inline(__always) - set { - self.__fileSize = newValue - } - } -} diff --git a/native-modules/react-native-app-update/nitrogen/generated/ios/swift/AppUpdateFileParams.swift b/native-modules/react-native-app-update/nitrogen/generated/ios/swift/AppUpdateFileParams.swift deleted file mode 100644 index 7fc1500..0000000 --- a/native-modules/react-native-app-update/nitrogen/generated/ios/swift/AppUpdateFileParams.swift +++ /dev/null @@ -1,36 +0,0 @@ -/// -/// AppUpdateFileParams.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Represents an instance of `AppUpdateFileParams`, backed by a C++ struct. - */ -public typealias AppUpdateFileParams = margelo.nitro.reactnativeappupdate.AppUpdateFileParams - -public extension AppUpdateFileParams { - private typealias bridge = margelo.nitro.reactnativeappupdate.bridge.swift - - /** - * Create a new instance of `AppUpdateFileParams`. - */ - init(downloadUrl: String) { - self.init(std.string(downloadUrl)) - } - - var downloadUrl: String { - @inline(__always) - get { - return String(self.__downloadUrl) - } - @inline(__always) - set { - self.__downloadUrl = std.string(newValue) - } - } -} diff --git a/native-modules/react-native-app-update/nitrogen/generated/ios/swift/DownloadEvent.swift b/native-modules/react-native-app-update/nitrogen/generated/ios/swift/DownloadEvent.swift deleted file mode 100644 index 90bf51f..0000000 --- a/native-modules/react-native-app-update/nitrogen/generated/ios/swift/DownloadEvent.swift +++ /dev/null @@ -1,58 +0,0 @@ -/// -/// DownloadEvent.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Represents an instance of `DownloadEvent`, backed by a C++ struct. - */ -public typealias DownloadEvent = margelo.nitro.reactnativeappupdate.DownloadEvent - -public extension DownloadEvent { - private typealias bridge = margelo.nitro.reactnativeappupdate.bridge.swift - - /** - * Create a new instance of `DownloadEvent`. - */ - init(type: String, progress: Double, message: String) { - self.init(std.string(type), progress, std.string(message)) - } - - var type: String { - @inline(__always) - get { - return String(self.__type) - } - @inline(__always) - set { - self.__type = std.string(newValue) - } - } - - var progress: Double { - @inline(__always) - get { - return self.__progress - } - @inline(__always) - set { - self.__progress = newValue - } - } - - var message: String { - @inline(__always) - get { - return String(self.__message) - } - @inline(__always) - set { - self.__message = std.string(newValue) - } - } -} diff --git a/native-modules/react-native-app-update/nitrogen/generated/ios/swift/Func_void.swift b/native-modules/react-native-app-update/nitrogen/generated/ios/swift/Func_void.swift deleted file mode 100644 index b3c3ee8..0000000 --- a/native-modules/react-native-app-update/nitrogen/generated/ios/swift/Func_void.swift +++ /dev/null @@ -1,47 +0,0 @@ -/// -/// Func_void.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Wraps a Swift `() -> Void` as a class. - * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`. - */ -public final class Func_void { - public typealias bridge = margelo.nitro.reactnativeappupdate.bridge.swift - - private let closure: () -> Void - - public init(_ closure: @escaping () -> Void) { - self.closure = closure - } - - @inline(__always) - public func call() -> Void { - self.closure() - } - - /** - * Casts this instance to a retained unsafe raw pointer. - * This acquires one additional strong reference on the object! - */ - @inline(__always) - public func toUnsafe() -> UnsafeMutableRawPointer { - return Unmanaged.passRetained(self).toOpaque() - } - - /** - * Casts an unsafe pointer to a `Func_void`. - * The pointer has to be a retained opaque `Unmanaged`. - * This removes one strong reference from the object! - */ - @inline(__always) - public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void { - return Unmanaged.fromOpaque(pointer).takeRetainedValue() - } -} diff --git a/native-modules/react-native-app-update/nitrogen/generated/ios/swift/Func_void_DownloadEvent.swift b/native-modules/react-native-app-update/nitrogen/generated/ios/swift/Func_void_DownloadEvent.swift deleted file mode 100644 index dfb9e0a..0000000 --- a/native-modules/react-native-app-update/nitrogen/generated/ios/swift/Func_void_DownloadEvent.swift +++ /dev/null @@ -1,47 +0,0 @@ -/// -/// Func_void_DownloadEvent.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Wraps a Swift `(_ event: DownloadEvent) -> Void` as a class. - * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`. - */ -public final class Func_void_DownloadEvent { - public typealias bridge = margelo.nitro.reactnativeappupdate.bridge.swift - - private let closure: (_ event: DownloadEvent) -> Void - - public init(_ closure: @escaping (_ event: DownloadEvent) -> Void) { - self.closure = closure - } - - @inline(__always) - public func call(event: DownloadEvent) -> Void { - self.closure(event) - } - - /** - * Casts this instance to a retained unsafe raw pointer. - * This acquires one additional strong reference on the object! - */ - @inline(__always) - public func toUnsafe() -> UnsafeMutableRawPointer { - return Unmanaged.passRetained(self).toOpaque() - } - - /** - * Casts an unsafe pointer to a `Func_void_DownloadEvent`. - * The pointer has to be a retained opaque `Unmanaged`. - * This removes one strong reference from the object! - */ - @inline(__always) - public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_DownloadEvent { - return Unmanaged.fromOpaque(pointer).takeRetainedValue() - } -} diff --git a/native-modules/react-native-app-update/nitrogen/generated/ios/swift/Func_void_bool.swift b/native-modules/react-native-app-update/nitrogen/generated/ios/swift/Func_void_bool.swift deleted file mode 100644 index ee8959c..0000000 --- a/native-modules/react-native-app-update/nitrogen/generated/ios/swift/Func_void_bool.swift +++ /dev/null @@ -1,47 +0,0 @@ -/// -/// Func_void_bool.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Wraps a Swift `(_ value: Bool) -> Void` as a class. - * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`. - */ -public final class Func_void_bool { - public typealias bridge = margelo.nitro.reactnativeappupdate.bridge.swift - - private let closure: (_ value: Bool) -> Void - - public init(_ closure: @escaping (_ value: Bool) -> Void) { - self.closure = closure - } - - @inline(__always) - public func call(value: Bool) -> Void { - self.closure(value) - } - - /** - * Casts this instance to a retained unsafe raw pointer. - * This acquires one additional strong reference on the object! - */ - @inline(__always) - public func toUnsafe() -> UnsafeMutableRawPointer { - return Unmanaged.passRetained(self).toOpaque() - } - - /** - * Casts an unsafe pointer to a `Func_void_bool`. - * The pointer has to be a retained opaque `Unmanaged`. - * This removes one strong reference from the object! - */ - @inline(__always) - public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_bool { - return Unmanaged.fromOpaque(pointer).takeRetainedValue() - } -} diff --git a/native-modules/react-native-app-update/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift b/native-modules/react-native-app-update/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift deleted file mode 100644 index ae12304..0000000 --- a/native-modules/react-native-app-update/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +++ /dev/null @@ -1,47 +0,0 @@ -/// -/// Func_void_std__exception_ptr.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Wraps a Swift `(_ error: Error) -> Void` as a class. - * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`. - */ -public final class Func_void_std__exception_ptr { - public typealias bridge = margelo.nitro.reactnativeappupdate.bridge.swift - - private let closure: (_ error: Error) -> Void - - public init(_ closure: @escaping (_ error: Error) -> Void) { - self.closure = closure - } - - @inline(__always) - public func call(error: std.exception_ptr) -> Void { - self.closure(RuntimeError.from(cppError: error)) - } - - /** - * Casts this instance to a retained unsafe raw pointer. - * This acquires one additional strong reference on the object! - */ - @inline(__always) - public func toUnsafe() -> UnsafeMutableRawPointer { - return Unmanaged.passRetained(self).toOpaque() - } - - /** - * Casts an unsafe pointer to a `Func_void_std__exception_ptr`. - * The pointer has to be a retained opaque `Unmanaged`. - * This removes one strong reference from the object! - */ - @inline(__always) - public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_std__exception_ptr { - return Unmanaged.fromOpaque(pointer).takeRetainedValue() - } -} diff --git a/native-modules/react-native-app-update/nitrogen/generated/ios/swift/HybridReactNativeAppUpdateSpec.swift b/native-modules/react-native-app-update/nitrogen/generated/ios/swift/HybridReactNativeAppUpdateSpec.swift deleted file mode 100644 index 6a8a104..0000000 --- a/native-modules/react-native-app-update/nitrogen/generated/ios/swift/HybridReactNativeAppUpdateSpec.swift +++ /dev/null @@ -1,66 +0,0 @@ -/// -/// HybridReactNativeAppUpdateSpec.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/// See ``HybridReactNativeAppUpdateSpec`` -public protocol HybridReactNativeAppUpdateSpec_protocol: HybridObject { - // Properties - - - // Methods - func downloadAPK(params: AppUpdateDownloadParams) throws -> Promise - func downloadASC(params: AppUpdateFileParams) throws -> Promise - func verifyASC(params: AppUpdateFileParams) throws -> Promise - func verifyAPK(params: AppUpdateFileParams) throws -> Promise - func installAPK(params: AppUpdateFileParams) throws -> Promise - func clearCache() throws -> Promise - func testVerification() throws -> Promise - func testSkipVerification() throws -> Promise - func isSkipGpgVerificationAllowed() throws -> Bool - func addDownloadListener(callback: @escaping (_ event: DownloadEvent) -> Void) throws -> Double - func removeDownloadListener(id: Double) throws -> Void -} - -public extension HybridReactNativeAppUpdateSpec_protocol { - /// Default implementation of ``HybridObject.toString`` - func toString() -> String { - return "[HybridObject ReactNativeAppUpdate]" - } -} - -/// See ``HybridReactNativeAppUpdateSpec`` -open class HybridReactNativeAppUpdateSpec_base { - private weak var cxxWrapper: HybridReactNativeAppUpdateSpec_cxx? = nil - public init() { } - public func getCxxWrapper() -> HybridReactNativeAppUpdateSpec_cxx { - #if DEBUG - guard self is HybridReactNativeAppUpdateSpec else { - fatalError("`self` is not a `HybridReactNativeAppUpdateSpec`! Did you accidentally inherit from `HybridReactNativeAppUpdateSpec_base` instead of `HybridReactNativeAppUpdateSpec`?") - } - #endif - if let cxxWrapper = self.cxxWrapper { - return cxxWrapper - } else { - let cxxWrapper = HybridReactNativeAppUpdateSpec_cxx(self as! HybridReactNativeAppUpdateSpec) - self.cxxWrapper = cxxWrapper - return cxxWrapper - } - } -} - -/** - * A Swift base-protocol representing the ReactNativeAppUpdate HybridObject. - * Implement this protocol to create Swift-based instances of ReactNativeAppUpdate. - * ```swift - * class HybridReactNativeAppUpdate : HybridReactNativeAppUpdateSpec { - * // ... - * } - * ``` - */ -public typealias HybridReactNativeAppUpdateSpec = HybridReactNativeAppUpdateSpec_protocol & HybridReactNativeAppUpdateSpec_base diff --git a/native-modules/react-native-app-update/nitrogen/generated/ios/swift/HybridReactNativeAppUpdateSpec_cxx.swift b/native-modules/react-native-app-update/nitrogen/generated/ios/swift/HybridReactNativeAppUpdateSpec_cxx.swift deleted file mode 100644 index 6e9d526..0000000 --- a/native-modules/react-native-app-update/nitrogen/generated/ios/swift/HybridReactNativeAppUpdateSpec_cxx.swift +++ /dev/null @@ -1,311 +0,0 @@ -/// -/// HybridReactNativeAppUpdateSpec_cxx.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * A class implementation that bridges HybridReactNativeAppUpdateSpec over to C++. - * In C++, we cannot use Swift protocols - so we need to wrap it in a class to make it strongly defined. - * - * Also, some Swift types need to be bridged with special handling: - * - Enums need to be wrapped in Structs, otherwise they cannot be accessed bi-directionally (Swift bug: https://github.com/swiftlang/swift/issues/75330) - * - Other HybridObjects need to be wrapped/unwrapped from the Swift TCxx wrapper - * - Throwing methods need to be wrapped with a Result type, as exceptions cannot be propagated to C++ - */ -open class HybridReactNativeAppUpdateSpec_cxx { - /** - * The Swift <> C++ bridge's namespace (`margelo::nitro::reactnativeappupdate::bridge::swift`) - * from `ReactNativeAppUpdate-Swift-Cxx-Bridge.hpp`. - * This contains specialized C++ templates, and C++ helper functions that can be accessed from Swift. - */ - public typealias bridge = margelo.nitro.reactnativeappupdate.bridge.swift - - /** - * Holds an instance of the `HybridReactNativeAppUpdateSpec` Swift protocol. - */ - private var __implementation: any HybridReactNativeAppUpdateSpec - - /** - * Holds a weak pointer to the C++ class that wraps the Swift class. - */ - private var __cxxPart: bridge.std__weak_ptr_HybridReactNativeAppUpdateSpec_ - - /** - * Create a new `HybridReactNativeAppUpdateSpec_cxx` that wraps the given `HybridReactNativeAppUpdateSpec`. - * All properties and methods bridge to C++ types. - */ - public init(_ implementation: any HybridReactNativeAppUpdateSpec) { - self.__implementation = implementation - self.__cxxPart = .init() - /* no base class */ - } - - /** - * Get the actual `HybridReactNativeAppUpdateSpec` instance this class wraps. - */ - @inline(__always) - public func getHybridReactNativeAppUpdateSpec() -> any HybridReactNativeAppUpdateSpec { - return __implementation - } - - /** - * Casts this instance to a retained unsafe raw pointer. - * This acquires one additional strong reference on the object! - */ - public func toUnsafe() -> UnsafeMutableRawPointer { - return Unmanaged.passRetained(self).toOpaque() - } - - /** - * Casts an unsafe pointer to a `HybridReactNativeAppUpdateSpec_cxx`. - * The pointer has to be a retained opaque `Unmanaged`. - * This removes one strong reference from the object! - */ - public class func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> HybridReactNativeAppUpdateSpec_cxx { - return Unmanaged.fromOpaque(pointer).takeRetainedValue() - } - - /** - * Gets (or creates) the C++ part of this Hybrid Object. - * The C++ part is a `std::shared_ptr`. - */ - public func getCxxPart() -> bridge.std__shared_ptr_HybridReactNativeAppUpdateSpec_ { - let cachedCxxPart = self.__cxxPart.lock() - if Bool(fromCxx: cachedCxxPart) { - return cachedCxxPart - } else { - let newCxxPart = bridge.create_std__shared_ptr_HybridReactNativeAppUpdateSpec_(self.toUnsafe()) - __cxxPart = bridge.weakify_std__shared_ptr_HybridReactNativeAppUpdateSpec_(newCxxPart) - return newCxxPart - } - } - - - - /** - * Get the memory size of the Swift class (plus size of any other allocations) - * so the JS VM can properly track it and garbage-collect the JS object if needed. - */ - @inline(__always) - public var memorySize: Int { - return MemoryHelper.getSizeOf(self.__implementation) + self.__implementation.memorySize - } - - /** - * Call dispose() on the Swift class. - * This _may_ be called manually from JS. - */ - @inline(__always) - public func dispose() { - self.__implementation.dispose() - } - - /** - * Call toString() on the Swift class. - */ - @inline(__always) - public func toString() -> String { - return self.__implementation.toString() - } - - // Properties - - - // Methods - @inline(__always) - public final func downloadAPK(params: AppUpdateDownloadParams) -> bridge.Result_std__shared_ptr_Promise_void___ { - do { - let __result = try self.__implementation.downloadAPK(params: params) - let __resultCpp = { () -> bridge.std__shared_ptr_Promise_void__ in - let __promise = bridge.create_std__shared_ptr_Promise_void__() - let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_void__(__promise) - __result - .then({ __result in __promiseHolder.resolve() }) - .catch({ __error in __promiseHolder.reject(__error.toCpp()) }) - return __promise - }() - return bridge.create_Result_std__shared_ptr_Promise_void___(__resultCpp) - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_std__shared_ptr_Promise_void___(__exceptionPtr) - } - } - - @inline(__always) - public final func downloadASC(params: AppUpdateFileParams) -> bridge.Result_std__shared_ptr_Promise_void___ { - do { - let __result = try self.__implementation.downloadASC(params: params) - let __resultCpp = { () -> bridge.std__shared_ptr_Promise_void__ in - let __promise = bridge.create_std__shared_ptr_Promise_void__() - let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_void__(__promise) - __result - .then({ __result in __promiseHolder.resolve() }) - .catch({ __error in __promiseHolder.reject(__error.toCpp()) }) - return __promise - }() - return bridge.create_Result_std__shared_ptr_Promise_void___(__resultCpp) - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_std__shared_ptr_Promise_void___(__exceptionPtr) - } - } - - @inline(__always) - public final func verifyASC(params: AppUpdateFileParams) -> bridge.Result_std__shared_ptr_Promise_void___ { - do { - let __result = try self.__implementation.verifyASC(params: params) - let __resultCpp = { () -> bridge.std__shared_ptr_Promise_void__ in - let __promise = bridge.create_std__shared_ptr_Promise_void__() - let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_void__(__promise) - __result - .then({ __result in __promiseHolder.resolve() }) - .catch({ __error in __promiseHolder.reject(__error.toCpp()) }) - return __promise - }() - return bridge.create_Result_std__shared_ptr_Promise_void___(__resultCpp) - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_std__shared_ptr_Promise_void___(__exceptionPtr) - } - } - - @inline(__always) - public final func verifyAPK(params: AppUpdateFileParams) -> bridge.Result_std__shared_ptr_Promise_void___ { - do { - let __result = try self.__implementation.verifyAPK(params: params) - let __resultCpp = { () -> bridge.std__shared_ptr_Promise_void__ in - let __promise = bridge.create_std__shared_ptr_Promise_void__() - let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_void__(__promise) - __result - .then({ __result in __promiseHolder.resolve() }) - .catch({ __error in __promiseHolder.reject(__error.toCpp()) }) - return __promise - }() - return bridge.create_Result_std__shared_ptr_Promise_void___(__resultCpp) - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_std__shared_ptr_Promise_void___(__exceptionPtr) - } - } - - @inline(__always) - public final func installAPK(params: AppUpdateFileParams) -> bridge.Result_std__shared_ptr_Promise_void___ { - do { - let __result = try self.__implementation.installAPK(params: params) - let __resultCpp = { () -> bridge.std__shared_ptr_Promise_void__ in - let __promise = bridge.create_std__shared_ptr_Promise_void__() - let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_void__(__promise) - __result - .then({ __result in __promiseHolder.resolve() }) - .catch({ __error in __promiseHolder.reject(__error.toCpp()) }) - return __promise - }() - return bridge.create_Result_std__shared_ptr_Promise_void___(__resultCpp) - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_std__shared_ptr_Promise_void___(__exceptionPtr) - } - } - - @inline(__always) - public final func clearCache() -> bridge.Result_std__shared_ptr_Promise_void___ { - do { - let __result = try self.__implementation.clearCache() - let __resultCpp = { () -> bridge.std__shared_ptr_Promise_void__ in - let __promise = bridge.create_std__shared_ptr_Promise_void__() - let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_void__(__promise) - __result - .then({ __result in __promiseHolder.resolve() }) - .catch({ __error in __promiseHolder.reject(__error.toCpp()) }) - return __promise - }() - return bridge.create_Result_std__shared_ptr_Promise_void___(__resultCpp) - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_std__shared_ptr_Promise_void___(__exceptionPtr) - } - } - - @inline(__always) - public final func testVerification() -> bridge.Result_std__shared_ptr_Promise_bool___ { - do { - let __result = try self.__implementation.testVerification() - let __resultCpp = { () -> bridge.std__shared_ptr_Promise_bool__ in - let __promise = bridge.create_std__shared_ptr_Promise_bool__() - let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_bool__(__promise) - __result - .then({ __result in __promiseHolder.resolve(__result) }) - .catch({ __error in __promiseHolder.reject(__error.toCpp()) }) - return __promise - }() - return bridge.create_Result_std__shared_ptr_Promise_bool___(__resultCpp) - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_std__shared_ptr_Promise_bool___(__exceptionPtr) - } - } - - @inline(__always) - public final func testSkipVerification() -> bridge.Result_std__shared_ptr_Promise_bool___ { - do { - let __result = try self.__implementation.testSkipVerification() - let __resultCpp = { () -> bridge.std__shared_ptr_Promise_bool__ in - let __promise = bridge.create_std__shared_ptr_Promise_bool__() - let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_bool__(__promise) - __result - .then({ __result in __promiseHolder.resolve(__result) }) - .catch({ __error in __promiseHolder.reject(__error.toCpp()) }) - return __promise - }() - return bridge.create_Result_std__shared_ptr_Promise_bool___(__resultCpp) - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_std__shared_ptr_Promise_bool___(__exceptionPtr) - } - } - - @inline(__always) - public final func isSkipGpgVerificationAllowed() -> bridge.Result_bool_ { - do { - let __result = try self.__implementation.isSkipGpgVerificationAllowed() - let __resultCpp = __result - return bridge.create_Result_bool_(__resultCpp) - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_bool_(__exceptionPtr) - } - } - - @inline(__always) - public final func addDownloadListener(callback: bridge.Func_void_DownloadEvent) -> bridge.Result_double_ { - do { - let __result = try self.__implementation.addDownloadListener(callback: { () -> (DownloadEvent) -> Void in - let __wrappedFunction = bridge.wrap_Func_void_DownloadEvent(callback) - return { (__event: DownloadEvent) -> Void in - __wrappedFunction.call(__event) - } - }()) - let __resultCpp = __result - return bridge.create_Result_double_(__resultCpp) - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_double_(__exceptionPtr) - } - } - - @inline(__always) - public final func removeDownloadListener(id: Double) -> bridge.Result_void_ { - do { - try self.__implementation.removeDownloadListener(id: id) - return bridge.create_Result_void_() - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_void_(__exceptionPtr) - } - } -} diff --git a/native-modules/react-native-app-update/nitrogen/generated/shared/c++/AppUpdateDownloadParams.hpp b/native-modules/react-native-app-update/nitrogen/generated/shared/c++/AppUpdateDownloadParams.hpp deleted file mode 100644 index 93986eb..0000000 --- a/native-modules/react-native-app-update/nitrogen/generated/shared/c++/AppUpdateDownloadParams.hpp +++ /dev/null @@ -1,83 +0,0 @@ -/// -/// AppUpdateDownloadParams.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif - - - -#include - -namespace margelo::nitro::reactnativeappupdate { - - /** - * A struct which can be represented as a JavaScript object (AppUpdateDownloadParams). - */ - struct AppUpdateDownloadParams { - public: - std::string downloadUrl SWIFT_PRIVATE; - std::string notificationTitle SWIFT_PRIVATE; - double fileSize SWIFT_PRIVATE; - - public: - AppUpdateDownloadParams() = default; - explicit AppUpdateDownloadParams(std::string downloadUrl, std::string notificationTitle, double fileSize): downloadUrl(downloadUrl), notificationTitle(notificationTitle), fileSize(fileSize) {} - }; - -} // namespace margelo::nitro::reactnativeappupdate - -namespace margelo::nitro { - - // C++ AppUpdateDownloadParams <> JS AppUpdateDownloadParams (object) - template <> - struct JSIConverter final { - static inline margelo::nitro::reactnativeappupdate::AppUpdateDownloadParams fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { - jsi::Object obj = arg.asObject(runtime); - return margelo::nitro::reactnativeappupdate::AppUpdateDownloadParams( - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "downloadUrl")), - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "notificationTitle")), - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "fileSize")) - ); - } - static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::reactnativeappupdate::AppUpdateDownloadParams& arg) { - jsi::Object obj(runtime); - obj.setProperty(runtime, "downloadUrl", JSIConverter::toJSI(runtime, arg.downloadUrl)); - obj.setProperty(runtime, "notificationTitle", JSIConverter::toJSI(runtime, arg.notificationTitle)); - obj.setProperty(runtime, "fileSize", JSIConverter::toJSI(runtime, arg.fileSize)); - return obj; - } - static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) { - if (!value.isObject()) { - return false; - } - jsi::Object obj = value.getObject(runtime); - if (!nitro::isPlainObject(runtime, obj)) { - return false; - } - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "downloadUrl"))) return false; - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "notificationTitle"))) return false; - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "fileSize"))) return false; - return true; - } - }; - -} // namespace margelo::nitro diff --git a/native-modules/react-native-app-update/nitrogen/generated/shared/c++/AppUpdateFileParams.hpp b/native-modules/react-native-app-update/nitrogen/generated/shared/c++/AppUpdateFileParams.hpp deleted file mode 100644 index a5612cf..0000000 --- a/native-modules/react-native-app-update/nitrogen/generated/shared/c++/AppUpdateFileParams.hpp +++ /dev/null @@ -1,75 +0,0 @@ -/// -/// AppUpdateFileParams.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif - - - -#include - -namespace margelo::nitro::reactnativeappupdate { - - /** - * A struct which can be represented as a JavaScript object (AppUpdateFileParams). - */ - struct AppUpdateFileParams { - public: - std::string downloadUrl SWIFT_PRIVATE; - - public: - AppUpdateFileParams() = default; - explicit AppUpdateFileParams(std::string downloadUrl): downloadUrl(downloadUrl) {} - }; - -} // namespace margelo::nitro::reactnativeappupdate - -namespace margelo::nitro { - - // C++ AppUpdateFileParams <> JS AppUpdateFileParams (object) - template <> - struct JSIConverter final { - static inline margelo::nitro::reactnativeappupdate::AppUpdateFileParams fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { - jsi::Object obj = arg.asObject(runtime); - return margelo::nitro::reactnativeappupdate::AppUpdateFileParams( - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "downloadUrl")) - ); - } - static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::reactnativeappupdate::AppUpdateFileParams& arg) { - jsi::Object obj(runtime); - obj.setProperty(runtime, "downloadUrl", JSIConverter::toJSI(runtime, arg.downloadUrl)); - return obj; - } - static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) { - if (!value.isObject()) { - return false; - } - jsi::Object obj = value.getObject(runtime); - if (!nitro::isPlainObject(runtime, obj)) { - return false; - } - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "downloadUrl"))) return false; - return true; - } - }; - -} // namespace margelo::nitro diff --git a/native-modules/react-native-app-update/nitrogen/generated/shared/c++/DownloadEvent.hpp b/native-modules/react-native-app-update/nitrogen/generated/shared/c++/DownloadEvent.hpp deleted file mode 100644 index e9afe31..0000000 --- a/native-modules/react-native-app-update/nitrogen/generated/shared/c++/DownloadEvent.hpp +++ /dev/null @@ -1,83 +0,0 @@ -/// -/// DownloadEvent.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif - - - -#include - -namespace margelo::nitro::reactnativeappupdate { - - /** - * A struct which can be represented as a JavaScript object (DownloadEvent). - */ - struct DownloadEvent { - public: - std::string type SWIFT_PRIVATE; - double progress SWIFT_PRIVATE; - std::string message SWIFT_PRIVATE; - - public: - DownloadEvent() = default; - explicit DownloadEvent(std::string type, double progress, std::string message): type(type), progress(progress), message(message) {} - }; - -} // namespace margelo::nitro::reactnativeappupdate - -namespace margelo::nitro { - - // C++ DownloadEvent <> JS DownloadEvent (object) - template <> - struct JSIConverter final { - static inline margelo::nitro::reactnativeappupdate::DownloadEvent fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { - jsi::Object obj = arg.asObject(runtime); - return margelo::nitro::reactnativeappupdate::DownloadEvent( - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "type")), - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "progress")), - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "message")) - ); - } - static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::reactnativeappupdate::DownloadEvent& arg) { - jsi::Object obj(runtime); - obj.setProperty(runtime, "type", JSIConverter::toJSI(runtime, arg.type)); - obj.setProperty(runtime, "progress", JSIConverter::toJSI(runtime, arg.progress)); - obj.setProperty(runtime, "message", JSIConverter::toJSI(runtime, arg.message)); - return obj; - } - static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) { - if (!value.isObject()) { - return false; - } - jsi::Object obj = value.getObject(runtime); - if (!nitro::isPlainObject(runtime, obj)) { - return false; - } - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "type"))) return false; - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "progress"))) return false; - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "message"))) return false; - return true; - } - }; - -} // namespace margelo::nitro diff --git a/native-modules/react-native-app-update/nitrogen/generated/shared/c++/HybridReactNativeAppUpdateSpec.cpp b/native-modules/react-native-app-update/nitrogen/generated/shared/c++/HybridReactNativeAppUpdateSpec.cpp deleted file mode 100644 index f8c84f0..0000000 --- a/native-modules/react-native-app-update/nitrogen/generated/shared/c++/HybridReactNativeAppUpdateSpec.cpp +++ /dev/null @@ -1,31 +0,0 @@ -/// -/// HybridReactNativeAppUpdateSpec.cpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#include "HybridReactNativeAppUpdateSpec.hpp" - -namespace margelo::nitro::reactnativeappupdate { - - void HybridReactNativeAppUpdateSpec::loadHybridMethods() { - // load base methods/properties - HybridObject::loadHybridMethods(); - // load custom methods/properties - registerHybrids(this, [](Prototype& prototype) { - prototype.registerHybridMethod("downloadAPK", &HybridReactNativeAppUpdateSpec::downloadAPK); - prototype.registerHybridMethod("downloadASC", &HybridReactNativeAppUpdateSpec::downloadASC); - prototype.registerHybridMethod("verifyASC", &HybridReactNativeAppUpdateSpec::verifyASC); - prototype.registerHybridMethod("verifyAPK", &HybridReactNativeAppUpdateSpec::verifyAPK); - prototype.registerHybridMethod("installAPK", &HybridReactNativeAppUpdateSpec::installAPK); - prototype.registerHybridMethod("clearCache", &HybridReactNativeAppUpdateSpec::clearCache); - prototype.registerHybridMethod("testVerification", &HybridReactNativeAppUpdateSpec::testVerification); - prototype.registerHybridMethod("testSkipVerification", &HybridReactNativeAppUpdateSpec::testSkipVerification); - prototype.registerHybridMethod("isSkipGpgVerificationAllowed", &HybridReactNativeAppUpdateSpec::isSkipGpgVerificationAllowed); - prototype.registerHybridMethod("addDownloadListener", &HybridReactNativeAppUpdateSpec::addDownloadListener); - prototype.registerHybridMethod("removeDownloadListener", &HybridReactNativeAppUpdateSpec::removeDownloadListener); - }); - } - -} // namespace margelo::nitro::reactnativeappupdate diff --git a/native-modules/react-native-app-update/nitrogen/generated/shared/c++/HybridReactNativeAppUpdateSpec.hpp b/native-modules/react-native-app-update/nitrogen/generated/shared/c++/HybridReactNativeAppUpdateSpec.hpp deleted file mode 100644 index 5bacf09..0000000 --- a/native-modules/react-native-app-update/nitrogen/generated/shared/c++/HybridReactNativeAppUpdateSpec.hpp +++ /dev/null @@ -1,81 +0,0 @@ -/// -/// HybridReactNativeAppUpdateSpec.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif - -// Forward declaration of `AppUpdateDownloadParams` to properly resolve imports. -namespace margelo::nitro::reactnativeappupdate { struct AppUpdateDownloadParams; } -// Forward declaration of `AppUpdateFileParams` to properly resolve imports. -namespace margelo::nitro::reactnativeappupdate { struct AppUpdateFileParams; } -// Forward declaration of `DownloadEvent` to properly resolve imports. -namespace margelo::nitro::reactnativeappupdate { struct DownloadEvent; } - -#include -#include "AppUpdateDownloadParams.hpp" -#include "AppUpdateFileParams.hpp" -#include "DownloadEvent.hpp" -#include - -namespace margelo::nitro::reactnativeappupdate { - - using namespace margelo::nitro; - - /** - * An abstract base class for `ReactNativeAppUpdate` - * Inherit this class to create instances of `HybridReactNativeAppUpdateSpec` in C++. - * You must explicitly call `HybridObject`'s constructor yourself, because it is virtual. - * @example - * ```cpp - * class HybridReactNativeAppUpdate: public HybridReactNativeAppUpdateSpec { - * public: - * HybridReactNativeAppUpdate(...): HybridObject(TAG) { ... } - * // ... - * }; - * ``` - */ - class HybridReactNativeAppUpdateSpec: public virtual HybridObject { - public: - // Constructor - explicit HybridReactNativeAppUpdateSpec(): HybridObject(TAG) { } - - // Destructor - ~HybridReactNativeAppUpdateSpec() override = default; - - public: - // Properties - - - public: - // Methods - virtual std::shared_ptr> downloadAPK(const AppUpdateDownloadParams& params) = 0; - virtual std::shared_ptr> downloadASC(const AppUpdateFileParams& params) = 0; - virtual std::shared_ptr> verifyASC(const AppUpdateFileParams& params) = 0; - virtual std::shared_ptr> verifyAPK(const AppUpdateFileParams& params) = 0; - virtual std::shared_ptr> installAPK(const AppUpdateFileParams& params) = 0; - virtual std::shared_ptr> clearCache() = 0; - virtual std::shared_ptr> testVerification() = 0; - virtual std::shared_ptr> testSkipVerification() = 0; - virtual bool isSkipGpgVerificationAllowed() = 0; - virtual double addDownloadListener(const std::function& callback) = 0; - virtual void removeDownloadListener(double id) = 0; - - protected: - // Hybrid Setup - void loadHybridMethods() override; - - protected: - // Tag for logging - static constexpr auto TAG = "ReactNativeAppUpdate"; - }; - -} // namespace margelo::nitro::reactnativeappupdate diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/.gitattributes b/native-modules/react-native-bundle-update/nitrogen/generated/.gitattributes deleted file mode 100644 index fb7a0d5..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -** linguist-generated=true diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/android/c++/JAscFileInfo.hpp b/native-modules/react-native-bundle-update/nitrogen/generated/android/c++/JAscFileInfo.hpp deleted file mode 100644 index 1c3dd45..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/android/c++/JAscFileInfo.hpp +++ /dev/null @@ -1,65 +0,0 @@ -/// -/// JAscFileInfo.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#include -#include "AscFileInfo.hpp" - -#include - -namespace margelo::nitro::reactnativebundleupdate { - - using namespace facebook; - - /** - * The C++ JNI bridge between the C++ struct "AscFileInfo" and the the Kotlin data class "AscFileInfo". - */ - struct JAscFileInfo final: public jni::JavaClass { - public: - static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/reactnativebundleupdate/AscFileInfo;"; - - public: - /** - * Convert this Java/Kotlin-based struct to the C++ struct AscFileInfo by copying all values to C++. - */ - [[maybe_unused]] - [[nodiscard]] - AscFileInfo toCpp() const { - static const auto clazz = javaClassStatic(); - static const auto fieldFileName = clazz->getField("fileName"); - jni::local_ref fileName = this->getFieldValue(fieldFileName); - static const auto fieldFilePath = clazz->getField("filePath"); - jni::local_ref filePath = this->getFieldValue(fieldFilePath); - static const auto fieldFileSize = clazz->getField("fileSize"); - double fileSize = this->getFieldValue(fieldFileSize); - return AscFileInfo( - fileName->toStdString(), - filePath->toStdString(), - fileSize - ); - } - - public: - /** - * Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java. - */ - [[maybe_unused]] - static jni::local_ref fromCpp(const AscFileInfo& value) { - using JSignature = JAscFileInfo(jni::alias_ref, jni::alias_ref, double); - static const auto clazz = javaClassStatic(); - static const auto create = clazz->getStaticMethod("fromCpp"); - return create( - clazz, - jni::make_jstring(value.fileName), - jni::make_jstring(value.filePath), - value.fileSize - ); - } - }; - -} // namespace margelo::nitro::reactnativebundleupdate diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/android/c++/JBundleDownloadASCParams.hpp b/native-modules/react-native-bundle-update/nitrogen/generated/android/c++/JBundleDownloadASCParams.hpp deleted file mode 100644 index 1dddb90..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/android/c++/JBundleDownloadASCParams.hpp +++ /dev/null @@ -1,77 +0,0 @@ -/// -/// JBundleDownloadASCParams.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#include -#include "BundleDownloadASCParams.hpp" - -#include - -namespace margelo::nitro::reactnativebundleupdate { - - using namespace facebook; - - /** - * The C++ JNI bridge between the C++ struct "BundleDownloadASCParams" and the the Kotlin data class "BundleDownloadASCParams". - */ - struct JBundleDownloadASCParams final: public jni::JavaClass { - public: - static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/reactnativebundleupdate/BundleDownloadASCParams;"; - - public: - /** - * Convert this Java/Kotlin-based struct to the C++ struct BundleDownloadASCParams by copying all values to C++. - */ - [[maybe_unused]] - [[nodiscard]] - BundleDownloadASCParams toCpp() const { - static const auto clazz = javaClassStatic(); - static const auto fieldDownloadUrl = clazz->getField("downloadUrl"); - jni::local_ref downloadUrl = this->getFieldValue(fieldDownloadUrl); - static const auto fieldDownloadedFile = clazz->getField("downloadedFile"); - jni::local_ref downloadedFile = this->getFieldValue(fieldDownloadedFile); - static const auto fieldSignature = clazz->getField("signature"); - jni::local_ref signature = this->getFieldValue(fieldSignature); - static const auto fieldLatestVersion = clazz->getField("latestVersion"); - jni::local_ref latestVersion = this->getFieldValue(fieldLatestVersion); - static const auto fieldBundleVersion = clazz->getField("bundleVersion"); - jni::local_ref bundleVersion = this->getFieldValue(fieldBundleVersion); - static const auto fieldSha256 = clazz->getField("sha256"); - jni::local_ref sha256 = this->getFieldValue(fieldSha256); - return BundleDownloadASCParams( - downloadUrl->toStdString(), - downloadedFile->toStdString(), - signature->toStdString(), - latestVersion->toStdString(), - bundleVersion->toStdString(), - sha256->toStdString() - ); - } - - public: - /** - * Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java. - */ - [[maybe_unused]] - static jni::local_ref fromCpp(const BundleDownloadASCParams& value) { - using JSignature = JBundleDownloadASCParams(jni::alias_ref, jni::alias_ref, jni::alias_ref, jni::alias_ref, jni::alias_ref, jni::alias_ref); - static const auto clazz = javaClassStatic(); - static const auto create = clazz->getStaticMethod("fromCpp"); - return create( - clazz, - jni::make_jstring(value.downloadUrl), - jni::make_jstring(value.downloadedFile), - jni::make_jstring(value.signature), - jni::make_jstring(value.latestVersion), - jni::make_jstring(value.bundleVersion), - jni::make_jstring(value.sha256) - ); - } - }; - -} // namespace margelo::nitro::reactnativebundleupdate diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/android/c++/JBundleDownloadEvent.hpp b/native-modules/react-native-bundle-update/nitrogen/generated/android/c++/JBundleDownloadEvent.hpp deleted file mode 100644 index 518e1af..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/android/c++/JBundleDownloadEvent.hpp +++ /dev/null @@ -1,65 +0,0 @@ -/// -/// JBundleDownloadEvent.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#include -#include "BundleDownloadEvent.hpp" - -#include - -namespace margelo::nitro::reactnativebundleupdate { - - using namespace facebook; - - /** - * The C++ JNI bridge between the C++ struct "BundleDownloadEvent" and the the Kotlin data class "BundleDownloadEvent". - */ - struct JBundleDownloadEvent final: public jni::JavaClass { - public: - static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/reactnativebundleupdate/BundleDownloadEvent;"; - - public: - /** - * Convert this Java/Kotlin-based struct to the C++ struct BundleDownloadEvent by copying all values to C++. - */ - [[maybe_unused]] - [[nodiscard]] - BundleDownloadEvent toCpp() const { - static const auto clazz = javaClassStatic(); - static const auto fieldType = clazz->getField("type"); - jni::local_ref type = this->getFieldValue(fieldType); - static const auto fieldProgress = clazz->getField("progress"); - double progress = this->getFieldValue(fieldProgress); - static const auto fieldMessage = clazz->getField("message"); - jni::local_ref message = this->getFieldValue(fieldMessage); - return BundleDownloadEvent( - type->toStdString(), - progress, - message->toStdString() - ); - } - - public: - /** - * Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java. - */ - [[maybe_unused]] - static jni::local_ref fromCpp(const BundleDownloadEvent& value) { - using JSignature = JBundleDownloadEvent(jni::alias_ref, double, jni::alias_ref); - static const auto clazz = javaClassStatic(); - static const auto create = clazz->getStaticMethod("fromCpp"); - return create( - clazz, - jni::make_jstring(value.type), - value.progress, - jni::make_jstring(value.message) - ); - } - }; - -} // namespace margelo::nitro::reactnativebundleupdate diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/android/c++/JBundleDownloadParams.hpp b/native-modules/react-native-bundle-update/nitrogen/generated/android/c++/JBundleDownloadParams.hpp deleted file mode 100644 index a9c6ef9..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/android/c++/JBundleDownloadParams.hpp +++ /dev/null @@ -1,73 +0,0 @@ -/// -/// JBundleDownloadParams.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#include -#include "BundleDownloadParams.hpp" - -#include - -namespace margelo::nitro::reactnativebundleupdate { - - using namespace facebook; - - /** - * The C++ JNI bridge between the C++ struct "BundleDownloadParams" and the the Kotlin data class "BundleDownloadParams". - */ - struct JBundleDownloadParams final: public jni::JavaClass { - public: - static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/reactnativebundleupdate/BundleDownloadParams;"; - - public: - /** - * Convert this Java/Kotlin-based struct to the C++ struct BundleDownloadParams by copying all values to C++. - */ - [[maybe_unused]] - [[nodiscard]] - BundleDownloadParams toCpp() const { - static const auto clazz = javaClassStatic(); - static const auto fieldDownloadUrl = clazz->getField("downloadUrl"); - jni::local_ref downloadUrl = this->getFieldValue(fieldDownloadUrl); - static const auto fieldLatestVersion = clazz->getField("latestVersion"); - jni::local_ref latestVersion = this->getFieldValue(fieldLatestVersion); - static const auto fieldBundleVersion = clazz->getField("bundleVersion"); - jni::local_ref bundleVersion = this->getFieldValue(fieldBundleVersion); - static const auto fieldFileSize = clazz->getField("fileSize"); - double fileSize = this->getFieldValue(fieldFileSize); - static const auto fieldSha256 = clazz->getField("sha256"); - jni::local_ref sha256 = this->getFieldValue(fieldSha256); - return BundleDownloadParams( - downloadUrl->toStdString(), - latestVersion->toStdString(), - bundleVersion->toStdString(), - fileSize, - sha256->toStdString() - ); - } - - public: - /** - * Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java. - */ - [[maybe_unused]] - static jni::local_ref fromCpp(const BundleDownloadParams& value) { - using JSignature = JBundleDownloadParams(jni::alias_ref, jni::alias_ref, jni::alias_ref, double, jni::alias_ref); - static const auto clazz = javaClassStatic(); - static const auto create = clazz->getStaticMethod("fromCpp"); - return create( - clazz, - jni::make_jstring(value.downloadUrl), - jni::make_jstring(value.latestVersion), - jni::make_jstring(value.bundleVersion), - value.fileSize, - jni::make_jstring(value.sha256) - ); - } - }; - -} // namespace margelo::nitro::reactnativebundleupdate diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/android/c++/JBundleDownloadResult.hpp b/native-modules/react-native-bundle-update/nitrogen/generated/android/c++/JBundleDownloadResult.hpp deleted file mode 100644 index 07f4853..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/android/c++/JBundleDownloadResult.hpp +++ /dev/null @@ -1,73 +0,0 @@ -/// -/// JBundleDownloadResult.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#include -#include "BundleDownloadResult.hpp" - -#include - -namespace margelo::nitro::reactnativebundleupdate { - - using namespace facebook; - - /** - * The C++ JNI bridge between the C++ struct "BundleDownloadResult" and the the Kotlin data class "BundleDownloadResult". - */ - struct JBundleDownloadResult final: public jni::JavaClass { - public: - static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/reactnativebundleupdate/BundleDownloadResult;"; - - public: - /** - * Convert this Java/Kotlin-based struct to the C++ struct BundleDownloadResult by copying all values to C++. - */ - [[maybe_unused]] - [[nodiscard]] - BundleDownloadResult toCpp() const { - static const auto clazz = javaClassStatic(); - static const auto fieldDownloadedFile = clazz->getField("downloadedFile"); - jni::local_ref downloadedFile = this->getFieldValue(fieldDownloadedFile); - static const auto fieldDownloadUrl = clazz->getField("downloadUrl"); - jni::local_ref downloadUrl = this->getFieldValue(fieldDownloadUrl); - static const auto fieldLatestVersion = clazz->getField("latestVersion"); - jni::local_ref latestVersion = this->getFieldValue(fieldLatestVersion); - static const auto fieldBundleVersion = clazz->getField("bundleVersion"); - jni::local_ref bundleVersion = this->getFieldValue(fieldBundleVersion); - static const auto fieldSha256 = clazz->getField("sha256"); - jni::local_ref sha256 = this->getFieldValue(fieldSha256); - return BundleDownloadResult( - downloadedFile->toStdString(), - downloadUrl->toStdString(), - latestVersion->toStdString(), - bundleVersion->toStdString(), - sha256->toStdString() - ); - } - - public: - /** - * Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java. - */ - [[maybe_unused]] - static jni::local_ref fromCpp(const BundleDownloadResult& value) { - using JSignature = JBundleDownloadResult(jni::alias_ref, jni::alias_ref, jni::alias_ref, jni::alias_ref, jni::alias_ref); - static const auto clazz = javaClassStatic(); - static const auto create = clazz->getStaticMethod("fromCpp"); - return create( - clazz, - jni::make_jstring(value.downloadedFile), - jni::make_jstring(value.downloadUrl), - jni::make_jstring(value.latestVersion), - jni::make_jstring(value.bundleVersion), - jni::make_jstring(value.sha256) - ); - } - }; - -} // namespace margelo::nitro::reactnativebundleupdate diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/android/c++/JBundleInstallParams.hpp b/native-modules/react-native-bundle-update/nitrogen/generated/android/c++/JBundleInstallParams.hpp deleted file mode 100644 index cd6e01a..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/android/c++/JBundleInstallParams.hpp +++ /dev/null @@ -1,69 +0,0 @@ -/// -/// JBundleInstallParams.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#include -#include "BundleInstallParams.hpp" - -#include - -namespace margelo::nitro::reactnativebundleupdate { - - using namespace facebook; - - /** - * The C++ JNI bridge between the C++ struct "BundleInstallParams" and the the Kotlin data class "BundleInstallParams". - */ - struct JBundleInstallParams final: public jni::JavaClass { - public: - static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/reactnativebundleupdate/BundleInstallParams;"; - - public: - /** - * Convert this Java/Kotlin-based struct to the C++ struct BundleInstallParams by copying all values to C++. - */ - [[maybe_unused]] - [[nodiscard]] - BundleInstallParams toCpp() const { - static const auto clazz = javaClassStatic(); - static const auto fieldDownloadedFile = clazz->getField("downloadedFile"); - jni::local_ref downloadedFile = this->getFieldValue(fieldDownloadedFile); - static const auto fieldLatestVersion = clazz->getField("latestVersion"); - jni::local_ref latestVersion = this->getFieldValue(fieldLatestVersion); - static const auto fieldBundleVersion = clazz->getField("bundleVersion"); - jni::local_ref bundleVersion = this->getFieldValue(fieldBundleVersion); - static const auto fieldSignature = clazz->getField("signature"); - jni::local_ref signature = this->getFieldValue(fieldSignature); - return BundleInstallParams( - downloadedFile->toStdString(), - latestVersion->toStdString(), - bundleVersion->toStdString(), - signature->toStdString() - ); - } - - public: - /** - * Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java. - */ - [[maybe_unused]] - static jni::local_ref fromCpp(const BundleInstallParams& value) { - using JSignature = JBundleInstallParams(jni::alias_ref, jni::alias_ref, jni::alias_ref, jni::alias_ref); - static const auto clazz = javaClassStatic(); - static const auto create = clazz->getStaticMethod("fromCpp"); - return create( - clazz, - jni::make_jstring(value.downloadedFile), - jni::make_jstring(value.latestVersion), - jni::make_jstring(value.bundleVersion), - jni::make_jstring(value.signature) - ); - } - }; - -} // namespace margelo::nitro::reactnativebundleupdate diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/android/c++/JBundleSwitchParams.hpp b/native-modules/react-native-bundle-update/nitrogen/generated/android/c++/JBundleSwitchParams.hpp deleted file mode 100644 index bb56da8..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/android/c++/JBundleSwitchParams.hpp +++ /dev/null @@ -1,65 +0,0 @@ -/// -/// JBundleSwitchParams.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#include -#include "BundleSwitchParams.hpp" - -#include - -namespace margelo::nitro::reactnativebundleupdate { - - using namespace facebook; - - /** - * The C++ JNI bridge between the C++ struct "BundleSwitchParams" and the the Kotlin data class "BundleSwitchParams". - */ - struct JBundleSwitchParams final: public jni::JavaClass { - public: - static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/reactnativebundleupdate/BundleSwitchParams;"; - - public: - /** - * Convert this Java/Kotlin-based struct to the C++ struct BundleSwitchParams by copying all values to C++. - */ - [[maybe_unused]] - [[nodiscard]] - BundleSwitchParams toCpp() const { - static const auto clazz = javaClassStatic(); - static const auto fieldAppVersion = clazz->getField("appVersion"); - jni::local_ref appVersion = this->getFieldValue(fieldAppVersion); - static const auto fieldBundleVersion = clazz->getField("bundleVersion"); - jni::local_ref bundleVersion = this->getFieldValue(fieldBundleVersion); - static const auto fieldSignature = clazz->getField("signature"); - jni::local_ref signature = this->getFieldValue(fieldSignature); - return BundleSwitchParams( - appVersion->toStdString(), - bundleVersion->toStdString(), - signature->toStdString() - ); - } - - public: - /** - * Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java. - */ - [[maybe_unused]] - static jni::local_ref fromCpp(const BundleSwitchParams& value) { - using JSignature = JBundleSwitchParams(jni::alias_ref, jni::alias_ref, jni::alias_ref); - static const auto clazz = javaClassStatic(); - static const auto create = clazz->getStaticMethod("fromCpp"); - return create( - clazz, - jni::make_jstring(value.appVersion), - jni::make_jstring(value.bundleVersion), - jni::make_jstring(value.signature) - ); - } - }; - -} // namespace margelo::nitro::reactnativebundleupdate diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/android/c++/JBundleVerifyASCParams.hpp b/native-modules/react-native-bundle-update/nitrogen/generated/android/c++/JBundleVerifyASCParams.hpp deleted file mode 100644 index 82611ff..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/android/c++/JBundleVerifyASCParams.hpp +++ /dev/null @@ -1,73 +0,0 @@ -/// -/// JBundleVerifyASCParams.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#include -#include "BundleVerifyASCParams.hpp" - -#include - -namespace margelo::nitro::reactnativebundleupdate { - - using namespace facebook; - - /** - * The C++ JNI bridge between the C++ struct "BundleVerifyASCParams" and the the Kotlin data class "BundleVerifyASCParams". - */ - struct JBundleVerifyASCParams final: public jni::JavaClass { - public: - static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/reactnativebundleupdate/BundleVerifyASCParams;"; - - public: - /** - * Convert this Java/Kotlin-based struct to the C++ struct BundleVerifyASCParams by copying all values to C++. - */ - [[maybe_unused]] - [[nodiscard]] - BundleVerifyASCParams toCpp() const { - static const auto clazz = javaClassStatic(); - static const auto fieldDownloadedFile = clazz->getField("downloadedFile"); - jni::local_ref downloadedFile = this->getFieldValue(fieldDownloadedFile); - static const auto fieldSha256 = clazz->getField("sha256"); - jni::local_ref sha256 = this->getFieldValue(fieldSha256); - static const auto fieldLatestVersion = clazz->getField("latestVersion"); - jni::local_ref latestVersion = this->getFieldValue(fieldLatestVersion); - static const auto fieldBundleVersion = clazz->getField("bundleVersion"); - jni::local_ref bundleVersion = this->getFieldValue(fieldBundleVersion); - static const auto fieldSignature = clazz->getField("signature"); - jni::local_ref signature = this->getFieldValue(fieldSignature); - return BundleVerifyASCParams( - downloadedFile->toStdString(), - sha256->toStdString(), - latestVersion->toStdString(), - bundleVersion->toStdString(), - signature->toStdString() - ); - } - - public: - /** - * Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java. - */ - [[maybe_unused]] - static jni::local_ref fromCpp(const BundleVerifyASCParams& value) { - using JSignature = JBundleVerifyASCParams(jni::alias_ref, jni::alias_ref, jni::alias_ref, jni::alias_ref, jni::alias_ref); - static const auto clazz = javaClassStatic(); - static const auto create = clazz->getStaticMethod("fromCpp"); - return create( - clazz, - jni::make_jstring(value.downloadedFile), - jni::make_jstring(value.sha256), - jni::make_jstring(value.latestVersion), - jni::make_jstring(value.bundleVersion), - jni::make_jstring(value.signature) - ); - } - }; - -} // namespace margelo::nitro::reactnativebundleupdate diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/android/c++/JBundleVerifyParams.hpp b/native-modules/react-native-bundle-update/nitrogen/generated/android/c++/JBundleVerifyParams.hpp deleted file mode 100644 index e4faea1..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/android/c++/JBundleVerifyParams.hpp +++ /dev/null @@ -1,69 +0,0 @@ -/// -/// JBundleVerifyParams.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#include -#include "BundleVerifyParams.hpp" - -#include - -namespace margelo::nitro::reactnativebundleupdate { - - using namespace facebook; - - /** - * The C++ JNI bridge between the C++ struct "BundleVerifyParams" and the the Kotlin data class "BundleVerifyParams". - */ - struct JBundleVerifyParams final: public jni::JavaClass { - public: - static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/reactnativebundleupdate/BundleVerifyParams;"; - - public: - /** - * Convert this Java/Kotlin-based struct to the C++ struct BundleVerifyParams by copying all values to C++. - */ - [[maybe_unused]] - [[nodiscard]] - BundleVerifyParams toCpp() const { - static const auto clazz = javaClassStatic(); - static const auto fieldDownloadedFile = clazz->getField("downloadedFile"); - jni::local_ref downloadedFile = this->getFieldValue(fieldDownloadedFile); - static const auto fieldSha256 = clazz->getField("sha256"); - jni::local_ref sha256 = this->getFieldValue(fieldSha256); - static const auto fieldLatestVersion = clazz->getField("latestVersion"); - jni::local_ref latestVersion = this->getFieldValue(fieldLatestVersion); - static const auto fieldBundleVersion = clazz->getField("bundleVersion"); - jni::local_ref bundleVersion = this->getFieldValue(fieldBundleVersion); - return BundleVerifyParams( - downloadedFile->toStdString(), - sha256->toStdString(), - latestVersion->toStdString(), - bundleVersion->toStdString() - ); - } - - public: - /** - * Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java. - */ - [[maybe_unused]] - static jni::local_ref fromCpp(const BundleVerifyParams& value) { - using JSignature = JBundleVerifyParams(jni::alias_ref, jni::alias_ref, jni::alias_ref, jni::alias_ref); - static const auto clazz = javaClassStatic(); - static const auto create = clazz->getStaticMethod("fromCpp"); - return create( - clazz, - jni::make_jstring(value.downloadedFile), - jni::make_jstring(value.sha256), - jni::make_jstring(value.latestVersion), - jni::make_jstring(value.bundleVersion) - ); - } - }; - -} // namespace margelo::nitro::reactnativebundleupdate diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/android/c++/JFallbackBundleInfo.hpp b/native-modules/react-native-bundle-update/nitrogen/generated/android/c++/JFallbackBundleInfo.hpp deleted file mode 100644 index c578b9a..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/android/c++/JFallbackBundleInfo.hpp +++ /dev/null @@ -1,65 +0,0 @@ -/// -/// JFallbackBundleInfo.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#include -#include "FallbackBundleInfo.hpp" - -#include - -namespace margelo::nitro::reactnativebundleupdate { - - using namespace facebook; - - /** - * The C++ JNI bridge between the C++ struct "FallbackBundleInfo" and the the Kotlin data class "FallbackBundleInfo". - */ - struct JFallbackBundleInfo final: public jni::JavaClass { - public: - static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/reactnativebundleupdate/FallbackBundleInfo;"; - - public: - /** - * Convert this Java/Kotlin-based struct to the C++ struct FallbackBundleInfo by copying all values to C++. - */ - [[maybe_unused]] - [[nodiscard]] - FallbackBundleInfo toCpp() const { - static const auto clazz = javaClassStatic(); - static const auto fieldAppVersion = clazz->getField("appVersion"); - jni::local_ref appVersion = this->getFieldValue(fieldAppVersion); - static const auto fieldBundleVersion = clazz->getField("bundleVersion"); - jni::local_ref bundleVersion = this->getFieldValue(fieldBundleVersion); - static const auto fieldSignature = clazz->getField("signature"); - jni::local_ref signature = this->getFieldValue(fieldSignature); - return FallbackBundleInfo( - appVersion->toStdString(), - bundleVersion->toStdString(), - signature->toStdString() - ); - } - - public: - /** - * Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java. - */ - [[maybe_unused]] - static jni::local_ref fromCpp(const FallbackBundleInfo& value) { - using JSignature = JFallbackBundleInfo(jni::alias_ref, jni::alias_ref, jni::alias_ref); - static const auto clazz = javaClassStatic(); - static const auto create = clazz->getStaticMethod("fromCpp"); - return create( - clazz, - jni::make_jstring(value.appVersion), - jni::make_jstring(value.bundleVersion), - jni::make_jstring(value.signature) - ); - } - }; - -} // namespace margelo::nitro::reactnativebundleupdate diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/android/c++/JFunc_void_BundleDownloadEvent.hpp b/native-modules/react-native-bundle-update/nitrogen/generated/android/c++/JFunc_void_BundleDownloadEvent.hpp deleted file mode 100644 index 83a1fd6..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/android/c++/JFunc_void_BundleDownloadEvent.hpp +++ /dev/null @@ -1,78 +0,0 @@ -/// -/// JFunc_void_BundleDownloadEvent.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#include -#include - -#include "BundleDownloadEvent.hpp" -#include -#include -#include "JBundleDownloadEvent.hpp" -#include - -namespace margelo::nitro::reactnativebundleupdate { - - using namespace facebook; - - /** - * Represents the Java/Kotlin callback `(event: BundleDownloadEvent) -> Unit`. - * This can be passed around between C++ and Java/Kotlin. - */ - struct JFunc_void_BundleDownloadEvent: public jni::JavaClass { - public: - static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/reactnativebundleupdate/Func_void_BundleDownloadEvent;"; - - public: - /** - * Invokes the function this `JFunc_void_BundleDownloadEvent` instance holds through JNI. - */ - void invoke(const BundleDownloadEvent& event) const { - static const auto method = javaClassStatic()->getMethod /* event */)>("invoke"); - method(self(), JBundleDownloadEvent::fromCpp(event)); - } - }; - - /** - * An implementation of Func_void_BundleDownloadEvent that is backed by a C++ implementation (using `std::function<...>`) - */ - class JFunc_void_BundleDownloadEvent_cxx final: public jni::HybridClass { - public: - static jni::local_ref fromCpp(const std::function& func) { - return JFunc_void_BundleDownloadEvent_cxx::newObjectCxxArgs(func); - } - - public: - /** - * Invokes the C++ `std::function<...>` this `JFunc_void_BundleDownloadEvent_cxx` instance holds. - */ - void invoke_cxx(jni::alias_ref event) { - _func(event->toCpp()); - } - - public: - [[nodiscard]] - inline const std::function& getFunction() const { - return _func; - } - - public: - static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/reactnativebundleupdate/Func_void_BundleDownloadEvent_cxx;"; - static void registerNatives() { - registerHybrid({makeNativeMethod("invoke_cxx", JFunc_void_BundleDownloadEvent_cxx::invoke_cxx)}); - } - - private: - explicit JFunc_void_BundleDownloadEvent_cxx(const std::function& func): _func(func) { } - - private: - friend HybridBase; - std::function _func; - }; - -} // namespace margelo::nitro::reactnativebundleupdate diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/android/c++/JHybridReactNativeBundleUpdateSpec.cpp b/native-modules/react-native-bundle-update/nitrogen/generated/android/c++/JHybridReactNativeBundleUpdateSpec.cpp deleted file mode 100644 index 4443d97..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/android/c++/JHybridReactNativeBundleUpdateSpec.cpp +++ /dev/null @@ -1,527 +0,0 @@ -/// -/// JHybridReactNativeBundleUpdateSpec.cpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#include "JHybridReactNativeBundleUpdateSpec.hpp" - -// Forward declaration of `BundleDownloadResult` to properly resolve imports. -namespace margelo::nitro::reactnativebundleupdate { struct BundleDownloadResult; } -// Forward declaration of `TestResult` to properly resolve imports. -namespace margelo::nitro::reactnativebundleupdate { struct TestResult; } -// Forward declaration of `FallbackBundleInfo` to properly resolve imports. -namespace margelo::nitro::reactnativebundleupdate { struct FallbackBundleInfo; } -// Forward declaration of `LocalBundleInfo` to properly resolve imports. -namespace margelo::nitro::reactnativebundleupdate { struct LocalBundleInfo; } -// Forward declaration of `AscFileInfo` to properly resolve imports. -namespace margelo::nitro::reactnativebundleupdate { struct AscFileInfo; } -// Forward declaration of `BundleDownloadParams` to properly resolve imports. -namespace margelo::nitro::reactnativebundleupdate { struct BundleDownloadParams; } -// Forward declaration of `BundleVerifyParams` to properly resolve imports. -namespace margelo::nitro::reactnativebundleupdate { struct BundleVerifyParams; } -// Forward declaration of `BundleVerifyASCParams` to properly resolve imports. -namespace margelo::nitro::reactnativebundleupdate { struct BundleVerifyASCParams; } -// Forward declaration of `BundleDownloadASCParams` to properly resolve imports. -namespace margelo::nitro::reactnativebundleupdate { struct BundleDownloadASCParams; } -// Forward declaration of `BundleInstallParams` to properly resolve imports. -namespace margelo::nitro::reactnativebundleupdate { struct BundleInstallParams; } -// Forward declaration of `BundleSwitchParams` to properly resolve imports. -namespace margelo::nitro::reactnativebundleupdate { struct BundleSwitchParams; } -// Forward declaration of `BundleDownloadEvent` to properly resolve imports. -namespace margelo::nitro::reactnativebundleupdate { struct BundleDownloadEvent; } - -#include "BundleDownloadResult.hpp" -#include -#include -#include "JBundleDownloadResult.hpp" -#include -#include "TestResult.hpp" -#include "JTestResult.hpp" -#include "FallbackBundleInfo.hpp" -#include -#include "JFallbackBundleInfo.hpp" -#include "LocalBundleInfo.hpp" -#include "JLocalBundleInfo.hpp" -#include "AscFileInfo.hpp" -#include "JAscFileInfo.hpp" -#include "BundleDownloadParams.hpp" -#include "JBundleDownloadParams.hpp" -#include "BundleVerifyParams.hpp" -#include "JBundleVerifyParams.hpp" -#include "BundleVerifyASCParams.hpp" -#include "JBundleVerifyASCParams.hpp" -#include "BundleDownloadASCParams.hpp" -#include "JBundleDownloadASCParams.hpp" -#include "BundleInstallParams.hpp" -#include "JBundleInstallParams.hpp" -#include "BundleSwitchParams.hpp" -#include "JBundleSwitchParams.hpp" -#include "BundleDownloadEvent.hpp" -#include -#include "JFunc_void_BundleDownloadEvent.hpp" -#include -#include "JBundleDownloadEvent.hpp" - -namespace margelo::nitro::reactnativebundleupdate { - - jni::local_ref JHybridReactNativeBundleUpdateSpec::initHybrid(jni::alias_ref jThis) { - return makeCxxInstance(jThis); - } - - void JHybridReactNativeBundleUpdateSpec::registerNatives() { - registerHybrid({ - makeNativeMethod("initHybrid", JHybridReactNativeBundleUpdateSpec::initHybrid), - }); - } - - size_t JHybridReactNativeBundleUpdateSpec::getExternalMemorySize() noexcept { - static const auto method = javaClassStatic()->getMethod("getMemorySize"); - return method(_javaPart); - } - - void JHybridReactNativeBundleUpdateSpec::dispose() noexcept { - static const auto method = javaClassStatic()->getMethod("dispose"); - method(_javaPart); - } - - std::string JHybridReactNativeBundleUpdateSpec::toString() { - static const auto method = javaClassStatic()->getMethod("toString"); - auto javaString = method(_javaPart); - return javaString->toStdString(); - } - - // Properties - - - // Methods - std::shared_ptr> JHybridReactNativeBundleUpdateSpec::downloadBundle(const BundleDownloadParams& params) { - static const auto method = javaClassStatic()->getMethod(jni::alias_ref /* params */)>("downloadBundle"); - auto __result = method(_javaPart, JBundleDownloadParams::fromCpp(params)); - return [&]() { - auto __promise = Promise::create(); - __result->cthis()->addOnResolvedListener([=](const jni::alias_ref& __boxedResult) { - auto __result = jni::static_ref_cast(__boxedResult); - __promise->resolve(__result->toCpp()); - }); - __result->cthis()->addOnRejectedListener([=](const jni::alias_ref& __throwable) { - jni::JniException __jniError(__throwable); - __promise->reject(std::make_exception_ptr(__jniError)); - }); - return __promise; - }(); - } - std::shared_ptr> JHybridReactNativeBundleUpdateSpec::verifyBundle(const BundleVerifyParams& params) { - static const auto method = javaClassStatic()->getMethod(jni::alias_ref /* params */)>("verifyBundle"); - auto __result = method(_javaPart, JBundleVerifyParams::fromCpp(params)); - return [&]() { - auto __promise = Promise::create(); - __result->cthis()->addOnResolvedListener([=](const jni::alias_ref& /* unit */) { - __promise->resolve(); - }); - __result->cthis()->addOnRejectedListener([=](const jni::alias_ref& __throwable) { - jni::JniException __jniError(__throwable); - __promise->reject(std::make_exception_ptr(__jniError)); - }); - return __promise; - }(); - } - std::shared_ptr> JHybridReactNativeBundleUpdateSpec::verifyBundleASC(const BundleVerifyASCParams& params) { - static const auto method = javaClassStatic()->getMethod(jni::alias_ref /* params */)>("verifyBundleASC"); - auto __result = method(_javaPart, JBundleVerifyASCParams::fromCpp(params)); - return [&]() { - auto __promise = Promise::create(); - __result->cthis()->addOnResolvedListener([=](const jni::alias_ref& /* unit */) { - __promise->resolve(); - }); - __result->cthis()->addOnRejectedListener([=](const jni::alias_ref& __throwable) { - jni::JniException __jniError(__throwable); - __promise->reject(std::make_exception_ptr(__jniError)); - }); - return __promise; - }(); - } - std::shared_ptr> JHybridReactNativeBundleUpdateSpec::downloadBundleASC(const BundleDownloadASCParams& params) { - static const auto method = javaClassStatic()->getMethod(jni::alias_ref /* params */)>("downloadBundleASC"); - auto __result = method(_javaPart, JBundleDownloadASCParams::fromCpp(params)); - return [&]() { - auto __promise = Promise::create(); - __result->cthis()->addOnResolvedListener([=](const jni::alias_ref& /* unit */) { - __promise->resolve(); - }); - __result->cthis()->addOnRejectedListener([=](const jni::alias_ref& __throwable) { - jni::JniException __jniError(__throwable); - __promise->reject(std::make_exception_ptr(__jniError)); - }); - return __promise; - }(); - } - std::shared_ptr> JHybridReactNativeBundleUpdateSpec::installBundle(const BundleInstallParams& params) { - static const auto method = javaClassStatic()->getMethod(jni::alias_ref /* params */)>("installBundle"); - auto __result = method(_javaPart, JBundleInstallParams::fromCpp(params)); - return [&]() { - auto __promise = Promise::create(); - __result->cthis()->addOnResolvedListener([=](const jni::alias_ref& /* unit */) { - __promise->resolve(); - }); - __result->cthis()->addOnRejectedListener([=](const jni::alias_ref& __throwable) { - jni::JniException __jniError(__throwable); - __promise->reject(std::make_exception_ptr(__jniError)); - }); - return __promise; - }(); - } - std::shared_ptr> JHybridReactNativeBundleUpdateSpec::clearBundle() { - static const auto method = javaClassStatic()->getMethod()>("clearBundle"); - auto __result = method(_javaPart); - return [&]() { - auto __promise = Promise::create(); - __result->cthis()->addOnResolvedListener([=](const jni::alias_ref& /* unit */) { - __promise->resolve(); - }); - __result->cthis()->addOnRejectedListener([=](const jni::alias_ref& __throwable) { - jni::JniException __jniError(__throwable); - __promise->reject(std::make_exception_ptr(__jniError)); - }); - return __promise; - }(); - } - std::shared_ptr> JHybridReactNativeBundleUpdateSpec::clearAllJSBundleData() { - static const auto method = javaClassStatic()->getMethod()>("clearAllJSBundleData"); - auto __result = method(_javaPart); - return [&]() { - auto __promise = Promise::create(); - __result->cthis()->addOnResolvedListener([=](const jni::alias_ref& __boxedResult) { - auto __result = jni::static_ref_cast(__boxedResult); - __promise->resolve(__result->toCpp()); - }); - __result->cthis()->addOnRejectedListener([=](const jni::alias_ref& __throwable) { - jni::JniException __jniError(__throwable); - __promise->reject(std::make_exception_ptr(__jniError)); - }); - return __promise; - }(); - } - std::shared_ptr> JHybridReactNativeBundleUpdateSpec::resetToBuiltInBundle() { - static const auto method = javaClassStatic()->getMethod()>("resetToBuiltInBundle"); - auto __result = method(_javaPart); - return [&]() { - auto __promise = Promise::create(); - __result->cthis()->addOnResolvedListener([=](const jni::alias_ref& /* unit */) { - __promise->resolve(); - }); - __result->cthis()->addOnRejectedListener([=](const jni::alias_ref& __throwable) { - jni::JniException __jniError(__throwable); - __promise->reject(std::make_exception_ptr(__jniError)); - }); - return __promise; - }(); - } - std::shared_ptr>> JHybridReactNativeBundleUpdateSpec::getFallbackUpdateBundleData() { - static const auto method = javaClassStatic()->getMethod()>("getFallbackUpdateBundleData"); - auto __result = method(_javaPart); - return [&]() { - auto __promise = Promise>::create(); - __result->cthis()->addOnResolvedListener([=](const jni::alias_ref& __boxedResult) { - auto __result = jni::static_ref_cast>(__boxedResult); - __promise->resolve([&]() { - size_t __size = __result->size(); - std::vector __vector; - __vector.reserve(__size); - for (size_t __i = 0; __i < __size; __i++) { - auto __element = __result->getElement(__i); - __vector.push_back(__element->toCpp()); - } - return __vector; - }()); - }); - __result->cthis()->addOnRejectedListener([=](const jni::alias_ref& __throwable) { - jni::JniException __jniError(__throwable); - __promise->reject(std::make_exception_ptr(__jniError)); - }); - return __promise; - }(); - } - std::shared_ptr> JHybridReactNativeBundleUpdateSpec::setCurrentUpdateBundleData(const BundleSwitchParams& params) { - static const auto method = javaClassStatic()->getMethod(jni::alias_ref /* params */)>("setCurrentUpdateBundleData"); - auto __result = method(_javaPart, JBundleSwitchParams::fromCpp(params)); - return [&]() { - auto __promise = Promise::create(); - __result->cthis()->addOnResolvedListener([=](const jni::alias_ref& /* unit */) { - __promise->resolve(); - }); - __result->cthis()->addOnRejectedListener([=](const jni::alias_ref& __throwable) { - jni::JniException __jniError(__throwable); - __promise->reject(std::make_exception_ptr(__jniError)); - }); - return __promise; - }(); - } - std::string JHybridReactNativeBundleUpdateSpec::getWebEmbedPath() { - static const auto method = javaClassStatic()->getMethod()>("getWebEmbedPath"); - auto __result = method(_javaPart); - return __result->toStdString(); - } - std::shared_ptr> JHybridReactNativeBundleUpdateSpec::getWebEmbedPathAsync() { - static const auto method = javaClassStatic()->getMethod()>("getWebEmbedPathAsync"); - auto __result = method(_javaPart); - return [&]() { - auto __promise = Promise::create(); - __result->cthis()->addOnResolvedListener([=](const jni::alias_ref& __boxedResult) { - auto __result = jni::static_ref_cast(__boxedResult); - __promise->resolve(__result->toStdString()); - }); - __result->cthis()->addOnRejectedListener([=](const jni::alias_ref& __throwable) { - jni::JniException __jniError(__throwable); - __promise->reject(std::make_exception_ptr(__jniError)); - }); - return __promise; - }(); - } - std::string JHybridReactNativeBundleUpdateSpec::getJsBundlePath() { - static const auto method = javaClassStatic()->getMethod()>("getJsBundlePath"); - auto __result = method(_javaPart); - return __result->toStdString(); - } - std::shared_ptr> JHybridReactNativeBundleUpdateSpec::getJsBundlePathAsync() { - static const auto method = javaClassStatic()->getMethod()>("getJsBundlePathAsync"); - auto __result = method(_javaPart); - return [&]() { - auto __promise = Promise::create(); - __result->cthis()->addOnResolvedListener([=](const jni::alias_ref& __boxedResult) { - auto __result = jni::static_ref_cast(__boxedResult); - __promise->resolve(__result->toStdString()); - }); - __result->cthis()->addOnRejectedListener([=](const jni::alias_ref& __throwable) { - jni::JniException __jniError(__throwable); - __promise->reject(std::make_exception_ptr(__jniError)); - }); - return __promise; - }(); - } - std::shared_ptr> JHybridReactNativeBundleUpdateSpec::getNativeAppVersion() { - static const auto method = javaClassStatic()->getMethod()>("getNativeAppVersion"); - auto __result = method(_javaPart); - return [&]() { - auto __promise = Promise::create(); - __result->cthis()->addOnResolvedListener([=](const jni::alias_ref& __boxedResult) { - auto __result = jni::static_ref_cast(__boxedResult); - __promise->resolve(__result->toStdString()); - }); - __result->cthis()->addOnRejectedListener([=](const jni::alias_ref& __throwable) { - jni::JniException __jniError(__throwable); - __promise->reject(std::make_exception_ptr(__jniError)); - }); - return __promise; - }(); - } - std::shared_ptr> JHybridReactNativeBundleUpdateSpec::testVerification() { - static const auto method = javaClassStatic()->getMethod()>("testVerification"); - auto __result = method(_javaPart); - return [&]() { - auto __promise = Promise::create(); - __result->cthis()->addOnResolvedListener([=](const jni::alias_ref& __boxedResult) { - auto __result = jni::static_ref_cast(__boxedResult); - __promise->resolve(static_cast(__result->value())); - }); - __result->cthis()->addOnRejectedListener([=](const jni::alias_ref& __throwable) { - jni::JniException __jniError(__throwable); - __promise->reject(std::make_exception_ptr(__jniError)); - }); - return __promise; - }(); - } - std::shared_ptr> JHybridReactNativeBundleUpdateSpec::testSkipVerification() { - static const auto method = javaClassStatic()->getMethod()>("testSkipVerification"); - auto __result = method(_javaPart); - return [&]() { - auto __promise = Promise::create(); - __result->cthis()->addOnResolvedListener([=](const jni::alias_ref& __boxedResult) { - auto __result = jni::static_ref_cast(__boxedResult); - __promise->resolve(static_cast(__result->value())); - }); - __result->cthis()->addOnRejectedListener([=](const jni::alias_ref& __throwable) { - jni::JniException __jniError(__throwable); - __promise->reject(std::make_exception_ptr(__jniError)); - }); - return __promise; - }(); - } - bool JHybridReactNativeBundleUpdateSpec::isSkipGpgVerificationAllowed() { - static const auto method = javaClassStatic()->getMethod("isSkipGpgVerificationAllowed"); - auto __result = method(_javaPart); - return static_cast(__result); - } - std::shared_ptr> JHybridReactNativeBundleUpdateSpec::isBundleExists(const std::string& appVersion, const std::string& bundleVersion) { - static const auto method = javaClassStatic()->getMethod(jni::alias_ref /* appVersion */, jni::alias_ref /* bundleVersion */)>("isBundleExists"); - auto __result = method(_javaPart, jni::make_jstring(appVersion), jni::make_jstring(bundleVersion)); - return [&]() { - auto __promise = Promise::create(); - __result->cthis()->addOnResolvedListener([=](const jni::alias_ref& __boxedResult) { - auto __result = jni::static_ref_cast(__boxedResult); - __promise->resolve(static_cast(__result->value())); - }); - __result->cthis()->addOnRejectedListener([=](const jni::alias_ref& __throwable) { - jni::JniException __jniError(__throwable); - __promise->reject(std::make_exception_ptr(__jniError)); - }); - return __promise; - }(); - } - std::shared_ptr> JHybridReactNativeBundleUpdateSpec::verifyExtractedBundle(const std::string& appVersion, const std::string& bundleVersion) { - static const auto method = javaClassStatic()->getMethod(jni::alias_ref /* appVersion */, jni::alias_ref /* bundleVersion */)>("verifyExtractedBundle"); - auto __result = method(_javaPart, jni::make_jstring(appVersion), jni::make_jstring(bundleVersion)); - return [&]() { - auto __promise = Promise::create(); - __result->cthis()->addOnResolvedListener([=](const jni::alias_ref& /* unit */) { - __promise->resolve(); - }); - __result->cthis()->addOnRejectedListener([=](const jni::alias_ref& __throwable) { - jni::JniException __jniError(__throwable); - __promise->reject(std::make_exception_ptr(__jniError)); - }); - return __promise; - }(); - } - std::shared_ptr>> JHybridReactNativeBundleUpdateSpec::listLocalBundles() { - static const auto method = javaClassStatic()->getMethod()>("listLocalBundles"); - auto __result = method(_javaPart); - return [&]() { - auto __promise = Promise>::create(); - __result->cthis()->addOnResolvedListener([=](const jni::alias_ref& __boxedResult) { - auto __result = jni::static_ref_cast>(__boxedResult); - __promise->resolve([&]() { - size_t __size = __result->size(); - std::vector __vector; - __vector.reserve(__size); - for (size_t __i = 0; __i < __size; __i++) { - auto __element = __result->getElement(__i); - __vector.push_back(__element->toCpp()); - } - return __vector; - }()); - }); - __result->cthis()->addOnRejectedListener([=](const jni::alias_ref& __throwable) { - jni::JniException __jniError(__throwable); - __promise->reject(std::make_exception_ptr(__jniError)); - }); - return __promise; - }(); - } - std::shared_ptr>> JHybridReactNativeBundleUpdateSpec::listAscFiles() { - static const auto method = javaClassStatic()->getMethod()>("listAscFiles"); - auto __result = method(_javaPart); - return [&]() { - auto __promise = Promise>::create(); - __result->cthis()->addOnResolvedListener([=](const jni::alias_ref& __boxedResult) { - auto __result = jni::static_ref_cast>(__boxedResult); - __promise->resolve([&]() { - size_t __size = __result->size(); - std::vector __vector; - __vector.reserve(__size); - for (size_t __i = 0; __i < __size; __i++) { - auto __element = __result->getElement(__i); - __vector.push_back(__element->toCpp()); - } - return __vector; - }()); - }); - __result->cthis()->addOnRejectedListener([=](const jni::alias_ref& __throwable) { - jni::JniException __jniError(__throwable); - __promise->reject(std::make_exception_ptr(__jniError)); - }); - return __promise; - }(); - } - std::shared_ptr> JHybridReactNativeBundleUpdateSpec::getSha256FromFilePath(const std::string& filePath) { - static const auto method = javaClassStatic()->getMethod(jni::alias_ref /* filePath */)>("getSha256FromFilePath"); - auto __result = method(_javaPart, jni::make_jstring(filePath)); - return [&]() { - auto __promise = Promise::create(); - __result->cthis()->addOnResolvedListener([=](const jni::alias_ref& __boxedResult) { - auto __result = jni::static_ref_cast(__boxedResult); - __promise->resolve(__result->toStdString()); - }); - __result->cthis()->addOnRejectedListener([=](const jni::alias_ref& __throwable) { - jni::JniException __jniError(__throwable); - __promise->reject(std::make_exception_ptr(__jniError)); - }); - return __promise; - }(); - } - std::shared_ptr> JHybridReactNativeBundleUpdateSpec::testDeleteJsBundle(const std::string& appVersion, const std::string& bundleVersion) { - static const auto method = javaClassStatic()->getMethod(jni::alias_ref /* appVersion */, jni::alias_ref /* bundleVersion */)>("testDeleteJsBundle"); - auto __result = method(_javaPart, jni::make_jstring(appVersion), jni::make_jstring(bundleVersion)); - return [&]() { - auto __promise = Promise::create(); - __result->cthis()->addOnResolvedListener([=](const jni::alias_ref& __boxedResult) { - auto __result = jni::static_ref_cast(__boxedResult); - __promise->resolve(__result->toCpp()); - }); - __result->cthis()->addOnRejectedListener([=](const jni::alias_ref& __throwable) { - jni::JniException __jniError(__throwable); - __promise->reject(std::make_exception_ptr(__jniError)); - }); - return __promise; - }(); - } - std::shared_ptr> JHybridReactNativeBundleUpdateSpec::testDeleteJsRuntimeDir(const std::string& appVersion, const std::string& bundleVersion) { - static const auto method = javaClassStatic()->getMethod(jni::alias_ref /* appVersion */, jni::alias_ref /* bundleVersion */)>("testDeleteJsRuntimeDir"); - auto __result = method(_javaPart, jni::make_jstring(appVersion), jni::make_jstring(bundleVersion)); - return [&]() { - auto __promise = Promise::create(); - __result->cthis()->addOnResolvedListener([=](const jni::alias_ref& __boxedResult) { - auto __result = jni::static_ref_cast(__boxedResult); - __promise->resolve(__result->toCpp()); - }); - __result->cthis()->addOnRejectedListener([=](const jni::alias_ref& __throwable) { - jni::JniException __jniError(__throwable); - __promise->reject(std::make_exception_ptr(__jniError)); - }); - return __promise; - }(); - } - std::shared_ptr> JHybridReactNativeBundleUpdateSpec::testDeleteMetadataJson(const std::string& appVersion, const std::string& bundleVersion) { - static const auto method = javaClassStatic()->getMethod(jni::alias_ref /* appVersion */, jni::alias_ref /* bundleVersion */)>("testDeleteMetadataJson"); - auto __result = method(_javaPart, jni::make_jstring(appVersion), jni::make_jstring(bundleVersion)); - return [&]() { - auto __promise = Promise::create(); - __result->cthis()->addOnResolvedListener([=](const jni::alias_ref& __boxedResult) { - auto __result = jni::static_ref_cast(__boxedResult); - __promise->resolve(__result->toCpp()); - }); - __result->cthis()->addOnRejectedListener([=](const jni::alias_ref& __throwable) { - jni::JniException __jniError(__throwable); - __promise->reject(std::make_exception_ptr(__jniError)); - }); - return __promise; - }(); - } - std::shared_ptr> JHybridReactNativeBundleUpdateSpec::testWriteEmptyMetadataJson(const std::string& appVersion, const std::string& bundleVersion) { - static const auto method = javaClassStatic()->getMethod(jni::alias_ref /* appVersion */, jni::alias_ref /* bundleVersion */)>("testWriteEmptyMetadataJson"); - auto __result = method(_javaPart, jni::make_jstring(appVersion), jni::make_jstring(bundleVersion)); - return [&]() { - auto __promise = Promise::create(); - __result->cthis()->addOnResolvedListener([=](const jni::alias_ref& __boxedResult) { - auto __result = jni::static_ref_cast(__boxedResult); - __promise->resolve(__result->toCpp()); - }); - __result->cthis()->addOnRejectedListener([=](const jni::alias_ref& __throwable) { - jni::JniException __jniError(__throwable); - __promise->reject(std::make_exception_ptr(__jniError)); - }); - return __promise; - }(); - } - double JHybridReactNativeBundleUpdateSpec::addDownloadListener(const std::function& callback) { - static const auto method = javaClassStatic()->getMethod /* callback */)>("addDownloadListener_cxx"); - auto __result = method(_javaPart, JFunc_void_BundleDownloadEvent_cxx::fromCpp(callback)); - return __result; - } - void JHybridReactNativeBundleUpdateSpec::removeDownloadListener(double id) { - static const auto method = javaClassStatic()->getMethod("removeDownloadListener"); - method(_javaPart, id); - } - -} // namespace margelo::nitro::reactnativebundleupdate diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/android/c++/JHybridReactNativeBundleUpdateSpec.hpp b/native-modules/react-native-bundle-update/nitrogen/generated/android/c++/JHybridReactNativeBundleUpdateSpec.hpp deleted file mode 100644 index 3718806..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/android/c++/JHybridReactNativeBundleUpdateSpec.hpp +++ /dev/null @@ -1,93 +0,0 @@ -/// -/// HybridReactNativeBundleUpdateSpec.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#include -#include -#include "HybridReactNativeBundleUpdateSpec.hpp" - - - - -namespace margelo::nitro::reactnativebundleupdate { - - using namespace facebook; - - class JHybridReactNativeBundleUpdateSpec: public jni::HybridClass, - public virtual HybridReactNativeBundleUpdateSpec { - public: - static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/reactnativebundleupdate/HybridReactNativeBundleUpdateSpec;"; - static jni::local_ref initHybrid(jni::alias_ref jThis); - static void registerNatives(); - - protected: - // C++ constructor (called from Java via `initHybrid()`) - explicit JHybridReactNativeBundleUpdateSpec(jni::alias_ref jThis) : - HybridObject(HybridReactNativeBundleUpdateSpec::TAG), - HybridBase(jThis), - _javaPart(jni::make_global(jThis)) {} - - public: - ~JHybridReactNativeBundleUpdateSpec() override { - // Hermes GC can destroy JS objects on a non-JNI Thread. - jni::ThreadScope::WithClassLoader([&] { _javaPart.reset(); }); - } - - public: - size_t getExternalMemorySize() noexcept override; - void dispose() noexcept override; - std::string toString() override; - - public: - inline const jni::global_ref& getJavaPart() const noexcept { - return _javaPart; - } - - public: - // Properties - - - public: - // Methods - std::shared_ptr> downloadBundle(const BundleDownloadParams& params) override; - std::shared_ptr> verifyBundle(const BundleVerifyParams& params) override; - std::shared_ptr> verifyBundleASC(const BundleVerifyASCParams& params) override; - std::shared_ptr> downloadBundleASC(const BundleDownloadASCParams& params) override; - std::shared_ptr> installBundle(const BundleInstallParams& params) override; - std::shared_ptr> clearBundle() override; - std::shared_ptr> clearAllJSBundleData() override; - std::shared_ptr> resetToBuiltInBundle() override; - std::shared_ptr>> getFallbackUpdateBundleData() override; - std::shared_ptr> setCurrentUpdateBundleData(const BundleSwitchParams& params) override; - std::string getWebEmbedPath() override; - std::shared_ptr> getWebEmbedPathAsync() override; - std::string getJsBundlePath() override; - std::shared_ptr> getJsBundlePathAsync() override; - std::shared_ptr> getNativeAppVersion() override; - std::shared_ptr> testVerification() override; - std::shared_ptr> testSkipVerification() override; - bool isSkipGpgVerificationAllowed() override; - std::shared_ptr> isBundleExists(const std::string& appVersion, const std::string& bundleVersion) override; - std::shared_ptr> verifyExtractedBundle(const std::string& appVersion, const std::string& bundleVersion) override; - std::shared_ptr>> listLocalBundles() override; - std::shared_ptr>> listAscFiles() override; - std::shared_ptr> getSha256FromFilePath(const std::string& filePath) override; - std::shared_ptr> testDeleteJsBundle(const std::string& appVersion, const std::string& bundleVersion) override; - std::shared_ptr> testDeleteJsRuntimeDir(const std::string& appVersion, const std::string& bundleVersion) override; - std::shared_ptr> testDeleteMetadataJson(const std::string& appVersion, const std::string& bundleVersion) override; - std::shared_ptr> testWriteEmptyMetadataJson(const std::string& appVersion, const std::string& bundleVersion) override; - double addDownloadListener(const std::function& callback) override; - void removeDownloadListener(double id) override; - - private: - friend HybridBase; - using HybridBase::HybridBase; - jni::global_ref _javaPart; - }; - -} // namespace margelo::nitro::reactnativebundleupdate diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/android/c++/JLocalBundleInfo.hpp b/native-modules/react-native-bundle-update/nitrogen/generated/android/c++/JLocalBundleInfo.hpp deleted file mode 100644 index 3097bcc..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/android/c++/JLocalBundleInfo.hpp +++ /dev/null @@ -1,61 +0,0 @@ -/// -/// JLocalBundleInfo.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#include -#include "LocalBundleInfo.hpp" - -#include - -namespace margelo::nitro::reactnativebundleupdate { - - using namespace facebook; - - /** - * The C++ JNI bridge between the C++ struct "LocalBundleInfo" and the the Kotlin data class "LocalBundleInfo". - */ - struct JLocalBundleInfo final: public jni::JavaClass { - public: - static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/reactnativebundleupdate/LocalBundleInfo;"; - - public: - /** - * Convert this Java/Kotlin-based struct to the C++ struct LocalBundleInfo by copying all values to C++. - */ - [[maybe_unused]] - [[nodiscard]] - LocalBundleInfo toCpp() const { - static const auto clazz = javaClassStatic(); - static const auto fieldAppVersion = clazz->getField("appVersion"); - jni::local_ref appVersion = this->getFieldValue(fieldAppVersion); - static const auto fieldBundleVersion = clazz->getField("bundleVersion"); - jni::local_ref bundleVersion = this->getFieldValue(fieldBundleVersion); - return LocalBundleInfo( - appVersion->toStdString(), - bundleVersion->toStdString() - ); - } - - public: - /** - * Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java. - */ - [[maybe_unused]] - static jni::local_ref fromCpp(const LocalBundleInfo& value) { - using JSignature = JLocalBundleInfo(jni::alias_ref, jni::alias_ref); - static const auto clazz = javaClassStatic(); - static const auto create = clazz->getStaticMethod("fromCpp"); - return create( - clazz, - jni::make_jstring(value.appVersion), - jni::make_jstring(value.bundleVersion) - ); - } - }; - -} // namespace margelo::nitro::reactnativebundleupdate diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/android/c++/JTestResult.hpp b/native-modules/react-native-bundle-update/nitrogen/generated/android/c++/JTestResult.hpp deleted file mode 100644 index feb0ab3..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/android/c++/JTestResult.hpp +++ /dev/null @@ -1,61 +0,0 @@ -/// -/// JTestResult.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#include -#include "TestResult.hpp" - -#include - -namespace margelo::nitro::reactnativebundleupdate { - - using namespace facebook; - - /** - * The C++ JNI bridge between the C++ struct "TestResult" and the the Kotlin data class "TestResult". - */ - struct JTestResult final: public jni::JavaClass { - public: - static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/reactnativebundleupdate/TestResult;"; - - public: - /** - * Convert this Java/Kotlin-based struct to the C++ struct TestResult by copying all values to C++. - */ - [[maybe_unused]] - [[nodiscard]] - TestResult toCpp() const { - static const auto clazz = javaClassStatic(); - static const auto fieldSuccess = clazz->getField("success"); - jboolean success = this->getFieldValue(fieldSuccess); - static const auto fieldMessage = clazz->getField("message"); - jni::local_ref message = this->getFieldValue(fieldMessage); - return TestResult( - static_cast(success), - message->toStdString() - ); - } - - public: - /** - * Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java. - */ - [[maybe_unused]] - static jni::local_ref fromCpp(const TestResult& value) { - using JSignature = JTestResult(jboolean, jni::alias_ref); - static const auto clazz = javaClassStatic(); - static const auto create = clazz->getStaticMethod("fromCpp"); - return create( - clazz, - value.success, - jni::make_jstring(value.message) - ); - } - }; - -} // namespace margelo::nitro::reactnativebundleupdate diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/AscFileInfo.kt b/native-modules/react-native-bundle-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/AscFileInfo.kt deleted file mode 100644 index de22f70..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/AscFileInfo.kt +++ /dev/null @@ -1,44 +0,0 @@ -/// -/// AscFileInfo.kt -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -package com.margelo.nitro.reactnativebundleupdate - -import androidx.annotation.Keep -import com.facebook.proguard.annotations.DoNotStrip - - -/** - * Represents the JavaScript object/struct "AscFileInfo". - */ -@DoNotStrip -@Keep -data class AscFileInfo( - @DoNotStrip - @Keep - val fileName: String, - @DoNotStrip - @Keep - val filePath: String, - @DoNotStrip - @Keep - val fileSize: Double -) { - /* primary constructor */ - - private companion object { - /** - * Constructor called from C++ - */ - @DoNotStrip - @Keep - @Suppress("unused") - @JvmStatic - private fun fromCpp(fileName: String, filePath: String, fileSize: Double): AscFileInfo { - return AscFileInfo(fileName, filePath, fileSize) - } - } -} diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/BundleDownloadASCParams.kt b/native-modules/react-native-bundle-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/BundleDownloadASCParams.kt deleted file mode 100644 index f11a948..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/BundleDownloadASCParams.kt +++ /dev/null @@ -1,53 +0,0 @@ -/// -/// BundleDownloadASCParams.kt -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -package com.margelo.nitro.reactnativebundleupdate - -import androidx.annotation.Keep -import com.facebook.proguard.annotations.DoNotStrip - - -/** - * Represents the JavaScript object/struct "BundleDownloadASCParams". - */ -@DoNotStrip -@Keep -data class BundleDownloadASCParams( - @DoNotStrip - @Keep - val downloadUrl: String, - @DoNotStrip - @Keep - val downloadedFile: String, - @DoNotStrip - @Keep - val signature: String, - @DoNotStrip - @Keep - val latestVersion: String, - @DoNotStrip - @Keep - val bundleVersion: String, - @DoNotStrip - @Keep - val sha256: String -) { - /* primary constructor */ - - private companion object { - /** - * Constructor called from C++ - */ - @DoNotStrip - @Keep - @Suppress("unused") - @JvmStatic - private fun fromCpp(downloadUrl: String, downloadedFile: String, signature: String, latestVersion: String, bundleVersion: String, sha256: String): BundleDownloadASCParams { - return BundleDownloadASCParams(downloadUrl, downloadedFile, signature, latestVersion, bundleVersion, sha256) - } - } -} diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/BundleDownloadEvent.kt b/native-modules/react-native-bundle-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/BundleDownloadEvent.kt deleted file mode 100644 index a737bd2..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/BundleDownloadEvent.kt +++ /dev/null @@ -1,44 +0,0 @@ -/// -/// BundleDownloadEvent.kt -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -package com.margelo.nitro.reactnativebundleupdate - -import androidx.annotation.Keep -import com.facebook.proguard.annotations.DoNotStrip - - -/** - * Represents the JavaScript object/struct "BundleDownloadEvent". - */ -@DoNotStrip -@Keep -data class BundleDownloadEvent( - @DoNotStrip - @Keep - val type: String, - @DoNotStrip - @Keep - val progress: Double, - @DoNotStrip - @Keep - val message: String -) { - /* primary constructor */ - - private companion object { - /** - * Constructor called from C++ - */ - @DoNotStrip - @Keep - @Suppress("unused") - @JvmStatic - private fun fromCpp(type: String, progress: Double, message: String): BundleDownloadEvent { - return BundleDownloadEvent(type, progress, message) - } - } -} diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/BundleDownloadParams.kt b/native-modules/react-native-bundle-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/BundleDownloadParams.kt deleted file mode 100644 index e33b6d6..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/BundleDownloadParams.kt +++ /dev/null @@ -1,50 +0,0 @@ -/// -/// BundleDownloadParams.kt -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -package com.margelo.nitro.reactnativebundleupdate - -import androidx.annotation.Keep -import com.facebook.proguard.annotations.DoNotStrip - - -/** - * Represents the JavaScript object/struct "BundleDownloadParams". - */ -@DoNotStrip -@Keep -data class BundleDownloadParams( - @DoNotStrip - @Keep - val downloadUrl: String, - @DoNotStrip - @Keep - val latestVersion: String, - @DoNotStrip - @Keep - val bundleVersion: String, - @DoNotStrip - @Keep - val fileSize: Double, - @DoNotStrip - @Keep - val sha256: String -) { - /* primary constructor */ - - private companion object { - /** - * Constructor called from C++ - */ - @DoNotStrip - @Keep - @Suppress("unused") - @JvmStatic - private fun fromCpp(downloadUrl: String, latestVersion: String, bundleVersion: String, fileSize: Double, sha256: String): BundleDownloadParams { - return BundleDownloadParams(downloadUrl, latestVersion, bundleVersion, fileSize, sha256) - } - } -} diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/BundleDownloadResult.kt b/native-modules/react-native-bundle-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/BundleDownloadResult.kt deleted file mode 100644 index a7df2e4..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/BundleDownloadResult.kt +++ /dev/null @@ -1,50 +0,0 @@ -/// -/// BundleDownloadResult.kt -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -package com.margelo.nitro.reactnativebundleupdate - -import androidx.annotation.Keep -import com.facebook.proguard.annotations.DoNotStrip - - -/** - * Represents the JavaScript object/struct "BundleDownloadResult". - */ -@DoNotStrip -@Keep -data class BundleDownloadResult( - @DoNotStrip - @Keep - val downloadedFile: String, - @DoNotStrip - @Keep - val downloadUrl: String, - @DoNotStrip - @Keep - val latestVersion: String, - @DoNotStrip - @Keep - val bundleVersion: String, - @DoNotStrip - @Keep - val sha256: String -) { - /* primary constructor */ - - private companion object { - /** - * Constructor called from C++ - */ - @DoNotStrip - @Keep - @Suppress("unused") - @JvmStatic - private fun fromCpp(downloadedFile: String, downloadUrl: String, latestVersion: String, bundleVersion: String, sha256: String): BundleDownloadResult { - return BundleDownloadResult(downloadedFile, downloadUrl, latestVersion, bundleVersion, sha256) - } - } -} diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/BundleInstallParams.kt b/native-modules/react-native-bundle-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/BundleInstallParams.kt deleted file mode 100644 index c7c4de2..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/BundleInstallParams.kt +++ /dev/null @@ -1,47 +0,0 @@ -/// -/// BundleInstallParams.kt -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -package com.margelo.nitro.reactnativebundleupdate - -import androidx.annotation.Keep -import com.facebook.proguard.annotations.DoNotStrip - - -/** - * Represents the JavaScript object/struct "BundleInstallParams". - */ -@DoNotStrip -@Keep -data class BundleInstallParams( - @DoNotStrip - @Keep - val downloadedFile: String, - @DoNotStrip - @Keep - val latestVersion: String, - @DoNotStrip - @Keep - val bundleVersion: String, - @DoNotStrip - @Keep - val signature: String -) { - /* primary constructor */ - - private companion object { - /** - * Constructor called from C++ - */ - @DoNotStrip - @Keep - @Suppress("unused") - @JvmStatic - private fun fromCpp(downloadedFile: String, latestVersion: String, bundleVersion: String, signature: String): BundleInstallParams { - return BundleInstallParams(downloadedFile, latestVersion, bundleVersion, signature) - } - } -} diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/BundleSwitchParams.kt b/native-modules/react-native-bundle-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/BundleSwitchParams.kt deleted file mode 100644 index f11699d..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/BundleSwitchParams.kt +++ /dev/null @@ -1,44 +0,0 @@ -/// -/// BundleSwitchParams.kt -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -package com.margelo.nitro.reactnativebundleupdate - -import androidx.annotation.Keep -import com.facebook.proguard.annotations.DoNotStrip - - -/** - * Represents the JavaScript object/struct "BundleSwitchParams". - */ -@DoNotStrip -@Keep -data class BundleSwitchParams( - @DoNotStrip - @Keep - val appVersion: String, - @DoNotStrip - @Keep - val bundleVersion: String, - @DoNotStrip - @Keep - val signature: String -) { - /* primary constructor */ - - private companion object { - /** - * Constructor called from C++ - */ - @DoNotStrip - @Keep - @Suppress("unused") - @JvmStatic - private fun fromCpp(appVersion: String, bundleVersion: String, signature: String): BundleSwitchParams { - return BundleSwitchParams(appVersion, bundleVersion, signature) - } - } -} diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/BundleVerifyASCParams.kt b/native-modules/react-native-bundle-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/BundleVerifyASCParams.kt deleted file mode 100644 index aea5240..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/BundleVerifyASCParams.kt +++ /dev/null @@ -1,50 +0,0 @@ -/// -/// BundleVerifyASCParams.kt -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -package com.margelo.nitro.reactnativebundleupdate - -import androidx.annotation.Keep -import com.facebook.proguard.annotations.DoNotStrip - - -/** - * Represents the JavaScript object/struct "BundleVerifyASCParams". - */ -@DoNotStrip -@Keep -data class BundleVerifyASCParams( - @DoNotStrip - @Keep - val downloadedFile: String, - @DoNotStrip - @Keep - val sha256: String, - @DoNotStrip - @Keep - val latestVersion: String, - @DoNotStrip - @Keep - val bundleVersion: String, - @DoNotStrip - @Keep - val signature: String -) { - /* primary constructor */ - - private companion object { - /** - * Constructor called from C++ - */ - @DoNotStrip - @Keep - @Suppress("unused") - @JvmStatic - private fun fromCpp(downloadedFile: String, sha256: String, latestVersion: String, bundleVersion: String, signature: String): BundleVerifyASCParams { - return BundleVerifyASCParams(downloadedFile, sha256, latestVersion, bundleVersion, signature) - } - } -} diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/BundleVerifyParams.kt b/native-modules/react-native-bundle-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/BundleVerifyParams.kt deleted file mode 100644 index 5d88d68..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/BundleVerifyParams.kt +++ /dev/null @@ -1,47 +0,0 @@ -/// -/// BundleVerifyParams.kt -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -package com.margelo.nitro.reactnativebundleupdate - -import androidx.annotation.Keep -import com.facebook.proguard.annotations.DoNotStrip - - -/** - * Represents the JavaScript object/struct "BundleVerifyParams". - */ -@DoNotStrip -@Keep -data class BundleVerifyParams( - @DoNotStrip - @Keep - val downloadedFile: String, - @DoNotStrip - @Keep - val sha256: String, - @DoNotStrip - @Keep - val latestVersion: String, - @DoNotStrip - @Keep - val bundleVersion: String -) { - /* primary constructor */ - - private companion object { - /** - * Constructor called from C++ - */ - @DoNotStrip - @Keep - @Suppress("unused") - @JvmStatic - private fun fromCpp(downloadedFile: String, sha256: String, latestVersion: String, bundleVersion: String): BundleVerifyParams { - return BundleVerifyParams(downloadedFile, sha256, latestVersion, bundleVersion) - } - } -} diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/FallbackBundleInfo.kt b/native-modules/react-native-bundle-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/FallbackBundleInfo.kt deleted file mode 100644 index d6b338a..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/FallbackBundleInfo.kt +++ /dev/null @@ -1,44 +0,0 @@ -/// -/// FallbackBundleInfo.kt -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -package com.margelo.nitro.reactnativebundleupdate - -import androidx.annotation.Keep -import com.facebook.proguard.annotations.DoNotStrip - - -/** - * Represents the JavaScript object/struct "FallbackBundleInfo". - */ -@DoNotStrip -@Keep -data class FallbackBundleInfo( - @DoNotStrip - @Keep - val appVersion: String, - @DoNotStrip - @Keep - val bundleVersion: String, - @DoNotStrip - @Keep - val signature: String -) { - /* primary constructor */ - - private companion object { - /** - * Constructor called from C++ - */ - @DoNotStrip - @Keep - @Suppress("unused") - @JvmStatic - private fun fromCpp(appVersion: String, bundleVersion: String, signature: String): FallbackBundleInfo { - return FallbackBundleInfo(appVersion, bundleVersion, signature) - } - } -} diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/Func_void_BundleDownloadEvent.kt b/native-modules/react-native-bundle-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/Func_void_BundleDownloadEvent.kt deleted file mode 100644 index ab4a10a..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/Func_void_BundleDownloadEvent.kt +++ /dev/null @@ -1,80 +0,0 @@ -/// -/// Func_void_BundleDownloadEvent.kt -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -package com.margelo.nitro.reactnativebundleupdate - -import androidx.annotation.Keep -import com.facebook.jni.HybridData -import com.facebook.proguard.annotations.DoNotStrip -import dalvik.annotation.optimization.FastNative - - -/** - * Represents the JavaScript callback `(event: struct) => void`. - * This can be either implemented in C++ (in which case it might be a callback coming from JS), - * or in Kotlin/Java (in which case it is a native callback). - */ -@DoNotStrip -@Keep -@Suppress("ClassName", "RedundantUnitReturnType") -fun interface Func_void_BundleDownloadEvent: (BundleDownloadEvent) -> Unit { - /** - * Call the given JS callback. - * @throws Throwable if the JS function itself throws an error, or if the JS function/runtime has already been deleted. - */ - @DoNotStrip - @Keep - override fun invoke(event: BundleDownloadEvent): Unit -} - -/** - * Represents the JavaScript callback `(event: struct) => void`. - * This is implemented in C++, via a `std::function<...>`. - * The callback might be coming from JS. - */ -@DoNotStrip -@Keep -@Suppress( - "KotlinJniMissingFunction", "unused", - "RedundantSuppression", "RedundantUnitReturnType", "FunctionName", - "ConvertSecondaryConstructorToPrimary", "ClassName", "LocalVariableName", -) -class Func_void_BundleDownloadEvent_cxx: Func_void_BundleDownloadEvent { - @DoNotStrip - @Keep - private val mHybridData: HybridData - - @DoNotStrip - @Keep - private constructor(hybridData: HybridData) { - mHybridData = hybridData - } - - @DoNotStrip - @Keep - override fun invoke(event: BundleDownloadEvent): Unit - = invoke_cxx(event) - - @FastNative - private external fun invoke_cxx(event: BundleDownloadEvent): Unit -} - -/** - * Represents the JavaScript callback `(event: struct) => void`. - * This is implemented in Java/Kotlin, via a `(BundleDownloadEvent) -> Unit`. - * The callback is always coming from native. - */ -@DoNotStrip -@Keep -@Suppress("ClassName", "RedundantUnitReturnType", "unused") -class Func_void_BundleDownloadEvent_java(private val function: (BundleDownloadEvent) -> Unit): Func_void_BundleDownloadEvent { - @DoNotStrip - @Keep - override fun invoke(event: BundleDownloadEvent): Unit { - return this.function(event) - } -} diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/HybridReactNativeBundleUpdateSpec.kt b/native-modules/react-native-bundle-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/HybridReactNativeBundleUpdateSpec.kt deleted file mode 100644 index 55cf384..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/HybridReactNativeBundleUpdateSpec.kt +++ /dev/null @@ -1,175 +0,0 @@ -/// -/// HybridReactNativeBundleUpdateSpec.kt -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -package com.margelo.nitro.reactnativebundleupdate - -import androidx.annotation.Keep -import com.facebook.jni.HybridData -import com.facebook.proguard.annotations.DoNotStrip -import com.margelo.nitro.core.Promise -import com.margelo.nitro.core.HybridObject - -/** - * A Kotlin class representing the ReactNativeBundleUpdate HybridObject. - * Implement this abstract class to create Kotlin-based instances of ReactNativeBundleUpdate. - */ -@DoNotStrip -@Keep -@Suppress( - "KotlinJniMissingFunction", "unused", - "RedundantSuppression", "RedundantUnitReturnType", "SimpleRedundantLet", - "LocalVariableName", "PropertyName", "PrivatePropertyName", "FunctionName" -) -abstract class HybridReactNativeBundleUpdateSpec: HybridObject() { - @DoNotStrip - private var mHybridData: HybridData = initHybrid() - - init { - super.updateNative(mHybridData) - } - - override fun updateNative(hybridData: HybridData) { - mHybridData = hybridData - super.updateNative(hybridData) - } - - // Default implementation of `HybridObject.toString()` - override fun toString(): String { - return "[HybridObject ReactNativeBundleUpdate]" - } - - // Properties - - - // Methods - @DoNotStrip - @Keep - abstract fun downloadBundle(params: BundleDownloadParams): Promise - - @DoNotStrip - @Keep - abstract fun verifyBundle(params: BundleVerifyParams): Promise - - @DoNotStrip - @Keep - abstract fun verifyBundleASC(params: BundleVerifyASCParams): Promise - - @DoNotStrip - @Keep - abstract fun downloadBundleASC(params: BundleDownloadASCParams): Promise - - @DoNotStrip - @Keep - abstract fun installBundle(params: BundleInstallParams): Promise - - @DoNotStrip - @Keep - abstract fun clearBundle(): Promise - - @DoNotStrip - @Keep - abstract fun clearAllJSBundleData(): Promise - - @DoNotStrip - @Keep - abstract fun resetToBuiltInBundle(): Promise - - @DoNotStrip - @Keep - abstract fun getFallbackUpdateBundleData(): Promise> - - @DoNotStrip - @Keep - abstract fun setCurrentUpdateBundleData(params: BundleSwitchParams): Promise - - @DoNotStrip - @Keep - abstract fun getWebEmbedPath(): String - - @DoNotStrip - @Keep - abstract fun getWebEmbedPathAsync(): Promise - - @DoNotStrip - @Keep - abstract fun getJsBundlePath(): String - - @DoNotStrip - @Keep - abstract fun getJsBundlePathAsync(): Promise - - @DoNotStrip - @Keep - abstract fun getNativeAppVersion(): Promise - - @DoNotStrip - @Keep - abstract fun testVerification(): Promise - - @DoNotStrip - @Keep - abstract fun testSkipVerification(): Promise - - @DoNotStrip - @Keep - abstract fun isSkipGpgVerificationAllowed(): Boolean - - @DoNotStrip - @Keep - abstract fun isBundleExists(appVersion: String, bundleVersion: String): Promise - - @DoNotStrip - @Keep - abstract fun verifyExtractedBundle(appVersion: String, bundleVersion: String): Promise - - @DoNotStrip - @Keep - abstract fun listLocalBundles(): Promise> - - @DoNotStrip - @Keep - abstract fun listAscFiles(): Promise> - - @DoNotStrip - @Keep - abstract fun getSha256FromFilePath(filePath: String): Promise - - @DoNotStrip - @Keep - abstract fun testDeleteJsBundle(appVersion: String, bundleVersion: String): Promise - - @DoNotStrip - @Keep - abstract fun testDeleteJsRuntimeDir(appVersion: String, bundleVersion: String): Promise - - @DoNotStrip - @Keep - abstract fun testDeleteMetadataJson(appVersion: String, bundleVersion: String): Promise - - @DoNotStrip - @Keep - abstract fun testWriteEmptyMetadataJson(appVersion: String, bundleVersion: String): Promise - - abstract fun addDownloadListener(callback: (event: BundleDownloadEvent) -> Unit): Double - - @DoNotStrip - @Keep - private fun addDownloadListener_cxx(callback: Func_void_BundleDownloadEvent): Double { - val __result = addDownloadListener(callback) - return __result - } - - @DoNotStrip - @Keep - abstract fun removeDownloadListener(id: Double): Unit - - private external fun initHybrid(): HybridData - - companion object { - protected const val TAG = "HybridReactNativeBundleUpdateSpec" - } -} diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/LocalBundleInfo.kt b/native-modules/react-native-bundle-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/LocalBundleInfo.kt deleted file mode 100644 index 2161d66..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/LocalBundleInfo.kt +++ /dev/null @@ -1,41 +0,0 @@ -/// -/// LocalBundleInfo.kt -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -package com.margelo.nitro.reactnativebundleupdate - -import androidx.annotation.Keep -import com.facebook.proguard.annotations.DoNotStrip - - -/** - * Represents the JavaScript object/struct "LocalBundleInfo". - */ -@DoNotStrip -@Keep -data class LocalBundleInfo( - @DoNotStrip - @Keep - val appVersion: String, - @DoNotStrip - @Keep - val bundleVersion: String -) { - /* primary constructor */ - - private companion object { - /** - * Constructor called from C++ - */ - @DoNotStrip - @Keep - @Suppress("unused") - @JvmStatic - private fun fromCpp(appVersion: String, bundleVersion: String): LocalBundleInfo { - return LocalBundleInfo(appVersion, bundleVersion) - } - } -} diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/TestResult.kt b/native-modules/react-native-bundle-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/TestResult.kt deleted file mode 100644 index 1744d04..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/TestResult.kt +++ /dev/null @@ -1,41 +0,0 @@ -/// -/// TestResult.kt -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -package com.margelo.nitro.reactnativebundleupdate - -import androidx.annotation.Keep -import com.facebook.proguard.annotations.DoNotStrip - - -/** - * Represents the JavaScript object/struct "TestResult". - */ -@DoNotStrip -@Keep -data class TestResult( - @DoNotStrip - @Keep - val success: Boolean, - @DoNotStrip - @Keep - val message: String -) { - /* primary constructor */ - - private companion object { - /** - * Constructor called from C++ - */ - @DoNotStrip - @Keep - @Suppress("unused") - @JvmStatic - private fun fromCpp(success: Boolean, message: String): TestResult { - return TestResult(success, message) - } - } -} diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/reactnativebundleupdateOnLoad.kt b/native-modules/react-native-bundle-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/reactnativebundleupdateOnLoad.kt deleted file mode 100644 index 69e258b..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativebundleupdate/reactnativebundleupdateOnLoad.kt +++ /dev/null @@ -1,35 +0,0 @@ -/// -/// reactnativebundleupdateOnLoad.kt -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -package com.margelo.nitro.reactnativebundleupdate - -import android.util.Log - -internal class reactnativebundleupdateOnLoad { - companion object { - private const val TAG = "reactnativebundleupdateOnLoad" - private var didLoad = false - /** - * Initializes the native part of "reactnativebundleupdate". - * This method is idempotent and can be called more than once. - */ - @JvmStatic - fun initializeNative() { - if (didLoad) return - try { - Log.i(TAG, "Loading reactnativebundleupdate C++ library...") - System.loadLibrary("reactnativebundleupdate") - Log.i(TAG, "Successfully loaded reactnativebundleupdate C++ library!") - didLoad = true - } catch (e: Error) { - Log.e(TAG, "Failed to load reactnativebundleupdate C++ library! Is it properly installed and linked? " + - "Is the name correct? (see `CMakeLists.txt`, at `add_library(...)`)", e) - throw e - } - } - } -} diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/android/reactnativebundleupdate+autolinking.cmake b/native-modules/react-native-bundle-update/nitrogen/generated/android/reactnativebundleupdate+autolinking.cmake deleted file mode 100644 index 0ec4ac1..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/android/reactnativebundleupdate+autolinking.cmake +++ /dev/null @@ -1,81 +0,0 @@ -# -# reactnativebundleupdate+autolinking.cmake -# This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -# https://github.com/mrousavy/nitro -# Copyright © 2026 Marc Rousavy @ Margelo -# - -# This is a CMake file that adds all files generated by Nitrogen -# to the current CMake project. -# -# To use it, add this to your CMakeLists.txt: -# ```cmake -# include(${CMAKE_SOURCE_DIR}/../nitrogen/generated/android/reactnativebundleupdate+autolinking.cmake) -# ``` - -# Define a flag to check if we are building properly -add_definitions(-DBUILDING_REACTNATIVEBUNDLEUPDATE_WITH_GENERATED_CMAKE_PROJECT) - -# Enable Raw Props parsing in react-native (for Nitro Views) -add_definitions(-DRN_SERIALIZABLE_STATE) - -# Add all headers that were generated by Nitrogen -include_directories( - "../nitrogen/generated/shared/c++" - "../nitrogen/generated/android/c++" - "../nitrogen/generated/android/" -) - -# Add all .cpp sources that were generated by Nitrogen -target_sources( - # CMake project name (Android C++ library name) - reactnativebundleupdate PRIVATE - # Autolinking Setup - ../nitrogen/generated/android/reactnativebundleupdateOnLoad.cpp - # Shared Nitrogen C++ sources - ../nitrogen/generated/shared/c++/HybridReactNativeBundleUpdateSpec.cpp - # Android-specific Nitrogen C++ sources - ../nitrogen/generated/android/c++/JHybridReactNativeBundleUpdateSpec.cpp -) - -# From node_modules/react-native/ReactAndroid/cmake-utils/folly-flags.cmake -# Used in node_modules/react-native/ReactAndroid/cmake-utils/ReactNative-application.cmake -target_compile_definitions( - reactnativebundleupdate PRIVATE - -DFOLLY_NO_CONFIG=1 - -DFOLLY_HAVE_CLOCK_GETTIME=1 - -DFOLLY_USE_LIBCPP=1 - -DFOLLY_CFG_NO_COROUTINES=1 - -DFOLLY_MOBILE=1 - -DFOLLY_HAVE_RECVMMSG=1 - -DFOLLY_HAVE_PTHREAD=1 - # Once we target android-23 above, we can comment - # the following line. NDK uses GNU style stderror_r() after API 23. - -DFOLLY_HAVE_XSI_STRERROR_R=1 -) - -# Add all libraries required by the generated specs -find_package(fbjni REQUIRED) # <-- Used for communication between Java <-> C++ -find_package(ReactAndroid REQUIRED) # <-- Used to set up React Native bindings (e.g. CallInvoker/TurboModule) -find_package(react-native-nitro-modules REQUIRED) # <-- Used to create all HybridObjects and use the Nitro core library - -# Link all libraries together -target_link_libraries( - reactnativebundleupdate - fbjni::fbjni # <-- Facebook C++ JNI helpers - ReactAndroid::jsi # <-- RN: JSI - react-native-nitro-modules::NitroModules # <-- NitroModules Core :) -) - -# Link react-native (different prefab between RN 0.75 and RN 0.76) -if(ReactAndroid_VERSION_MINOR GREATER_EQUAL 76) - target_link_libraries( - reactnativebundleupdate - ReactAndroid::reactnative # <-- RN: Native Modules umbrella prefab - ) -else() - target_link_libraries( - reactnativebundleupdate - ReactAndroid::react_nativemodule_core # <-- RN: TurboModules Core - ) -endif() diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/android/reactnativebundleupdate+autolinking.gradle b/native-modules/react-native-bundle-update/nitrogen/generated/android/reactnativebundleupdate+autolinking.gradle deleted file mode 100644 index cecb066..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/android/reactnativebundleupdate+autolinking.gradle +++ /dev/null @@ -1,27 +0,0 @@ -/// -/// reactnativebundleupdate+autolinking.gradle -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -/// This is a Gradle file that adds all files generated by Nitrogen -/// to the current Gradle project. -/// -/// To use it, add this to your build.gradle: -/// ```gradle -/// apply from: '../nitrogen/generated/android/reactnativebundleupdate+autolinking.gradle' -/// ``` - -logger.warn("[NitroModules] 🔥 reactnativebundleupdate is boosted by nitro!") - -android { - sourceSets { - main { - java.srcDirs += [ - // Nitrogen files - "${project.projectDir}/../nitrogen/generated/android/kotlin" - ] - } - } -} diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/android/reactnativebundleupdateOnLoad.cpp b/native-modules/react-native-bundle-update/nitrogen/generated/android/reactnativebundleupdateOnLoad.cpp deleted file mode 100644 index f4c20d9..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/android/reactnativebundleupdateOnLoad.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/// -/// reactnativebundleupdateOnLoad.cpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#ifndef BUILDING_REACTNATIVEBUNDLEUPDATE_WITH_GENERATED_CMAKE_PROJECT -#error reactnativebundleupdateOnLoad.cpp is not being built with the autogenerated CMakeLists.txt project. Is a different CMakeLists.txt building this? -#endif - -#include "reactnativebundleupdateOnLoad.hpp" - -#include -#include -#include - -#include "JHybridReactNativeBundleUpdateSpec.hpp" -#include "JFunc_void_BundleDownloadEvent.hpp" -#include - -namespace margelo::nitro::reactnativebundleupdate { - -int initialize(JavaVM* vm) { - using namespace margelo::nitro; - using namespace margelo::nitro::reactnativebundleupdate; - using namespace facebook; - - return facebook::jni::initialize(vm, [] { - // Register native JNI methods - margelo::nitro::reactnativebundleupdate::JHybridReactNativeBundleUpdateSpec::registerNatives(); - margelo::nitro::reactnativebundleupdate::JFunc_void_BundleDownloadEvent_cxx::registerNatives(); - - // Register Nitro Hybrid Objects - HybridObjectRegistry::registerHybridObjectConstructor( - "ReactNativeBundleUpdate", - []() -> std::shared_ptr { - static DefaultConstructableObject object("com/margelo/nitro/reactnativebundleupdate/ReactNativeBundleUpdate"); - auto instance = object.create(); - return instance->cthis()->shared(); - } - ); - }); -} - -} // namespace margelo::nitro::reactnativebundleupdate diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/android/reactnativebundleupdateOnLoad.hpp b/native-modules/react-native-bundle-update/nitrogen/generated/android/reactnativebundleupdateOnLoad.hpp deleted file mode 100644 index 60d724f..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/android/reactnativebundleupdateOnLoad.hpp +++ /dev/null @@ -1,25 +0,0 @@ -/// -/// reactnativebundleupdateOnLoad.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#include -#include - -namespace margelo::nitro::reactnativebundleupdate { - - /** - * Initializes the native (C++) part of reactnativebundleupdate, and autolinks all Hybrid Objects. - * Call this in your `JNI_OnLoad` function (probably inside `cpp-adapter.cpp`). - * Example: - * ```cpp (cpp-adapter.cpp) - * JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void*) { - * return margelo::nitro::reactnativebundleupdate::initialize(vm); - * } - * ``` - */ - int initialize(JavaVM* vm); - -} // namespace margelo::nitro::reactnativebundleupdate diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/ios/ReactNativeBundleUpdate+autolinking.rb b/native-modules/react-native-bundle-update/nitrogen/generated/ios/ReactNativeBundleUpdate+autolinking.rb deleted file mode 100644 index 59bec43..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/ios/ReactNativeBundleUpdate+autolinking.rb +++ /dev/null @@ -1,60 +0,0 @@ -# -# ReactNativeBundleUpdate+autolinking.rb -# This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -# https://github.com/mrousavy/nitro -# Copyright © 2026 Marc Rousavy @ Margelo -# - -# This is a Ruby script that adds all files generated by Nitrogen -# to the given podspec. -# -# To use it, add this to your .podspec: -# ```ruby -# Pod::Spec.new do |spec| -# # ... -# -# # Add all files generated by Nitrogen -# load 'nitrogen/generated/ios/ReactNativeBundleUpdate+autolinking.rb' -# add_nitrogen_files(spec) -# end -# ``` - -def add_nitrogen_files(spec) - Pod::UI.puts "[NitroModules] 🔥 ReactNativeBundleUpdate is boosted by nitro!" - - spec.dependency "NitroModules" - - current_source_files = Array(spec.attributes_hash['source_files']) - spec.source_files = current_source_files + [ - # Generated cross-platform specs - "nitrogen/generated/shared/**/*.{h,hpp,c,cpp,swift}", - # Generated bridges for the cross-platform specs - "nitrogen/generated/ios/**/*.{h,hpp,c,cpp,mm,swift}", - ] - - current_public_header_files = Array(spec.attributes_hash['public_header_files']) - spec.public_header_files = current_public_header_files + [ - # Generated specs - "nitrogen/generated/shared/**/*.{h,hpp}", - # Swift to C++ bridging helpers - "nitrogen/generated/ios/ReactNativeBundleUpdate-Swift-Cxx-Bridge.hpp" - ] - - current_private_header_files = Array(spec.attributes_hash['private_header_files']) - spec.private_header_files = current_private_header_files + [ - # iOS specific specs - "nitrogen/generated/ios/c++/**/*.{h,hpp}", - # Views are framework-specific and should be private - "nitrogen/generated/shared/**/views/**/*" - ] - - current_pod_target_xcconfig = spec.attributes_hash['pod_target_xcconfig'] || {} - spec.pod_target_xcconfig = current_pod_target_xcconfig.merge({ - # Use C++ 20 - "CLANG_CXX_LANGUAGE_STANDARD" => "c++20", - # Enables C++ <-> Swift interop (by default it's only C) - "SWIFT_OBJC_INTEROP_MODE" => "objcxx", - # Enables stricter modular headers - "DEFINES_MODULE" => "YES", - }) -end diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/ios/ReactNativeBundleUpdate-Swift-Cxx-Bridge.cpp b/native-modules/react-native-bundle-update/nitrogen/generated/ios/ReactNativeBundleUpdate-Swift-Cxx-Bridge.cpp deleted file mode 100644 index e0f9bfc..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/ios/ReactNativeBundleUpdate-Swift-Cxx-Bridge.cpp +++ /dev/null @@ -1,113 +0,0 @@ -/// -/// ReactNativeBundleUpdate-Swift-Cxx-Bridge.cpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#include "ReactNativeBundleUpdate-Swift-Cxx-Bridge.hpp" - -// Include C++ implementation defined types -#include "HybridReactNativeBundleUpdateSpecSwift.hpp" -#include "ReactNativeBundleUpdate-Swift-Cxx-Umbrella.hpp" -#include - -namespace margelo::nitro::reactnativebundleupdate::bridge::swift { - - // pragma MARK: std::function - Func_void_BundleDownloadResult create_Func_void_BundleDownloadResult(void* NON_NULL swiftClosureWrapper) noexcept { - auto swiftClosure = ReactNativeBundleUpdate::Func_void_BundleDownloadResult::fromUnsafe(swiftClosureWrapper); - return [swiftClosure = std::move(swiftClosure)](const BundleDownloadResult& result) mutable -> void { - swiftClosure.call(result); - }; - } - - // pragma MARK: std::function - Func_void_std__exception_ptr create_Func_void_std__exception_ptr(void* NON_NULL swiftClosureWrapper) noexcept { - auto swiftClosure = ReactNativeBundleUpdate::Func_void_std__exception_ptr::fromUnsafe(swiftClosureWrapper); - return [swiftClosure = std::move(swiftClosure)](const std::exception_ptr& error) mutable -> void { - swiftClosure.call(error); - }; - } - - // pragma MARK: std::function - Func_void create_Func_void(void* NON_NULL swiftClosureWrapper) noexcept { - auto swiftClosure = ReactNativeBundleUpdate::Func_void::fromUnsafe(swiftClosureWrapper); - return [swiftClosure = std::move(swiftClosure)]() mutable -> void { - swiftClosure.call(); - }; - } - - // pragma MARK: std::function - Func_void_TestResult create_Func_void_TestResult(void* NON_NULL swiftClosureWrapper) noexcept { - auto swiftClosure = ReactNativeBundleUpdate::Func_void_TestResult::fromUnsafe(swiftClosureWrapper); - return [swiftClosure = std::move(swiftClosure)](const TestResult& result) mutable -> void { - swiftClosure.call(result); - }; - } - - // pragma MARK: std::function& /* result */)> - Func_void_std__vector_FallbackBundleInfo_ create_Func_void_std__vector_FallbackBundleInfo_(void* NON_NULL swiftClosureWrapper) noexcept { - auto swiftClosure = ReactNativeBundleUpdate::Func_void_std__vector_FallbackBundleInfo_::fromUnsafe(swiftClosureWrapper); - return [swiftClosure = std::move(swiftClosure)](const std::vector& result) mutable -> void { - swiftClosure.call(result); - }; - } - - // pragma MARK: std::function - Func_void_std__string create_Func_void_std__string(void* NON_NULL swiftClosureWrapper) noexcept { - auto swiftClosure = ReactNativeBundleUpdate::Func_void_std__string::fromUnsafe(swiftClosureWrapper); - return [swiftClosure = std::move(swiftClosure)](const std::string& result) mutable -> void { - swiftClosure.call(result); - }; - } - - // pragma MARK: std::function - Func_void_bool create_Func_void_bool(void* NON_NULL swiftClosureWrapper) noexcept { - auto swiftClosure = ReactNativeBundleUpdate::Func_void_bool::fromUnsafe(swiftClosureWrapper); - return [swiftClosure = std::move(swiftClosure)](bool result) mutable -> void { - swiftClosure.call(result); - }; - } - - // pragma MARK: std::function& /* result */)> - Func_void_std__vector_LocalBundleInfo_ create_Func_void_std__vector_LocalBundleInfo_(void* NON_NULL swiftClosureWrapper) noexcept { - auto swiftClosure = ReactNativeBundleUpdate::Func_void_std__vector_LocalBundleInfo_::fromUnsafe(swiftClosureWrapper); - return [swiftClosure = std::move(swiftClosure)](const std::vector& result) mutable -> void { - swiftClosure.call(result); - }; - } - - // pragma MARK: std::function& /* result */)> - Func_void_std__vector_AscFileInfo_ create_Func_void_std__vector_AscFileInfo_(void* NON_NULL swiftClosureWrapper) noexcept { - auto swiftClosure = ReactNativeBundleUpdate::Func_void_std__vector_AscFileInfo_::fromUnsafe(swiftClosureWrapper); - return [swiftClosure = std::move(swiftClosure)](const std::vector& result) mutable -> void { - swiftClosure.call(result); - }; - } - - // pragma MARK: std::function - Func_void_BundleDownloadEvent create_Func_void_BundleDownloadEvent(void* NON_NULL swiftClosureWrapper) noexcept { - auto swiftClosure = ReactNativeBundleUpdate::Func_void_BundleDownloadEvent::fromUnsafe(swiftClosureWrapper); - return [swiftClosure = std::move(swiftClosure)](const BundleDownloadEvent& event) mutable -> void { - swiftClosure.call(event); - }; - } - - // pragma MARK: std::shared_ptr - std::shared_ptr create_std__shared_ptr_HybridReactNativeBundleUpdateSpec_(void* NON_NULL swiftUnsafePointer) noexcept { - ReactNativeBundleUpdate::HybridReactNativeBundleUpdateSpec_cxx swiftPart = ReactNativeBundleUpdate::HybridReactNativeBundleUpdateSpec_cxx::fromUnsafe(swiftUnsafePointer); - return std::make_shared(swiftPart); - } - void* NON_NULL get_std__shared_ptr_HybridReactNativeBundleUpdateSpec_(std__shared_ptr_HybridReactNativeBundleUpdateSpec_ cppType) { - std::shared_ptr swiftWrapper = std::dynamic_pointer_cast(cppType); - #ifdef NITRO_DEBUG - if (swiftWrapper == nullptr) [[unlikely]] { - throw std::runtime_error("Class \"HybridReactNativeBundleUpdateSpec\" is not implemented in Swift!"); - } - #endif - ReactNativeBundleUpdate::HybridReactNativeBundleUpdateSpec_cxx& swiftPart = swiftWrapper->getSwiftPart(); - return swiftPart.toUnsafe(); - } - -} // namespace margelo::nitro::reactnativebundleupdate::bridge::swift diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/ios/ReactNativeBundleUpdate-Swift-Cxx-Bridge.hpp b/native-modules/react-native-bundle-update/nitrogen/generated/ios/ReactNativeBundleUpdate-Swift-Cxx-Bridge.hpp deleted file mode 100644 index 763c294..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/ios/ReactNativeBundleUpdate-Swift-Cxx-Bridge.hpp +++ /dev/null @@ -1,522 +0,0 @@ -/// -/// ReactNativeBundleUpdate-Swift-Cxx-Bridge.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -// Forward declarations of C++ defined types -// Forward declaration of `AscFileInfo` to properly resolve imports. -namespace margelo::nitro::reactnativebundleupdate { struct AscFileInfo; } -// Forward declaration of `BundleDownloadEvent` to properly resolve imports. -namespace margelo::nitro::reactnativebundleupdate { struct BundleDownloadEvent; } -// Forward declaration of `BundleDownloadResult` to properly resolve imports. -namespace margelo::nitro::reactnativebundleupdate { struct BundleDownloadResult; } -// Forward declaration of `FallbackBundleInfo` to properly resolve imports. -namespace margelo::nitro::reactnativebundleupdate { struct FallbackBundleInfo; } -// Forward declaration of `HybridReactNativeBundleUpdateSpec` to properly resolve imports. -namespace margelo::nitro::reactnativebundleupdate { class HybridReactNativeBundleUpdateSpec; } -// Forward declaration of `LocalBundleInfo` to properly resolve imports. -namespace margelo::nitro::reactnativebundleupdate { struct LocalBundleInfo; } -// Forward declaration of `TestResult` to properly resolve imports. -namespace margelo::nitro::reactnativebundleupdate { struct TestResult; } - -// Forward declarations of Swift defined types -// Forward declaration of `HybridReactNativeBundleUpdateSpec_cxx` to properly resolve imports. -namespace ReactNativeBundleUpdate { class HybridReactNativeBundleUpdateSpec_cxx; } - -// Include C++ defined types -#include "AscFileInfo.hpp" -#include "BundleDownloadEvent.hpp" -#include "BundleDownloadResult.hpp" -#include "FallbackBundleInfo.hpp" -#include "HybridReactNativeBundleUpdateSpec.hpp" -#include "LocalBundleInfo.hpp" -#include "TestResult.hpp" -#include -#include -#include -#include -#include -#include -#include -#include - -/** - * Contains specialized versions of C++ templated types so they can be accessed from Swift, - * as well as helper functions to interact with those C++ types from Swift. - */ -namespace margelo::nitro::reactnativebundleupdate::bridge::swift { - - // pragma MARK: std::shared_ptr> - /** - * Specialized version of `std::shared_ptr>`. - */ - using std__shared_ptr_Promise_BundleDownloadResult__ = std::shared_ptr>; - inline std::shared_ptr> create_std__shared_ptr_Promise_BundleDownloadResult__() noexcept { - return Promise::create(); - } - inline PromiseHolder wrap_std__shared_ptr_Promise_BundleDownloadResult__(std::shared_ptr> promise) noexcept { - return PromiseHolder(std::move(promise)); - } - - // pragma MARK: std::function - /** - * Specialized version of `std::function`. - */ - using Func_void_BundleDownloadResult = std::function; - /** - * Wrapper class for a `std::function`, this can be used from Swift. - */ - class Func_void_BundleDownloadResult_Wrapper final { - public: - explicit Func_void_BundleDownloadResult_Wrapper(std::function&& func): _function(std::make_unique>(std::move(func))) {} - inline void call(BundleDownloadResult result) const noexcept { - _function->operator()(result); - } - private: - std::unique_ptr> _function; - } SWIFT_NONCOPYABLE; - Func_void_BundleDownloadResult create_Func_void_BundleDownloadResult(void* NON_NULL swiftClosureWrapper) noexcept; - inline Func_void_BundleDownloadResult_Wrapper wrap_Func_void_BundleDownloadResult(Func_void_BundleDownloadResult value) noexcept { - return Func_void_BundleDownloadResult_Wrapper(std::move(value)); - } - - // pragma MARK: std::function - /** - * Specialized version of `std::function`. - */ - using Func_void_std__exception_ptr = std::function; - /** - * Wrapper class for a `std::function`, this can be used from Swift. - */ - class Func_void_std__exception_ptr_Wrapper final { - public: - explicit Func_void_std__exception_ptr_Wrapper(std::function&& func): _function(std::make_unique>(std::move(func))) {} - inline void call(std::exception_ptr error) const noexcept { - _function->operator()(error); - } - private: - std::unique_ptr> _function; - } SWIFT_NONCOPYABLE; - Func_void_std__exception_ptr create_Func_void_std__exception_ptr(void* NON_NULL swiftClosureWrapper) noexcept; - inline Func_void_std__exception_ptr_Wrapper wrap_Func_void_std__exception_ptr(Func_void_std__exception_ptr value) noexcept { - return Func_void_std__exception_ptr_Wrapper(std::move(value)); - } - - // pragma MARK: std::shared_ptr> - /** - * Specialized version of `std::shared_ptr>`. - */ - using std__shared_ptr_Promise_void__ = std::shared_ptr>; - inline std::shared_ptr> create_std__shared_ptr_Promise_void__() noexcept { - return Promise::create(); - } - inline PromiseHolder wrap_std__shared_ptr_Promise_void__(std::shared_ptr> promise) noexcept { - return PromiseHolder(std::move(promise)); - } - - // pragma MARK: std::function - /** - * Specialized version of `std::function`. - */ - using Func_void = std::function; - /** - * Wrapper class for a `std::function`, this can be used from Swift. - */ - class Func_void_Wrapper final { - public: - explicit Func_void_Wrapper(std::function&& func): _function(std::make_unique>(std::move(func))) {} - inline void call() const noexcept { - _function->operator()(); - } - private: - std::unique_ptr> _function; - } SWIFT_NONCOPYABLE; - Func_void create_Func_void(void* NON_NULL swiftClosureWrapper) noexcept; - inline Func_void_Wrapper wrap_Func_void(Func_void value) noexcept { - return Func_void_Wrapper(std::move(value)); - } - - // pragma MARK: std::shared_ptr> - /** - * Specialized version of `std::shared_ptr>`. - */ - using std__shared_ptr_Promise_TestResult__ = std::shared_ptr>; - inline std::shared_ptr> create_std__shared_ptr_Promise_TestResult__() noexcept { - return Promise::create(); - } - inline PromiseHolder wrap_std__shared_ptr_Promise_TestResult__(std::shared_ptr> promise) noexcept { - return PromiseHolder(std::move(promise)); - } - - // pragma MARK: std::function - /** - * Specialized version of `std::function`. - */ - using Func_void_TestResult = std::function; - /** - * Wrapper class for a `std::function`, this can be used from Swift. - */ - class Func_void_TestResult_Wrapper final { - public: - explicit Func_void_TestResult_Wrapper(std::function&& func): _function(std::make_unique>(std::move(func))) {} - inline void call(TestResult result) const noexcept { - _function->operator()(result); - } - private: - std::unique_ptr> _function; - } SWIFT_NONCOPYABLE; - Func_void_TestResult create_Func_void_TestResult(void* NON_NULL swiftClosureWrapper) noexcept; - inline Func_void_TestResult_Wrapper wrap_Func_void_TestResult(Func_void_TestResult value) noexcept { - return Func_void_TestResult_Wrapper(std::move(value)); - } - - // pragma MARK: std::vector - /** - * Specialized version of `std::vector`. - */ - using std__vector_FallbackBundleInfo_ = std::vector; - inline std::vector create_std__vector_FallbackBundleInfo_(size_t size) noexcept { - std::vector vector; - vector.reserve(size); - return vector; - } - - // pragma MARK: std::shared_ptr>> - /** - * Specialized version of `std::shared_ptr>>`. - */ - using std__shared_ptr_Promise_std__vector_FallbackBundleInfo___ = std::shared_ptr>>; - inline std::shared_ptr>> create_std__shared_ptr_Promise_std__vector_FallbackBundleInfo___() noexcept { - return Promise>::create(); - } - inline PromiseHolder> wrap_std__shared_ptr_Promise_std__vector_FallbackBundleInfo___(std::shared_ptr>> promise) noexcept { - return PromiseHolder>(std::move(promise)); - } - - // pragma MARK: std::function& /* result */)> - /** - * Specialized version of `std::function&)>`. - */ - using Func_void_std__vector_FallbackBundleInfo_ = std::function& /* result */)>; - /** - * Wrapper class for a `std::function& / * result * /)>`, this can be used from Swift. - */ - class Func_void_std__vector_FallbackBundleInfo__Wrapper final { - public: - explicit Func_void_std__vector_FallbackBundleInfo__Wrapper(std::function& /* result */)>&& func): _function(std::make_unique& /* result */)>>(std::move(func))) {} - inline void call(std::vector result) const noexcept { - _function->operator()(result); - } - private: - std::unique_ptr& /* result */)>> _function; - } SWIFT_NONCOPYABLE; - Func_void_std__vector_FallbackBundleInfo_ create_Func_void_std__vector_FallbackBundleInfo_(void* NON_NULL swiftClosureWrapper) noexcept; - inline Func_void_std__vector_FallbackBundleInfo__Wrapper wrap_Func_void_std__vector_FallbackBundleInfo_(Func_void_std__vector_FallbackBundleInfo_ value) noexcept { - return Func_void_std__vector_FallbackBundleInfo__Wrapper(std::move(value)); - } - - // pragma MARK: std::shared_ptr> - /** - * Specialized version of `std::shared_ptr>`. - */ - using std__shared_ptr_Promise_std__string__ = std::shared_ptr>; - inline std::shared_ptr> create_std__shared_ptr_Promise_std__string__() noexcept { - return Promise::create(); - } - inline PromiseHolder wrap_std__shared_ptr_Promise_std__string__(std::shared_ptr> promise) noexcept { - return PromiseHolder(std::move(promise)); - } - - // pragma MARK: std::function - /** - * Specialized version of `std::function`. - */ - using Func_void_std__string = std::function; - /** - * Wrapper class for a `std::function`, this can be used from Swift. - */ - class Func_void_std__string_Wrapper final { - public: - explicit Func_void_std__string_Wrapper(std::function&& func): _function(std::make_unique>(std::move(func))) {} - inline void call(std::string result) const noexcept { - _function->operator()(result); - } - private: - std::unique_ptr> _function; - } SWIFT_NONCOPYABLE; - Func_void_std__string create_Func_void_std__string(void* NON_NULL swiftClosureWrapper) noexcept; - inline Func_void_std__string_Wrapper wrap_Func_void_std__string(Func_void_std__string value) noexcept { - return Func_void_std__string_Wrapper(std::move(value)); - } - - // pragma MARK: std::shared_ptr> - /** - * Specialized version of `std::shared_ptr>`. - */ - using std__shared_ptr_Promise_bool__ = std::shared_ptr>; - inline std::shared_ptr> create_std__shared_ptr_Promise_bool__() noexcept { - return Promise::create(); - } - inline PromiseHolder wrap_std__shared_ptr_Promise_bool__(std::shared_ptr> promise) noexcept { - return PromiseHolder(std::move(promise)); - } - - // pragma MARK: std::function - /** - * Specialized version of `std::function`. - */ - using Func_void_bool = std::function; - /** - * Wrapper class for a `std::function`, this can be used from Swift. - */ - class Func_void_bool_Wrapper final { - public: - explicit Func_void_bool_Wrapper(std::function&& func): _function(std::make_unique>(std::move(func))) {} - inline void call(bool result) const noexcept { - _function->operator()(result); - } - private: - std::unique_ptr> _function; - } SWIFT_NONCOPYABLE; - Func_void_bool create_Func_void_bool(void* NON_NULL swiftClosureWrapper) noexcept; - inline Func_void_bool_Wrapper wrap_Func_void_bool(Func_void_bool value) noexcept { - return Func_void_bool_Wrapper(std::move(value)); - } - - // pragma MARK: std::vector - /** - * Specialized version of `std::vector`. - */ - using std__vector_LocalBundleInfo_ = std::vector; - inline std::vector create_std__vector_LocalBundleInfo_(size_t size) noexcept { - std::vector vector; - vector.reserve(size); - return vector; - } - - // pragma MARK: std::shared_ptr>> - /** - * Specialized version of `std::shared_ptr>>`. - */ - using std__shared_ptr_Promise_std__vector_LocalBundleInfo___ = std::shared_ptr>>; - inline std::shared_ptr>> create_std__shared_ptr_Promise_std__vector_LocalBundleInfo___() noexcept { - return Promise>::create(); - } - inline PromiseHolder> wrap_std__shared_ptr_Promise_std__vector_LocalBundleInfo___(std::shared_ptr>> promise) noexcept { - return PromiseHolder>(std::move(promise)); - } - - // pragma MARK: std::function& /* result */)> - /** - * Specialized version of `std::function&)>`. - */ - using Func_void_std__vector_LocalBundleInfo_ = std::function& /* result */)>; - /** - * Wrapper class for a `std::function& / * result * /)>`, this can be used from Swift. - */ - class Func_void_std__vector_LocalBundleInfo__Wrapper final { - public: - explicit Func_void_std__vector_LocalBundleInfo__Wrapper(std::function& /* result */)>&& func): _function(std::make_unique& /* result */)>>(std::move(func))) {} - inline void call(std::vector result) const noexcept { - _function->operator()(result); - } - private: - std::unique_ptr& /* result */)>> _function; - } SWIFT_NONCOPYABLE; - Func_void_std__vector_LocalBundleInfo_ create_Func_void_std__vector_LocalBundleInfo_(void* NON_NULL swiftClosureWrapper) noexcept; - inline Func_void_std__vector_LocalBundleInfo__Wrapper wrap_Func_void_std__vector_LocalBundleInfo_(Func_void_std__vector_LocalBundleInfo_ value) noexcept { - return Func_void_std__vector_LocalBundleInfo__Wrapper(std::move(value)); - } - - // pragma MARK: std::vector - /** - * Specialized version of `std::vector`. - */ - using std__vector_AscFileInfo_ = std::vector; - inline std::vector create_std__vector_AscFileInfo_(size_t size) noexcept { - std::vector vector; - vector.reserve(size); - return vector; - } - - // pragma MARK: std::shared_ptr>> - /** - * Specialized version of `std::shared_ptr>>`. - */ - using std__shared_ptr_Promise_std__vector_AscFileInfo___ = std::shared_ptr>>; - inline std::shared_ptr>> create_std__shared_ptr_Promise_std__vector_AscFileInfo___() noexcept { - return Promise>::create(); - } - inline PromiseHolder> wrap_std__shared_ptr_Promise_std__vector_AscFileInfo___(std::shared_ptr>> promise) noexcept { - return PromiseHolder>(std::move(promise)); - } - - // pragma MARK: std::function& /* result */)> - /** - * Specialized version of `std::function&)>`. - */ - using Func_void_std__vector_AscFileInfo_ = std::function& /* result */)>; - /** - * Wrapper class for a `std::function& / * result * /)>`, this can be used from Swift. - */ - class Func_void_std__vector_AscFileInfo__Wrapper final { - public: - explicit Func_void_std__vector_AscFileInfo__Wrapper(std::function& /* result */)>&& func): _function(std::make_unique& /* result */)>>(std::move(func))) {} - inline void call(std::vector result) const noexcept { - _function->operator()(result); - } - private: - std::unique_ptr& /* result */)>> _function; - } SWIFT_NONCOPYABLE; - Func_void_std__vector_AscFileInfo_ create_Func_void_std__vector_AscFileInfo_(void* NON_NULL swiftClosureWrapper) noexcept; - inline Func_void_std__vector_AscFileInfo__Wrapper wrap_Func_void_std__vector_AscFileInfo_(Func_void_std__vector_AscFileInfo_ value) noexcept { - return Func_void_std__vector_AscFileInfo__Wrapper(std::move(value)); - } - - // pragma MARK: std::function - /** - * Specialized version of `std::function`. - */ - using Func_void_BundleDownloadEvent = std::function; - /** - * Wrapper class for a `std::function`, this can be used from Swift. - */ - class Func_void_BundleDownloadEvent_Wrapper final { - public: - explicit Func_void_BundleDownloadEvent_Wrapper(std::function&& func): _function(std::make_unique>(std::move(func))) {} - inline void call(BundleDownloadEvent event) const noexcept { - _function->operator()(event); - } - private: - std::unique_ptr> _function; - } SWIFT_NONCOPYABLE; - Func_void_BundleDownloadEvent create_Func_void_BundleDownloadEvent(void* NON_NULL swiftClosureWrapper) noexcept; - inline Func_void_BundleDownloadEvent_Wrapper wrap_Func_void_BundleDownloadEvent(Func_void_BundleDownloadEvent value) noexcept { - return Func_void_BundleDownloadEvent_Wrapper(std::move(value)); - } - - // pragma MARK: std::shared_ptr - /** - * Specialized version of `std::shared_ptr`. - */ - using std__shared_ptr_HybridReactNativeBundleUpdateSpec_ = std::shared_ptr; - std::shared_ptr create_std__shared_ptr_HybridReactNativeBundleUpdateSpec_(void* NON_NULL swiftUnsafePointer) noexcept; - void* NON_NULL get_std__shared_ptr_HybridReactNativeBundleUpdateSpec_(std__shared_ptr_HybridReactNativeBundleUpdateSpec_ cppType); - - // pragma MARK: std::weak_ptr - using std__weak_ptr_HybridReactNativeBundleUpdateSpec_ = std::weak_ptr; - inline std__weak_ptr_HybridReactNativeBundleUpdateSpec_ weakify_std__shared_ptr_HybridReactNativeBundleUpdateSpec_(const std::shared_ptr& strong) noexcept { return strong; } - - // pragma MARK: Result>> - using Result_std__shared_ptr_Promise_BundleDownloadResult___ = Result>>; - inline Result_std__shared_ptr_Promise_BundleDownloadResult___ create_Result_std__shared_ptr_Promise_BundleDownloadResult___(const std::shared_ptr>& value) noexcept { - return Result>>::withValue(value); - } - inline Result_std__shared_ptr_Promise_BundleDownloadResult___ create_Result_std__shared_ptr_Promise_BundleDownloadResult___(const std::exception_ptr& error) noexcept { - return Result>>::withError(error); - } - - // pragma MARK: Result>> - using Result_std__shared_ptr_Promise_void___ = Result>>; - inline Result_std__shared_ptr_Promise_void___ create_Result_std__shared_ptr_Promise_void___(const std::shared_ptr>& value) noexcept { - return Result>>::withValue(value); - } - inline Result_std__shared_ptr_Promise_void___ create_Result_std__shared_ptr_Promise_void___(const std::exception_ptr& error) noexcept { - return Result>>::withError(error); - } - - // pragma MARK: Result>> - using Result_std__shared_ptr_Promise_TestResult___ = Result>>; - inline Result_std__shared_ptr_Promise_TestResult___ create_Result_std__shared_ptr_Promise_TestResult___(const std::shared_ptr>& value) noexcept { - return Result>>::withValue(value); - } - inline Result_std__shared_ptr_Promise_TestResult___ create_Result_std__shared_ptr_Promise_TestResult___(const std::exception_ptr& error) noexcept { - return Result>>::withError(error); - } - - // pragma MARK: Result>>> - using Result_std__shared_ptr_Promise_std__vector_FallbackBundleInfo____ = Result>>>; - inline Result_std__shared_ptr_Promise_std__vector_FallbackBundleInfo____ create_Result_std__shared_ptr_Promise_std__vector_FallbackBundleInfo____(const std::shared_ptr>>& value) noexcept { - return Result>>>::withValue(value); - } - inline Result_std__shared_ptr_Promise_std__vector_FallbackBundleInfo____ create_Result_std__shared_ptr_Promise_std__vector_FallbackBundleInfo____(const std::exception_ptr& error) noexcept { - return Result>>>::withError(error); - } - - // pragma MARK: Result - using Result_std__string_ = Result; - inline Result_std__string_ create_Result_std__string_(const std::string& value) noexcept { - return Result::withValue(value); - } - inline Result_std__string_ create_Result_std__string_(const std::exception_ptr& error) noexcept { - return Result::withError(error); - } - - // pragma MARK: Result>> - using Result_std__shared_ptr_Promise_std__string___ = Result>>; - inline Result_std__shared_ptr_Promise_std__string___ create_Result_std__shared_ptr_Promise_std__string___(const std::shared_ptr>& value) noexcept { - return Result>>::withValue(value); - } - inline Result_std__shared_ptr_Promise_std__string___ create_Result_std__shared_ptr_Promise_std__string___(const std::exception_ptr& error) noexcept { - return Result>>::withError(error); - } - - // pragma MARK: Result>> - using Result_std__shared_ptr_Promise_bool___ = Result>>; - inline Result_std__shared_ptr_Promise_bool___ create_Result_std__shared_ptr_Promise_bool___(const std::shared_ptr>& value) noexcept { - return Result>>::withValue(value); - } - inline Result_std__shared_ptr_Promise_bool___ create_Result_std__shared_ptr_Promise_bool___(const std::exception_ptr& error) noexcept { - return Result>>::withError(error); - } - - // pragma MARK: Result - using Result_bool_ = Result; - inline Result_bool_ create_Result_bool_(bool value) noexcept { - return Result::withValue(std::move(value)); - } - inline Result_bool_ create_Result_bool_(const std::exception_ptr& error) noexcept { - return Result::withError(error); - } - - // pragma MARK: Result>>> - using Result_std__shared_ptr_Promise_std__vector_LocalBundleInfo____ = Result>>>; - inline Result_std__shared_ptr_Promise_std__vector_LocalBundleInfo____ create_Result_std__shared_ptr_Promise_std__vector_LocalBundleInfo____(const std::shared_ptr>>& value) noexcept { - return Result>>>::withValue(value); - } - inline Result_std__shared_ptr_Promise_std__vector_LocalBundleInfo____ create_Result_std__shared_ptr_Promise_std__vector_LocalBundleInfo____(const std::exception_ptr& error) noexcept { - return Result>>>::withError(error); - } - - // pragma MARK: Result>>> - using Result_std__shared_ptr_Promise_std__vector_AscFileInfo____ = Result>>>; - inline Result_std__shared_ptr_Promise_std__vector_AscFileInfo____ create_Result_std__shared_ptr_Promise_std__vector_AscFileInfo____(const std::shared_ptr>>& value) noexcept { - return Result>>>::withValue(value); - } - inline Result_std__shared_ptr_Promise_std__vector_AscFileInfo____ create_Result_std__shared_ptr_Promise_std__vector_AscFileInfo____(const std::exception_ptr& error) noexcept { - return Result>>>::withError(error); - } - - // pragma MARK: Result - using Result_double_ = Result; - inline Result_double_ create_Result_double_(double value) noexcept { - return Result::withValue(std::move(value)); - } - inline Result_double_ create_Result_double_(const std::exception_ptr& error) noexcept { - return Result::withError(error); - } - - // pragma MARK: Result - using Result_void_ = Result; - inline Result_void_ create_Result_void_() noexcept { - return Result::withValue(); - } - inline Result_void_ create_Result_void_(const std::exception_ptr& error) noexcept { - return Result::withError(error); - } - -} // namespace margelo::nitro::reactnativebundleupdate::bridge::swift diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/ios/ReactNativeBundleUpdate-Swift-Cxx-Umbrella.hpp b/native-modules/react-native-bundle-update/nitrogen/generated/ios/ReactNativeBundleUpdate-Swift-Cxx-Umbrella.hpp deleted file mode 100644 index fb48716..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/ios/ReactNativeBundleUpdate-Swift-Cxx-Umbrella.hpp +++ /dev/null @@ -1,83 +0,0 @@ -/// -/// ReactNativeBundleUpdate-Swift-Cxx-Umbrella.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -// Forward declarations of C++ defined types -// Forward declaration of `AscFileInfo` to properly resolve imports. -namespace margelo::nitro::reactnativebundleupdate { struct AscFileInfo; } -// Forward declaration of `BundleDownloadASCParams` to properly resolve imports. -namespace margelo::nitro::reactnativebundleupdate { struct BundleDownloadASCParams; } -// Forward declaration of `BundleDownloadEvent` to properly resolve imports. -namespace margelo::nitro::reactnativebundleupdate { struct BundleDownloadEvent; } -// Forward declaration of `BundleDownloadParams` to properly resolve imports. -namespace margelo::nitro::reactnativebundleupdate { struct BundleDownloadParams; } -// Forward declaration of `BundleDownloadResult` to properly resolve imports. -namespace margelo::nitro::reactnativebundleupdate { struct BundleDownloadResult; } -// Forward declaration of `BundleInstallParams` to properly resolve imports. -namespace margelo::nitro::reactnativebundleupdate { struct BundleInstallParams; } -// Forward declaration of `BundleSwitchParams` to properly resolve imports. -namespace margelo::nitro::reactnativebundleupdate { struct BundleSwitchParams; } -// Forward declaration of `BundleVerifyASCParams` to properly resolve imports. -namespace margelo::nitro::reactnativebundleupdate { struct BundleVerifyASCParams; } -// Forward declaration of `BundleVerifyParams` to properly resolve imports. -namespace margelo::nitro::reactnativebundleupdate { struct BundleVerifyParams; } -// Forward declaration of `FallbackBundleInfo` to properly resolve imports. -namespace margelo::nitro::reactnativebundleupdate { struct FallbackBundleInfo; } -// Forward declaration of `HybridReactNativeBundleUpdateSpec` to properly resolve imports. -namespace margelo::nitro::reactnativebundleupdate { class HybridReactNativeBundleUpdateSpec; } -// Forward declaration of `LocalBundleInfo` to properly resolve imports. -namespace margelo::nitro::reactnativebundleupdate { struct LocalBundleInfo; } -// Forward declaration of `TestResult` to properly resolve imports. -namespace margelo::nitro::reactnativebundleupdate { struct TestResult; } - -// Include C++ defined types -#include "AscFileInfo.hpp" -#include "BundleDownloadASCParams.hpp" -#include "BundleDownloadEvent.hpp" -#include "BundleDownloadParams.hpp" -#include "BundleDownloadResult.hpp" -#include "BundleInstallParams.hpp" -#include "BundleSwitchParams.hpp" -#include "BundleVerifyASCParams.hpp" -#include "BundleVerifyParams.hpp" -#include "FallbackBundleInfo.hpp" -#include "HybridReactNativeBundleUpdateSpec.hpp" -#include "LocalBundleInfo.hpp" -#include "TestResult.hpp" -#include -#include -#include -#include -#include -#include -#include - -// C++ helpers for Swift -#include "ReactNativeBundleUpdate-Swift-Cxx-Bridge.hpp" - -// Common C++ types used in Swift -#include -#include -#include -#include - -// Forward declarations of Swift defined types -// Forward declaration of `HybridReactNativeBundleUpdateSpec_cxx` to properly resolve imports. -namespace ReactNativeBundleUpdate { class HybridReactNativeBundleUpdateSpec_cxx; } - -// Include Swift defined types -#if __has_include("ReactNativeBundleUpdate-Swift.h") -// This header is generated by Xcode/Swift on every app build. -// If it cannot be found, make sure the Swift module's name (= podspec name) is actually "ReactNativeBundleUpdate". -#include "ReactNativeBundleUpdate-Swift.h" -// Same as above, but used when building with frameworks (`use_frameworks`) -#elif __has_include() -#include -#else -#error ReactNativeBundleUpdate's autogenerated Swift header cannot be found! Make sure the Swift module's name (= podspec name) is actually "ReactNativeBundleUpdate", and try building the app first. -#endif diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/ios/ReactNativeBundleUpdateAutolinking.mm b/native-modules/react-native-bundle-update/nitrogen/generated/ios/ReactNativeBundleUpdateAutolinking.mm deleted file mode 100644 index 313f887..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/ios/ReactNativeBundleUpdateAutolinking.mm +++ /dev/null @@ -1,33 +0,0 @@ -/// -/// ReactNativeBundleUpdateAutolinking.mm -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#import -#import -#import "ReactNativeBundleUpdate-Swift-Cxx-Umbrella.hpp" -#import - -#include "HybridReactNativeBundleUpdateSpecSwift.hpp" - -@interface ReactNativeBundleUpdateAutolinking : NSObject -@end - -@implementation ReactNativeBundleUpdateAutolinking - -+ (void) load { - using namespace margelo::nitro; - using namespace margelo::nitro::reactnativebundleupdate; - - HybridObjectRegistry::registerHybridObjectConstructor( - "ReactNativeBundleUpdate", - []() -> std::shared_ptr { - std::shared_ptr hybridObject = ReactNativeBundleUpdate::ReactNativeBundleUpdateAutolinking::createReactNativeBundleUpdate(); - return hybridObject; - } - ); -} - -@end diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/ios/ReactNativeBundleUpdateAutolinking.swift b/native-modules/react-native-bundle-update/nitrogen/generated/ios/ReactNativeBundleUpdateAutolinking.swift deleted file mode 100644 index c49b918..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/ios/ReactNativeBundleUpdateAutolinking.swift +++ /dev/null @@ -1,25 +0,0 @@ -/// -/// ReactNativeBundleUpdateAutolinking.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -public final class ReactNativeBundleUpdateAutolinking { - public typealias bridge = margelo.nitro.reactnativebundleupdate.bridge.swift - - /** - * Creates an instance of a Swift class that implements `HybridReactNativeBundleUpdateSpec`, - * and wraps it in a Swift class that can directly interop with C++ (`HybridReactNativeBundleUpdateSpec_cxx`) - * - * This is generated by Nitrogen and will initialize the class specified - * in the `"autolinking"` property of `nitro.json` (in this case, `ReactNativeBundleUpdate`). - */ - public static func createReactNativeBundleUpdate() -> bridge.std__shared_ptr_HybridReactNativeBundleUpdateSpec_ { - let hybridObject = ReactNativeBundleUpdate() - return { () -> bridge.std__shared_ptr_HybridReactNativeBundleUpdateSpec_ in - let __cxxWrapped = hybridObject.getCxxWrapper() - return __cxxWrapped.getCxxPart() - }() - } -} diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/ios/c++/HybridReactNativeBundleUpdateSpecSwift.cpp b/native-modules/react-native-bundle-update/nitrogen/generated/ios/c++/HybridReactNativeBundleUpdateSpecSwift.cpp deleted file mode 100644 index cd7d3c3..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/ios/c++/HybridReactNativeBundleUpdateSpecSwift.cpp +++ /dev/null @@ -1,11 +0,0 @@ -/// -/// HybridReactNativeBundleUpdateSpecSwift.cpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#include "HybridReactNativeBundleUpdateSpecSwift.hpp" - -namespace margelo::nitro::reactnativebundleupdate { -} // namespace margelo::nitro::reactnativebundleupdate diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/ios/c++/HybridReactNativeBundleUpdateSpecSwift.hpp b/native-modules/react-native-bundle-update/nitrogen/generated/ios/c++/HybridReactNativeBundleUpdateSpecSwift.hpp deleted file mode 100644 index c71bbd9..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/ios/c++/HybridReactNativeBundleUpdateSpecSwift.hpp +++ /dev/null @@ -1,336 +0,0 @@ -/// -/// HybridReactNativeBundleUpdateSpecSwift.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#include "HybridReactNativeBundleUpdateSpec.hpp" - -// Forward declaration of `HybridReactNativeBundleUpdateSpec_cxx` to properly resolve imports. -namespace ReactNativeBundleUpdate { class HybridReactNativeBundleUpdateSpec_cxx; } - -// Forward declaration of `BundleDownloadResult` to properly resolve imports. -namespace margelo::nitro::reactnativebundleupdate { struct BundleDownloadResult; } -// Forward declaration of `BundleDownloadParams` to properly resolve imports. -namespace margelo::nitro::reactnativebundleupdate { struct BundleDownloadParams; } -// Forward declaration of `BundleVerifyParams` to properly resolve imports. -namespace margelo::nitro::reactnativebundleupdate { struct BundleVerifyParams; } -// Forward declaration of `BundleVerifyASCParams` to properly resolve imports. -namespace margelo::nitro::reactnativebundleupdate { struct BundleVerifyASCParams; } -// Forward declaration of `BundleDownloadASCParams` to properly resolve imports. -namespace margelo::nitro::reactnativebundleupdate { struct BundleDownloadASCParams; } -// Forward declaration of `BundleInstallParams` to properly resolve imports. -namespace margelo::nitro::reactnativebundleupdate { struct BundleInstallParams; } -// Forward declaration of `TestResult` to properly resolve imports. -namespace margelo::nitro::reactnativebundleupdate { struct TestResult; } -// Forward declaration of `FallbackBundleInfo` to properly resolve imports. -namespace margelo::nitro::reactnativebundleupdate { struct FallbackBundleInfo; } -// Forward declaration of `BundleSwitchParams` to properly resolve imports. -namespace margelo::nitro::reactnativebundleupdate { struct BundleSwitchParams; } -// Forward declaration of `LocalBundleInfo` to properly resolve imports. -namespace margelo::nitro::reactnativebundleupdate { struct LocalBundleInfo; } -// Forward declaration of `AscFileInfo` to properly resolve imports. -namespace margelo::nitro::reactnativebundleupdate { struct AscFileInfo; } -// Forward declaration of `BundleDownloadEvent` to properly resolve imports. -namespace margelo::nitro::reactnativebundleupdate { struct BundleDownloadEvent; } - -#include "BundleDownloadResult.hpp" -#include -#include -#include "BundleDownloadParams.hpp" -#include "BundleVerifyParams.hpp" -#include "BundleVerifyASCParams.hpp" -#include "BundleDownloadASCParams.hpp" -#include "BundleInstallParams.hpp" -#include "TestResult.hpp" -#include "FallbackBundleInfo.hpp" -#include -#include "BundleSwitchParams.hpp" -#include "LocalBundleInfo.hpp" -#include "AscFileInfo.hpp" -#include "BundleDownloadEvent.hpp" -#include - -#include "ReactNativeBundleUpdate-Swift-Cxx-Umbrella.hpp" - -namespace margelo::nitro::reactnativebundleupdate { - - /** - * The C++ part of HybridReactNativeBundleUpdateSpec_cxx.swift. - * - * HybridReactNativeBundleUpdateSpecSwift (C++) accesses HybridReactNativeBundleUpdateSpec_cxx (Swift), and might - * contain some additional bridging code for C++ <> Swift interop. - * - * Since this obviously introduces an overhead, I hope at some point in - * the future, HybridReactNativeBundleUpdateSpec_cxx can directly inherit from the C++ class HybridReactNativeBundleUpdateSpec - * to simplify the whole structure and memory management. - */ - class HybridReactNativeBundleUpdateSpecSwift: public virtual HybridReactNativeBundleUpdateSpec { - public: - // Constructor from a Swift instance - explicit HybridReactNativeBundleUpdateSpecSwift(const ReactNativeBundleUpdate::HybridReactNativeBundleUpdateSpec_cxx& swiftPart): - HybridObject(HybridReactNativeBundleUpdateSpec::TAG), - _swiftPart(swiftPart) { } - - public: - // Get the Swift part - inline ReactNativeBundleUpdate::HybridReactNativeBundleUpdateSpec_cxx& getSwiftPart() noexcept { - return _swiftPart; - } - - public: - inline size_t getExternalMemorySize() noexcept override { - return _swiftPart.getMemorySize(); - } - void dispose() noexcept override { - _swiftPart.dispose(); - } - std::string toString() override { - return _swiftPart.toString(); - } - - public: - // Properties - - - public: - // Methods - inline std::shared_ptr> downloadBundle(const BundleDownloadParams& params) override { - auto __result = _swiftPart.downloadBundle(std::forward(params)); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - auto __value = std::move(__result.value()); - return __value; - } - inline std::shared_ptr> verifyBundle(const BundleVerifyParams& params) override { - auto __result = _swiftPart.verifyBundle(std::forward(params)); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - auto __value = std::move(__result.value()); - return __value; - } - inline std::shared_ptr> verifyBundleASC(const BundleVerifyASCParams& params) override { - auto __result = _swiftPart.verifyBundleASC(std::forward(params)); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - auto __value = std::move(__result.value()); - return __value; - } - inline std::shared_ptr> downloadBundleASC(const BundleDownloadASCParams& params) override { - auto __result = _swiftPart.downloadBundleASC(std::forward(params)); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - auto __value = std::move(__result.value()); - return __value; - } - inline std::shared_ptr> installBundle(const BundleInstallParams& params) override { - auto __result = _swiftPart.installBundle(std::forward(params)); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - auto __value = std::move(__result.value()); - return __value; - } - inline std::shared_ptr> clearBundle() override { - auto __result = _swiftPart.clearBundle(); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - auto __value = std::move(__result.value()); - return __value; - } - inline std::shared_ptr> clearAllJSBundleData() override { - auto __result = _swiftPart.clearAllJSBundleData(); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - auto __value = std::move(__result.value()); - return __value; - } - inline std::shared_ptr> resetToBuiltInBundle() override { - auto __result = _swiftPart.resetToBuiltInBundle(); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - auto __value = std::move(__result.value()); - return __value; - } - inline std::shared_ptr>> getFallbackUpdateBundleData() override { - auto __result = _swiftPart.getFallbackUpdateBundleData(); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - auto __value = std::move(__result.value()); - return __value; - } - inline std::shared_ptr> setCurrentUpdateBundleData(const BundleSwitchParams& params) override { - auto __result = _swiftPart.setCurrentUpdateBundleData(std::forward(params)); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - auto __value = std::move(__result.value()); - return __value; - } - inline std::string getWebEmbedPath() override { - auto __result = _swiftPart.getWebEmbedPath(); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - auto __value = std::move(__result.value()); - return __value; - } - inline std::shared_ptr> getWebEmbedPathAsync() override { - auto __result = _swiftPart.getWebEmbedPathAsync(); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - auto __value = std::move(__result.value()); - return __value; - } - inline std::string getJsBundlePath() override { - auto __result = _swiftPart.getJsBundlePath(); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - auto __value = std::move(__result.value()); - return __value; - } - inline std::shared_ptr> getJsBundlePathAsync() override { - auto __result = _swiftPart.getJsBundlePathAsync(); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - auto __value = std::move(__result.value()); - return __value; - } - inline std::shared_ptr> getNativeAppVersion() override { - auto __result = _swiftPart.getNativeAppVersion(); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - auto __value = std::move(__result.value()); - return __value; - } - inline std::shared_ptr> testVerification() override { - auto __result = _swiftPart.testVerification(); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - auto __value = std::move(__result.value()); - return __value; - } - inline std::shared_ptr> testSkipVerification() override { - auto __result = _swiftPart.testSkipVerification(); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - auto __value = std::move(__result.value()); - return __value; - } - inline bool isSkipGpgVerificationAllowed() override { - auto __result = _swiftPart.isSkipGpgVerificationAllowed(); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - auto __value = std::move(__result.value()); - return __value; - } - inline std::shared_ptr> isBundleExists(const std::string& appVersion, const std::string& bundleVersion) override { - auto __result = _swiftPart.isBundleExists(appVersion, bundleVersion); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - auto __value = std::move(__result.value()); - return __value; - } - inline std::shared_ptr> verifyExtractedBundle(const std::string& appVersion, const std::string& bundleVersion) override { - auto __result = _swiftPart.verifyExtractedBundle(appVersion, bundleVersion); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - auto __value = std::move(__result.value()); - return __value; - } - inline std::shared_ptr>> listLocalBundles() override { - auto __result = _swiftPart.listLocalBundles(); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - auto __value = std::move(__result.value()); - return __value; - } - inline std::shared_ptr>> listAscFiles() override { - auto __result = _swiftPart.listAscFiles(); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - auto __value = std::move(__result.value()); - return __value; - } - inline std::shared_ptr> getSha256FromFilePath(const std::string& filePath) override { - auto __result = _swiftPart.getSha256FromFilePath(filePath); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - auto __value = std::move(__result.value()); - return __value; - } - inline std::shared_ptr> testDeleteJsBundle(const std::string& appVersion, const std::string& bundleVersion) override { - auto __result = _swiftPart.testDeleteJsBundle(appVersion, bundleVersion); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - auto __value = std::move(__result.value()); - return __value; - } - inline std::shared_ptr> testDeleteJsRuntimeDir(const std::string& appVersion, const std::string& bundleVersion) override { - auto __result = _swiftPart.testDeleteJsRuntimeDir(appVersion, bundleVersion); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - auto __value = std::move(__result.value()); - return __value; - } - inline std::shared_ptr> testDeleteMetadataJson(const std::string& appVersion, const std::string& bundleVersion) override { - auto __result = _swiftPart.testDeleteMetadataJson(appVersion, bundleVersion); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - auto __value = std::move(__result.value()); - return __value; - } - inline std::shared_ptr> testWriteEmptyMetadataJson(const std::string& appVersion, const std::string& bundleVersion) override { - auto __result = _swiftPart.testWriteEmptyMetadataJson(appVersion, bundleVersion); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - auto __value = std::move(__result.value()); - return __value; - } - inline double addDownloadListener(const std::function& callback) override { - auto __result = _swiftPart.addDownloadListener(callback); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - auto __value = std::move(__result.value()); - return __value; - } - inline void removeDownloadListener(double id) override { - auto __result = _swiftPart.removeDownloadListener(std::forward(id)); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - } - - private: - ReactNativeBundleUpdate::HybridReactNativeBundleUpdateSpec_cxx _swiftPart; - }; - -} // namespace margelo::nitro::reactnativebundleupdate diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/AscFileInfo.swift b/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/AscFileInfo.swift deleted file mode 100644 index 8f28b57..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/AscFileInfo.swift +++ /dev/null @@ -1,58 +0,0 @@ -/// -/// AscFileInfo.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Represents an instance of `AscFileInfo`, backed by a C++ struct. - */ -public typealias AscFileInfo = margelo.nitro.reactnativebundleupdate.AscFileInfo - -public extension AscFileInfo { - private typealias bridge = margelo.nitro.reactnativebundleupdate.bridge.swift - - /** - * Create a new instance of `AscFileInfo`. - */ - init(fileName: String, filePath: String, fileSize: Double) { - self.init(std.string(fileName), std.string(filePath), fileSize) - } - - var fileName: String { - @inline(__always) - get { - return String(self.__fileName) - } - @inline(__always) - set { - self.__fileName = std.string(newValue) - } - } - - var filePath: String { - @inline(__always) - get { - return String(self.__filePath) - } - @inline(__always) - set { - self.__filePath = std.string(newValue) - } - } - - var fileSize: Double { - @inline(__always) - get { - return self.__fileSize - } - @inline(__always) - set { - self.__fileSize = newValue - } - } -} diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/BundleDownloadASCParams.swift b/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/BundleDownloadASCParams.swift deleted file mode 100644 index 52b62bb..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/BundleDownloadASCParams.swift +++ /dev/null @@ -1,91 +0,0 @@ -/// -/// BundleDownloadASCParams.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Represents an instance of `BundleDownloadASCParams`, backed by a C++ struct. - */ -public typealias BundleDownloadASCParams = margelo.nitro.reactnativebundleupdate.BundleDownloadASCParams - -public extension BundleDownloadASCParams { - private typealias bridge = margelo.nitro.reactnativebundleupdate.bridge.swift - - /** - * Create a new instance of `BundleDownloadASCParams`. - */ - init(downloadUrl: String, downloadedFile: String, signature: String, latestVersion: String, bundleVersion: String, sha256: String) { - self.init(std.string(downloadUrl), std.string(downloadedFile), std.string(signature), std.string(latestVersion), std.string(bundleVersion), std.string(sha256)) - } - - var downloadUrl: String { - @inline(__always) - get { - return String(self.__downloadUrl) - } - @inline(__always) - set { - self.__downloadUrl = std.string(newValue) - } - } - - var downloadedFile: String { - @inline(__always) - get { - return String(self.__downloadedFile) - } - @inline(__always) - set { - self.__downloadedFile = std.string(newValue) - } - } - - var signature: String { - @inline(__always) - get { - return String(self.__signature) - } - @inline(__always) - set { - self.__signature = std.string(newValue) - } - } - - var latestVersion: String { - @inline(__always) - get { - return String(self.__latestVersion) - } - @inline(__always) - set { - self.__latestVersion = std.string(newValue) - } - } - - var bundleVersion: String { - @inline(__always) - get { - return String(self.__bundleVersion) - } - @inline(__always) - set { - self.__bundleVersion = std.string(newValue) - } - } - - var sha256: String { - @inline(__always) - get { - return String(self.__sha256) - } - @inline(__always) - set { - self.__sha256 = std.string(newValue) - } - } -} diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/BundleDownloadEvent.swift b/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/BundleDownloadEvent.swift deleted file mode 100644 index c8fbc76..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/BundleDownloadEvent.swift +++ /dev/null @@ -1,58 +0,0 @@ -/// -/// BundleDownloadEvent.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Represents an instance of `BundleDownloadEvent`, backed by a C++ struct. - */ -public typealias BundleDownloadEvent = margelo.nitro.reactnativebundleupdate.BundleDownloadEvent - -public extension BundleDownloadEvent { - private typealias bridge = margelo.nitro.reactnativebundleupdate.bridge.swift - - /** - * Create a new instance of `BundleDownloadEvent`. - */ - init(type: String, progress: Double, message: String) { - self.init(std.string(type), progress, std.string(message)) - } - - var type: String { - @inline(__always) - get { - return String(self.__type) - } - @inline(__always) - set { - self.__type = std.string(newValue) - } - } - - var progress: Double { - @inline(__always) - get { - return self.__progress - } - @inline(__always) - set { - self.__progress = newValue - } - } - - var message: String { - @inline(__always) - get { - return String(self.__message) - } - @inline(__always) - set { - self.__message = std.string(newValue) - } - } -} diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/BundleDownloadParams.swift b/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/BundleDownloadParams.swift deleted file mode 100644 index 7f2b94d..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/BundleDownloadParams.swift +++ /dev/null @@ -1,80 +0,0 @@ -/// -/// BundleDownloadParams.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Represents an instance of `BundleDownloadParams`, backed by a C++ struct. - */ -public typealias BundleDownloadParams = margelo.nitro.reactnativebundleupdate.BundleDownloadParams - -public extension BundleDownloadParams { - private typealias bridge = margelo.nitro.reactnativebundleupdate.bridge.swift - - /** - * Create a new instance of `BundleDownloadParams`. - */ - init(downloadUrl: String, latestVersion: String, bundleVersion: String, fileSize: Double, sha256: String) { - self.init(std.string(downloadUrl), std.string(latestVersion), std.string(bundleVersion), fileSize, std.string(sha256)) - } - - var downloadUrl: String { - @inline(__always) - get { - return String(self.__downloadUrl) - } - @inline(__always) - set { - self.__downloadUrl = std.string(newValue) - } - } - - var latestVersion: String { - @inline(__always) - get { - return String(self.__latestVersion) - } - @inline(__always) - set { - self.__latestVersion = std.string(newValue) - } - } - - var bundleVersion: String { - @inline(__always) - get { - return String(self.__bundleVersion) - } - @inline(__always) - set { - self.__bundleVersion = std.string(newValue) - } - } - - var fileSize: Double { - @inline(__always) - get { - return self.__fileSize - } - @inline(__always) - set { - self.__fileSize = newValue - } - } - - var sha256: String { - @inline(__always) - get { - return String(self.__sha256) - } - @inline(__always) - set { - self.__sha256 = std.string(newValue) - } - } -} diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/BundleDownloadResult.swift b/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/BundleDownloadResult.swift deleted file mode 100644 index c1e1418..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/BundleDownloadResult.swift +++ /dev/null @@ -1,80 +0,0 @@ -/// -/// BundleDownloadResult.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Represents an instance of `BundleDownloadResult`, backed by a C++ struct. - */ -public typealias BundleDownloadResult = margelo.nitro.reactnativebundleupdate.BundleDownloadResult - -public extension BundleDownloadResult { - private typealias bridge = margelo.nitro.reactnativebundleupdate.bridge.swift - - /** - * Create a new instance of `BundleDownloadResult`. - */ - init(downloadedFile: String, downloadUrl: String, latestVersion: String, bundleVersion: String, sha256: String) { - self.init(std.string(downloadedFile), std.string(downloadUrl), std.string(latestVersion), std.string(bundleVersion), std.string(sha256)) - } - - var downloadedFile: String { - @inline(__always) - get { - return String(self.__downloadedFile) - } - @inline(__always) - set { - self.__downloadedFile = std.string(newValue) - } - } - - var downloadUrl: String { - @inline(__always) - get { - return String(self.__downloadUrl) - } - @inline(__always) - set { - self.__downloadUrl = std.string(newValue) - } - } - - var latestVersion: String { - @inline(__always) - get { - return String(self.__latestVersion) - } - @inline(__always) - set { - self.__latestVersion = std.string(newValue) - } - } - - var bundleVersion: String { - @inline(__always) - get { - return String(self.__bundleVersion) - } - @inline(__always) - set { - self.__bundleVersion = std.string(newValue) - } - } - - var sha256: String { - @inline(__always) - get { - return String(self.__sha256) - } - @inline(__always) - set { - self.__sha256 = std.string(newValue) - } - } -} diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/BundleInstallParams.swift b/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/BundleInstallParams.swift deleted file mode 100644 index 13b1507..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/BundleInstallParams.swift +++ /dev/null @@ -1,69 +0,0 @@ -/// -/// BundleInstallParams.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Represents an instance of `BundleInstallParams`, backed by a C++ struct. - */ -public typealias BundleInstallParams = margelo.nitro.reactnativebundleupdate.BundleInstallParams - -public extension BundleInstallParams { - private typealias bridge = margelo.nitro.reactnativebundleupdate.bridge.swift - - /** - * Create a new instance of `BundleInstallParams`. - */ - init(downloadedFile: String, latestVersion: String, bundleVersion: String, signature: String) { - self.init(std.string(downloadedFile), std.string(latestVersion), std.string(bundleVersion), std.string(signature)) - } - - var downloadedFile: String { - @inline(__always) - get { - return String(self.__downloadedFile) - } - @inline(__always) - set { - self.__downloadedFile = std.string(newValue) - } - } - - var latestVersion: String { - @inline(__always) - get { - return String(self.__latestVersion) - } - @inline(__always) - set { - self.__latestVersion = std.string(newValue) - } - } - - var bundleVersion: String { - @inline(__always) - get { - return String(self.__bundleVersion) - } - @inline(__always) - set { - self.__bundleVersion = std.string(newValue) - } - } - - var signature: String { - @inline(__always) - get { - return String(self.__signature) - } - @inline(__always) - set { - self.__signature = std.string(newValue) - } - } -} diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/BundleSwitchParams.swift b/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/BundleSwitchParams.swift deleted file mode 100644 index a4cdac8..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/BundleSwitchParams.swift +++ /dev/null @@ -1,58 +0,0 @@ -/// -/// BundleSwitchParams.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Represents an instance of `BundleSwitchParams`, backed by a C++ struct. - */ -public typealias BundleSwitchParams = margelo.nitro.reactnativebundleupdate.BundleSwitchParams - -public extension BundleSwitchParams { - private typealias bridge = margelo.nitro.reactnativebundleupdate.bridge.swift - - /** - * Create a new instance of `BundleSwitchParams`. - */ - init(appVersion: String, bundleVersion: String, signature: String) { - self.init(std.string(appVersion), std.string(bundleVersion), std.string(signature)) - } - - var appVersion: String { - @inline(__always) - get { - return String(self.__appVersion) - } - @inline(__always) - set { - self.__appVersion = std.string(newValue) - } - } - - var bundleVersion: String { - @inline(__always) - get { - return String(self.__bundleVersion) - } - @inline(__always) - set { - self.__bundleVersion = std.string(newValue) - } - } - - var signature: String { - @inline(__always) - get { - return String(self.__signature) - } - @inline(__always) - set { - self.__signature = std.string(newValue) - } - } -} diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/BundleVerifyASCParams.swift b/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/BundleVerifyASCParams.swift deleted file mode 100644 index 8e91ef0..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/BundleVerifyASCParams.swift +++ /dev/null @@ -1,80 +0,0 @@ -/// -/// BundleVerifyASCParams.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Represents an instance of `BundleVerifyASCParams`, backed by a C++ struct. - */ -public typealias BundleVerifyASCParams = margelo.nitro.reactnativebundleupdate.BundleVerifyASCParams - -public extension BundleVerifyASCParams { - private typealias bridge = margelo.nitro.reactnativebundleupdate.bridge.swift - - /** - * Create a new instance of `BundleVerifyASCParams`. - */ - init(downloadedFile: String, sha256: String, latestVersion: String, bundleVersion: String, signature: String) { - self.init(std.string(downloadedFile), std.string(sha256), std.string(latestVersion), std.string(bundleVersion), std.string(signature)) - } - - var downloadedFile: String { - @inline(__always) - get { - return String(self.__downloadedFile) - } - @inline(__always) - set { - self.__downloadedFile = std.string(newValue) - } - } - - var sha256: String { - @inline(__always) - get { - return String(self.__sha256) - } - @inline(__always) - set { - self.__sha256 = std.string(newValue) - } - } - - var latestVersion: String { - @inline(__always) - get { - return String(self.__latestVersion) - } - @inline(__always) - set { - self.__latestVersion = std.string(newValue) - } - } - - var bundleVersion: String { - @inline(__always) - get { - return String(self.__bundleVersion) - } - @inline(__always) - set { - self.__bundleVersion = std.string(newValue) - } - } - - var signature: String { - @inline(__always) - get { - return String(self.__signature) - } - @inline(__always) - set { - self.__signature = std.string(newValue) - } - } -} diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/BundleVerifyParams.swift b/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/BundleVerifyParams.swift deleted file mode 100644 index 2fa5df8..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/BundleVerifyParams.swift +++ /dev/null @@ -1,69 +0,0 @@ -/// -/// BundleVerifyParams.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Represents an instance of `BundleVerifyParams`, backed by a C++ struct. - */ -public typealias BundleVerifyParams = margelo.nitro.reactnativebundleupdate.BundleVerifyParams - -public extension BundleVerifyParams { - private typealias bridge = margelo.nitro.reactnativebundleupdate.bridge.swift - - /** - * Create a new instance of `BundleVerifyParams`. - */ - init(downloadedFile: String, sha256: String, latestVersion: String, bundleVersion: String) { - self.init(std.string(downloadedFile), std.string(sha256), std.string(latestVersion), std.string(bundleVersion)) - } - - var downloadedFile: String { - @inline(__always) - get { - return String(self.__downloadedFile) - } - @inline(__always) - set { - self.__downloadedFile = std.string(newValue) - } - } - - var sha256: String { - @inline(__always) - get { - return String(self.__sha256) - } - @inline(__always) - set { - self.__sha256 = std.string(newValue) - } - } - - var latestVersion: String { - @inline(__always) - get { - return String(self.__latestVersion) - } - @inline(__always) - set { - self.__latestVersion = std.string(newValue) - } - } - - var bundleVersion: String { - @inline(__always) - get { - return String(self.__bundleVersion) - } - @inline(__always) - set { - self.__bundleVersion = std.string(newValue) - } - } -} diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/FallbackBundleInfo.swift b/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/FallbackBundleInfo.swift deleted file mode 100644 index 2dc71c5..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/FallbackBundleInfo.swift +++ /dev/null @@ -1,58 +0,0 @@ -/// -/// FallbackBundleInfo.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Represents an instance of `FallbackBundleInfo`, backed by a C++ struct. - */ -public typealias FallbackBundleInfo = margelo.nitro.reactnativebundleupdate.FallbackBundleInfo - -public extension FallbackBundleInfo { - private typealias bridge = margelo.nitro.reactnativebundleupdate.bridge.swift - - /** - * Create a new instance of `FallbackBundleInfo`. - */ - init(appVersion: String, bundleVersion: String, signature: String) { - self.init(std.string(appVersion), std.string(bundleVersion), std.string(signature)) - } - - var appVersion: String { - @inline(__always) - get { - return String(self.__appVersion) - } - @inline(__always) - set { - self.__appVersion = std.string(newValue) - } - } - - var bundleVersion: String { - @inline(__always) - get { - return String(self.__bundleVersion) - } - @inline(__always) - set { - self.__bundleVersion = std.string(newValue) - } - } - - var signature: String { - @inline(__always) - get { - return String(self.__signature) - } - @inline(__always) - set { - self.__signature = std.string(newValue) - } - } -} diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/Func_void.swift b/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/Func_void.swift deleted file mode 100644 index cd97af4..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/Func_void.swift +++ /dev/null @@ -1,47 +0,0 @@ -/// -/// Func_void.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Wraps a Swift `() -> Void` as a class. - * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`. - */ -public final class Func_void { - public typealias bridge = margelo.nitro.reactnativebundleupdate.bridge.swift - - private let closure: () -> Void - - public init(_ closure: @escaping () -> Void) { - self.closure = closure - } - - @inline(__always) - public func call() -> Void { - self.closure() - } - - /** - * Casts this instance to a retained unsafe raw pointer. - * This acquires one additional strong reference on the object! - */ - @inline(__always) - public func toUnsafe() -> UnsafeMutableRawPointer { - return Unmanaged.passRetained(self).toOpaque() - } - - /** - * Casts an unsafe pointer to a `Func_void`. - * The pointer has to be a retained opaque `Unmanaged`. - * This removes one strong reference from the object! - */ - @inline(__always) - public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void { - return Unmanaged.fromOpaque(pointer).takeRetainedValue() - } -} diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/Func_void_BundleDownloadEvent.swift b/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/Func_void_BundleDownloadEvent.swift deleted file mode 100644 index de078b0..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/Func_void_BundleDownloadEvent.swift +++ /dev/null @@ -1,47 +0,0 @@ -/// -/// Func_void_BundleDownloadEvent.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Wraps a Swift `(_ event: BundleDownloadEvent) -> Void` as a class. - * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`. - */ -public final class Func_void_BundleDownloadEvent { - public typealias bridge = margelo.nitro.reactnativebundleupdate.bridge.swift - - private let closure: (_ event: BundleDownloadEvent) -> Void - - public init(_ closure: @escaping (_ event: BundleDownloadEvent) -> Void) { - self.closure = closure - } - - @inline(__always) - public func call(event: BundleDownloadEvent) -> Void { - self.closure(event) - } - - /** - * Casts this instance to a retained unsafe raw pointer. - * This acquires one additional strong reference on the object! - */ - @inline(__always) - public func toUnsafe() -> UnsafeMutableRawPointer { - return Unmanaged.passRetained(self).toOpaque() - } - - /** - * Casts an unsafe pointer to a `Func_void_BundleDownloadEvent`. - * The pointer has to be a retained opaque `Unmanaged`. - * This removes one strong reference from the object! - */ - @inline(__always) - public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_BundleDownloadEvent { - return Unmanaged.fromOpaque(pointer).takeRetainedValue() - } -} diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/Func_void_BundleDownloadResult.swift b/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/Func_void_BundleDownloadResult.swift deleted file mode 100644 index 56657f9..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/Func_void_BundleDownloadResult.swift +++ /dev/null @@ -1,47 +0,0 @@ -/// -/// Func_void_BundleDownloadResult.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Wraps a Swift `(_ value: BundleDownloadResult) -> Void` as a class. - * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`. - */ -public final class Func_void_BundleDownloadResult { - public typealias bridge = margelo.nitro.reactnativebundleupdate.bridge.swift - - private let closure: (_ value: BundleDownloadResult) -> Void - - public init(_ closure: @escaping (_ value: BundleDownloadResult) -> Void) { - self.closure = closure - } - - @inline(__always) - public func call(value: BundleDownloadResult) -> Void { - self.closure(value) - } - - /** - * Casts this instance to a retained unsafe raw pointer. - * This acquires one additional strong reference on the object! - */ - @inline(__always) - public func toUnsafe() -> UnsafeMutableRawPointer { - return Unmanaged.passRetained(self).toOpaque() - } - - /** - * Casts an unsafe pointer to a `Func_void_BundleDownloadResult`. - * The pointer has to be a retained opaque `Unmanaged`. - * This removes one strong reference from the object! - */ - @inline(__always) - public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_BundleDownloadResult { - return Unmanaged.fromOpaque(pointer).takeRetainedValue() - } -} diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/Func_void_TestResult.swift b/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/Func_void_TestResult.swift deleted file mode 100644 index 1b7a3cb..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/Func_void_TestResult.swift +++ /dev/null @@ -1,47 +0,0 @@ -/// -/// Func_void_TestResult.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Wraps a Swift `(_ value: TestResult) -> Void` as a class. - * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`. - */ -public final class Func_void_TestResult { - public typealias bridge = margelo.nitro.reactnativebundleupdate.bridge.swift - - private let closure: (_ value: TestResult) -> Void - - public init(_ closure: @escaping (_ value: TestResult) -> Void) { - self.closure = closure - } - - @inline(__always) - public func call(value: TestResult) -> Void { - self.closure(value) - } - - /** - * Casts this instance to a retained unsafe raw pointer. - * This acquires one additional strong reference on the object! - */ - @inline(__always) - public func toUnsafe() -> UnsafeMutableRawPointer { - return Unmanaged.passRetained(self).toOpaque() - } - - /** - * Casts an unsafe pointer to a `Func_void_TestResult`. - * The pointer has to be a retained opaque `Unmanaged`. - * This removes one strong reference from the object! - */ - @inline(__always) - public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_TestResult { - return Unmanaged.fromOpaque(pointer).takeRetainedValue() - } -} diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/Func_void_bool.swift b/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/Func_void_bool.swift deleted file mode 100644 index 6e0be7d..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/Func_void_bool.swift +++ /dev/null @@ -1,47 +0,0 @@ -/// -/// Func_void_bool.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Wraps a Swift `(_ value: Bool) -> Void` as a class. - * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`. - */ -public final class Func_void_bool { - public typealias bridge = margelo.nitro.reactnativebundleupdate.bridge.swift - - private let closure: (_ value: Bool) -> Void - - public init(_ closure: @escaping (_ value: Bool) -> Void) { - self.closure = closure - } - - @inline(__always) - public func call(value: Bool) -> Void { - self.closure(value) - } - - /** - * Casts this instance to a retained unsafe raw pointer. - * This acquires one additional strong reference on the object! - */ - @inline(__always) - public func toUnsafe() -> UnsafeMutableRawPointer { - return Unmanaged.passRetained(self).toOpaque() - } - - /** - * Casts an unsafe pointer to a `Func_void_bool`. - * The pointer has to be a retained opaque `Unmanaged`. - * This removes one strong reference from the object! - */ - @inline(__always) - public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_bool { - return Unmanaged.fromOpaque(pointer).takeRetainedValue() - } -} diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift b/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift deleted file mode 100644 index 26ceb00..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +++ /dev/null @@ -1,47 +0,0 @@ -/// -/// Func_void_std__exception_ptr.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Wraps a Swift `(_ error: Error) -> Void` as a class. - * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`. - */ -public final class Func_void_std__exception_ptr { - public typealias bridge = margelo.nitro.reactnativebundleupdate.bridge.swift - - private let closure: (_ error: Error) -> Void - - public init(_ closure: @escaping (_ error: Error) -> Void) { - self.closure = closure - } - - @inline(__always) - public func call(error: std.exception_ptr) -> Void { - self.closure(RuntimeError.from(cppError: error)) - } - - /** - * Casts this instance to a retained unsafe raw pointer. - * This acquires one additional strong reference on the object! - */ - @inline(__always) - public func toUnsafe() -> UnsafeMutableRawPointer { - return Unmanaged.passRetained(self).toOpaque() - } - - /** - * Casts an unsafe pointer to a `Func_void_std__exception_ptr`. - * The pointer has to be a retained opaque `Unmanaged`. - * This removes one strong reference from the object! - */ - @inline(__always) - public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_std__exception_ptr { - return Unmanaged.fromOpaque(pointer).takeRetainedValue() - } -} diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/Func_void_std__string.swift b/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/Func_void_std__string.swift deleted file mode 100644 index 3d131e8..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/Func_void_std__string.swift +++ /dev/null @@ -1,47 +0,0 @@ -/// -/// Func_void_std__string.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Wraps a Swift `(_ value: String) -> Void` as a class. - * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`. - */ -public final class Func_void_std__string { - public typealias bridge = margelo.nitro.reactnativebundleupdate.bridge.swift - - private let closure: (_ value: String) -> Void - - public init(_ closure: @escaping (_ value: String) -> Void) { - self.closure = closure - } - - @inline(__always) - public func call(value: std.string) -> Void { - self.closure(String(value)) - } - - /** - * Casts this instance to a retained unsafe raw pointer. - * This acquires one additional strong reference on the object! - */ - @inline(__always) - public func toUnsafe() -> UnsafeMutableRawPointer { - return Unmanaged.passRetained(self).toOpaque() - } - - /** - * Casts an unsafe pointer to a `Func_void_std__string`. - * The pointer has to be a retained opaque `Unmanaged`. - * This removes one strong reference from the object! - */ - @inline(__always) - public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_std__string { - return Unmanaged.fromOpaque(pointer).takeRetainedValue() - } -} diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/Func_void_std__vector_AscFileInfo_.swift b/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/Func_void_std__vector_AscFileInfo_.swift deleted file mode 100644 index d49c017..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/Func_void_std__vector_AscFileInfo_.swift +++ /dev/null @@ -1,47 +0,0 @@ -/// -/// Func_void_std__vector_AscFileInfo_.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Wraps a Swift `(_ value: [AscFileInfo]) -> Void` as a class. - * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`. - */ -public final class Func_void_std__vector_AscFileInfo_ { - public typealias bridge = margelo.nitro.reactnativebundleupdate.bridge.swift - - private let closure: (_ value: [AscFileInfo]) -> Void - - public init(_ closure: @escaping (_ value: [AscFileInfo]) -> Void) { - self.closure = closure - } - - @inline(__always) - public func call(value: bridge.std__vector_AscFileInfo_) -> Void { - self.closure(value.map({ __item in __item })) - } - - /** - * Casts this instance to a retained unsafe raw pointer. - * This acquires one additional strong reference on the object! - */ - @inline(__always) - public func toUnsafe() -> UnsafeMutableRawPointer { - return Unmanaged.passRetained(self).toOpaque() - } - - /** - * Casts an unsafe pointer to a `Func_void_std__vector_AscFileInfo_`. - * The pointer has to be a retained opaque `Unmanaged`. - * This removes one strong reference from the object! - */ - @inline(__always) - public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_std__vector_AscFileInfo_ { - return Unmanaged.fromOpaque(pointer).takeRetainedValue() - } -} diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/Func_void_std__vector_FallbackBundleInfo_.swift b/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/Func_void_std__vector_FallbackBundleInfo_.swift deleted file mode 100644 index ef1dbb9..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/Func_void_std__vector_FallbackBundleInfo_.swift +++ /dev/null @@ -1,47 +0,0 @@ -/// -/// Func_void_std__vector_FallbackBundleInfo_.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Wraps a Swift `(_ value: [FallbackBundleInfo]) -> Void` as a class. - * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`. - */ -public final class Func_void_std__vector_FallbackBundleInfo_ { - public typealias bridge = margelo.nitro.reactnativebundleupdate.bridge.swift - - private let closure: (_ value: [FallbackBundleInfo]) -> Void - - public init(_ closure: @escaping (_ value: [FallbackBundleInfo]) -> Void) { - self.closure = closure - } - - @inline(__always) - public func call(value: bridge.std__vector_FallbackBundleInfo_) -> Void { - self.closure(value.map({ __item in __item })) - } - - /** - * Casts this instance to a retained unsafe raw pointer. - * This acquires one additional strong reference on the object! - */ - @inline(__always) - public func toUnsafe() -> UnsafeMutableRawPointer { - return Unmanaged.passRetained(self).toOpaque() - } - - /** - * Casts an unsafe pointer to a `Func_void_std__vector_FallbackBundleInfo_`. - * The pointer has to be a retained opaque `Unmanaged`. - * This removes one strong reference from the object! - */ - @inline(__always) - public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_std__vector_FallbackBundleInfo_ { - return Unmanaged.fromOpaque(pointer).takeRetainedValue() - } -} diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/Func_void_std__vector_LocalBundleInfo_.swift b/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/Func_void_std__vector_LocalBundleInfo_.swift deleted file mode 100644 index 8aa584c..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/Func_void_std__vector_LocalBundleInfo_.swift +++ /dev/null @@ -1,47 +0,0 @@ -/// -/// Func_void_std__vector_LocalBundleInfo_.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Wraps a Swift `(_ value: [LocalBundleInfo]) -> Void` as a class. - * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`. - */ -public final class Func_void_std__vector_LocalBundleInfo_ { - public typealias bridge = margelo.nitro.reactnativebundleupdate.bridge.swift - - private let closure: (_ value: [LocalBundleInfo]) -> Void - - public init(_ closure: @escaping (_ value: [LocalBundleInfo]) -> Void) { - self.closure = closure - } - - @inline(__always) - public func call(value: bridge.std__vector_LocalBundleInfo_) -> Void { - self.closure(value.map({ __item in __item })) - } - - /** - * Casts this instance to a retained unsafe raw pointer. - * This acquires one additional strong reference on the object! - */ - @inline(__always) - public func toUnsafe() -> UnsafeMutableRawPointer { - return Unmanaged.passRetained(self).toOpaque() - } - - /** - * Casts an unsafe pointer to a `Func_void_std__vector_LocalBundleInfo_`. - * The pointer has to be a retained opaque `Unmanaged`. - * This removes one strong reference from the object! - */ - @inline(__always) - public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_std__vector_LocalBundleInfo_ { - return Unmanaged.fromOpaque(pointer).takeRetainedValue() - } -} diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/HybridReactNativeBundleUpdateSpec.swift b/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/HybridReactNativeBundleUpdateSpec.swift deleted file mode 100644 index 3cd0322..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/HybridReactNativeBundleUpdateSpec.swift +++ /dev/null @@ -1,84 +0,0 @@ -/// -/// HybridReactNativeBundleUpdateSpec.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/// See ``HybridReactNativeBundleUpdateSpec`` -public protocol HybridReactNativeBundleUpdateSpec_protocol: HybridObject { - // Properties - - - // Methods - func downloadBundle(params: BundleDownloadParams) throws -> Promise - func verifyBundle(params: BundleVerifyParams) throws -> Promise - func verifyBundleASC(params: BundleVerifyASCParams) throws -> Promise - func downloadBundleASC(params: BundleDownloadASCParams) throws -> Promise - func installBundle(params: BundleInstallParams) throws -> Promise - func clearBundle() throws -> Promise - func clearAllJSBundleData() throws -> Promise - func resetToBuiltInBundle() throws -> Promise - func getFallbackUpdateBundleData() throws -> Promise<[FallbackBundleInfo]> - func setCurrentUpdateBundleData(params: BundleSwitchParams) throws -> Promise - func getWebEmbedPath() throws -> String - func getWebEmbedPathAsync() throws -> Promise - func getJsBundlePath() throws -> String - func getJsBundlePathAsync() throws -> Promise - func getNativeAppVersion() throws -> Promise - func testVerification() throws -> Promise - func testSkipVerification() throws -> Promise - func isSkipGpgVerificationAllowed() throws -> Bool - func isBundleExists(appVersion: String, bundleVersion: String) throws -> Promise - func verifyExtractedBundle(appVersion: String, bundleVersion: String) throws -> Promise - func listLocalBundles() throws -> Promise<[LocalBundleInfo]> - func listAscFiles() throws -> Promise<[AscFileInfo]> - func getSha256FromFilePath(filePath: String) throws -> Promise - func testDeleteJsBundle(appVersion: String, bundleVersion: String) throws -> Promise - func testDeleteJsRuntimeDir(appVersion: String, bundleVersion: String) throws -> Promise - func testDeleteMetadataJson(appVersion: String, bundleVersion: String) throws -> Promise - func testWriteEmptyMetadataJson(appVersion: String, bundleVersion: String) throws -> Promise - func addDownloadListener(callback: @escaping (_ event: BundleDownloadEvent) -> Void) throws -> Double - func removeDownloadListener(id: Double) throws -> Void -} - -public extension HybridReactNativeBundleUpdateSpec_protocol { - /// Default implementation of ``HybridObject.toString`` - func toString() -> String { - return "[HybridObject ReactNativeBundleUpdate]" - } -} - -/// See ``HybridReactNativeBundleUpdateSpec`` -open class HybridReactNativeBundleUpdateSpec_base { - private weak var cxxWrapper: HybridReactNativeBundleUpdateSpec_cxx? = nil - public init() { } - public func getCxxWrapper() -> HybridReactNativeBundleUpdateSpec_cxx { - #if DEBUG - guard self is HybridReactNativeBundleUpdateSpec else { - fatalError("`self` is not a `HybridReactNativeBundleUpdateSpec`! Did you accidentally inherit from `HybridReactNativeBundleUpdateSpec_base` instead of `HybridReactNativeBundleUpdateSpec`?") - } - #endif - if let cxxWrapper = self.cxxWrapper { - return cxxWrapper - } else { - let cxxWrapper = HybridReactNativeBundleUpdateSpec_cxx(self as! HybridReactNativeBundleUpdateSpec) - self.cxxWrapper = cxxWrapper - return cxxWrapper - } - } -} - -/** - * A Swift base-protocol representing the ReactNativeBundleUpdate HybridObject. - * Implement this protocol to create Swift-based instances of ReactNativeBundleUpdate. - * ```swift - * class HybridReactNativeBundleUpdate : HybridReactNativeBundleUpdateSpec { - * // ... - * } - * ``` - */ -public typealias HybridReactNativeBundleUpdateSpec = HybridReactNativeBundleUpdateSpec_protocol & HybridReactNativeBundleUpdateSpec_base diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/HybridReactNativeBundleUpdateSpec_cxx.swift b/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/HybridReactNativeBundleUpdateSpec_cxx.swift deleted file mode 100644 index 759d98e..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/HybridReactNativeBundleUpdateSpec_cxx.swift +++ /dev/null @@ -1,657 +0,0 @@ -/// -/// HybridReactNativeBundleUpdateSpec_cxx.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * A class implementation that bridges HybridReactNativeBundleUpdateSpec over to C++. - * In C++, we cannot use Swift protocols - so we need to wrap it in a class to make it strongly defined. - * - * Also, some Swift types need to be bridged with special handling: - * - Enums need to be wrapped in Structs, otherwise they cannot be accessed bi-directionally (Swift bug: https://github.com/swiftlang/swift/issues/75330) - * - Other HybridObjects need to be wrapped/unwrapped from the Swift TCxx wrapper - * - Throwing methods need to be wrapped with a Result type, as exceptions cannot be propagated to C++ - */ -open class HybridReactNativeBundleUpdateSpec_cxx { - /** - * The Swift <> C++ bridge's namespace (`margelo::nitro::reactnativebundleupdate::bridge::swift`) - * from `ReactNativeBundleUpdate-Swift-Cxx-Bridge.hpp`. - * This contains specialized C++ templates, and C++ helper functions that can be accessed from Swift. - */ - public typealias bridge = margelo.nitro.reactnativebundleupdate.bridge.swift - - /** - * Holds an instance of the `HybridReactNativeBundleUpdateSpec` Swift protocol. - */ - private var __implementation: any HybridReactNativeBundleUpdateSpec - - /** - * Holds a weak pointer to the C++ class that wraps the Swift class. - */ - private var __cxxPart: bridge.std__weak_ptr_HybridReactNativeBundleUpdateSpec_ - - /** - * Create a new `HybridReactNativeBundleUpdateSpec_cxx` that wraps the given `HybridReactNativeBundleUpdateSpec`. - * All properties and methods bridge to C++ types. - */ - public init(_ implementation: any HybridReactNativeBundleUpdateSpec) { - self.__implementation = implementation - self.__cxxPart = .init() - /* no base class */ - } - - /** - * Get the actual `HybridReactNativeBundleUpdateSpec` instance this class wraps. - */ - @inline(__always) - public func getHybridReactNativeBundleUpdateSpec() -> any HybridReactNativeBundleUpdateSpec { - return __implementation - } - - /** - * Casts this instance to a retained unsafe raw pointer. - * This acquires one additional strong reference on the object! - */ - public func toUnsafe() -> UnsafeMutableRawPointer { - return Unmanaged.passRetained(self).toOpaque() - } - - /** - * Casts an unsafe pointer to a `HybridReactNativeBundleUpdateSpec_cxx`. - * The pointer has to be a retained opaque `Unmanaged`. - * This removes one strong reference from the object! - */ - public class func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> HybridReactNativeBundleUpdateSpec_cxx { - return Unmanaged.fromOpaque(pointer).takeRetainedValue() - } - - /** - * Gets (or creates) the C++ part of this Hybrid Object. - * The C++ part is a `std::shared_ptr`. - */ - public func getCxxPart() -> bridge.std__shared_ptr_HybridReactNativeBundleUpdateSpec_ { - let cachedCxxPart = self.__cxxPart.lock() - if Bool(fromCxx: cachedCxxPart) { - return cachedCxxPart - } else { - let newCxxPart = bridge.create_std__shared_ptr_HybridReactNativeBundleUpdateSpec_(self.toUnsafe()) - __cxxPart = bridge.weakify_std__shared_ptr_HybridReactNativeBundleUpdateSpec_(newCxxPart) - return newCxxPart - } - } - - - - /** - * Get the memory size of the Swift class (plus size of any other allocations) - * so the JS VM can properly track it and garbage-collect the JS object if needed. - */ - @inline(__always) - public var memorySize: Int { - return MemoryHelper.getSizeOf(self.__implementation) + self.__implementation.memorySize - } - - /** - * Call dispose() on the Swift class. - * This _may_ be called manually from JS. - */ - @inline(__always) - public func dispose() { - self.__implementation.dispose() - } - - /** - * Call toString() on the Swift class. - */ - @inline(__always) - public func toString() -> String { - return self.__implementation.toString() - } - - // Properties - - - // Methods - @inline(__always) - public final func downloadBundle(params: BundleDownloadParams) -> bridge.Result_std__shared_ptr_Promise_BundleDownloadResult___ { - do { - let __result = try self.__implementation.downloadBundle(params: params) - let __resultCpp = { () -> bridge.std__shared_ptr_Promise_BundleDownloadResult__ in - let __promise = bridge.create_std__shared_ptr_Promise_BundleDownloadResult__() - let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_BundleDownloadResult__(__promise) - __result - .then({ __result in __promiseHolder.resolve(__result) }) - .catch({ __error in __promiseHolder.reject(__error.toCpp()) }) - return __promise - }() - return bridge.create_Result_std__shared_ptr_Promise_BundleDownloadResult___(__resultCpp) - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_std__shared_ptr_Promise_BundleDownloadResult___(__exceptionPtr) - } - } - - @inline(__always) - public final func verifyBundle(params: BundleVerifyParams) -> bridge.Result_std__shared_ptr_Promise_void___ { - do { - let __result = try self.__implementation.verifyBundle(params: params) - let __resultCpp = { () -> bridge.std__shared_ptr_Promise_void__ in - let __promise = bridge.create_std__shared_ptr_Promise_void__() - let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_void__(__promise) - __result - .then({ __result in __promiseHolder.resolve() }) - .catch({ __error in __promiseHolder.reject(__error.toCpp()) }) - return __promise - }() - return bridge.create_Result_std__shared_ptr_Promise_void___(__resultCpp) - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_std__shared_ptr_Promise_void___(__exceptionPtr) - } - } - - @inline(__always) - public final func verifyBundleASC(params: BundleVerifyASCParams) -> bridge.Result_std__shared_ptr_Promise_void___ { - do { - let __result = try self.__implementation.verifyBundleASC(params: params) - let __resultCpp = { () -> bridge.std__shared_ptr_Promise_void__ in - let __promise = bridge.create_std__shared_ptr_Promise_void__() - let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_void__(__promise) - __result - .then({ __result in __promiseHolder.resolve() }) - .catch({ __error in __promiseHolder.reject(__error.toCpp()) }) - return __promise - }() - return bridge.create_Result_std__shared_ptr_Promise_void___(__resultCpp) - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_std__shared_ptr_Promise_void___(__exceptionPtr) - } - } - - @inline(__always) - public final func downloadBundleASC(params: BundleDownloadASCParams) -> bridge.Result_std__shared_ptr_Promise_void___ { - do { - let __result = try self.__implementation.downloadBundleASC(params: params) - let __resultCpp = { () -> bridge.std__shared_ptr_Promise_void__ in - let __promise = bridge.create_std__shared_ptr_Promise_void__() - let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_void__(__promise) - __result - .then({ __result in __promiseHolder.resolve() }) - .catch({ __error in __promiseHolder.reject(__error.toCpp()) }) - return __promise - }() - return bridge.create_Result_std__shared_ptr_Promise_void___(__resultCpp) - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_std__shared_ptr_Promise_void___(__exceptionPtr) - } - } - - @inline(__always) - public final func installBundle(params: BundleInstallParams) -> bridge.Result_std__shared_ptr_Promise_void___ { - do { - let __result = try self.__implementation.installBundle(params: params) - let __resultCpp = { () -> bridge.std__shared_ptr_Promise_void__ in - let __promise = bridge.create_std__shared_ptr_Promise_void__() - let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_void__(__promise) - __result - .then({ __result in __promiseHolder.resolve() }) - .catch({ __error in __promiseHolder.reject(__error.toCpp()) }) - return __promise - }() - return bridge.create_Result_std__shared_ptr_Promise_void___(__resultCpp) - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_std__shared_ptr_Promise_void___(__exceptionPtr) - } - } - - @inline(__always) - public final func clearBundle() -> bridge.Result_std__shared_ptr_Promise_void___ { - do { - let __result = try self.__implementation.clearBundle() - let __resultCpp = { () -> bridge.std__shared_ptr_Promise_void__ in - let __promise = bridge.create_std__shared_ptr_Promise_void__() - let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_void__(__promise) - __result - .then({ __result in __promiseHolder.resolve() }) - .catch({ __error in __promiseHolder.reject(__error.toCpp()) }) - return __promise - }() - return bridge.create_Result_std__shared_ptr_Promise_void___(__resultCpp) - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_std__shared_ptr_Promise_void___(__exceptionPtr) - } - } - - @inline(__always) - public final func clearAllJSBundleData() -> bridge.Result_std__shared_ptr_Promise_TestResult___ { - do { - let __result = try self.__implementation.clearAllJSBundleData() - let __resultCpp = { () -> bridge.std__shared_ptr_Promise_TestResult__ in - let __promise = bridge.create_std__shared_ptr_Promise_TestResult__() - let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_TestResult__(__promise) - __result - .then({ __result in __promiseHolder.resolve(__result) }) - .catch({ __error in __promiseHolder.reject(__error.toCpp()) }) - return __promise - }() - return bridge.create_Result_std__shared_ptr_Promise_TestResult___(__resultCpp) - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_std__shared_ptr_Promise_TestResult___(__exceptionPtr) - } - } - - @inline(__always) - public final func resetToBuiltInBundle() -> bridge.Result_std__shared_ptr_Promise_void___ { - do { - let __result = try self.__implementation.resetToBuiltInBundle() - let __resultCpp = { () -> bridge.std__shared_ptr_Promise_void__ in - let __promise = bridge.create_std__shared_ptr_Promise_void__() - let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_void__(__promise) - __result - .then({ __result in __promiseHolder.resolve() }) - .catch({ __error in __promiseHolder.reject(__error.toCpp()) }) - return __promise - }() - return bridge.create_Result_std__shared_ptr_Promise_void___(__resultCpp) - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_std__shared_ptr_Promise_void___(__exceptionPtr) - } - } - - @inline(__always) - public final func getFallbackUpdateBundleData() -> bridge.Result_std__shared_ptr_Promise_std__vector_FallbackBundleInfo____ { - do { - let __result = try self.__implementation.getFallbackUpdateBundleData() - let __resultCpp = { () -> bridge.std__shared_ptr_Promise_std__vector_FallbackBundleInfo___ in - let __promise = bridge.create_std__shared_ptr_Promise_std__vector_FallbackBundleInfo___() - let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_std__vector_FallbackBundleInfo___(__promise) - __result - .then({ __result in __promiseHolder.resolve({ () -> bridge.std__vector_FallbackBundleInfo_ in - var __vector = bridge.create_std__vector_FallbackBundleInfo_(__result.count) - for __item in __result { - __vector.push_back(__item) - } - return __vector - }()) }) - .catch({ __error in __promiseHolder.reject(__error.toCpp()) }) - return __promise - }() - return bridge.create_Result_std__shared_ptr_Promise_std__vector_FallbackBundleInfo____(__resultCpp) - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_std__shared_ptr_Promise_std__vector_FallbackBundleInfo____(__exceptionPtr) - } - } - - @inline(__always) - public final func setCurrentUpdateBundleData(params: BundleSwitchParams) -> bridge.Result_std__shared_ptr_Promise_void___ { - do { - let __result = try self.__implementation.setCurrentUpdateBundleData(params: params) - let __resultCpp = { () -> bridge.std__shared_ptr_Promise_void__ in - let __promise = bridge.create_std__shared_ptr_Promise_void__() - let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_void__(__promise) - __result - .then({ __result in __promiseHolder.resolve() }) - .catch({ __error in __promiseHolder.reject(__error.toCpp()) }) - return __promise - }() - return bridge.create_Result_std__shared_ptr_Promise_void___(__resultCpp) - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_std__shared_ptr_Promise_void___(__exceptionPtr) - } - } - - @inline(__always) - public final func getWebEmbedPath() -> bridge.Result_std__string_ { - do { - let __result = try self.__implementation.getWebEmbedPath() - let __resultCpp = std.string(__result) - return bridge.create_Result_std__string_(__resultCpp) - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_std__string_(__exceptionPtr) - } - } - - @inline(__always) - public final func getWebEmbedPathAsync() -> bridge.Result_std__shared_ptr_Promise_std__string___ { - do { - let __result = try self.__implementation.getWebEmbedPathAsync() - let __resultCpp = { () -> bridge.std__shared_ptr_Promise_std__string__ in - let __promise = bridge.create_std__shared_ptr_Promise_std__string__() - let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_std__string__(__promise) - __result - .then({ __result in __promiseHolder.resolve(std.string(__result)) }) - .catch({ __error in __promiseHolder.reject(__error.toCpp()) }) - return __promise - }() - return bridge.create_Result_std__shared_ptr_Promise_std__string___(__resultCpp) - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_std__shared_ptr_Promise_std__string___(__exceptionPtr) - } - } - - @inline(__always) - public final func getJsBundlePath() -> bridge.Result_std__string_ { - do { - let __result = try self.__implementation.getJsBundlePath() - let __resultCpp = std.string(__result) - return bridge.create_Result_std__string_(__resultCpp) - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_std__string_(__exceptionPtr) - } - } - - @inline(__always) - public final func getJsBundlePathAsync() -> bridge.Result_std__shared_ptr_Promise_std__string___ { - do { - let __result = try self.__implementation.getJsBundlePathAsync() - let __resultCpp = { () -> bridge.std__shared_ptr_Promise_std__string__ in - let __promise = bridge.create_std__shared_ptr_Promise_std__string__() - let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_std__string__(__promise) - __result - .then({ __result in __promiseHolder.resolve(std.string(__result)) }) - .catch({ __error in __promiseHolder.reject(__error.toCpp()) }) - return __promise - }() - return bridge.create_Result_std__shared_ptr_Promise_std__string___(__resultCpp) - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_std__shared_ptr_Promise_std__string___(__exceptionPtr) - } - } - - @inline(__always) - public final func getNativeAppVersion() -> bridge.Result_std__shared_ptr_Promise_std__string___ { - do { - let __result = try self.__implementation.getNativeAppVersion() - let __resultCpp = { () -> bridge.std__shared_ptr_Promise_std__string__ in - let __promise = bridge.create_std__shared_ptr_Promise_std__string__() - let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_std__string__(__promise) - __result - .then({ __result in __promiseHolder.resolve(std.string(__result)) }) - .catch({ __error in __promiseHolder.reject(__error.toCpp()) }) - return __promise - }() - return bridge.create_Result_std__shared_ptr_Promise_std__string___(__resultCpp) - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_std__shared_ptr_Promise_std__string___(__exceptionPtr) - } - } - - @inline(__always) - public final func testVerification() -> bridge.Result_std__shared_ptr_Promise_bool___ { - do { - let __result = try self.__implementation.testVerification() - let __resultCpp = { () -> bridge.std__shared_ptr_Promise_bool__ in - let __promise = bridge.create_std__shared_ptr_Promise_bool__() - let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_bool__(__promise) - __result - .then({ __result in __promiseHolder.resolve(__result) }) - .catch({ __error in __promiseHolder.reject(__error.toCpp()) }) - return __promise - }() - return bridge.create_Result_std__shared_ptr_Promise_bool___(__resultCpp) - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_std__shared_ptr_Promise_bool___(__exceptionPtr) - } - } - - @inline(__always) - public final func testSkipVerification() -> bridge.Result_std__shared_ptr_Promise_bool___ { - do { - let __result = try self.__implementation.testSkipVerification() - let __resultCpp = { () -> bridge.std__shared_ptr_Promise_bool__ in - let __promise = bridge.create_std__shared_ptr_Promise_bool__() - let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_bool__(__promise) - __result - .then({ __result in __promiseHolder.resolve(__result) }) - .catch({ __error in __promiseHolder.reject(__error.toCpp()) }) - return __promise - }() - return bridge.create_Result_std__shared_ptr_Promise_bool___(__resultCpp) - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_std__shared_ptr_Promise_bool___(__exceptionPtr) - } - } - - @inline(__always) - public final func isSkipGpgVerificationAllowed() -> bridge.Result_bool_ { - do { - let __result = try self.__implementation.isSkipGpgVerificationAllowed() - let __resultCpp = __result - return bridge.create_Result_bool_(__resultCpp) - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_bool_(__exceptionPtr) - } - } - - @inline(__always) - public final func isBundleExists(appVersion: std.string, bundleVersion: std.string) -> bridge.Result_std__shared_ptr_Promise_bool___ { - do { - let __result = try self.__implementation.isBundleExists(appVersion: String(appVersion), bundleVersion: String(bundleVersion)) - let __resultCpp = { () -> bridge.std__shared_ptr_Promise_bool__ in - let __promise = bridge.create_std__shared_ptr_Promise_bool__() - let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_bool__(__promise) - __result - .then({ __result in __promiseHolder.resolve(__result) }) - .catch({ __error in __promiseHolder.reject(__error.toCpp()) }) - return __promise - }() - return bridge.create_Result_std__shared_ptr_Promise_bool___(__resultCpp) - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_std__shared_ptr_Promise_bool___(__exceptionPtr) - } - } - - @inline(__always) - public final func verifyExtractedBundle(appVersion: std.string, bundleVersion: std.string) -> bridge.Result_std__shared_ptr_Promise_void___ { - do { - let __result = try self.__implementation.verifyExtractedBundle(appVersion: String(appVersion), bundleVersion: String(bundleVersion)) - let __resultCpp = { () -> bridge.std__shared_ptr_Promise_void__ in - let __promise = bridge.create_std__shared_ptr_Promise_void__() - let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_void__(__promise) - __result - .then({ __result in __promiseHolder.resolve() }) - .catch({ __error in __promiseHolder.reject(__error.toCpp()) }) - return __promise - }() - return bridge.create_Result_std__shared_ptr_Promise_void___(__resultCpp) - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_std__shared_ptr_Promise_void___(__exceptionPtr) - } - } - - @inline(__always) - public final func listLocalBundles() -> bridge.Result_std__shared_ptr_Promise_std__vector_LocalBundleInfo____ { - do { - let __result = try self.__implementation.listLocalBundles() - let __resultCpp = { () -> bridge.std__shared_ptr_Promise_std__vector_LocalBundleInfo___ in - let __promise = bridge.create_std__shared_ptr_Promise_std__vector_LocalBundleInfo___() - let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_std__vector_LocalBundleInfo___(__promise) - __result - .then({ __result in __promiseHolder.resolve({ () -> bridge.std__vector_LocalBundleInfo_ in - var __vector = bridge.create_std__vector_LocalBundleInfo_(__result.count) - for __item in __result { - __vector.push_back(__item) - } - return __vector - }()) }) - .catch({ __error in __promiseHolder.reject(__error.toCpp()) }) - return __promise - }() - return bridge.create_Result_std__shared_ptr_Promise_std__vector_LocalBundleInfo____(__resultCpp) - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_std__shared_ptr_Promise_std__vector_LocalBundleInfo____(__exceptionPtr) - } - } - - @inline(__always) - public final func listAscFiles() -> bridge.Result_std__shared_ptr_Promise_std__vector_AscFileInfo____ { - do { - let __result = try self.__implementation.listAscFiles() - let __resultCpp = { () -> bridge.std__shared_ptr_Promise_std__vector_AscFileInfo___ in - let __promise = bridge.create_std__shared_ptr_Promise_std__vector_AscFileInfo___() - let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_std__vector_AscFileInfo___(__promise) - __result - .then({ __result in __promiseHolder.resolve({ () -> bridge.std__vector_AscFileInfo_ in - var __vector = bridge.create_std__vector_AscFileInfo_(__result.count) - for __item in __result { - __vector.push_back(__item) - } - return __vector - }()) }) - .catch({ __error in __promiseHolder.reject(__error.toCpp()) }) - return __promise - }() - return bridge.create_Result_std__shared_ptr_Promise_std__vector_AscFileInfo____(__resultCpp) - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_std__shared_ptr_Promise_std__vector_AscFileInfo____(__exceptionPtr) - } - } - - @inline(__always) - public final func getSha256FromFilePath(filePath: std.string) -> bridge.Result_std__shared_ptr_Promise_std__string___ { - do { - let __result = try self.__implementation.getSha256FromFilePath(filePath: String(filePath)) - let __resultCpp = { () -> bridge.std__shared_ptr_Promise_std__string__ in - let __promise = bridge.create_std__shared_ptr_Promise_std__string__() - let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_std__string__(__promise) - __result - .then({ __result in __promiseHolder.resolve(std.string(__result)) }) - .catch({ __error in __promiseHolder.reject(__error.toCpp()) }) - return __promise - }() - return bridge.create_Result_std__shared_ptr_Promise_std__string___(__resultCpp) - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_std__shared_ptr_Promise_std__string___(__exceptionPtr) - } - } - - @inline(__always) - public final func testDeleteJsBundle(appVersion: std.string, bundleVersion: std.string) -> bridge.Result_std__shared_ptr_Promise_TestResult___ { - do { - let __result = try self.__implementation.testDeleteJsBundle(appVersion: String(appVersion), bundleVersion: String(bundleVersion)) - let __resultCpp = { () -> bridge.std__shared_ptr_Promise_TestResult__ in - let __promise = bridge.create_std__shared_ptr_Promise_TestResult__() - let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_TestResult__(__promise) - __result - .then({ __result in __promiseHolder.resolve(__result) }) - .catch({ __error in __promiseHolder.reject(__error.toCpp()) }) - return __promise - }() - return bridge.create_Result_std__shared_ptr_Promise_TestResult___(__resultCpp) - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_std__shared_ptr_Promise_TestResult___(__exceptionPtr) - } - } - - @inline(__always) - public final func testDeleteJsRuntimeDir(appVersion: std.string, bundleVersion: std.string) -> bridge.Result_std__shared_ptr_Promise_TestResult___ { - do { - let __result = try self.__implementation.testDeleteJsRuntimeDir(appVersion: String(appVersion), bundleVersion: String(bundleVersion)) - let __resultCpp = { () -> bridge.std__shared_ptr_Promise_TestResult__ in - let __promise = bridge.create_std__shared_ptr_Promise_TestResult__() - let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_TestResult__(__promise) - __result - .then({ __result in __promiseHolder.resolve(__result) }) - .catch({ __error in __promiseHolder.reject(__error.toCpp()) }) - return __promise - }() - return bridge.create_Result_std__shared_ptr_Promise_TestResult___(__resultCpp) - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_std__shared_ptr_Promise_TestResult___(__exceptionPtr) - } - } - - @inline(__always) - public final func testDeleteMetadataJson(appVersion: std.string, bundleVersion: std.string) -> bridge.Result_std__shared_ptr_Promise_TestResult___ { - do { - let __result = try self.__implementation.testDeleteMetadataJson(appVersion: String(appVersion), bundleVersion: String(bundleVersion)) - let __resultCpp = { () -> bridge.std__shared_ptr_Promise_TestResult__ in - let __promise = bridge.create_std__shared_ptr_Promise_TestResult__() - let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_TestResult__(__promise) - __result - .then({ __result in __promiseHolder.resolve(__result) }) - .catch({ __error in __promiseHolder.reject(__error.toCpp()) }) - return __promise - }() - return bridge.create_Result_std__shared_ptr_Promise_TestResult___(__resultCpp) - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_std__shared_ptr_Promise_TestResult___(__exceptionPtr) - } - } - - @inline(__always) - public final func testWriteEmptyMetadataJson(appVersion: std.string, bundleVersion: std.string) -> bridge.Result_std__shared_ptr_Promise_TestResult___ { - do { - let __result = try self.__implementation.testWriteEmptyMetadataJson(appVersion: String(appVersion), bundleVersion: String(bundleVersion)) - let __resultCpp = { () -> bridge.std__shared_ptr_Promise_TestResult__ in - let __promise = bridge.create_std__shared_ptr_Promise_TestResult__() - let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_TestResult__(__promise) - __result - .then({ __result in __promiseHolder.resolve(__result) }) - .catch({ __error in __promiseHolder.reject(__error.toCpp()) }) - return __promise - }() - return bridge.create_Result_std__shared_ptr_Promise_TestResult___(__resultCpp) - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_std__shared_ptr_Promise_TestResult___(__exceptionPtr) - } - } - - @inline(__always) - public final func addDownloadListener(callback: bridge.Func_void_BundleDownloadEvent) -> bridge.Result_double_ { - do { - let __result = try self.__implementation.addDownloadListener(callback: { () -> (BundleDownloadEvent) -> Void in - let __wrappedFunction = bridge.wrap_Func_void_BundleDownloadEvent(callback) - return { (__event: BundleDownloadEvent) -> Void in - __wrappedFunction.call(__event) - } - }()) - let __resultCpp = __result - return bridge.create_Result_double_(__resultCpp) - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_double_(__exceptionPtr) - } - } - - @inline(__always) - public final func removeDownloadListener(id: Double) -> bridge.Result_void_ { - do { - try self.__implementation.removeDownloadListener(id: id) - return bridge.create_Result_void_() - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_void_(__exceptionPtr) - } - } -} diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/LocalBundleInfo.swift b/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/LocalBundleInfo.swift deleted file mode 100644 index cc69286..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/LocalBundleInfo.swift +++ /dev/null @@ -1,47 +0,0 @@ -/// -/// LocalBundleInfo.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Represents an instance of `LocalBundleInfo`, backed by a C++ struct. - */ -public typealias LocalBundleInfo = margelo.nitro.reactnativebundleupdate.LocalBundleInfo - -public extension LocalBundleInfo { - private typealias bridge = margelo.nitro.reactnativebundleupdate.bridge.swift - - /** - * Create a new instance of `LocalBundleInfo`. - */ - init(appVersion: String, bundleVersion: String) { - self.init(std.string(appVersion), std.string(bundleVersion)) - } - - var appVersion: String { - @inline(__always) - get { - return String(self.__appVersion) - } - @inline(__always) - set { - self.__appVersion = std.string(newValue) - } - } - - var bundleVersion: String { - @inline(__always) - get { - return String(self.__bundleVersion) - } - @inline(__always) - set { - self.__bundleVersion = std.string(newValue) - } - } -} diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/TestResult.swift b/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/TestResult.swift deleted file mode 100644 index 044c302..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/ios/swift/TestResult.swift +++ /dev/null @@ -1,47 +0,0 @@ -/// -/// TestResult.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Represents an instance of `TestResult`, backed by a C++ struct. - */ -public typealias TestResult = margelo.nitro.reactnativebundleupdate.TestResult - -public extension TestResult { - private typealias bridge = margelo.nitro.reactnativebundleupdate.bridge.swift - - /** - * Create a new instance of `TestResult`. - */ - init(success: Bool, message: String) { - self.init(success, std.string(message)) - } - - var success: Bool { - @inline(__always) - get { - return self.__success - } - @inline(__always) - set { - self.__success = newValue - } - } - - var message: String { - @inline(__always) - get { - return String(self.__message) - } - @inline(__always) - set { - self.__message = std.string(newValue) - } - } -} diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/shared/c++/AscFileInfo.hpp b/native-modules/react-native-bundle-update/nitrogen/generated/shared/c++/AscFileInfo.hpp deleted file mode 100644 index 39b1670..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/shared/c++/AscFileInfo.hpp +++ /dev/null @@ -1,83 +0,0 @@ -/// -/// AscFileInfo.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif - - - -#include - -namespace margelo::nitro::reactnativebundleupdate { - - /** - * A struct which can be represented as a JavaScript object (AscFileInfo). - */ - struct AscFileInfo { - public: - std::string fileName SWIFT_PRIVATE; - std::string filePath SWIFT_PRIVATE; - double fileSize SWIFT_PRIVATE; - - public: - AscFileInfo() = default; - explicit AscFileInfo(std::string fileName, std::string filePath, double fileSize): fileName(fileName), filePath(filePath), fileSize(fileSize) {} - }; - -} // namespace margelo::nitro::reactnativebundleupdate - -namespace margelo::nitro { - - // C++ AscFileInfo <> JS AscFileInfo (object) - template <> - struct JSIConverter final { - static inline margelo::nitro::reactnativebundleupdate::AscFileInfo fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { - jsi::Object obj = arg.asObject(runtime); - return margelo::nitro::reactnativebundleupdate::AscFileInfo( - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "fileName")), - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "filePath")), - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "fileSize")) - ); - } - static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::reactnativebundleupdate::AscFileInfo& arg) { - jsi::Object obj(runtime); - obj.setProperty(runtime, "fileName", JSIConverter::toJSI(runtime, arg.fileName)); - obj.setProperty(runtime, "filePath", JSIConverter::toJSI(runtime, arg.filePath)); - obj.setProperty(runtime, "fileSize", JSIConverter::toJSI(runtime, arg.fileSize)); - return obj; - } - static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) { - if (!value.isObject()) { - return false; - } - jsi::Object obj = value.getObject(runtime); - if (!nitro::isPlainObject(runtime, obj)) { - return false; - } - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "fileName"))) return false; - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "filePath"))) return false; - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "fileSize"))) return false; - return true; - } - }; - -} // namespace margelo::nitro diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/shared/c++/BundleDownloadASCParams.hpp b/native-modules/react-native-bundle-update/nitrogen/generated/shared/c++/BundleDownloadASCParams.hpp deleted file mode 100644 index 452e7bb..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/shared/c++/BundleDownloadASCParams.hpp +++ /dev/null @@ -1,95 +0,0 @@ -/// -/// BundleDownloadASCParams.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif - - - -#include - -namespace margelo::nitro::reactnativebundleupdate { - - /** - * A struct which can be represented as a JavaScript object (BundleDownloadASCParams). - */ - struct BundleDownloadASCParams { - public: - std::string downloadUrl SWIFT_PRIVATE; - std::string downloadedFile SWIFT_PRIVATE; - std::string signature SWIFT_PRIVATE; - std::string latestVersion SWIFT_PRIVATE; - std::string bundleVersion SWIFT_PRIVATE; - std::string sha256 SWIFT_PRIVATE; - - public: - BundleDownloadASCParams() = default; - explicit BundleDownloadASCParams(std::string downloadUrl, std::string downloadedFile, std::string signature, std::string latestVersion, std::string bundleVersion, std::string sha256): downloadUrl(downloadUrl), downloadedFile(downloadedFile), signature(signature), latestVersion(latestVersion), bundleVersion(bundleVersion), sha256(sha256) {} - }; - -} // namespace margelo::nitro::reactnativebundleupdate - -namespace margelo::nitro { - - // C++ BundleDownloadASCParams <> JS BundleDownloadASCParams (object) - template <> - struct JSIConverter final { - static inline margelo::nitro::reactnativebundleupdate::BundleDownloadASCParams fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { - jsi::Object obj = arg.asObject(runtime); - return margelo::nitro::reactnativebundleupdate::BundleDownloadASCParams( - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "downloadUrl")), - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "downloadedFile")), - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "signature")), - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "latestVersion")), - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "bundleVersion")), - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "sha256")) - ); - } - static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::reactnativebundleupdate::BundleDownloadASCParams& arg) { - jsi::Object obj(runtime); - obj.setProperty(runtime, "downloadUrl", JSIConverter::toJSI(runtime, arg.downloadUrl)); - obj.setProperty(runtime, "downloadedFile", JSIConverter::toJSI(runtime, arg.downloadedFile)); - obj.setProperty(runtime, "signature", JSIConverter::toJSI(runtime, arg.signature)); - obj.setProperty(runtime, "latestVersion", JSIConverter::toJSI(runtime, arg.latestVersion)); - obj.setProperty(runtime, "bundleVersion", JSIConverter::toJSI(runtime, arg.bundleVersion)); - obj.setProperty(runtime, "sha256", JSIConverter::toJSI(runtime, arg.sha256)); - return obj; - } - static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) { - if (!value.isObject()) { - return false; - } - jsi::Object obj = value.getObject(runtime); - if (!nitro::isPlainObject(runtime, obj)) { - return false; - } - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "downloadUrl"))) return false; - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "downloadedFile"))) return false; - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "signature"))) return false; - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "latestVersion"))) return false; - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "bundleVersion"))) return false; - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "sha256"))) return false; - return true; - } - }; - -} // namespace margelo::nitro diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/shared/c++/BundleDownloadEvent.hpp b/native-modules/react-native-bundle-update/nitrogen/generated/shared/c++/BundleDownloadEvent.hpp deleted file mode 100644 index 3ee563b..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/shared/c++/BundleDownloadEvent.hpp +++ /dev/null @@ -1,83 +0,0 @@ -/// -/// BundleDownloadEvent.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif - - - -#include - -namespace margelo::nitro::reactnativebundleupdate { - - /** - * A struct which can be represented as a JavaScript object (BundleDownloadEvent). - */ - struct BundleDownloadEvent { - public: - std::string type SWIFT_PRIVATE; - double progress SWIFT_PRIVATE; - std::string message SWIFT_PRIVATE; - - public: - BundleDownloadEvent() = default; - explicit BundleDownloadEvent(std::string type, double progress, std::string message): type(type), progress(progress), message(message) {} - }; - -} // namespace margelo::nitro::reactnativebundleupdate - -namespace margelo::nitro { - - // C++ BundleDownloadEvent <> JS BundleDownloadEvent (object) - template <> - struct JSIConverter final { - static inline margelo::nitro::reactnativebundleupdate::BundleDownloadEvent fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { - jsi::Object obj = arg.asObject(runtime); - return margelo::nitro::reactnativebundleupdate::BundleDownloadEvent( - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "type")), - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "progress")), - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "message")) - ); - } - static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::reactnativebundleupdate::BundleDownloadEvent& arg) { - jsi::Object obj(runtime); - obj.setProperty(runtime, "type", JSIConverter::toJSI(runtime, arg.type)); - obj.setProperty(runtime, "progress", JSIConverter::toJSI(runtime, arg.progress)); - obj.setProperty(runtime, "message", JSIConverter::toJSI(runtime, arg.message)); - return obj; - } - static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) { - if (!value.isObject()) { - return false; - } - jsi::Object obj = value.getObject(runtime); - if (!nitro::isPlainObject(runtime, obj)) { - return false; - } - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "type"))) return false; - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "progress"))) return false; - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "message"))) return false; - return true; - } - }; - -} // namespace margelo::nitro diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/shared/c++/BundleDownloadParams.hpp b/native-modules/react-native-bundle-update/nitrogen/generated/shared/c++/BundleDownloadParams.hpp deleted file mode 100644 index f35355e..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/shared/c++/BundleDownloadParams.hpp +++ /dev/null @@ -1,91 +0,0 @@ -/// -/// BundleDownloadParams.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif - - - -#include - -namespace margelo::nitro::reactnativebundleupdate { - - /** - * A struct which can be represented as a JavaScript object (BundleDownloadParams). - */ - struct BundleDownloadParams { - public: - std::string downloadUrl SWIFT_PRIVATE; - std::string latestVersion SWIFT_PRIVATE; - std::string bundleVersion SWIFT_PRIVATE; - double fileSize SWIFT_PRIVATE; - std::string sha256 SWIFT_PRIVATE; - - public: - BundleDownloadParams() = default; - explicit BundleDownloadParams(std::string downloadUrl, std::string latestVersion, std::string bundleVersion, double fileSize, std::string sha256): downloadUrl(downloadUrl), latestVersion(latestVersion), bundleVersion(bundleVersion), fileSize(fileSize), sha256(sha256) {} - }; - -} // namespace margelo::nitro::reactnativebundleupdate - -namespace margelo::nitro { - - // C++ BundleDownloadParams <> JS BundleDownloadParams (object) - template <> - struct JSIConverter final { - static inline margelo::nitro::reactnativebundleupdate::BundleDownloadParams fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { - jsi::Object obj = arg.asObject(runtime); - return margelo::nitro::reactnativebundleupdate::BundleDownloadParams( - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "downloadUrl")), - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "latestVersion")), - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "bundleVersion")), - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "fileSize")), - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "sha256")) - ); - } - static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::reactnativebundleupdate::BundleDownloadParams& arg) { - jsi::Object obj(runtime); - obj.setProperty(runtime, "downloadUrl", JSIConverter::toJSI(runtime, arg.downloadUrl)); - obj.setProperty(runtime, "latestVersion", JSIConverter::toJSI(runtime, arg.latestVersion)); - obj.setProperty(runtime, "bundleVersion", JSIConverter::toJSI(runtime, arg.bundleVersion)); - obj.setProperty(runtime, "fileSize", JSIConverter::toJSI(runtime, arg.fileSize)); - obj.setProperty(runtime, "sha256", JSIConverter::toJSI(runtime, arg.sha256)); - return obj; - } - static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) { - if (!value.isObject()) { - return false; - } - jsi::Object obj = value.getObject(runtime); - if (!nitro::isPlainObject(runtime, obj)) { - return false; - } - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "downloadUrl"))) return false; - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "latestVersion"))) return false; - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "bundleVersion"))) return false; - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "fileSize"))) return false; - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "sha256"))) return false; - return true; - } - }; - -} // namespace margelo::nitro diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/shared/c++/BundleDownloadResult.hpp b/native-modules/react-native-bundle-update/nitrogen/generated/shared/c++/BundleDownloadResult.hpp deleted file mode 100644 index 18b2d5d..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/shared/c++/BundleDownloadResult.hpp +++ /dev/null @@ -1,91 +0,0 @@ -/// -/// BundleDownloadResult.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif - - - -#include - -namespace margelo::nitro::reactnativebundleupdate { - - /** - * A struct which can be represented as a JavaScript object (BundleDownloadResult). - */ - struct BundleDownloadResult { - public: - std::string downloadedFile SWIFT_PRIVATE; - std::string downloadUrl SWIFT_PRIVATE; - std::string latestVersion SWIFT_PRIVATE; - std::string bundleVersion SWIFT_PRIVATE; - std::string sha256 SWIFT_PRIVATE; - - public: - BundleDownloadResult() = default; - explicit BundleDownloadResult(std::string downloadedFile, std::string downloadUrl, std::string latestVersion, std::string bundleVersion, std::string sha256): downloadedFile(downloadedFile), downloadUrl(downloadUrl), latestVersion(latestVersion), bundleVersion(bundleVersion), sha256(sha256) {} - }; - -} // namespace margelo::nitro::reactnativebundleupdate - -namespace margelo::nitro { - - // C++ BundleDownloadResult <> JS BundleDownloadResult (object) - template <> - struct JSIConverter final { - static inline margelo::nitro::reactnativebundleupdate::BundleDownloadResult fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { - jsi::Object obj = arg.asObject(runtime); - return margelo::nitro::reactnativebundleupdate::BundleDownloadResult( - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "downloadedFile")), - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "downloadUrl")), - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "latestVersion")), - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "bundleVersion")), - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "sha256")) - ); - } - static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::reactnativebundleupdate::BundleDownloadResult& arg) { - jsi::Object obj(runtime); - obj.setProperty(runtime, "downloadedFile", JSIConverter::toJSI(runtime, arg.downloadedFile)); - obj.setProperty(runtime, "downloadUrl", JSIConverter::toJSI(runtime, arg.downloadUrl)); - obj.setProperty(runtime, "latestVersion", JSIConverter::toJSI(runtime, arg.latestVersion)); - obj.setProperty(runtime, "bundleVersion", JSIConverter::toJSI(runtime, arg.bundleVersion)); - obj.setProperty(runtime, "sha256", JSIConverter::toJSI(runtime, arg.sha256)); - return obj; - } - static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) { - if (!value.isObject()) { - return false; - } - jsi::Object obj = value.getObject(runtime); - if (!nitro::isPlainObject(runtime, obj)) { - return false; - } - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "downloadedFile"))) return false; - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "downloadUrl"))) return false; - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "latestVersion"))) return false; - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "bundleVersion"))) return false; - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "sha256"))) return false; - return true; - } - }; - -} // namespace margelo::nitro diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/shared/c++/BundleInstallParams.hpp b/native-modules/react-native-bundle-update/nitrogen/generated/shared/c++/BundleInstallParams.hpp deleted file mode 100644 index 7d05dbd..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/shared/c++/BundleInstallParams.hpp +++ /dev/null @@ -1,87 +0,0 @@ -/// -/// BundleInstallParams.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif - - - -#include - -namespace margelo::nitro::reactnativebundleupdate { - - /** - * A struct which can be represented as a JavaScript object (BundleInstallParams). - */ - struct BundleInstallParams { - public: - std::string downloadedFile SWIFT_PRIVATE; - std::string latestVersion SWIFT_PRIVATE; - std::string bundleVersion SWIFT_PRIVATE; - std::string signature SWIFT_PRIVATE; - - public: - BundleInstallParams() = default; - explicit BundleInstallParams(std::string downloadedFile, std::string latestVersion, std::string bundleVersion, std::string signature): downloadedFile(downloadedFile), latestVersion(latestVersion), bundleVersion(bundleVersion), signature(signature) {} - }; - -} // namespace margelo::nitro::reactnativebundleupdate - -namespace margelo::nitro { - - // C++ BundleInstallParams <> JS BundleInstallParams (object) - template <> - struct JSIConverter final { - static inline margelo::nitro::reactnativebundleupdate::BundleInstallParams fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { - jsi::Object obj = arg.asObject(runtime); - return margelo::nitro::reactnativebundleupdate::BundleInstallParams( - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "downloadedFile")), - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "latestVersion")), - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "bundleVersion")), - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "signature")) - ); - } - static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::reactnativebundleupdate::BundleInstallParams& arg) { - jsi::Object obj(runtime); - obj.setProperty(runtime, "downloadedFile", JSIConverter::toJSI(runtime, arg.downloadedFile)); - obj.setProperty(runtime, "latestVersion", JSIConverter::toJSI(runtime, arg.latestVersion)); - obj.setProperty(runtime, "bundleVersion", JSIConverter::toJSI(runtime, arg.bundleVersion)); - obj.setProperty(runtime, "signature", JSIConverter::toJSI(runtime, arg.signature)); - return obj; - } - static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) { - if (!value.isObject()) { - return false; - } - jsi::Object obj = value.getObject(runtime); - if (!nitro::isPlainObject(runtime, obj)) { - return false; - } - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "downloadedFile"))) return false; - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "latestVersion"))) return false; - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "bundleVersion"))) return false; - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "signature"))) return false; - return true; - } - }; - -} // namespace margelo::nitro diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/shared/c++/BundleSwitchParams.hpp b/native-modules/react-native-bundle-update/nitrogen/generated/shared/c++/BundleSwitchParams.hpp deleted file mode 100644 index 545e4dc..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/shared/c++/BundleSwitchParams.hpp +++ /dev/null @@ -1,83 +0,0 @@ -/// -/// BundleSwitchParams.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif - - - -#include - -namespace margelo::nitro::reactnativebundleupdate { - - /** - * A struct which can be represented as a JavaScript object (BundleSwitchParams). - */ - struct BundleSwitchParams { - public: - std::string appVersion SWIFT_PRIVATE; - std::string bundleVersion SWIFT_PRIVATE; - std::string signature SWIFT_PRIVATE; - - public: - BundleSwitchParams() = default; - explicit BundleSwitchParams(std::string appVersion, std::string bundleVersion, std::string signature): appVersion(appVersion), bundleVersion(bundleVersion), signature(signature) {} - }; - -} // namespace margelo::nitro::reactnativebundleupdate - -namespace margelo::nitro { - - // C++ BundleSwitchParams <> JS BundleSwitchParams (object) - template <> - struct JSIConverter final { - static inline margelo::nitro::reactnativebundleupdate::BundleSwitchParams fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { - jsi::Object obj = arg.asObject(runtime); - return margelo::nitro::reactnativebundleupdate::BundleSwitchParams( - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "appVersion")), - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "bundleVersion")), - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "signature")) - ); - } - static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::reactnativebundleupdate::BundleSwitchParams& arg) { - jsi::Object obj(runtime); - obj.setProperty(runtime, "appVersion", JSIConverter::toJSI(runtime, arg.appVersion)); - obj.setProperty(runtime, "bundleVersion", JSIConverter::toJSI(runtime, arg.bundleVersion)); - obj.setProperty(runtime, "signature", JSIConverter::toJSI(runtime, arg.signature)); - return obj; - } - static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) { - if (!value.isObject()) { - return false; - } - jsi::Object obj = value.getObject(runtime); - if (!nitro::isPlainObject(runtime, obj)) { - return false; - } - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "appVersion"))) return false; - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "bundleVersion"))) return false; - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "signature"))) return false; - return true; - } - }; - -} // namespace margelo::nitro diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/shared/c++/BundleVerifyASCParams.hpp b/native-modules/react-native-bundle-update/nitrogen/generated/shared/c++/BundleVerifyASCParams.hpp deleted file mode 100644 index 1a2caa6..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/shared/c++/BundleVerifyASCParams.hpp +++ /dev/null @@ -1,91 +0,0 @@ -/// -/// BundleVerifyASCParams.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif - - - -#include - -namespace margelo::nitro::reactnativebundleupdate { - - /** - * A struct which can be represented as a JavaScript object (BundleVerifyASCParams). - */ - struct BundleVerifyASCParams { - public: - std::string downloadedFile SWIFT_PRIVATE; - std::string sha256 SWIFT_PRIVATE; - std::string latestVersion SWIFT_PRIVATE; - std::string bundleVersion SWIFT_PRIVATE; - std::string signature SWIFT_PRIVATE; - - public: - BundleVerifyASCParams() = default; - explicit BundleVerifyASCParams(std::string downloadedFile, std::string sha256, std::string latestVersion, std::string bundleVersion, std::string signature): downloadedFile(downloadedFile), sha256(sha256), latestVersion(latestVersion), bundleVersion(bundleVersion), signature(signature) {} - }; - -} // namespace margelo::nitro::reactnativebundleupdate - -namespace margelo::nitro { - - // C++ BundleVerifyASCParams <> JS BundleVerifyASCParams (object) - template <> - struct JSIConverter final { - static inline margelo::nitro::reactnativebundleupdate::BundleVerifyASCParams fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { - jsi::Object obj = arg.asObject(runtime); - return margelo::nitro::reactnativebundleupdate::BundleVerifyASCParams( - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "downloadedFile")), - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "sha256")), - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "latestVersion")), - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "bundleVersion")), - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "signature")) - ); - } - static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::reactnativebundleupdate::BundleVerifyASCParams& arg) { - jsi::Object obj(runtime); - obj.setProperty(runtime, "downloadedFile", JSIConverter::toJSI(runtime, arg.downloadedFile)); - obj.setProperty(runtime, "sha256", JSIConverter::toJSI(runtime, arg.sha256)); - obj.setProperty(runtime, "latestVersion", JSIConverter::toJSI(runtime, arg.latestVersion)); - obj.setProperty(runtime, "bundleVersion", JSIConverter::toJSI(runtime, arg.bundleVersion)); - obj.setProperty(runtime, "signature", JSIConverter::toJSI(runtime, arg.signature)); - return obj; - } - static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) { - if (!value.isObject()) { - return false; - } - jsi::Object obj = value.getObject(runtime); - if (!nitro::isPlainObject(runtime, obj)) { - return false; - } - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "downloadedFile"))) return false; - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "sha256"))) return false; - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "latestVersion"))) return false; - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "bundleVersion"))) return false; - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "signature"))) return false; - return true; - } - }; - -} // namespace margelo::nitro diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/shared/c++/BundleVerifyParams.hpp b/native-modules/react-native-bundle-update/nitrogen/generated/shared/c++/BundleVerifyParams.hpp deleted file mode 100644 index 4ba3ef6..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/shared/c++/BundleVerifyParams.hpp +++ /dev/null @@ -1,87 +0,0 @@ -/// -/// BundleVerifyParams.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif - - - -#include - -namespace margelo::nitro::reactnativebundleupdate { - - /** - * A struct which can be represented as a JavaScript object (BundleVerifyParams). - */ - struct BundleVerifyParams { - public: - std::string downloadedFile SWIFT_PRIVATE; - std::string sha256 SWIFT_PRIVATE; - std::string latestVersion SWIFT_PRIVATE; - std::string bundleVersion SWIFT_PRIVATE; - - public: - BundleVerifyParams() = default; - explicit BundleVerifyParams(std::string downloadedFile, std::string sha256, std::string latestVersion, std::string bundleVersion): downloadedFile(downloadedFile), sha256(sha256), latestVersion(latestVersion), bundleVersion(bundleVersion) {} - }; - -} // namespace margelo::nitro::reactnativebundleupdate - -namespace margelo::nitro { - - // C++ BundleVerifyParams <> JS BundleVerifyParams (object) - template <> - struct JSIConverter final { - static inline margelo::nitro::reactnativebundleupdate::BundleVerifyParams fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { - jsi::Object obj = arg.asObject(runtime); - return margelo::nitro::reactnativebundleupdate::BundleVerifyParams( - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "downloadedFile")), - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "sha256")), - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "latestVersion")), - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "bundleVersion")) - ); - } - static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::reactnativebundleupdate::BundleVerifyParams& arg) { - jsi::Object obj(runtime); - obj.setProperty(runtime, "downloadedFile", JSIConverter::toJSI(runtime, arg.downloadedFile)); - obj.setProperty(runtime, "sha256", JSIConverter::toJSI(runtime, arg.sha256)); - obj.setProperty(runtime, "latestVersion", JSIConverter::toJSI(runtime, arg.latestVersion)); - obj.setProperty(runtime, "bundleVersion", JSIConverter::toJSI(runtime, arg.bundleVersion)); - return obj; - } - static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) { - if (!value.isObject()) { - return false; - } - jsi::Object obj = value.getObject(runtime); - if (!nitro::isPlainObject(runtime, obj)) { - return false; - } - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "downloadedFile"))) return false; - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "sha256"))) return false; - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "latestVersion"))) return false; - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "bundleVersion"))) return false; - return true; - } - }; - -} // namespace margelo::nitro diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/shared/c++/FallbackBundleInfo.hpp b/native-modules/react-native-bundle-update/nitrogen/generated/shared/c++/FallbackBundleInfo.hpp deleted file mode 100644 index 2a39e9c..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/shared/c++/FallbackBundleInfo.hpp +++ /dev/null @@ -1,83 +0,0 @@ -/// -/// FallbackBundleInfo.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif - - - -#include - -namespace margelo::nitro::reactnativebundleupdate { - - /** - * A struct which can be represented as a JavaScript object (FallbackBundleInfo). - */ - struct FallbackBundleInfo { - public: - std::string appVersion SWIFT_PRIVATE; - std::string bundleVersion SWIFT_PRIVATE; - std::string signature SWIFT_PRIVATE; - - public: - FallbackBundleInfo() = default; - explicit FallbackBundleInfo(std::string appVersion, std::string bundleVersion, std::string signature): appVersion(appVersion), bundleVersion(bundleVersion), signature(signature) {} - }; - -} // namespace margelo::nitro::reactnativebundleupdate - -namespace margelo::nitro { - - // C++ FallbackBundleInfo <> JS FallbackBundleInfo (object) - template <> - struct JSIConverter final { - static inline margelo::nitro::reactnativebundleupdate::FallbackBundleInfo fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { - jsi::Object obj = arg.asObject(runtime); - return margelo::nitro::reactnativebundleupdate::FallbackBundleInfo( - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "appVersion")), - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "bundleVersion")), - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "signature")) - ); - } - static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::reactnativebundleupdate::FallbackBundleInfo& arg) { - jsi::Object obj(runtime); - obj.setProperty(runtime, "appVersion", JSIConverter::toJSI(runtime, arg.appVersion)); - obj.setProperty(runtime, "bundleVersion", JSIConverter::toJSI(runtime, arg.bundleVersion)); - obj.setProperty(runtime, "signature", JSIConverter::toJSI(runtime, arg.signature)); - return obj; - } - static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) { - if (!value.isObject()) { - return false; - } - jsi::Object obj = value.getObject(runtime); - if (!nitro::isPlainObject(runtime, obj)) { - return false; - } - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "appVersion"))) return false; - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "bundleVersion"))) return false; - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "signature"))) return false; - return true; - } - }; - -} // namespace margelo::nitro diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/shared/c++/HybridReactNativeBundleUpdateSpec.cpp b/native-modules/react-native-bundle-update/nitrogen/generated/shared/c++/HybridReactNativeBundleUpdateSpec.cpp deleted file mode 100644 index 0769943..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/shared/c++/HybridReactNativeBundleUpdateSpec.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/// -/// HybridReactNativeBundleUpdateSpec.cpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#include "HybridReactNativeBundleUpdateSpec.hpp" - -namespace margelo::nitro::reactnativebundleupdate { - - void HybridReactNativeBundleUpdateSpec::loadHybridMethods() { - // load base methods/properties - HybridObject::loadHybridMethods(); - // load custom methods/properties - registerHybrids(this, [](Prototype& prototype) { - prototype.registerHybridMethod("downloadBundle", &HybridReactNativeBundleUpdateSpec::downloadBundle); - prototype.registerHybridMethod("verifyBundle", &HybridReactNativeBundleUpdateSpec::verifyBundle); - prototype.registerHybridMethod("verifyBundleASC", &HybridReactNativeBundleUpdateSpec::verifyBundleASC); - prototype.registerHybridMethod("downloadBundleASC", &HybridReactNativeBundleUpdateSpec::downloadBundleASC); - prototype.registerHybridMethod("installBundle", &HybridReactNativeBundleUpdateSpec::installBundle); - prototype.registerHybridMethod("clearBundle", &HybridReactNativeBundleUpdateSpec::clearBundle); - prototype.registerHybridMethod("clearAllJSBundleData", &HybridReactNativeBundleUpdateSpec::clearAllJSBundleData); - prototype.registerHybridMethod("resetToBuiltInBundle", &HybridReactNativeBundleUpdateSpec::resetToBuiltInBundle); - prototype.registerHybridMethod("getFallbackUpdateBundleData", &HybridReactNativeBundleUpdateSpec::getFallbackUpdateBundleData); - prototype.registerHybridMethod("setCurrentUpdateBundleData", &HybridReactNativeBundleUpdateSpec::setCurrentUpdateBundleData); - prototype.registerHybridMethod("getWebEmbedPath", &HybridReactNativeBundleUpdateSpec::getWebEmbedPath); - prototype.registerHybridMethod("getWebEmbedPathAsync", &HybridReactNativeBundleUpdateSpec::getWebEmbedPathAsync); - prototype.registerHybridMethod("getJsBundlePath", &HybridReactNativeBundleUpdateSpec::getJsBundlePath); - prototype.registerHybridMethod("getJsBundlePathAsync", &HybridReactNativeBundleUpdateSpec::getJsBundlePathAsync); - prototype.registerHybridMethod("getNativeAppVersion", &HybridReactNativeBundleUpdateSpec::getNativeAppVersion); - prototype.registerHybridMethod("testVerification", &HybridReactNativeBundleUpdateSpec::testVerification); - prototype.registerHybridMethod("testSkipVerification", &HybridReactNativeBundleUpdateSpec::testSkipVerification); - prototype.registerHybridMethod("isSkipGpgVerificationAllowed", &HybridReactNativeBundleUpdateSpec::isSkipGpgVerificationAllowed); - prototype.registerHybridMethod("isBundleExists", &HybridReactNativeBundleUpdateSpec::isBundleExists); - prototype.registerHybridMethod("verifyExtractedBundle", &HybridReactNativeBundleUpdateSpec::verifyExtractedBundle); - prototype.registerHybridMethod("listLocalBundles", &HybridReactNativeBundleUpdateSpec::listLocalBundles); - prototype.registerHybridMethod("listAscFiles", &HybridReactNativeBundleUpdateSpec::listAscFiles); - prototype.registerHybridMethod("getSha256FromFilePath", &HybridReactNativeBundleUpdateSpec::getSha256FromFilePath); - prototype.registerHybridMethod("testDeleteJsBundle", &HybridReactNativeBundleUpdateSpec::testDeleteJsBundle); - prototype.registerHybridMethod("testDeleteJsRuntimeDir", &HybridReactNativeBundleUpdateSpec::testDeleteJsRuntimeDir); - prototype.registerHybridMethod("testDeleteMetadataJson", &HybridReactNativeBundleUpdateSpec::testDeleteMetadataJson); - prototype.registerHybridMethod("testWriteEmptyMetadataJson", &HybridReactNativeBundleUpdateSpec::testWriteEmptyMetadataJson); - prototype.registerHybridMethod("addDownloadListener", &HybridReactNativeBundleUpdateSpec::addDownloadListener); - prototype.registerHybridMethod("removeDownloadListener", &HybridReactNativeBundleUpdateSpec::removeDownloadListener); - }); - } - -} // namespace margelo::nitro::reactnativebundleupdate diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/shared/c++/HybridReactNativeBundleUpdateSpec.hpp b/native-modules/react-native-bundle-update/nitrogen/generated/shared/c++/HybridReactNativeBundleUpdateSpec.hpp deleted file mode 100644 index 3884f63..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/shared/c++/HybridReactNativeBundleUpdateSpec.hpp +++ /dev/null @@ -1,128 +0,0 @@ -/// -/// HybridReactNativeBundleUpdateSpec.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif - -// Forward declaration of `BundleDownloadResult` to properly resolve imports. -namespace margelo::nitro::reactnativebundleupdate { struct BundleDownloadResult; } -// Forward declaration of `BundleDownloadParams` to properly resolve imports. -namespace margelo::nitro::reactnativebundleupdate { struct BundleDownloadParams; } -// Forward declaration of `BundleVerifyParams` to properly resolve imports. -namespace margelo::nitro::reactnativebundleupdate { struct BundleVerifyParams; } -// Forward declaration of `BundleVerifyASCParams` to properly resolve imports. -namespace margelo::nitro::reactnativebundleupdate { struct BundleVerifyASCParams; } -// Forward declaration of `BundleDownloadASCParams` to properly resolve imports. -namespace margelo::nitro::reactnativebundleupdate { struct BundleDownloadASCParams; } -// Forward declaration of `BundleInstallParams` to properly resolve imports. -namespace margelo::nitro::reactnativebundleupdate { struct BundleInstallParams; } -// Forward declaration of `TestResult` to properly resolve imports. -namespace margelo::nitro::reactnativebundleupdate { struct TestResult; } -// Forward declaration of `FallbackBundleInfo` to properly resolve imports. -namespace margelo::nitro::reactnativebundleupdate { struct FallbackBundleInfo; } -// Forward declaration of `BundleSwitchParams` to properly resolve imports. -namespace margelo::nitro::reactnativebundleupdate { struct BundleSwitchParams; } -// Forward declaration of `LocalBundleInfo` to properly resolve imports. -namespace margelo::nitro::reactnativebundleupdate { struct LocalBundleInfo; } -// Forward declaration of `AscFileInfo` to properly resolve imports. -namespace margelo::nitro::reactnativebundleupdate { struct AscFileInfo; } -// Forward declaration of `BundleDownloadEvent` to properly resolve imports. -namespace margelo::nitro::reactnativebundleupdate { struct BundleDownloadEvent; } - -#include "BundleDownloadResult.hpp" -#include -#include "BundleDownloadParams.hpp" -#include "BundleVerifyParams.hpp" -#include "BundleVerifyASCParams.hpp" -#include "BundleDownloadASCParams.hpp" -#include "BundleInstallParams.hpp" -#include "TestResult.hpp" -#include "FallbackBundleInfo.hpp" -#include -#include "BundleSwitchParams.hpp" -#include -#include "LocalBundleInfo.hpp" -#include "AscFileInfo.hpp" -#include "BundleDownloadEvent.hpp" -#include - -namespace margelo::nitro::reactnativebundleupdate { - - using namespace margelo::nitro; - - /** - * An abstract base class for `ReactNativeBundleUpdate` - * Inherit this class to create instances of `HybridReactNativeBundleUpdateSpec` in C++. - * You must explicitly call `HybridObject`'s constructor yourself, because it is virtual. - * @example - * ```cpp - * class HybridReactNativeBundleUpdate: public HybridReactNativeBundleUpdateSpec { - * public: - * HybridReactNativeBundleUpdate(...): HybridObject(TAG) { ... } - * // ... - * }; - * ``` - */ - class HybridReactNativeBundleUpdateSpec: public virtual HybridObject { - public: - // Constructor - explicit HybridReactNativeBundleUpdateSpec(): HybridObject(TAG) { } - - // Destructor - ~HybridReactNativeBundleUpdateSpec() override = default; - - public: - // Properties - - - public: - // Methods - virtual std::shared_ptr> downloadBundle(const BundleDownloadParams& params) = 0; - virtual std::shared_ptr> verifyBundle(const BundleVerifyParams& params) = 0; - virtual std::shared_ptr> verifyBundleASC(const BundleVerifyASCParams& params) = 0; - virtual std::shared_ptr> downloadBundleASC(const BundleDownloadASCParams& params) = 0; - virtual std::shared_ptr> installBundle(const BundleInstallParams& params) = 0; - virtual std::shared_ptr> clearBundle() = 0; - virtual std::shared_ptr> clearAllJSBundleData() = 0; - virtual std::shared_ptr> resetToBuiltInBundle() = 0; - virtual std::shared_ptr>> getFallbackUpdateBundleData() = 0; - virtual std::shared_ptr> setCurrentUpdateBundleData(const BundleSwitchParams& params) = 0; - virtual std::string getWebEmbedPath() = 0; - virtual std::shared_ptr> getWebEmbedPathAsync() = 0; - virtual std::string getJsBundlePath() = 0; - virtual std::shared_ptr> getJsBundlePathAsync() = 0; - virtual std::shared_ptr> getNativeAppVersion() = 0; - virtual std::shared_ptr> testVerification() = 0; - virtual std::shared_ptr> testSkipVerification() = 0; - virtual bool isSkipGpgVerificationAllowed() = 0; - virtual std::shared_ptr> isBundleExists(const std::string& appVersion, const std::string& bundleVersion) = 0; - virtual std::shared_ptr> verifyExtractedBundle(const std::string& appVersion, const std::string& bundleVersion) = 0; - virtual std::shared_ptr>> listLocalBundles() = 0; - virtual std::shared_ptr>> listAscFiles() = 0; - virtual std::shared_ptr> getSha256FromFilePath(const std::string& filePath) = 0; - virtual std::shared_ptr> testDeleteJsBundle(const std::string& appVersion, const std::string& bundleVersion) = 0; - virtual std::shared_ptr> testDeleteJsRuntimeDir(const std::string& appVersion, const std::string& bundleVersion) = 0; - virtual std::shared_ptr> testDeleteMetadataJson(const std::string& appVersion, const std::string& bundleVersion) = 0; - virtual std::shared_ptr> testWriteEmptyMetadataJson(const std::string& appVersion, const std::string& bundleVersion) = 0; - virtual double addDownloadListener(const std::function& callback) = 0; - virtual void removeDownloadListener(double id) = 0; - - protected: - // Hybrid Setup - void loadHybridMethods() override; - - protected: - // Tag for logging - static constexpr auto TAG = "ReactNativeBundleUpdate"; - }; - -} // namespace margelo::nitro::reactnativebundleupdate diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/shared/c++/LocalBundleInfo.hpp b/native-modules/react-native-bundle-update/nitrogen/generated/shared/c++/LocalBundleInfo.hpp deleted file mode 100644 index f839054..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/shared/c++/LocalBundleInfo.hpp +++ /dev/null @@ -1,79 +0,0 @@ -/// -/// LocalBundleInfo.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif - - - -#include - -namespace margelo::nitro::reactnativebundleupdate { - - /** - * A struct which can be represented as a JavaScript object (LocalBundleInfo). - */ - struct LocalBundleInfo { - public: - std::string appVersion SWIFT_PRIVATE; - std::string bundleVersion SWIFT_PRIVATE; - - public: - LocalBundleInfo() = default; - explicit LocalBundleInfo(std::string appVersion, std::string bundleVersion): appVersion(appVersion), bundleVersion(bundleVersion) {} - }; - -} // namespace margelo::nitro::reactnativebundleupdate - -namespace margelo::nitro { - - // C++ LocalBundleInfo <> JS LocalBundleInfo (object) - template <> - struct JSIConverter final { - static inline margelo::nitro::reactnativebundleupdate::LocalBundleInfo fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { - jsi::Object obj = arg.asObject(runtime); - return margelo::nitro::reactnativebundleupdate::LocalBundleInfo( - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "appVersion")), - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "bundleVersion")) - ); - } - static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::reactnativebundleupdate::LocalBundleInfo& arg) { - jsi::Object obj(runtime); - obj.setProperty(runtime, "appVersion", JSIConverter::toJSI(runtime, arg.appVersion)); - obj.setProperty(runtime, "bundleVersion", JSIConverter::toJSI(runtime, arg.bundleVersion)); - return obj; - } - static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) { - if (!value.isObject()) { - return false; - } - jsi::Object obj = value.getObject(runtime); - if (!nitro::isPlainObject(runtime, obj)) { - return false; - } - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "appVersion"))) return false; - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "bundleVersion"))) return false; - return true; - } - }; - -} // namespace margelo::nitro diff --git a/native-modules/react-native-bundle-update/nitrogen/generated/shared/c++/TestResult.hpp b/native-modules/react-native-bundle-update/nitrogen/generated/shared/c++/TestResult.hpp deleted file mode 100644 index efbb571..0000000 --- a/native-modules/react-native-bundle-update/nitrogen/generated/shared/c++/TestResult.hpp +++ /dev/null @@ -1,79 +0,0 @@ -/// -/// TestResult.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif - - - -#include - -namespace margelo::nitro::reactnativebundleupdate { - - /** - * A struct which can be represented as a JavaScript object (TestResult). - */ - struct TestResult { - public: - bool success SWIFT_PRIVATE; - std::string message SWIFT_PRIVATE; - - public: - TestResult() = default; - explicit TestResult(bool success, std::string message): success(success), message(message) {} - }; - -} // namespace margelo::nitro::reactnativebundleupdate - -namespace margelo::nitro { - - // C++ TestResult <> JS TestResult (object) - template <> - struct JSIConverter final { - static inline margelo::nitro::reactnativebundleupdate::TestResult fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { - jsi::Object obj = arg.asObject(runtime); - return margelo::nitro::reactnativebundleupdate::TestResult( - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "success")), - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "message")) - ); - } - static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::reactnativebundleupdate::TestResult& arg) { - jsi::Object obj(runtime); - obj.setProperty(runtime, "success", JSIConverter::toJSI(runtime, arg.success)); - obj.setProperty(runtime, "message", JSIConverter::toJSI(runtime, arg.message)); - return obj; - } - static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) { - if (!value.isObject()) { - return false; - } - jsi::Object obj = value.getObject(runtime); - if (!nitro::isPlainObject(runtime, obj)) { - return false; - } - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "success"))) return false; - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "message"))) return false; - return true; - } - }; - -} // namespace margelo::nitro diff --git a/native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/.gitattributes b/native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/.gitattributes deleted file mode 100644 index fb7a0d5..0000000 --- a/native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -** linguist-generated=true diff --git a/native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/android/c++/JHybridReactNativeCheckBiometricAuthChangedSpec.cpp b/native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/android/c++/JHybridReactNativeCheckBiometricAuthChangedSpec.cpp deleted file mode 100644 index 96e1b6d..0000000 --- a/native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/android/c++/JHybridReactNativeCheckBiometricAuthChangedSpec.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/// -/// JHybridReactNativeCheckBiometricAuthChangedSpec.cpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#include "JHybridReactNativeCheckBiometricAuthChangedSpec.hpp" - - - -#include -#include - -namespace margelo::nitro::onekeyfe_reactnativecheckbiometricauthchanged { - - jni::local_ref JHybridReactNativeCheckBiometricAuthChangedSpec::initHybrid(jni::alias_ref jThis) { - return makeCxxInstance(jThis); - } - - void JHybridReactNativeCheckBiometricAuthChangedSpec::registerNatives() { - registerHybrid({ - makeNativeMethod("initHybrid", JHybridReactNativeCheckBiometricAuthChangedSpec::initHybrid), - }); - } - - size_t JHybridReactNativeCheckBiometricAuthChangedSpec::getExternalMemorySize() noexcept { - static const auto method = javaClassStatic()->getMethod("getMemorySize"); - return method(_javaPart); - } - - void JHybridReactNativeCheckBiometricAuthChangedSpec::dispose() noexcept { - static const auto method = javaClassStatic()->getMethod("dispose"); - method(_javaPart); - } - - std::string JHybridReactNativeCheckBiometricAuthChangedSpec::toString() { - static const auto method = javaClassStatic()->getMethod("toString"); - auto javaString = method(_javaPart); - return javaString->toStdString(); - } - - // Properties - - - // Methods - std::shared_ptr> JHybridReactNativeCheckBiometricAuthChangedSpec::checkChanged() { - static const auto method = javaClassStatic()->getMethod()>("checkChanged"); - auto __result = method(_javaPart); - return [&]() { - auto __promise = Promise::create(); - __result->cthis()->addOnResolvedListener([=](const jni::alias_ref& __boxedResult) { - auto __result = jni::static_ref_cast(__boxedResult); - __promise->resolve(static_cast(__result->value())); - }); - __result->cthis()->addOnRejectedListener([=](const jni::alias_ref& __throwable) { - jni::JniException __jniError(__throwable); - __promise->reject(std::make_exception_ptr(__jniError)); - }); - return __promise; - }(); - } - -} // namespace margelo::nitro::onekeyfe_reactnativecheckbiometricauthchanged diff --git a/native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/android/c++/JHybridReactNativeCheckBiometricAuthChangedSpec.hpp b/native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/android/c++/JHybridReactNativeCheckBiometricAuthChangedSpec.hpp deleted file mode 100644 index 60f458f..0000000 --- a/native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/android/c++/JHybridReactNativeCheckBiometricAuthChangedSpec.hpp +++ /dev/null @@ -1,65 +0,0 @@ -/// -/// HybridReactNativeCheckBiometricAuthChangedSpec.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#include -#include -#include "HybridReactNativeCheckBiometricAuthChangedSpec.hpp" - - - - -namespace margelo::nitro::onekeyfe_reactnativecheckbiometricauthchanged { - - using namespace facebook; - - class JHybridReactNativeCheckBiometricAuthChangedSpec: public jni::HybridClass, - public virtual HybridReactNativeCheckBiometricAuthChangedSpec { - public: - static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/onekeyfe/reactnativecheckbiometricauthchanged/HybridReactNativeCheckBiometricAuthChangedSpec;"; - static jni::local_ref initHybrid(jni::alias_ref jThis); - static void registerNatives(); - - protected: - // C++ constructor (called from Java via `initHybrid()`) - explicit JHybridReactNativeCheckBiometricAuthChangedSpec(jni::alias_ref jThis) : - HybridObject(HybridReactNativeCheckBiometricAuthChangedSpec::TAG), - HybridBase(jThis), - _javaPart(jni::make_global(jThis)) {} - - public: - ~JHybridReactNativeCheckBiometricAuthChangedSpec() override { - // Hermes GC can destroy JS objects on a non-JNI Thread. - jni::ThreadScope::WithClassLoader([&] { _javaPart.reset(); }); - } - - public: - size_t getExternalMemorySize() noexcept override; - void dispose() noexcept override; - std::string toString() override; - - public: - inline const jni::global_ref& getJavaPart() const noexcept { - return _javaPart; - } - - public: - // Properties - - - public: - // Methods - std::shared_ptr> checkChanged() override; - - private: - friend HybridBase; - using HybridBase::HybridBase; - jni::global_ref _javaPart; - }; - -} // namespace margelo::nitro::onekeyfe_reactnativecheckbiometricauthchanged diff --git a/native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/android/kotlin/com/margelo/nitro/onekeyfe/reactnativecheckbiometricauthchanged/HybridReactNativeCheckBiometricAuthChangedSpec.kt b/native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/android/kotlin/com/margelo/nitro/onekeyfe/reactnativecheckbiometricauthchanged/HybridReactNativeCheckBiometricAuthChangedSpec.kt deleted file mode 100644 index 15f5072..0000000 --- a/native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/android/kotlin/com/margelo/nitro/onekeyfe/reactnativecheckbiometricauthchanged/HybridReactNativeCheckBiometricAuthChangedSpec.kt +++ /dev/null @@ -1,58 +0,0 @@ -/// -/// HybridReactNativeCheckBiometricAuthChangedSpec.kt -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -package com.margelo.nitro.onekeyfe.reactnativecheckbiometricauthchanged - -import androidx.annotation.Keep -import com.facebook.jni.HybridData -import com.facebook.proguard.annotations.DoNotStrip -import com.margelo.nitro.core.Promise -import com.margelo.nitro.core.HybridObject - -/** - * A Kotlin class representing the ReactNativeCheckBiometricAuthChanged HybridObject. - * Implement this abstract class to create Kotlin-based instances of ReactNativeCheckBiometricAuthChanged. - */ -@DoNotStrip -@Keep -@Suppress( - "KotlinJniMissingFunction", "unused", - "RedundantSuppression", "RedundantUnitReturnType", "SimpleRedundantLet", - "LocalVariableName", "PropertyName", "PrivatePropertyName", "FunctionName" -) -abstract class HybridReactNativeCheckBiometricAuthChangedSpec: HybridObject() { - @DoNotStrip - private var mHybridData: HybridData = initHybrid() - - init { - super.updateNative(mHybridData) - } - - override fun updateNative(hybridData: HybridData) { - mHybridData = hybridData - super.updateNative(hybridData) - } - - // Default implementation of `HybridObject.toString()` - override fun toString(): String { - return "[HybridObject ReactNativeCheckBiometricAuthChanged]" - } - - // Properties - - - // Methods - @DoNotStrip - @Keep - abstract fun checkChanged(): Promise - - private external fun initHybrid(): HybridData - - companion object { - protected const val TAG = "HybridReactNativeCheckBiometricAuthChangedSpec" - } -} diff --git a/native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/android/kotlin/com/margelo/nitro/onekeyfe/reactnativecheckbiometricauthchanged/onekeyfe_reactnativecheckbiometricauthchangedOnLoad.kt b/native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/android/kotlin/com/margelo/nitro/onekeyfe/reactnativecheckbiometricauthchanged/onekeyfe_reactnativecheckbiometricauthchangedOnLoad.kt deleted file mode 100644 index 8013e14..0000000 --- a/native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/android/kotlin/com/margelo/nitro/onekeyfe/reactnativecheckbiometricauthchanged/onekeyfe_reactnativecheckbiometricauthchangedOnLoad.kt +++ /dev/null @@ -1,35 +0,0 @@ -/// -/// onekeyfe_reactnativecheckbiometricauthchangedOnLoad.kt -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -package com.margelo.nitro.onekeyfe.reactnativecheckbiometricauthchanged - -import android.util.Log - -internal class onekeyfe_reactnativecheckbiometricauthchangedOnLoad { - companion object { - private const val TAG = "onekeyfe_reactnativecheckbiometricauthchangedOnLoad" - private var didLoad = false - /** - * Initializes the native part of "onekeyfe_reactnativecheckbiometricauthchanged". - * This method is idempotent and can be called more than once. - */ - @JvmStatic - fun initializeNative() { - if (didLoad) return - try { - Log.i(TAG, "Loading onekeyfe_reactnativecheckbiometricauthchanged C++ library...") - System.loadLibrary("onekeyfe_reactnativecheckbiometricauthchanged") - Log.i(TAG, "Successfully loaded onekeyfe_reactnativecheckbiometricauthchanged C++ library!") - didLoad = true - } catch (e: Error) { - Log.e(TAG, "Failed to load onekeyfe_reactnativecheckbiometricauthchanged C++ library! Is it properly installed and linked? " + - "Is the name correct? (see `CMakeLists.txt`, at `add_library(...)`)", e) - throw e - } - } - } -} diff --git a/native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/android/onekeyfe_reactnativecheckbiometricauthchanged+autolinking.cmake b/native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/android/onekeyfe_reactnativecheckbiometricauthchanged+autolinking.cmake deleted file mode 100644 index 3ccc4f3..0000000 --- a/native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/android/onekeyfe_reactnativecheckbiometricauthchanged+autolinking.cmake +++ /dev/null @@ -1,81 +0,0 @@ -# -# onekeyfe_reactnativecheckbiometricauthchanged+autolinking.cmake -# This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -# https://github.com/mrousavy/nitro -# Copyright © 2026 Marc Rousavy @ Margelo -# - -# This is a CMake file that adds all files generated by Nitrogen -# to the current CMake project. -# -# To use it, add this to your CMakeLists.txt: -# ```cmake -# include(${CMAKE_SOURCE_DIR}/../nitrogen/generated/android/onekeyfe_reactnativecheckbiometricauthchanged+autolinking.cmake) -# ``` - -# Define a flag to check if we are building properly -add_definitions(-DBUILDING_ONEKEYFEREACTNATIVECHECKBIOMETRICAUTHCHANGED_WITH_GENERATED_CMAKE_PROJECT) - -# Enable Raw Props parsing in react-native (for Nitro Views) -add_definitions(-DRN_SERIALIZABLE_STATE) - -# Add all headers that were generated by Nitrogen -include_directories( - "../nitrogen/generated/shared/c++" - "../nitrogen/generated/android/c++" - "../nitrogen/generated/android/" -) - -# Add all .cpp sources that were generated by Nitrogen -target_sources( - # CMake project name (Android C++ library name) - onekeyfe_reactnativecheckbiometricauthchanged PRIVATE - # Autolinking Setup - ../nitrogen/generated/android/onekeyfe_reactnativecheckbiometricauthchangedOnLoad.cpp - # Shared Nitrogen C++ sources - ../nitrogen/generated/shared/c++/HybridReactNativeCheckBiometricAuthChangedSpec.cpp - # Android-specific Nitrogen C++ sources - ../nitrogen/generated/android/c++/JHybridReactNativeCheckBiometricAuthChangedSpec.cpp -) - -# From node_modules/react-native/ReactAndroid/cmake-utils/folly-flags.cmake -# Used in node_modules/react-native/ReactAndroid/cmake-utils/ReactNative-application.cmake -target_compile_definitions( - onekeyfe_reactnativecheckbiometricauthchanged PRIVATE - -DFOLLY_NO_CONFIG=1 - -DFOLLY_HAVE_CLOCK_GETTIME=1 - -DFOLLY_USE_LIBCPP=1 - -DFOLLY_CFG_NO_COROUTINES=1 - -DFOLLY_MOBILE=1 - -DFOLLY_HAVE_RECVMMSG=1 - -DFOLLY_HAVE_PTHREAD=1 - # Once we target android-23 above, we can comment - # the following line. NDK uses GNU style stderror_r() after API 23. - -DFOLLY_HAVE_XSI_STRERROR_R=1 -) - -# Add all libraries required by the generated specs -find_package(fbjni REQUIRED) # <-- Used for communication between Java <-> C++ -find_package(ReactAndroid REQUIRED) # <-- Used to set up React Native bindings (e.g. CallInvoker/TurboModule) -find_package(react-native-nitro-modules REQUIRED) # <-- Used to create all HybridObjects and use the Nitro core library - -# Link all libraries together -target_link_libraries( - onekeyfe_reactnativecheckbiometricauthchanged - fbjni::fbjni # <-- Facebook C++ JNI helpers - ReactAndroid::jsi # <-- RN: JSI - react-native-nitro-modules::NitroModules # <-- NitroModules Core :) -) - -# Link react-native (different prefab between RN 0.75 and RN 0.76) -if(ReactAndroid_VERSION_MINOR GREATER_EQUAL 76) - target_link_libraries( - onekeyfe_reactnativecheckbiometricauthchanged - ReactAndroid::reactnative # <-- RN: Native Modules umbrella prefab - ) -else() - target_link_libraries( - onekeyfe_reactnativecheckbiometricauthchanged - ReactAndroid::react_nativemodule_core # <-- RN: TurboModules Core - ) -endif() diff --git a/native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/android/onekeyfe_reactnativecheckbiometricauthchanged+autolinking.gradle b/native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/android/onekeyfe_reactnativecheckbiometricauthchanged+autolinking.gradle deleted file mode 100644 index d159677..0000000 --- a/native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/android/onekeyfe_reactnativecheckbiometricauthchanged+autolinking.gradle +++ /dev/null @@ -1,27 +0,0 @@ -/// -/// onekeyfe_reactnativecheckbiometricauthchanged+autolinking.gradle -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -/// This is a Gradle file that adds all files generated by Nitrogen -/// to the current Gradle project. -/// -/// To use it, add this to your build.gradle: -/// ```gradle -/// apply from: '../nitrogen/generated/android/onekeyfe_reactnativecheckbiometricauthchanged+autolinking.gradle' -/// ``` - -logger.warn("[NitroModules] 🔥 onekeyfe_reactnativecheckbiometricauthchanged is boosted by nitro!") - -android { - sourceSets { - main { - java.srcDirs += [ - // Nitrogen files - "${project.projectDir}/../nitrogen/generated/android/kotlin" - ] - } - } -} diff --git a/native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/android/onekeyfe_reactnativecheckbiometricauthchangedOnLoad.cpp b/native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/android/onekeyfe_reactnativecheckbiometricauthchangedOnLoad.cpp deleted file mode 100644 index 699807c..0000000 --- a/native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/android/onekeyfe_reactnativecheckbiometricauthchangedOnLoad.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/// -/// onekeyfe_reactnativecheckbiometricauthchangedOnLoad.cpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#ifndef BUILDING_ONEKEYFEREACTNATIVECHECKBIOMETRICAUTHCHANGED_WITH_GENERATED_CMAKE_PROJECT -#error onekeyfe_reactnativecheckbiometricauthchangedOnLoad.cpp is not being built with the autogenerated CMakeLists.txt project. Is a different CMakeLists.txt building this? -#endif - -#include "onekeyfe_reactnativecheckbiometricauthchangedOnLoad.hpp" - -#include -#include -#include - -#include "JHybridReactNativeCheckBiometricAuthChangedSpec.hpp" -#include - -namespace margelo::nitro::onekeyfe_reactnativecheckbiometricauthchanged { - -int initialize(JavaVM* vm) { - using namespace margelo::nitro; - using namespace margelo::nitro::onekeyfe_reactnativecheckbiometricauthchanged; - using namespace facebook; - - return facebook::jni::initialize(vm, [] { - // Register native JNI methods - margelo::nitro::onekeyfe_reactnativecheckbiometricauthchanged::JHybridReactNativeCheckBiometricAuthChangedSpec::registerNatives(); - - // Register Nitro Hybrid Objects - HybridObjectRegistry::registerHybridObjectConstructor( - "ReactNativeCheckBiometricAuthChanged", - []() -> std::shared_ptr { - static DefaultConstructableObject object("com/margelo/nitro/onekeyfe/reactnativecheckbiometricauthchanged/ReactNativeCheckBiometricAuthChanged"); - auto instance = object.create(); - return instance->cthis()->shared(); - } - ); - }); -} - -} // namespace margelo::nitro::onekeyfe_reactnativecheckbiometricauthchanged diff --git a/native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/android/onekeyfe_reactnativecheckbiometricauthchangedOnLoad.hpp b/native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/android/onekeyfe_reactnativecheckbiometricauthchangedOnLoad.hpp deleted file mode 100644 index 2a8198d..0000000 --- a/native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/android/onekeyfe_reactnativecheckbiometricauthchangedOnLoad.hpp +++ /dev/null @@ -1,25 +0,0 @@ -/// -/// onekeyfe_reactnativecheckbiometricauthchangedOnLoad.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#include -#include - -namespace margelo::nitro::onekeyfe_reactnativecheckbiometricauthchanged { - - /** - * Initializes the native (C++) part of onekeyfe_reactnativecheckbiometricauthchanged, and autolinks all Hybrid Objects. - * Call this in your `JNI_OnLoad` function (probably inside `cpp-adapter.cpp`). - * Example: - * ```cpp (cpp-adapter.cpp) - * JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void*) { - * return margelo::nitro::onekeyfe_reactnativecheckbiometricauthchanged::initialize(vm); - * } - * ``` - */ - int initialize(JavaVM* vm); - -} // namespace margelo::nitro::onekeyfe_reactnativecheckbiometricauthchanged diff --git a/native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/ios/ReactNativeCheckBiometricAuthChanged+autolinking.rb b/native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/ios/ReactNativeCheckBiometricAuthChanged+autolinking.rb deleted file mode 100644 index 10d2d5a..0000000 --- a/native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/ios/ReactNativeCheckBiometricAuthChanged+autolinking.rb +++ /dev/null @@ -1,60 +0,0 @@ -# -# ReactNativeCheckBiometricAuthChanged+autolinking.rb -# This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -# https://github.com/mrousavy/nitro -# Copyright © 2026 Marc Rousavy @ Margelo -# - -# This is a Ruby script that adds all files generated by Nitrogen -# to the given podspec. -# -# To use it, add this to your .podspec: -# ```ruby -# Pod::Spec.new do |spec| -# # ... -# -# # Add all files generated by Nitrogen -# load 'nitrogen/generated/ios/ReactNativeCheckBiometricAuthChanged+autolinking.rb' -# add_nitrogen_files(spec) -# end -# ``` - -def add_nitrogen_files(spec) - Pod::UI.puts "[NitroModules] 🔥 ReactNativeCheckBiometricAuthChanged is boosted by nitro!" - - spec.dependency "NitroModules" - - current_source_files = Array(spec.attributes_hash['source_files']) - spec.source_files = current_source_files + [ - # Generated cross-platform specs - "nitrogen/generated/shared/**/*.{h,hpp,c,cpp,swift}", - # Generated bridges for the cross-platform specs - "nitrogen/generated/ios/**/*.{h,hpp,c,cpp,mm,swift}", - ] - - current_public_header_files = Array(spec.attributes_hash['public_header_files']) - spec.public_header_files = current_public_header_files + [ - # Generated specs - "nitrogen/generated/shared/**/*.{h,hpp}", - # Swift to C++ bridging helpers - "nitrogen/generated/ios/ReactNativeCheckBiometricAuthChanged-Swift-Cxx-Bridge.hpp" - ] - - current_private_header_files = Array(spec.attributes_hash['private_header_files']) - spec.private_header_files = current_private_header_files + [ - # iOS specific specs - "nitrogen/generated/ios/c++/**/*.{h,hpp}", - # Views are framework-specific and should be private - "nitrogen/generated/shared/**/views/**/*" - ] - - current_pod_target_xcconfig = spec.attributes_hash['pod_target_xcconfig'] || {} - spec.pod_target_xcconfig = current_pod_target_xcconfig.merge({ - # Use C++ 20 - "CLANG_CXX_LANGUAGE_STANDARD" => "c++20", - # Enables C++ <-> Swift interop (by default it's only C) - "SWIFT_OBJC_INTEROP_MODE" => "objcxx", - # Enables stricter modular headers - "DEFINES_MODULE" => "YES", - }) -end diff --git a/native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/ios/ReactNativeCheckBiometricAuthChanged-Swift-Cxx-Bridge.cpp b/native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/ios/ReactNativeCheckBiometricAuthChanged-Swift-Cxx-Bridge.cpp deleted file mode 100644 index 27b6b21..0000000 --- a/native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/ios/ReactNativeCheckBiometricAuthChanged-Swift-Cxx-Bridge.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/// -/// ReactNativeCheckBiometricAuthChanged-Swift-Cxx-Bridge.cpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#include "ReactNativeCheckBiometricAuthChanged-Swift-Cxx-Bridge.hpp" - -// Include C++ implementation defined types -#include "HybridReactNativeCheckBiometricAuthChangedSpecSwift.hpp" -#include "ReactNativeCheckBiometricAuthChanged-Swift-Cxx-Umbrella.hpp" -#include - -namespace margelo::nitro::onekeyfe_reactnativecheckbiometricauthchanged::bridge::swift { - - // pragma MARK: std::function - Func_void_bool create_Func_void_bool(void* NON_NULL swiftClosureWrapper) noexcept { - auto swiftClosure = ReactNativeCheckBiometricAuthChanged::Func_void_bool::fromUnsafe(swiftClosureWrapper); - return [swiftClosure = std::move(swiftClosure)](bool result) mutable -> void { - swiftClosure.call(result); - }; - } - - // pragma MARK: std::function - Func_void_std__exception_ptr create_Func_void_std__exception_ptr(void* NON_NULL swiftClosureWrapper) noexcept { - auto swiftClosure = ReactNativeCheckBiometricAuthChanged::Func_void_std__exception_ptr::fromUnsafe(swiftClosureWrapper); - return [swiftClosure = std::move(swiftClosure)](const std::exception_ptr& error) mutable -> void { - swiftClosure.call(error); - }; - } - - // pragma MARK: std::shared_ptr - std::shared_ptr create_std__shared_ptr_HybridReactNativeCheckBiometricAuthChangedSpec_(void* NON_NULL swiftUnsafePointer) noexcept { - ReactNativeCheckBiometricAuthChanged::HybridReactNativeCheckBiometricAuthChangedSpec_cxx swiftPart = ReactNativeCheckBiometricAuthChanged::HybridReactNativeCheckBiometricAuthChangedSpec_cxx::fromUnsafe(swiftUnsafePointer); - return std::make_shared(swiftPart); - } - void* NON_NULL get_std__shared_ptr_HybridReactNativeCheckBiometricAuthChangedSpec_(std__shared_ptr_HybridReactNativeCheckBiometricAuthChangedSpec_ cppType) { - std::shared_ptr swiftWrapper = std::dynamic_pointer_cast(cppType); - #ifdef NITRO_DEBUG - if (swiftWrapper == nullptr) [[unlikely]] { - throw std::runtime_error("Class \"HybridReactNativeCheckBiometricAuthChangedSpec\" is not implemented in Swift!"); - } - #endif - ReactNativeCheckBiometricAuthChanged::HybridReactNativeCheckBiometricAuthChangedSpec_cxx& swiftPart = swiftWrapper->getSwiftPart(); - return swiftPart.toUnsafe(); - } - -} // namespace margelo::nitro::onekeyfe_reactnativecheckbiometricauthchanged::bridge::swift diff --git a/native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/ios/ReactNativeCheckBiometricAuthChanged-Swift-Cxx-Bridge.hpp b/native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/ios/ReactNativeCheckBiometricAuthChanged-Swift-Cxx-Bridge.hpp deleted file mode 100644 index 5c89d8a..0000000 --- a/native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/ios/ReactNativeCheckBiometricAuthChanged-Swift-Cxx-Bridge.hpp +++ /dev/null @@ -1,110 +0,0 @@ -/// -/// ReactNativeCheckBiometricAuthChanged-Swift-Cxx-Bridge.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -// Forward declarations of C++ defined types -// Forward declaration of `HybridReactNativeCheckBiometricAuthChangedSpec` to properly resolve imports. -namespace margelo::nitro::onekeyfe_reactnativecheckbiometricauthchanged { class HybridReactNativeCheckBiometricAuthChangedSpec; } - -// Forward declarations of Swift defined types -// Forward declaration of `HybridReactNativeCheckBiometricAuthChangedSpec_cxx` to properly resolve imports. -namespace ReactNativeCheckBiometricAuthChanged { class HybridReactNativeCheckBiometricAuthChangedSpec_cxx; } - -// Include C++ defined types -#include "HybridReactNativeCheckBiometricAuthChangedSpec.hpp" -#include -#include -#include -#include -#include -#include - -/** - * Contains specialized versions of C++ templated types so they can be accessed from Swift, - * as well as helper functions to interact with those C++ types from Swift. - */ -namespace margelo::nitro::onekeyfe_reactnativecheckbiometricauthchanged::bridge::swift { - - // pragma MARK: std::shared_ptr> - /** - * Specialized version of `std::shared_ptr>`. - */ - using std__shared_ptr_Promise_bool__ = std::shared_ptr>; - inline std::shared_ptr> create_std__shared_ptr_Promise_bool__() noexcept { - return Promise::create(); - } - inline PromiseHolder wrap_std__shared_ptr_Promise_bool__(std::shared_ptr> promise) noexcept { - return PromiseHolder(std::move(promise)); - } - - // pragma MARK: std::function - /** - * Specialized version of `std::function`. - */ - using Func_void_bool = std::function; - /** - * Wrapper class for a `std::function`, this can be used from Swift. - */ - class Func_void_bool_Wrapper final { - public: - explicit Func_void_bool_Wrapper(std::function&& func): _function(std::make_unique>(std::move(func))) {} - inline void call(bool result) const noexcept { - _function->operator()(result); - } - private: - std::unique_ptr> _function; - } SWIFT_NONCOPYABLE; - Func_void_bool create_Func_void_bool(void* NON_NULL swiftClosureWrapper) noexcept; - inline Func_void_bool_Wrapper wrap_Func_void_bool(Func_void_bool value) noexcept { - return Func_void_bool_Wrapper(std::move(value)); - } - - // pragma MARK: std::function - /** - * Specialized version of `std::function`. - */ - using Func_void_std__exception_ptr = std::function; - /** - * Wrapper class for a `std::function`, this can be used from Swift. - */ - class Func_void_std__exception_ptr_Wrapper final { - public: - explicit Func_void_std__exception_ptr_Wrapper(std::function&& func): _function(std::make_unique>(std::move(func))) {} - inline void call(std::exception_ptr error) const noexcept { - _function->operator()(error); - } - private: - std::unique_ptr> _function; - } SWIFT_NONCOPYABLE; - Func_void_std__exception_ptr create_Func_void_std__exception_ptr(void* NON_NULL swiftClosureWrapper) noexcept; - inline Func_void_std__exception_ptr_Wrapper wrap_Func_void_std__exception_ptr(Func_void_std__exception_ptr value) noexcept { - return Func_void_std__exception_ptr_Wrapper(std::move(value)); - } - - // pragma MARK: std::shared_ptr - /** - * Specialized version of `std::shared_ptr`. - */ - using std__shared_ptr_HybridReactNativeCheckBiometricAuthChangedSpec_ = std::shared_ptr; - std::shared_ptr create_std__shared_ptr_HybridReactNativeCheckBiometricAuthChangedSpec_(void* NON_NULL swiftUnsafePointer) noexcept; - void* NON_NULL get_std__shared_ptr_HybridReactNativeCheckBiometricAuthChangedSpec_(std__shared_ptr_HybridReactNativeCheckBiometricAuthChangedSpec_ cppType); - - // pragma MARK: std::weak_ptr - using std__weak_ptr_HybridReactNativeCheckBiometricAuthChangedSpec_ = std::weak_ptr; - inline std__weak_ptr_HybridReactNativeCheckBiometricAuthChangedSpec_ weakify_std__shared_ptr_HybridReactNativeCheckBiometricAuthChangedSpec_(const std::shared_ptr& strong) noexcept { return strong; } - - // pragma MARK: Result>> - using Result_std__shared_ptr_Promise_bool___ = Result>>; - inline Result_std__shared_ptr_Promise_bool___ create_Result_std__shared_ptr_Promise_bool___(const std::shared_ptr>& value) noexcept { - return Result>>::withValue(value); - } - inline Result_std__shared_ptr_Promise_bool___ create_Result_std__shared_ptr_Promise_bool___(const std::exception_ptr& error) noexcept { - return Result>>::withError(error); - } - -} // namespace margelo::nitro::onekeyfe_reactnativecheckbiometricauthchanged::bridge::swift diff --git a/native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/ios/ReactNativeCheckBiometricAuthChanged-Swift-Cxx-Umbrella.hpp b/native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/ios/ReactNativeCheckBiometricAuthChanged-Swift-Cxx-Umbrella.hpp deleted file mode 100644 index e922614..0000000 --- a/native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/ios/ReactNativeCheckBiometricAuthChanged-Swift-Cxx-Umbrella.hpp +++ /dev/null @@ -1,44 +0,0 @@ -/// -/// ReactNativeCheckBiometricAuthChanged-Swift-Cxx-Umbrella.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -// Forward declarations of C++ defined types -// Forward declaration of `HybridReactNativeCheckBiometricAuthChangedSpec` to properly resolve imports. -namespace margelo::nitro::onekeyfe_reactnativecheckbiometricauthchanged { class HybridReactNativeCheckBiometricAuthChangedSpec; } - -// Include C++ defined types -#include "HybridReactNativeCheckBiometricAuthChangedSpec.hpp" -#include -#include -#include -#include - -// C++ helpers for Swift -#include "ReactNativeCheckBiometricAuthChanged-Swift-Cxx-Bridge.hpp" - -// Common C++ types used in Swift -#include -#include -#include -#include - -// Forward declarations of Swift defined types -// Forward declaration of `HybridReactNativeCheckBiometricAuthChangedSpec_cxx` to properly resolve imports. -namespace ReactNativeCheckBiometricAuthChanged { class HybridReactNativeCheckBiometricAuthChangedSpec_cxx; } - -// Include Swift defined types -#if __has_include("ReactNativeCheckBiometricAuthChanged-Swift.h") -// This header is generated by Xcode/Swift on every app build. -// If it cannot be found, make sure the Swift module's name (= podspec name) is actually "ReactNativeCheckBiometricAuthChanged". -#include "ReactNativeCheckBiometricAuthChanged-Swift.h" -// Same as above, but used when building with frameworks (`use_frameworks`) -#elif __has_include() -#include -#else -#error ReactNativeCheckBiometricAuthChanged's autogenerated Swift header cannot be found! Make sure the Swift module's name (= podspec name) is actually "ReactNativeCheckBiometricAuthChanged", and try building the app first. -#endif diff --git a/native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/ios/ReactNativeCheckBiometricAuthChangedAutolinking.mm b/native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/ios/ReactNativeCheckBiometricAuthChangedAutolinking.mm deleted file mode 100644 index dd7a497..0000000 --- a/native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/ios/ReactNativeCheckBiometricAuthChangedAutolinking.mm +++ /dev/null @@ -1,33 +0,0 @@ -/// -/// ReactNativeCheckBiometricAuthChangedAutolinking.mm -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#import -#import -#import "ReactNativeCheckBiometricAuthChanged-Swift-Cxx-Umbrella.hpp" -#import - -#include "HybridReactNativeCheckBiometricAuthChangedSpecSwift.hpp" - -@interface ReactNativeCheckBiometricAuthChangedAutolinking : NSObject -@end - -@implementation ReactNativeCheckBiometricAuthChangedAutolinking - -+ (void) load { - using namespace margelo::nitro; - using namespace margelo::nitro::onekeyfe_reactnativecheckbiometricauthchanged; - - HybridObjectRegistry::registerHybridObjectConstructor( - "ReactNativeCheckBiometricAuthChanged", - []() -> std::shared_ptr { - std::shared_ptr hybridObject = ReactNativeCheckBiometricAuthChanged::ReactNativeCheckBiometricAuthChangedAutolinking::createReactNativeCheckBiometricAuthChanged(); - return hybridObject; - } - ); -} - -@end diff --git a/native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/ios/ReactNativeCheckBiometricAuthChangedAutolinking.swift b/native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/ios/ReactNativeCheckBiometricAuthChangedAutolinking.swift deleted file mode 100644 index 0b1a398..0000000 --- a/native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/ios/ReactNativeCheckBiometricAuthChangedAutolinking.swift +++ /dev/null @@ -1,25 +0,0 @@ -/// -/// ReactNativeCheckBiometricAuthChangedAutolinking.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -public final class ReactNativeCheckBiometricAuthChangedAutolinking { - public typealias bridge = margelo.nitro.onekeyfe_reactnativecheckbiometricauthchanged.bridge.swift - - /** - * Creates an instance of a Swift class that implements `HybridReactNativeCheckBiometricAuthChangedSpec`, - * and wraps it in a Swift class that can directly interop with C++ (`HybridReactNativeCheckBiometricAuthChangedSpec_cxx`) - * - * This is generated by Nitrogen and will initialize the class specified - * in the `"autolinking"` property of `nitro.json` (in this case, `ReactNativeCheckBiometricAuthChanged`). - */ - public static func createReactNativeCheckBiometricAuthChanged() -> bridge.std__shared_ptr_HybridReactNativeCheckBiometricAuthChangedSpec_ { - let hybridObject = ReactNativeCheckBiometricAuthChanged() - return { () -> bridge.std__shared_ptr_HybridReactNativeCheckBiometricAuthChangedSpec_ in - let __cxxWrapped = hybridObject.getCxxWrapper() - return __cxxWrapped.getCxxPart() - }() - } -} diff --git a/native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/ios/c++/HybridReactNativeCheckBiometricAuthChangedSpecSwift.cpp b/native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/ios/c++/HybridReactNativeCheckBiometricAuthChangedSpecSwift.cpp deleted file mode 100644 index 623d71e..0000000 --- a/native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/ios/c++/HybridReactNativeCheckBiometricAuthChangedSpecSwift.cpp +++ /dev/null @@ -1,11 +0,0 @@ -/// -/// HybridReactNativeCheckBiometricAuthChangedSpecSwift.cpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#include "HybridReactNativeCheckBiometricAuthChangedSpecSwift.hpp" - -namespace margelo::nitro::onekeyfe_reactnativecheckbiometricauthchanged { -} // namespace margelo::nitro::onekeyfe_reactnativecheckbiometricauthchanged diff --git a/native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/ios/c++/HybridReactNativeCheckBiometricAuthChangedSpecSwift.hpp b/native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/ios/c++/HybridReactNativeCheckBiometricAuthChangedSpecSwift.hpp deleted file mode 100644 index 20fcf6a..0000000 --- a/native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/ios/c++/HybridReactNativeCheckBiometricAuthChangedSpecSwift.hpp +++ /dev/null @@ -1,76 +0,0 @@ -/// -/// HybridReactNativeCheckBiometricAuthChangedSpecSwift.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#include "HybridReactNativeCheckBiometricAuthChangedSpec.hpp" - -// Forward declaration of `HybridReactNativeCheckBiometricAuthChangedSpec_cxx` to properly resolve imports. -namespace ReactNativeCheckBiometricAuthChanged { class HybridReactNativeCheckBiometricAuthChangedSpec_cxx; } - - - -#include - -#include "ReactNativeCheckBiometricAuthChanged-Swift-Cxx-Umbrella.hpp" - -namespace margelo::nitro::onekeyfe_reactnativecheckbiometricauthchanged { - - /** - * The C++ part of HybridReactNativeCheckBiometricAuthChangedSpec_cxx.swift. - * - * HybridReactNativeCheckBiometricAuthChangedSpecSwift (C++) accesses HybridReactNativeCheckBiometricAuthChangedSpec_cxx (Swift), and might - * contain some additional bridging code for C++ <> Swift interop. - * - * Since this obviously introduces an overhead, I hope at some point in - * the future, HybridReactNativeCheckBiometricAuthChangedSpec_cxx can directly inherit from the C++ class HybridReactNativeCheckBiometricAuthChangedSpec - * to simplify the whole structure and memory management. - */ - class HybridReactNativeCheckBiometricAuthChangedSpecSwift: public virtual HybridReactNativeCheckBiometricAuthChangedSpec { - public: - // Constructor from a Swift instance - explicit HybridReactNativeCheckBiometricAuthChangedSpecSwift(const ReactNativeCheckBiometricAuthChanged::HybridReactNativeCheckBiometricAuthChangedSpec_cxx& swiftPart): - HybridObject(HybridReactNativeCheckBiometricAuthChangedSpec::TAG), - _swiftPart(swiftPart) { } - - public: - // Get the Swift part - inline ReactNativeCheckBiometricAuthChanged::HybridReactNativeCheckBiometricAuthChangedSpec_cxx& getSwiftPart() noexcept { - return _swiftPart; - } - - public: - inline size_t getExternalMemorySize() noexcept override { - return _swiftPart.getMemorySize(); - } - void dispose() noexcept override { - _swiftPart.dispose(); - } - std::string toString() override { - return _swiftPart.toString(); - } - - public: - // Properties - - - public: - // Methods - inline std::shared_ptr> checkChanged() override { - auto __result = _swiftPart.checkChanged(); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - auto __value = std::move(__result.value()); - return __value; - } - - private: - ReactNativeCheckBiometricAuthChanged::HybridReactNativeCheckBiometricAuthChangedSpec_cxx _swiftPart; - }; - -} // namespace margelo::nitro::onekeyfe_reactnativecheckbiometricauthchanged diff --git a/native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/ios/swift/Func_void_bool.swift b/native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/ios/swift/Func_void_bool.swift deleted file mode 100644 index ce4e2f9..0000000 --- a/native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/ios/swift/Func_void_bool.swift +++ /dev/null @@ -1,47 +0,0 @@ -/// -/// Func_void_bool.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Wraps a Swift `(_ value: Bool) -> Void` as a class. - * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`. - */ -public final class Func_void_bool { - public typealias bridge = margelo.nitro.onekeyfe_reactnativecheckbiometricauthchanged.bridge.swift - - private let closure: (_ value: Bool) -> Void - - public init(_ closure: @escaping (_ value: Bool) -> Void) { - self.closure = closure - } - - @inline(__always) - public func call(value: Bool) -> Void { - self.closure(value) - } - - /** - * Casts this instance to a retained unsafe raw pointer. - * This acquires one additional strong reference on the object! - */ - @inline(__always) - public func toUnsafe() -> UnsafeMutableRawPointer { - return Unmanaged.passRetained(self).toOpaque() - } - - /** - * Casts an unsafe pointer to a `Func_void_bool`. - * The pointer has to be a retained opaque `Unmanaged`. - * This removes one strong reference from the object! - */ - @inline(__always) - public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_bool { - return Unmanaged.fromOpaque(pointer).takeRetainedValue() - } -} diff --git a/native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift b/native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift deleted file mode 100644 index 9dfd0ad..0000000 --- a/native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +++ /dev/null @@ -1,47 +0,0 @@ -/// -/// Func_void_std__exception_ptr.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Wraps a Swift `(_ error: Error) -> Void` as a class. - * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`. - */ -public final class Func_void_std__exception_ptr { - public typealias bridge = margelo.nitro.onekeyfe_reactnativecheckbiometricauthchanged.bridge.swift - - private let closure: (_ error: Error) -> Void - - public init(_ closure: @escaping (_ error: Error) -> Void) { - self.closure = closure - } - - @inline(__always) - public func call(error: std.exception_ptr) -> Void { - self.closure(RuntimeError.from(cppError: error)) - } - - /** - * Casts this instance to a retained unsafe raw pointer. - * This acquires one additional strong reference on the object! - */ - @inline(__always) - public func toUnsafe() -> UnsafeMutableRawPointer { - return Unmanaged.passRetained(self).toOpaque() - } - - /** - * Casts an unsafe pointer to a `Func_void_std__exception_ptr`. - * The pointer has to be a retained opaque `Unmanaged`. - * This removes one strong reference from the object! - */ - @inline(__always) - public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_std__exception_ptr { - return Unmanaged.fromOpaque(pointer).takeRetainedValue() - } -} diff --git a/native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/ios/swift/HybridReactNativeCheckBiometricAuthChangedSpec.swift b/native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/ios/swift/HybridReactNativeCheckBiometricAuthChangedSpec.swift deleted file mode 100644 index afa709a..0000000 --- a/native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/ios/swift/HybridReactNativeCheckBiometricAuthChangedSpec.swift +++ /dev/null @@ -1,56 +0,0 @@ -/// -/// HybridReactNativeCheckBiometricAuthChangedSpec.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/// See ``HybridReactNativeCheckBiometricAuthChangedSpec`` -public protocol HybridReactNativeCheckBiometricAuthChangedSpec_protocol: HybridObject { - // Properties - - - // Methods - func checkChanged() throws -> Promise -} - -public extension HybridReactNativeCheckBiometricAuthChangedSpec_protocol { - /// Default implementation of ``HybridObject.toString`` - func toString() -> String { - return "[HybridObject ReactNativeCheckBiometricAuthChanged]" - } -} - -/// See ``HybridReactNativeCheckBiometricAuthChangedSpec`` -open class HybridReactNativeCheckBiometricAuthChangedSpec_base { - private weak var cxxWrapper: HybridReactNativeCheckBiometricAuthChangedSpec_cxx? = nil - public init() { } - public func getCxxWrapper() -> HybridReactNativeCheckBiometricAuthChangedSpec_cxx { - #if DEBUG - guard self is HybridReactNativeCheckBiometricAuthChangedSpec else { - fatalError("`self` is not a `HybridReactNativeCheckBiometricAuthChangedSpec`! Did you accidentally inherit from `HybridReactNativeCheckBiometricAuthChangedSpec_base` instead of `HybridReactNativeCheckBiometricAuthChangedSpec`?") - } - #endif - if let cxxWrapper = self.cxxWrapper { - return cxxWrapper - } else { - let cxxWrapper = HybridReactNativeCheckBiometricAuthChangedSpec_cxx(self as! HybridReactNativeCheckBiometricAuthChangedSpec) - self.cxxWrapper = cxxWrapper - return cxxWrapper - } - } -} - -/** - * A Swift base-protocol representing the ReactNativeCheckBiometricAuthChanged HybridObject. - * Implement this protocol to create Swift-based instances of ReactNativeCheckBiometricAuthChanged. - * ```swift - * class HybridReactNativeCheckBiometricAuthChanged : HybridReactNativeCheckBiometricAuthChangedSpec { - * // ... - * } - * ``` - */ -public typealias HybridReactNativeCheckBiometricAuthChangedSpec = HybridReactNativeCheckBiometricAuthChangedSpec_protocol & HybridReactNativeCheckBiometricAuthChangedSpec_base diff --git a/native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/ios/swift/HybridReactNativeCheckBiometricAuthChangedSpec_cxx.swift b/native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/ios/swift/HybridReactNativeCheckBiometricAuthChangedSpec_cxx.swift deleted file mode 100644 index 0fdf859..0000000 --- a/native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/ios/swift/HybridReactNativeCheckBiometricAuthChangedSpec_cxx.swift +++ /dev/null @@ -1,138 +0,0 @@ -/// -/// HybridReactNativeCheckBiometricAuthChangedSpec_cxx.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * A class implementation that bridges HybridReactNativeCheckBiometricAuthChangedSpec over to C++. - * In C++, we cannot use Swift protocols - so we need to wrap it in a class to make it strongly defined. - * - * Also, some Swift types need to be bridged with special handling: - * - Enums need to be wrapped in Structs, otherwise they cannot be accessed bi-directionally (Swift bug: https://github.com/swiftlang/swift/issues/75330) - * - Other HybridObjects need to be wrapped/unwrapped from the Swift TCxx wrapper - * - Throwing methods need to be wrapped with a Result type, as exceptions cannot be propagated to C++ - */ -open class HybridReactNativeCheckBiometricAuthChangedSpec_cxx { - /** - * The Swift <> C++ bridge's namespace (`margelo::nitro::onekeyfe_reactnativecheckbiometricauthchanged::bridge::swift`) - * from `ReactNativeCheckBiometricAuthChanged-Swift-Cxx-Bridge.hpp`. - * This contains specialized C++ templates, and C++ helper functions that can be accessed from Swift. - */ - public typealias bridge = margelo.nitro.onekeyfe_reactnativecheckbiometricauthchanged.bridge.swift - - /** - * Holds an instance of the `HybridReactNativeCheckBiometricAuthChangedSpec` Swift protocol. - */ - private var __implementation: any HybridReactNativeCheckBiometricAuthChangedSpec - - /** - * Holds a weak pointer to the C++ class that wraps the Swift class. - */ - private var __cxxPart: bridge.std__weak_ptr_HybridReactNativeCheckBiometricAuthChangedSpec_ - - /** - * Create a new `HybridReactNativeCheckBiometricAuthChangedSpec_cxx` that wraps the given `HybridReactNativeCheckBiometricAuthChangedSpec`. - * All properties and methods bridge to C++ types. - */ - public init(_ implementation: any HybridReactNativeCheckBiometricAuthChangedSpec) { - self.__implementation = implementation - self.__cxxPart = .init() - /* no base class */ - } - - /** - * Get the actual `HybridReactNativeCheckBiometricAuthChangedSpec` instance this class wraps. - */ - @inline(__always) - public func getHybridReactNativeCheckBiometricAuthChangedSpec() -> any HybridReactNativeCheckBiometricAuthChangedSpec { - return __implementation - } - - /** - * Casts this instance to a retained unsafe raw pointer. - * This acquires one additional strong reference on the object! - */ - public func toUnsafe() -> UnsafeMutableRawPointer { - return Unmanaged.passRetained(self).toOpaque() - } - - /** - * Casts an unsafe pointer to a `HybridReactNativeCheckBiometricAuthChangedSpec_cxx`. - * The pointer has to be a retained opaque `Unmanaged`. - * This removes one strong reference from the object! - */ - public class func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> HybridReactNativeCheckBiometricAuthChangedSpec_cxx { - return Unmanaged.fromOpaque(pointer).takeRetainedValue() - } - - /** - * Gets (or creates) the C++ part of this Hybrid Object. - * The C++ part is a `std::shared_ptr`. - */ - public func getCxxPart() -> bridge.std__shared_ptr_HybridReactNativeCheckBiometricAuthChangedSpec_ { - let cachedCxxPart = self.__cxxPart.lock() - if Bool(fromCxx: cachedCxxPart) { - return cachedCxxPart - } else { - let newCxxPart = bridge.create_std__shared_ptr_HybridReactNativeCheckBiometricAuthChangedSpec_(self.toUnsafe()) - __cxxPart = bridge.weakify_std__shared_ptr_HybridReactNativeCheckBiometricAuthChangedSpec_(newCxxPart) - return newCxxPart - } - } - - - - /** - * Get the memory size of the Swift class (plus size of any other allocations) - * so the JS VM can properly track it and garbage-collect the JS object if needed. - */ - @inline(__always) - public var memorySize: Int { - return MemoryHelper.getSizeOf(self.__implementation) + self.__implementation.memorySize - } - - /** - * Call dispose() on the Swift class. - * This _may_ be called manually from JS. - */ - @inline(__always) - public func dispose() { - self.__implementation.dispose() - } - - /** - * Call toString() on the Swift class. - */ - @inline(__always) - public func toString() -> String { - return self.__implementation.toString() - } - - // Properties - - - // Methods - @inline(__always) - public final func checkChanged() -> bridge.Result_std__shared_ptr_Promise_bool___ { - do { - let __result = try self.__implementation.checkChanged() - let __resultCpp = { () -> bridge.std__shared_ptr_Promise_bool__ in - let __promise = bridge.create_std__shared_ptr_Promise_bool__() - let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_bool__(__promise) - __result - .then({ __result in __promiseHolder.resolve(__result) }) - .catch({ __error in __promiseHolder.reject(__error.toCpp()) }) - return __promise - }() - return bridge.create_Result_std__shared_ptr_Promise_bool___(__resultCpp) - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_std__shared_ptr_Promise_bool___(__exceptionPtr) - } - } -} diff --git a/native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/shared/c++/HybridReactNativeCheckBiometricAuthChangedSpec.cpp b/native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/shared/c++/HybridReactNativeCheckBiometricAuthChangedSpec.cpp deleted file mode 100644 index 9bdee4c..0000000 --- a/native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/shared/c++/HybridReactNativeCheckBiometricAuthChangedSpec.cpp +++ /dev/null @@ -1,21 +0,0 @@ -/// -/// HybridReactNativeCheckBiometricAuthChangedSpec.cpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#include "HybridReactNativeCheckBiometricAuthChangedSpec.hpp" - -namespace margelo::nitro::onekeyfe_reactnativecheckbiometricauthchanged { - - void HybridReactNativeCheckBiometricAuthChangedSpec::loadHybridMethods() { - // load base methods/properties - HybridObject::loadHybridMethods(); - // load custom methods/properties - registerHybrids(this, [](Prototype& prototype) { - prototype.registerHybridMethod("checkChanged", &HybridReactNativeCheckBiometricAuthChangedSpec::checkChanged); - }); - } - -} // namespace margelo::nitro::onekeyfe_reactnativecheckbiometricauthchanged diff --git a/native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/shared/c++/HybridReactNativeCheckBiometricAuthChangedSpec.hpp b/native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/shared/c++/HybridReactNativeCheckBiometricAuthChangedSpec.hpp deleted file mode 100644 index 20aef33..0000000 --- a/native-modules/react-native-check-biometric-auth-changed/nitrogen/generated/shared/c++/HybridReactNativeCheckBiometricAuthChangedSpec.hpp +++ /dev/null @@ -1,62 +0,0 @@ -/// -/// HybridReactNativeCheckBiometricAuthChangedSpec.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif - - - -#include - -namespace margelo::nitro::onekeyfe_reactnativecheckbiometricauthchanged { - - using namespace margelo::nitro; - - /** - * An abstract base class for `ReactNativeCheckBiometricAuthChanged` - * Inherit this class to create instances of `HybridReactNativeCheckBiometricAuthChangedSpec` in C++. - * You must explicitly call `HybridObject`'s constructor yourself, because it is virtual. - * @example - * ```cpp - * class HybridReactNativeCheckBiometricAuthChanged: public HybridReactNativeCheckBiometricAuthChangedSpec { - * public: - * HybridReactNativeCheckBiometricAuthChanged(...): HybridObject(TAG) { ... } - * // ... - * }; - * ``` - */ - class HybridReactNativeCheckBiometricAuthChangedSpec: public virtual HybridObject { - public: - // Constructor - explicit HybridReactNativeCheckBiometricAuthChangedSpec(): HybridObject(TAG) { } - - // Destructor - ~HybridReactNativeCheckBiometricAuthChangedSpec() override = default; - - public: - // Properties - - - public: - // Methods - virtual std::shared_ptr> checkChanged() = 0; - - protected: - // Hybrid Setup - void loadHybridMethods() override; - - protected: - // Tag for logging - static constexpr auto TAG = "ReactNativeCheckBiometricAuthChanged"; - }; - -} // namespace margelo::nitro::onekeyfe_reactnativecheckbiometricauthchanged diff --git a/native-modules/react-native-cloud-kit-module/nitrogen/generated/.gitattributes b/native-modules/react-native-cloud-kit-module/nitrogen/generated/.gitattributes deleted file mode 100644 index fb7a0d5..0000000 --- a/native-modules/react-native-cloud-kit-module/nitrogen/generated/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -** linguist-generated=true diff --git a/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/c++/JAccountInfoResult.hpp b/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/c++/JAccountInfoResult.hpp deleted file mode 100644 index d3f10fa..0000000 --- a/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/c++/JAccountInfoResult.hpp +++ /dev/null @@ -1,66 +0,0 @@ -/// -/// JAccountInfoResult.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#include -#include "AccountInfoResult.hpp" - -#include -#include - -namespace margelo::nitro::cloudkitmodule { - - using namespace facebook; - - /** - * The C++ JNI bridge between the C++ struct "AccountInfoResult" and the the Kotlin data class "AccountInfoResult". - */ - struct JAccountInfoResult final: public jni::JavaClass { - public: - static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/cloudkitmodule/AccountInfoResult;"; - - public: - /** - * Convert this Java/Kotlin-based struct to the C++ struct AccountInfoResult by copying all values to C++. - */ - [[maybe_unused]] - [[nodiscard]] - AccountInfoResult toCpp() const { - static const auto clazz = javaClassStatic(); - static const auto fieldStatus = clazz->getField("status"); - double status = this->getFieldValue(fieldStatus); - static const auto fieldStatusName = clazz->getField("statusName"); - jni::local_ref statusName = this->getFieldValue(fieldStatusName); - static const auto fieldContainerUserId = clazz->getField("containerUserId"); - jni::local_ref containerUserId = this->getFieldValue(fieldContainerUserId); - return AccountInfoResult( - status, - statusName->toStdString(), - containerUserId != nullptr ? std::make_optional(containerUserId->toStdString()) : std::nullopt - ); - } - - public: - /** - * Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java. - */ - [[maybe_unused]] - static jni::local_ref fromCpp(const AccountInfoResult& value) { - using JSignature = JAccountInfoResult(double, jni::alias_ref, jni::alias_ref); - static const auto clazz = javaClassStatic(); - static const auto create = clazz->getStaticMethod("fromCpp"); - return create( - clazz, - value.status, - jni::make_jstring(value.statusName), - value.containerUserId.has_value() ? jni::make_jstring(value.containerUserId.value()) : nullptr - ); - } - }; - -} // namespace margelo::nitro::cloudkitmodule diff --git a/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/c++/JDeleteRecordParams.hpp b/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/c++/JDeleteRecordParams.hpp deleted file mode 100644 index f80b566..0000000 --- a/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/c++/JDeleteRecordParams.hpp +++ /dev/null @@ -1,61 +0,0 @@ -/// -/// JDeleteRecordParams.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#include -#include "DeleteRecordParams.hpp" - -#include - -namespace margelo::nitro::cloudkitmodule { - - using namespace facebook; - - /** - * The C++ JNI bridge between the C++ struct "DeleteRecordParams" and the the Kotlin data class "DeleteRecordParams". - */ - struct JDeleteRecordParams final: public jni::JavaClass { - public: - static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/cloudkitmodule/DeleteRecordParams;"; - - public: - /** - * Convert this Java/Kotlin-based struct to the C++ struct DeleteRecordParams by copying all values to C++. - */ - [[maybe_unused]] - [[nodiscard]] - DeleteRecordParams toCpp() const { - static const auto clazz = javaClassStatic(); - static const auto fieldRecordType = clazz->getField("recordType"); - jni::local_ref recordType = this->getFieldValue(fieldRecordType); - static const auto fieldRecordID = clazz->getField("recordID"); - jni::local_ref recordID = this->getFieldValue(fieldRecordID); - return DeleteRecordParams( - recordType->toStdString(), - recordID->toStdString() - ); - } - - public: - /** - * Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java. - */ - [[maybe_unused]] - static jni::local_ref fromCpp(const DeleteRecordParams& value) { - using JSignature = JDeleteRecordParams(jni::alias_ref, jni::alias_ref); - static const auto clazz = javaClassStatic(); - static const auto create = clazz->getStaticMethod("fromCpp"); - return create( - clazz, - jni::make_jstring(value.recordType), - jni::make_jstring(value.recordID) - ); - } - }; - -} // namespace margelo::nitro::cloudkitmodule diff --git a/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/c++/JFetchRecordParams.hpp b/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/c++/JFetchRecordParams.hpp deleted file mode 100644 index 75ebbfd..0000000 --- a/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/c++/JFetchRecordParams.hpp +++ /dev/null @@ -1,61 +0,0 @@ -/// -/// JFetchRecordParams.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#include -#include "FetchRecordParams.hpp" - -#include - -namespace margelo::nitro::cloudkitmodule { - - using namespace facebook; - - /** - * The C++ JNI bridge between the C++ struct "FetchRecordParams" and the the Kotlin data class "FetchRecordParams". - */ - struct JFetchRecordParams final: public jni::JavaClass { - public: - static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/cloudkitmodule/FetchRecordParams;"; - - public: - /** - * Convert this Java/Kotlin-based struct to the C++ struct FetchRecordParams by copying all values to C++. - */ - [[maybe_unused]] - [[nodiscard]] - FetchRecordParams toCpp() const { - static const auto clazz = javaClassStatic(); - static const auto fieldRecordType = clazz->getField("recordType"); - jni::local_ref recordType = this->getFieldValue(fieldRecordType); - static const auto fieldRecordID = clazz->getField("recordID"); - jni::local_ref recordID = this->getFieldValue(fieldRecordID); - return FetchRecordParams( - recordType->toStdString(), - recordID->toStdString() - ); - } - - public: - /** - * Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java. - */ - [[maybe_unused]] - static jni::local_ref fromCpp(const FetchRecordParams& value) { - using JSignature = JFetchRecordParams(jni::alias_ref, jni::alias_ref); - static const auto clazz = javaClassStatic(); - static const auto create = clazz->getStaticMethod("fromCpp"); - return create( - clazz, - jni::make_jstring(value.recordType), - jni::make_jstring(value.recordID) - ); - } - }; - -} // namespace margelo::nitro::cloudkitmodule diff --git a/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/c++/JHybridCloudKitModuleSpec.cpp b/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/c++/JHybridCloudKitModuleSpec.cpp deleted file mode 100644 index 432a3b4..0000000 --- a/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/c++/JHybridCloudKitModuleSpec.cpp +++ /dev/null @@ -1,201 +0,0 @@ -/// -/// JHybridCloudKitModuleSpec.cpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#include "JHybridCloudKitModuleSpec.hpp" - -// Forward declaration of `AccountInfoResult` to properly resolve imports. -namespace margelo::nitro::cloudkitmodule { struct AccountInfoResult; } -// Forward declaration of `SaveRecordResult` to properly resolve imports. -namespace margelo::nitro::cloudkitmodule { struct SaveRecordResult; } -// Forward declaration of `RecordResult` to properly resolve imports. -namespace margelo::nitro::cloudkitmodule { struct RecordResult; } -// Forward declaration of `QueryRecordsResult` to properly resolve imports. -namespace margelo::nitro::cloudkitmodule { struct QueryRecordsResult; } -// Forward declaration of `SaveRecordParams` to properly resolve imports. -namespace margelo::nitro::cloudkitmodule { struct SaveRecordParams; } -// Forward declaration of `FetchRecordParams` to properly resolve imports. -namespace margelo::nitro::cloudkitmodule { struct FetchRecordParams; } -// Forward declaration of `DeleteRecordParams` to properly resolve imports. -namespace margelo::nitro::cloudkitmodule { struct DeleteRecordParams; } -// Forward declaration of `RecordExistsParams` to properly resolve imports. -namespace margelo::nitro::cloudkitmodule { struct RecordExistsParams; } -// Forward declaration of `QueryRecordsParams` to properly resolve imports. -namespace margelo::nitro::cloudkitmodule { struct QueryRecordsParams; } - -#include -#include -#include "AccountInfoResult.hpp" -#include "JAccountInfoResult.hpp" -#include -#include -#include "SaveRecordResult.hpp" -#include "JSaveRecordResult.hpp" -#include -#include "RecordResult.hpp" -#include -#include "JVariant_NullType_RecordResult.hpp" -#include -#include "JRecordResult.hpp" -#include "QueryRecordsResult.hpp" -#include "JQueryRecordsResult.hpp" -#include -#include "SaveRecordParams.hpp" -#include "JSaveRecordParams.hpp" -#include "FetchRecordParams.hpp" -#include "JFetchRecordParams.hpp" -#include "DeleteRecordParams.hpp" -#include "JDeleteRecordParams.hpp" -#include "RecordExistsParams.hpp" -#include "JRecordExistsParams.hpp" -#include "QueryRecordsParams.hpp" -#include "JQueryRecordsParams.hpp" - -namespace margelo::nitro::cloudkitmodule { - - jni::local_ref JHybridCloudKitModuleSpec::initHybrid(jni::alias_ref jThis) { - return makeCxxInstance(jThis); - } - - void JHybridCloudKitModuleSpec::registerNatives() { - registerHybrid({ - makeNativeMethod("initHybrid", JHybridCloudKitModuleSpec::initHybrid), - }); - } - - size_t JHybridCloudKitModuleSpec::getExternalMemorySize() noexcept { - static const auto method = javaClassStatic()->getMethod("getMemorySize"); - return method(_javaPart); - } - - void JHybridCloudKitModuleSpec::dispose() noexcept { - static const auto method = javaClassStatic()->getMethod("dispose"); - method(_javaPart); - } - - std::string JHybridCloudKitModuleSpec::toString() { - static const auto method = javaClassStatic()->getMethod("toString"); - auto javaString = method(_javaPart); - return javaString->toStdString(); - } - - // Properties - - - // Methods - std::shared_ptr> JHybridCloudKitModuleSpec::isAvailable() { - static const auto method = javaClassStatic()->getMethod()>("isAvailable"); - auto __result = method(_javaPart); - return [&]() { - auto __promise = Promise::create(); - __result->cthis()->addOnResolvedListener([=](const jni::alias_ref& __boxedResult) { - auto __result = jni::static_ref_cast(__boxedResult); - __promise->resolve(static_cast(__result->value())); - }); - __result->cthis()->addOnRejectedListener([=](const jni::alias_ref& __throwable) { - jni::JniException __jniError(__throwable); - __promise->reject(std::make_exception_ptr(__jniError)); - }); - return __promise; - }(); - } - std::shared_ptr> JHybridCloudKitModuleSpec::getAccountInfo() { - static const auto method = javaClassStatic()->getMethod()>("getAccountInfo"); - auto __result = method(_javaPart); - return [&]() { - auto __promise = Promise::create(); - __result->cthis()->addOnResolvedListener([=](const jni::alias_ref& __boxedResult) { - auto __result = jni::static_ref_cast(__boxedResult); - __promise->resolve(__result->toCpp()); - }); - __result->cthis()->addOnRejectedListener([=](const jni::alias_ref& __throwable) { - jni::JniException __jniError(__throwable); - __promise->reject(std::make_exception_ptr(__jniError)); - }); - return __promise; - }(); - } - std::shared_ptr> JHybridCloudKitModuleSpec::saveRecord(const SaveRecordParams& params) { - static const auto method = javaClassStatic()->getMethod(jni::alias_ref /* params */)>("saveRecord"); - auto __result = method(_javaPart, JSaveRecordParams::fromCpp(params)); - return [&]() { - auto __promise = Promise::create(); - __result->cthis()->addOnResolvedListener([=](const jni::alias_ref& __boxedResult) { - auto __result = jni::static_ref_cast(__boxedResult); - __promise->resolve(__result->toCpp()); - }); - __result->cthis()->addOnRejectedListener([=](const jni::alias_ref& __throwable) { - jni::JniException __jniError(__throwable); - __promise->reject(std::make_exception_ptr(__jniError)); - }); - return __promise; - }(); - } - std::shared_ptr>> JHybridCloudKitModuleSpec::fetchRecord(const FetchRecordParams& params) { - static const auto method = javaClassStatic()->getMethod(jni::alias_ref /* params */)>("fetchRecord"); - auto __result = method(_javaPart, JFetchRecordParams::fromCpp(params)); - return [&]() { - auto __promise = Promise>::create(); - __result->cthis()->addOnResolvedListener([=](const jni::alias_ref& __boxedResult) { - auto __result = jni::static_ref_cast(__boxedResult); - __promise->resolve(__result->toCpp()); - }); - __result->cthis()->addOnRejectedListener([=](const jni::alias_ref& __throwable) { - jni::JniException __jniError(__throwable); - __promise->reject(std::make_exception_ptr(__jniError)); - }); - return __promise; - }(); - } - std::shared_ptr> JHybridCloudKitModuleSpec::deleteRecord(const DeleteRecordParams& params) { - static const auto method = javaClassStatic()->getMethod(jni::alias_ref /* params */)>("deleteRecord"); - auto __result = method(_javaPart, JDeleteRecordParams::fromCpp(params)); - return [&]() { - auto __promise = Promise::create(); - __result->cthis()->addOnResolvedListener([=](const jni::alias_ref& /* unit */) { - __promise->resolve(); - }); - __result->cthis()->addOnRejectedListener([=](const jni::alias_ref& __throwable) { - jni::JniException __jniError(__throwable); - __promise->reject(std::make_exception_ptr(__jniError)); - }); - return __promise; - }(); - } - std::shared_ptr> JHybridCloudKitModuleSpec::recordExists(const RecordExistsParams& params) { - static const auto method = javaClassStatic()->getMethod(jni::alias_ref /* params */)>("recordExists"); - auto __result = method(_javaPart, JRecordExistsParams::fromCpp(params)); - return [&]() { - auto __promise = Promise::create(); - __result->cthis()->addOnResolvedListener([=](const jni::alias_ref& __boxedResult) { - auto __result = jni::static_ref_cast(__boxedResult); - __promise->resolve(static_cast(__result->value())); - }); - __result->cthis()->addOnRejectedListener([=](const jni::alias_ref& __throwable) { - jni::JniException __jniError(__throwable); - __promise->reject(std::make_exception_ptr(__jniError)); - }); - return __promise; - }(); - } - std::shared_ptr> JHybridCloudKitModuleSpec::queryRecords(const QueryRecordsParams& params) { - static const auto method = javaClassStatic()->getMethod(jni::alias_ref /* params */)>("queryRecords"); - auto __result = method(_javaPart, JQueryRecordsParams::fromCpp(params)); - return [&]() { - auto __promise = Promise::create(); - __result->cthis()->addOnResolvedListener([=](const jni::alias_ref& __boxedResult) { - auto __result = jni::static_ref_cast(__boxedResult); - __promise->resolve(__result->toCpp()); - }); - __result->cthis()->addOnRejectedListener([=](const jni::alias_ref& __throwable) { - jni::JniException __jniError(__throwable); - __promise->reject(std::make_exception_ptr(__jniError)); - }); - return __promise; - }(); - } - -} // namespace margelo::nitro::cloudkitmodule diff --git a/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/c++/JHybridCloudKitModuleSpec.hpp b/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/c++/JHybridCloudKitModuleSpec.hpp deleted file mode 100644 index 5363078..0000000 --- a/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/c++/JHybridCloudKitModuleSpec.hpp +++ /dev/null @@ -1,71 +0,0 @@ -/// -/// HybridCloudKitModuleSpec.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#include -#include -#include "HybridCloudKitModuleSpec.hpp" - - - - -namespace margelo::nitro::cloudkitmodule { - - using namespace facebook; - - class JHybridCloudKitModuleSpec: public jni::HybridClass, - public virtual HybridCloudKitModuleSpec { - public: - static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/cloudkitmodule/HybridCloudKitModuleSpec;"; - static jni::local_ref initHybrid(jni::alias_ref jThis); - static void registerNatives(); - - protected: - // C++ constructor (called from Java via `initHybrid()`) - explicit JHybridCloudKitModuleSpec(jni::alias_ref jThis) : - HybridObject(HybridCloudKitModuleSpec::TAG), - HybridBase(jThis), - _javaPart(jni::make_global(jThis)) {} - - public: - ~JHybridCloudKitModuleSpec() override { - // Hermes GC can destroy JS objects on a non-JNI Thread. - jni::ThreadScope::WithClassLoader([&] { _javaPart.reset(); }); - } - - public: - size_t getExternalMemorySize() noexcept override; - void dispose() noexcept override; - std::string toString() override; - - public: - inline const jni::global_ref& getJavaPart() const noexcept { - return _javaPart; - } - - public: - // Properties - - - public: - // Methods - std::shared_ptr> isAvailable() override; - std::shared_ptr> getAccountInfo() override; - std::shared_ptr> saveRecord(const SaveRecordParams& params) override; - std::shared_ptr>> fetchRecord(const FetchRecordParams& params) override; - std::shared_ptr> deleteRecord(const DeleteRecordParams& params) override; - std::shared_ptr> recordExists(const RecordExistsParams& params) override; - std::shared_ptr> queryRecords(const QueryRecordsParams& params) override; - - private: - friend HybridBase; - using HybridBase::HybridBase; - jni::global_ref _javaPart; - }; - -} // namespace margelo::nitro::cloudkitmodule diff --git a/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/c++/JQueryRecordsParams.hpp b/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/c++/JQueryRecordsParams.hpp deleted file mode 100644 index 0eccb42..0000000 --- a/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/c++/JQueryRecordsParams.hpp +++ /dev/null @@ -1,57 +0,0 @@ -/// -/// JQueryRecordsParams.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#include -#include "QueryRecordsParams.hpp" - -#include - -namespace margelo::nitro::cloudkitmodule { - - using namespace facebook; - - /** - * The C++ JNI bridge between the C++ struct "QueryRecordsParams" and the the Kotlin data class "QueryRecordsParams". - */ - struct JQueryRecordsParams final: public jni::JavaClass { - public: - static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/cloudkitmodule/QueryRecordsParams;"; - - public: - /** - * Convert this Java/Kotlin-based struct to the C++ struct QueryRecordsParams by copying all values to C++. - */ - [[maybe_unused]] - [[nodiscard]] - QueryRecordsParams toCpp() const { - static const auto clazz = javaClassStatic(); - static const auto fieldRecordType = clazz->getField("recordType"); - jni::local_ref recordType = this->getFieldValue(fieldRecordType); - return QueryRecordsParams( - recordType->toStdString() - ); - } - - public: - /** - * Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java. - */ - [[maybe_unused]] - static jni::local_ref fromCpp(const QueryRecordsParams& value) { - using JSignature = JQueryRecordsParams(jni::alias_ref); - static const auto clazz = javaClassStatic(); - static const auto create = clazz->getStaticMethod("fromCpp"); - return create( - clazz, - jni::make_jstring(value.recordType) - ); - } - }; - -} // namespace margelo::nitro::cloudkitmodule diff --git a/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/c++/JQueryRecordsResult.hpp b/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/c++/JQueryRecordsResult.hpp deleted file mode 100644 index d23073f..0000000 --- a/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/c++/JQueryRecordsResult.hpp +++ /dev/null @@ -1,78 +0,0 @@ -/// -/// JQueryRecordsResult.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#include -#include "QueryRecordsResult.hpp" - -#include "JRecordResult.hpp" -#include "RecordResult.hpp" -#include -#include - -namespace margelo::nitro::cloudkitmodule { - - using namespace facebook; - - /** - * The C++ JNI bridge between the C++ struct "QueryRecordsResult" and the the Kotlin data class "QueryRecordsResult". - */ - struct JQueryRecordsResult final: public jni::JavaClass { - public: - static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/cloudkitmodule/QueryRecordsResult;"; - - public: - /** - * Convert this Java/Kotlin-based struct to the C++ struct QueryRecordsResult by copying all values to C++. - */ - [[maybe_unused]] - [[nodiscard]] - QueryRecordsResult toCpp() const { - static const auto clazz = javaClassStatic(); - static const auto fieldRecords = clazz->getField>("records"); - jni::local_ref> records = this->getFieldValue(fieldRecords); - return QueryRecordsResult( - [&]() { - size_t __size = records->size(); - std::vector __vector; - __vector.reserve(__size); - for (size_t __i = 0; __i < __size; __i++) { - auto __element = records->getElement(__i); - __vector.push_back(__element->toCpp()); - } - return __vector; - }() - ); - } - - public: - /** - * Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java. - */ - [[maybe_unused]] - static jni::local_ref fromCpp(const QueryRecordsResult& value) { - using JSignature = JQueryRecordsResult(jni::alias_ref>); - static const auto clazz = javaClassStatic(); - static const auto create = clazz->getStaticMethod("fromCpp"); - return create( - clazz, - [&]() { - size_t __size = value.records.size(); - jni::local_ref> __array = jni::JArrayClass::newArray(__size); - for (size_t __i = 0; __i < __size; __i++) { - const auto& __element = value.records[__i]; - auto __elementJni = JRecordResult::fromCpp(__element); - __array->setElement(__i, *__elementJni); - } - return __array; - }() - ); - } - }; - -} // namespace margelo::nitro::cloudkitmodule diff --git a/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/c++/JRecordExistsParams.hpp b/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/c++/JRecordExistsParams.hpp deleted file mode 100644 index 037443c..0000000 --- a/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/c++/JRecordExistsParams.hpp +++ /dev/null @@ -1,61 +0,0 @@ -/// -/// JRecordExistsParams.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#include -#include "RecordExistsParams.hpp" - -#include - -namespace margelo::nitro::cloudkitmodule { - - using namespace facebook; - - /** - * The C++ JNI bridge between the C++ struct "RecordExistsParams" and the the Kotlin data class "RecordExistsParams". - */ - struct JRecordExistsParams final: public jni::JavaClass { - public: - static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/cloudkitmodule/RecordExistsParams;"; - - public: - /** - * Convert this Java/Kotlin-based struct to the C++ struct RecordExistsParams by copying all values to C++. - */ - [[maybe_unused]] - [[nodiscard]] - RecordExistsParams toCpp() const { - static const auto clazz = javaClassStatic(); - static const auto fieldRecordType = clazz->getField("recordType"); - jni::local_ref recordType = this->getFieldValue(fieldRecordType); - static const auto fieldRecordID = clazz->getField("recordID"); - jni::local_ref recordID = this->getFieldValue(fieldRecordID); - return RecordExistsParams( - recordType->toStdString(), - recordID->toStdString() - ); - } - - public: - /** - * Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java. - */ - [[maybe_unused]] - static jni::local_ref fromCpp(const RecordExistsParams& value) { - using JSignature = JRecordExistsParams(jni::alias_ref, jni::alias_ref); - static const auto clazz = javaClassStatic(); - static const auto create = clazz->getStaticMethod("fromCpp"); - return create( - clazz, - jni::make_jstring(value.recordType), - jni::make_jstring(value.recordID) - ); - } - }; - -} // namespace margelo::nitro::cloudkitmodule diff --git a/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/c++/JRecordResult.hpp b/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/c++/JRecordResult.hpp deleted file mode 100644 index cc0e964..0000000 --- a/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/c++/JRecordResult.hpp +++ /dev/null @@ -1,77 +0,0 @@ -/// -/// JRecordResult.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#include -#include "RecordResult.hpp" - -#include - -namespace margelo::nitro::cloudkitmodule { - - using namespace facebook; - - /** - * The C++ JNI bridge between the C++ struct "RecordResult" and the the Kotlin data class "RecordResult". - */ - struct JRecordResult final: public jni::JavaClass { - public: - static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/cloudkitmodule/RecordResult;"; - - public: - /** - * Convert this Java/Kotlin-based struct to the C++ struct RecordResult by copying all values to C++. - */ - [[maybe_unused]] - [[nodiscard]] - RecordResult toCpp() const { - static const auto clazz = javaClassStatic(); - static const auto fieldRecordID = clazz->getField("recordID"); - jni::local_ref recordID = this->getFieldValue(fieldRecordID); - static const auto fieldRecordType = clazz->getField("recordType"); - jni::local_ref recordType = this->getFieldValue(fieldRecordType); - static const auto fieldData = clazz->getField("data"); - jni::local_ref data = this->getFieldValue(fieldData); - static const auto fieldMeta = clazz->getField("meta"); - jni::local_ref meta = this->getFieldValue(fieldMeta); - static const auto fieldCreatedAt = clazz->getField("createdAt"); - double createdAt = this->getFieldValue(fieldCreatedAt); - static const auto fieldModifiedAt = clazz->getField("modifiedAt"); - double modifiedAt = this->getFieldValue(fieldModifiedAt); - return RecordResult( - recordID->toStdString(), - recordType->toStdString(), - data->toStdString(), - meta->toStdString(), - createdAt, - modifiedAt - ); - } - - public: - /** - * Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java. - */ - [[maybe_unused]] - static jni::local_ref fromCpp(const RecordResult& value) { - using JSignature = JRecordResult(jni::alias_ref, jni::alias_ref, jni::alias_ref, jni::alias_ref, double, double); - static const auto clazz = javaClassStatic(); - static const auto create = clazz->getStaticMethod("fromCpp"); - return create( - clazz, - jni::make_jstring(value.recordID), - jni::make_jstring(value.recordType), - jni::make_jstring(value.data), - jni::make_jstring(value.meta), - value.createdAt, - value.modifiedAt - ); - } - }; - -} // namespace margelo::nitro::cloudkitmodule diff --git a/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/c++/JSaveRecordParams.hpp b/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/c++/JSaveRecordParams.hpp deleted file mode 100644 index 6b16334..0000000 --- a/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/c++/JSaveRecordParams.hpp +++ /dev/null @@ -1,69 +0,0 @@ -/// -/// JSaveRecordParams.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#include -#include "SaveRecordParams.hpp" - -#include - -namespace margelo::nitro::cloudkitmodule { - - using namespace facebook; - - /** - * The C++ JNI bridge between the C++ struct "SaveRecordParams" and the the Kotlin data class "SaveRecordParams". - */ - struct JSaveRecordParams final: public jni::JavaClass { - public: - static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/cloudkitmodule/SaveRecordParams;"; - - public: - /** - * Convert this Java/Kotlin-based struct to the C++ struct SaveRecordParams by copying all values to C++. - */ - [[maybe_unused]] - [[nodiscard]] - SaveRecordParams toCpp() const { - static const auto clazz = javaClassStatic(); - static const auto fieldRecordType = clazz->getField("recordType"); - jni::local_ref recordType = this->getFieldValue(fieldRecordType); - static const auto fieldRecordID = clazz->getField("recordID"); - jni::local_ref recordID = this->getFieldValue(fieldRecordID); - static const auto fieldData = clazz->getField("data"); - jni::local_ref data = this->getFieldValue(fieldData); - static const auto fieldMeta = clazz->getField("meta"); - jni::local_ref meta = this->getFieldValue(fieldMeta); - return SaveRecordParams( - recordType->toStdString(), - recordID->toStdString(), - data->toStdString(), - meta->toStdString() - ); - } - - public: - /** - * Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java. - */ - [[maybe_unused]] - static jni::local_ref fromCpp(const SaveRecordParams& value) { - using JSignature = JSaveRecordParams(jni::alias_ref, jni::alias_ref, jni::alias_ref, jni::alias_ref); - static const auto clazz = javaClassStatic(); - static const auto create = clazz->getStaticMethod("fromCpp"); - return create( - clazz, - jni::make_jstring(value.recordType), - jni::make_jstring(value.recordID), - jni::make_jstring(value.data), - jni::make_jstring(value.meta) - ); - } - }; - -} // namespace margelo::nitro::cloudkitmodule diff --git a/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/c++/JSaveRecordResult.hpp b/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/c++/JSaveRecordResult.hpp deleted file mode 100644 index 130806f..0000000 --- a/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/c++/JSaveRecordResult.hpp +++ /dev/null @@ -1,61 +0,0 @@ -/// -/// JSaveRecordResult.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#include -#include "SaveRecordResult.hpp" - -#include - -namespace margelo::nitro::cloudkitmodule { - - using namespace facebook; - - /** - * The C++ JNI bridge between the C++ struct "SaveRecordResult" and the the Kotlin data class "SaveRecordResult". - */ - struct JSaveRecordResult final: public jni::JavaClass { - public: - static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/cloudkitmodule/SaveRecordResult;"; - - public: - /** - * Convert this Java/Kotlin-based struct to the C++ struct SaveRecordResult by copying all values to C++. - */ - [[maybe_unused]] - [[nodiscard]] - SaveRecordResult toCpp() const { - static const auto clazz = javaClassStatic(); - static const auto fieldRecordID = clazz->getField("recordID"); - jni::local_ref recordID = this->getFieldValue(fieldRecordID); - static const auto fieldCreatedAt = clazz->getField("createdAt"); - double createdAt = this->getFieldValue(fieldCreatedAt); - return SaveRecordResult( - recordID->toStdString(), - createdAt - ); - } - - public: - /** - * Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java. - */ - [[maybe_unused]] - static jni::local_ref fromCpp(const SaveRecordResult& value) { - using JSignature = JSaveRecordResult(jni::alias_ref, double); - static const auto clazz = javaClassStatic(); - static const auto create = clazz->getStaticMethod("fromCpp"); - return create( - clazz, - jni::make_jstring(value.recordID), - value.createdAt - ); - } - }; - -} // namespace margelo::nitro::cloudkitmodule diff --git a/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/c++/JVariant_NullType_RecordResult.cpp b/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/c++/JVariant_NullType_RecordResult.cpp deleted file mode 100644 index 280c7d8..0000000 --- a/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/c++/JVariant_NullType_RecordResult.cpp +++ /dev/null @@ -1,26 +0,0 @@ -/// -/// JVariant_NullType_RecordResult.cpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#include "JVariant_NullType_RecordResult.hpp" - -namespace margelo::nitro::cloudkitmodule { - /** - * Converts JVariant_NullType_RecordResult to std::variant - */ - std::variant JVariant_NullType_RecordResult::toCpp() const { - if (isInstanceOf(JVariant_NullType_RecordResult_impl::First::javaClassStatic())) { - // It's a `nitro::NullType` - auto jniValue = static_cast(this)->getValue(); - return nitro::null; - } else if (isInstanceOf(JVariant_NullType_RecordResult_impl::Second::javaClassStatic())) { - // It's a `RecordResult` - auto jniValue = static_cast(this)->getValue(); - return jniValue->toCpp(); - } - throw std::invalid_argument("Variant is unknown Kotlin instance!"); - } -} // namespace margelo::nitro::cloudkitmodule diff --git a/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/c++/JVariant_NullType_RecordResult.hpp b/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/c++/JVariant_NullType_RecordResult.hpp deleted file mode 100644 index 19dd5ef..0000000 --- a/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/c++/JVariant_NullType_RecordResult.hpp +++ /dev/null @@ -1,72 +0,0 @@ -/// -/// JVariant_NullType_RecordResult.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#include -#include - -#include -#include "RecordResult.hpp" -#include -#include -#include "JRecordResult.hpp" -#include - -namespace margelo::nitro::cloudkitmodule { - - using namespace facebook; - - /** - * The C++ JNI bridge between the C++ std::variant and the Java class "Variant_NullType_RecordResult". - */ - class JVariant_NullType_RecordResult: public jni::JavaClass { - public: - static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/cloudkitmodule/Variant_NullType_RecordResult;"; - - static jni::local_ref create_0(jni::alias_ref value) { - static const auto method = javaClassStatic()->getStaticMethod)>("create"); - return method(javaClassStatic(), value); - } - static jni::local_ref create_1(jni::alias_ref value) { - static const auto method = javaClassStatic()->getStaticMethod)>("create"); - return method(javaClassStatic(), value); - } - - static jni::local_ref fromCpp(const std::variant& variant) { - switch (variant.index()) { - case 0: return create_0(JNull::null()); - case 1: return create_1(JRecordResult::fromCpp(std::get<1>(variant))); - default: throw std::invalid_argument("Variant holds unknown index! (" + std::to_string(variant.index()) + ")"); - } - } - - [[nodiscard]] std::variant toCpp() const; - }; - - namespace JVariant_NullType_RecordResult_impl { - class First: public jni::JavaClass { - public: - static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/cloudkitmodule/Variant_NullType_RecordResult$First;"; - - [[nodiscard]] jni::local_ref getValue() const { - static const auto field = javaClassStatic()->getField("value"); - return getFieldValue(field); - } - }; - - class Second: public jni::JavaClass { - public: - static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/cloudkitmodule/Variant_NullType_RecordResult$Second;"; - - [[nodiscard]] jni::local_ref getValue() const { - static const auto field = javaClassStatic()->getField("value"); - return getFieldValue(field); - } - }; - } // namespace JVariant_NullType_RecordResult_impl -} // namespace margelo::nitro::cloudkitmodule diff --git a/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/cloudkitmodule+autolinking.cmake b/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/cloudkitmodule+autolinking.cmake deleted file mode 100644 index eb2e5ff..0000000 --- a/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/cloudkitmodule+autolinking.cmake +++ /dev/null @@ -1,82 +0,0 @@ -# -# cloudkitmodule+autolinking.cmake -# This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -# https://github.com/mrousavy/nitro -# Copyright © 2026 Marc Rousavy @ Margelo -# - -# This is a CMake file that adds all files generated by Nitrogen -# to the current CMake project. -# -# To use it, add this to your CMakeLists.txt: -# ```cmake -# include(${CMAKE_SOURCE_DIR}/../nitrogen/generated/android/cloudkitmodule+autolinking.cmake) -# ``` - -# Define a flag to check if we are building properly -add_definitions(-DBUILDING_CLOUDKITMODULE_WITH_GENERATED_CMAKE_PROJECT) - -# Enable Raw Props parsing in react-native (for Nitro Views) -add_definitions(-DRN_SERIALIZABLE_STATE) - -# Add all headers that were generated by Nitrogen -include_directories( - "../nitrogen/generated/shared/c++" - "../nitrogen/generated/android/c++" - "../nitrogen/generated/android/" -) - -# Add all .cpp sources that were generated by Nitrogen -target_sources( - # CMake project name (Android C++ library name) - cloudkitmodule PRIVATE - # Autolinking Setup - ../nitrogen/generated/android/cloudkitmoduleOnLoad.cpp - # Shared Nitrogen C++ sources - ../nitrogen/generated/shared/c++/HybridCloudKitModuleSpec.cpp - # Android-specific Nitrogen C++ sources - ../nitrogen/generated/android/c++/JHybridCloudKitModuleSpec.cpp - ../nitrogen/generated/android/c++/JVariant_NullType_RecordResult.cpp -) - -# From node_modules/react-native/ReactAndroid/cmake-utils/folly-flags.cmake -# Used in node_modules/react-native/ReactAndroid/cmake-utils/ReactNative-application.cmake -target_compile_definitions( - cloudkitmodule PRIVATE - -DFOLLY_NO_CONFIG=1 - -DFOLLY_HAVE_CLOCK_GETTIME=1 - -DFOLLY_USE_LIBCPP=1 - -DFOLLY_CFG_NO_COROUTINES=1 - -DFOLLY_MOBILE=1 - -DFOLLY_HAVE_RECVMMSG=1 - -DFOLLY_HAVE_PTHREAD=1 - # Once we target android-23 above, we can comment - # the following line. NDK uses GNU style stderror_r() after API 23. - -DFOLLY_HAVE_XSI_STRERROR_R=1 -) - -# Add all libraries required by the generated specs -find_package(fbjni REQUIRED) # <-- Used for communication between Java <-> C++ -find_package(ReactAndroid REQUIRED) # <-- Used to set up React Native bindings (e.g. CallInvoker/TurboModule) -find_package(react-native-nitro-modules REQUIRED) # <-- Used to create all HybridObjects and use the Nitro core library - -# Link all libraries together -target_link_libraries( - cloudkitmodule - fbjni::fbjni # <-- Facebook C++ JNI helpers - ReactAndroid::jsi # <-- RN: JSI - react-native-nitro-modules::NitroModules # <-- NitroModules Core :) -) - -# Link react-native (different prefab between RN 0.75 and RN 0.76) -if(ReactAndroid_VERSION_MINOR GREATER_EQUAL 76) - target_link_libraries( - cloudkitmodule - ReactAndroid::reactnative # <-- RN: Native Modules umbrella prefab - ) -else() - target_link_libraries( - cloudkitmodule - ReactAndroid::react_nativemodule_core # <-- RN: TurboModules Core - ) -endif() diff --git a/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/cloudkitmodule+autolinking.gradle b/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/cloudkitmodule+autolinking.gradle deleted file mode 100644 index b4f54ce..0000000 --- a/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/cloudkitmodule+autolinking.gradle +++ /dev/null @@ -1,27 +0,0 @@ -/// -/// cloudkitmodule+autolinking.gradle -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -/// This is a Gradle file that adds all files generated by Nitrogen -/// to the current Gradle project. -/// -/// To use it, add this to your build.gradle: -/// ```gradle -/// apply from: '../nitrogen/generated/android/cloudkitmodule+autolinking.gradle' -/// ``` - -logger.warn("[NitroModules] 🔥 cloudkitmodule is boosted by nitro!") - -android { - sourceSets { - main { - java.srcDirs += [ - // Nitrogen files - "${project.projectDir}/../nitrogen/generated/android/kotlin" - ] - } - } -} diff --git a/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/cloudkitmoduleOnLoad.cpp b/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/cloudkitmoduleOnLoad.cpp deleted file mode 100644 index bd42830..0000000 --- a/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/cloudkitmoduleOnLoad.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/// -/// cloudkitmoduleOnLoad.cpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#ifndef BUILDING_CLOUDKITMODULE_WITH_GENERATED_CMAKE_PROJECT -#error cloudkitmoduleOnLoad.cpp is not being built with the autogenerated CMakeLists.txt project. Is a different CMakeLists.txt building this? -#endif - -#include "cloudkitmoduleOnLoad.hpp" - -#include -#include -#include - -#include "JHybridCloudKitModuleSpec.hpp" -#include - -namespace margelo::nitro::cloudkitmodule { - -int initialize(JavaVM* vm) { - using namespace margelo::nitro; - using namespace margelo::nitro::cloudkitmodule; - using namespace facebook; - - return facebook::jni::initialize(vm, [] { - // Register native JNI methods - margelo::nitro::cloudkitmodule::JHybridCloudKitModuleSpec::registerNatives(); - - // Register Nitro Hybrid Objects - HybridObjectRegistry::registerHybridObjectConstructor( - "CloudKitModule", - []() -> std::shared_ptr { - static DefaultConstructableObject object("com/margelo/nitro/cloudkitmodule/CloudKitModule"); - auto instance = object.create(); - return instance->cthis()->shared(); - } - ); - }); -} - -} // namespace margelo::nitro::cloudkitmodule diff --git a/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/cloudkitmoduleOnLoad.hpp b/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/cloudkitmoduleOnLoad.hpp deleted file mode 100644 index 9c783d3..0000000 --- a/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/cloudkitmoduleOnLoad.hpp +++ /dev/null @@ -1,25 +0,0 @@ -/// -/// cloudkitmoduleOnLoad.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#include -#include - -namespace margelo::nitro::cloudkitmodule { - - /** - * Initializes the native (C++) part of cloudkitmodule, and autolinks all Hybrid Objects. - * Call this in your `JNI_OnLoad` function (probably inside `cpp-adapter.cpp`). - * Example: - * ```cpp (cpp-adapter.cpp) - * JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void*) { - * return margelo::nitro::cloudkitmodule::initialize(vm); - * } - * ``` - */ - int initialize(JavaVM* vm); - -} // namespace margelo::nitro::cloudkitmodule diff --git a/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/AccountInfoResult.kt b/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/AccountInfoResult.kt deleted file mode 100644 index 6613fb8..0000000 --- a/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/AccountInfoResult.kt +++ /dev/null @@ -1,44 +0,0 @@ -/// -/// AccountInfoResult.kt -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -package com.margelo.nitro.cloudkitmodule - -import androidx.annotation.Keep -import com.facebook.proguard.annotations.DoNotStrip - - -/** - * Represents the JavaScript object/struct "AccountInfoResult". - */ -@DoNotStrip -@Keep -data class AccountInfoResult( - @DoNotStrip - @Keep - val status: Double, - @DoNotStrip - @Keep - val statusName: String, - @DoNotStrip - @Keep - val containerUserId: String? -) { - /* primary constructor */ - - private companion object { - /** - * Constructor called from C++ - */ - @DoNotStrip - @Keep - @Suppress("unused") - @JvmStatic - private fun fromCpp(status: Double, statusName: String, containerUserId: String?): AccountInfoResult { - return AccountInfoResult(status, statusName, containerUserId) - } - } -} diff --git a/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/DeleteRecordParams.kt b/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/DeleteRecordParams.kt deleted file mode 100644 index 7dfa963..0000000 --- a/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/DeleteRecordParams.kt +++ /dev/null @@ -1,41 +0,0 @@ -/// -/// DeleteRecordParams.kt -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -package com.margelo.nitro.cloudkitmodule - -import androidx.annotation.Keep -import com.facebook.proguard.annotations.DoNotStrip - - -/** - * Represents the JavaScript object/struct "DeleteRecordParams". - */ -@DoNotStrip -@Keep -data class DeleteRecordParams( - @DoNotStrip - @Keep - val recordType: String, - @DoNotStrip - @Keep - val recordID: String -) { - /* primary constructor */ - - private companion object { - /** - * Constructor called from C++ - */ - @DoNotStrip - @Keep - @Suppress("unused") - @JvmStatic - private fun fromCpp(recordType: String, recordID: String): DeleteRecordParams { - return DeleteRecordParams(recordType, recordID) - } - } -} diff --git a/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/FetchRecordParams.kt b/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/FetchRecordParams.kt deleted file mode 100644 index 1f84d00..0000000 --- a/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/FetchRecordParams.kt +++ /dev/null @@ -1,41 +0,0 @@ -/// -/// FetchRecordParams.kt -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -package com.margelo.nitro.cloudkitmodule - -import androidx.annotation.Keep -import com.facebook.proguard.annotations.DoNotStrip - - -/** - * Represents the JavaScript object/struct "FetchRecordParams". - */ -@DoNotStrip -@Keep -data class FetchRecordParams( - @DoNotStrip - @Keep - val recordType: String, - @DoNotStrip - @Keep - val recordID: String -) { - /* primary constructor */ - - private companion object { - /** - * Constructor called from C++ - */ - @DoNotStrip - @Keep - @Suppress("unused") - @JvmStatic - private fun fromCpp(recordType: String, recordID: String): FetchRecordParams { - return FetchRecordParams(recordType, recordID) - } - } -} diff --git a/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/HybridCloudKitModuleSpec.kt b/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/HybridCloudKitModuleSpec.kt deleted file mode 100644 index b29acdc..0000000 --- a/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/HybridCloudKitModuleSpec.kt +++ /dev/null @@ -1,83 +0,0 @@ -/// -/// HybridCloudKitModuleSpec.kt -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -package com.margelo.nitro.cloudkitmodule - -import androidx.annotation.Keep -import com.facebook.jni.HybridData -import com.facebook.proguard.annotations.DoNotStrip -import com.margelo.nitro.core.Promise -import com.margelo.nitro.core.NullType -import com.margelo.nitro.core.HybridObject - -/** - * A Kotlin class representing the CloudKitModule HybridObject. - * Implement this abstract class to create Kotlin-based instances of CloudKitModule. - */ -@DoNotStrip -@Keep -@Suppress( - "KotlinJniMissingFunction", "unused", - "RedundantSuppression", "RedundantUnitReturnType", "SimpleRedundantLet", - "LocalVariableName", "PropertyName", "PrivatePropertyName", "FunctionName" -) -abstract class HybridCloudKitModuleSpec: HybridObject() { - @DoNotStrip - private var mHybridData: HybridData = initHybrid() - - init { - super.updateNative(mHybridData) - } - - override fun updateNative(hybridData: HybridData) { - mHybridData = hybridData - super.updateNative(hybridData) - } - - // Default implementation of `HybridObject.toString()` - override fun toString(): String { - return "[HybridObject CloudKitModule]" - } - - // Properties - - - // Methods - @DoNotStrip - @Keep - abstract fun isAvailable(): Promise - - @DoNotStrip - @Keep - abstract fun getAccountInfo(): Promise - - @DoNotStrip - @Keep - abstract fun saveRecord(params: SaveRecordParams): Promise - - @DoNotStrip - @Keep - abstract fun fetchRecord(params: FetchRecordParams): Promise - - @DoNotStrip - @Keep - abstract fun deleteRecord(params: DeleteRecordParams): Promise - - @DoNotStrip - @Keep - abstract fun recordExists(params: RecordExistsParams): Promise - - @DoNotStrip - @Keep - abstract fun queryRecords(params: QueryRecordsParams): Promise - - private external fun initHybrid(): HybridData - - companion object { - protected const val TAG = "HybridCloudKitModuleSpec" - } -} diff --git a/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/QueryRecordsParams.kt b/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/QueryRecordsParams.kt deleted file mode 100644 index 526eda7..0000000 --- a/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/QueryRecordsParams.kt +++ /dev/null @@ -1,38 +0,0 @@ -/// -/// QueryRecordsParams.kt -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -package com.margelo.nitro.cloudkitmodule - -import androidx.annotation.Keep -import com.facebook.proguard.annotations.DoNotStrip - - -/** - * Represents the JavaScript object/struct "QueryRecordsParams". - */ -@DoNotStrip -@Keep -data class QueryRecordsParams( - @DoNotStrip - @Keep - val recordType: String -) { - /* primary constructor */ - - private companion object { - /** - * Constructor called from C++ - */ - @DoNotStrip - @Keep - @Suppress("unused") - @JvmStatic - private fun fromCpp(recordType: String): QueryRecordsParams { - return QueryRecordsParams(recordType) - } - } -} diff --git a/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/QueryRecordsResult.kt b/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/QueryRecordsResult.kt deleted file mode 100644 index d50f0f3..0000000 --- a/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/QueryRecordsResult.kt +++ /dev/null @@ -1,38 +0,0 @@ -/// -/// QueryRecordsResult.kt -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -package com.margelo.nitro.cloudkitmodule - -import androidx.annotation.Keep -import com.facebook.proguard.annotations.DoNotStrip - - -/** - * Represents the JavaScript object/struct "QueryRecordsResult". - */ -@DoNotStrip -@Keep -data class QueryRecordsResult( - @DoNotStrip - @Keep - val records: Array -) { - /* primary constructor */ - - private companion object { - /** - * Constructor called from C++ - */ - @DoNotStrip - @Keep - @Suppress("unused") - @JvmStatic - private fun fromCpp(records: Array): QueryRecordsResult { - return QueryRecordsResult(records) - } - } -} diff --git a/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/RecordExistsParams.kt b/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/RecordExistsParams.kt deleted file mode 100644 index 0ccf5e9..0000000 --- a/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/RecordExistsParams.kt +++ /dev/null @@ -1,41 +0,0 @@ -/// -/// RecordExistsParams.kt -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -package com.margelo.nitro.cloudkitmodule - -import androidx.annotation.Keep -import com.facebook.proguard.annotations.DoNotStrip - - -/** - * Represents the JavaScript object/struct "RecordExistsParams". - */ -@DoNotStrip -@Keep -data class RecordExistsParams( - @DoNotStrip - @Keep - val recordType: String, - @DoNotStrip - @Keep - val recordID: String -) { - /* primary constructor */ - - private companion object { - /** - * Constructor called from C++ - */ - @DoNotStrip - @Keep - @Suppress("unused") - @JvmStatic - private fun fromCpp(recordType: String, recordID: String): RecordExistsParams { - return RecordExistsParams(recordType, recordID) - } - } -} diff --git a/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/RecordResult.kt b/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/RecordResult.kt deleted file mode 100644 index f7c92e4..0000000 --- a/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/RecordResult.kt +++ /dev/null @@ -1,53 +0,0 @@ -/// -/// RecordResult.kt -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -package com.margelo.nitro.cloudkitmodule - -import androidx.annotation.Keep -import com.facebook.proguard.annotations.DoNotStrip - - -/** - * Represents the JavaScript object/struct "RecordResult". - */ -@DoNotStrip -@Keep -data class RecordResult( - @DoNotStrip - @Keep - val recordID: String, - @DoNotStrip - @Keep - val recordType: String, - @DoNotStrip - @Keep - val data: String, - @DoNotStrip - @Keep - val meta: String, - @DoNotStrip - @Keep - val createdAt: Double, - @DoNotStrip - @Keep - val modifiedAt: Double -) { - /* primary constructor */ - - private companion object { - /** - * Constructor called from C++ - */ - @DoNotStrip - @Keep - @Suppress("unused") - @JvmStatic - private fun fromCpp(recordID: String, recordType: String, data: String, meta: String, createdAt: Double, modifiedAt: Double): RecordResult { - return RecordResult(recordID, recordType, data, meta, createdAt, modifiedAt) - } - } -} diff --git a/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/SaveRecordParams.kt b/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/SaveRecordParams.kt deleted file mode 100644 index 9304700..0000000 --- a/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/SaveRecordParams.kt +++ /dev/null @@ -1,47 +0,0 @@ -/// -/// SaveRecordParams.kt -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -package com.margelo.nitro.cloudkitmodule - -import androidx.annotation.Keep -import com.facebook.proguard.annotations.DoNotStrip - - -/** - * Represents the JavaScript object/struct "SaveRecordParams". - */ -@DoNotStrip -@Keep -data class SaveRecordParams( - @DoNotStrip - @Keep - val recordType: String, - @DoNotStrip - @Keep - val recordID: String, - @DoNotStrip - @Keep - val data: String, - @DoNotStrip - @Keep - val meta: String -) { - /* primary constructor */ - - private companion object { - /** - * Constructor called from C++ - */ - @DoNotStrip - @Keep - @Suppress("unused") - @JvmStatic - private fun fromCpp(recordType: String, recordID: String, data: String, meta: String): SaveRecordParams { - return SaveRecordParams(recordType, recordID, data, meta) - } - } -} diff --git a/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/SaveRecordResult.kt b/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/SaveRecordResult.kt deleted file mode 100644 index 04cedc3..0000000 --- a/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/SaveRecordResult.kt +++ /dev/null @@ -1,41 +0,0 @@ -/// -/// SaveRecordResult.kt -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -package com.margelo.nitro.cloudkitmodule - -import androidx.annotation.Keep -import com.facebook.proguard.annotations.DoNotStrip - - -/** - * Represents the JavaScript object/struct "SaveRecordResult". - */ -@DoNotStrip -@Keep -data class SaveRecordResult( - @DoNotStrip - @Keep - val recordID: String, - @DoNotStrip - @Keep - val createdAt: Double -) { - /* primary constructor */ - - private companion object { - /** - * Constructor called from C++ - */ - @DoNotStrip - @Keep - @Suppress("unused") - @JvmStatic - private fun fromCpp(recordID: String, createdAt: Double): SaveRecordResult { - return SaveRecordResult(recordID, createdAt) - } - } -} diff --git a/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/Variant_NullType_RecordResult.kt b/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/Variant_NullType_RecordResult.kt deleted file mode 100644 index 4d75255..0000000 --- a/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/Variant_NullType_RecordResult.kt +++ /dev/null @@ -1,59 +0,0 @@ -/// -/// Variant_NullType_RecordResult.kt -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -package com.margelo.nitro.cloudkitmodule - -import com.facebook.proguard.annotations.DoNotStrip -import com.margelo.nitro.core.NullType - -/** - * Represents the TypeScript variant "NullType | RecordResult". - */ -@Suppress("ClassName") -@DoNotStrip -sealed class Variant_NullType_RecordResult { - @DoNotStrip - data class First(@DoNotStrip val value: NullType): Variant_NullType_RecordResult() - @DoNotStrip - data class Second(@DoNotStrip val value: RecordResult): Variant_NullType_RecordResult() - - @Deprecated("getAs() is not type-safe. Use fold/asFirstOrNull/asSecondOrNull instead.", level = DeprecationLevel.ERROR) - inline fun getAs(): T? = when (this) { - is First -> value as? T - is Second -> value as? T - } - - val isFirst: Boolean - get() = this is First - val isSecond: Boolean - get() = this is Second - - fun asFirstOrNull(): NullType? { - val value = (this as? First)?.value ?: return null - return value - } - fun asSecondOrNull(): RecordResult? { - val value = (this as? Second)?.value ?: return null - return value - } - - inline fun match(first: (NullType) -> R, second: (RecordResult) -> R): R { - return when (this) { - is First -> first(value) - is Second -> second(value) - } - } - - companion object { - @JvmStatic - @DoNotStrip - fun create(value: NullType): Variant_NullType_RecordResult = First(value) - @JvmStatic - @DoNotStrip - fun create(value: RecordResult): Variant_NullType_RecordResult = Second(value) - } -} diff --git a/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/cloudkitmoduleOnLoad.kt b/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/cloudkitmoduleOnLoad.kt deleted file mode 100644 index b3a0d92..0000000 --- a/native-modules/react-native-cloud-kit-module/nitrogen/generated/android/kotlin/com/margelo/nitro/cloudkitmodule/cloudkitmoduleOnLoad.kt +++ /dev/null @@ -1,35 +0,0 @@ -/// -/// cloudkitmoduleOnLoad.kt -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -package com.margelo.nitro.cloudkitmodule - -import android.util.Log - -internal class cloudkitmoduleOnLoad { - companion object { - private const val TAG = "cloudkitmoduleOnLoad" - private var didLoad = false - /** - * Initializes the native part of "cloudkitmodule". - * This method is idempotent and can be called more than once. - */ - @JvmStatic - fun initializeNative() { - if (didLoad) return - try { - Log.i(TAG, "Loading cloudkitmodule C++ library...") - System.loadLibrary("cloudkitmodule") - Log.i(TAG, "Successfully loaded cloudkitmodule C++ library!") - didLoad = true - } catch (e: Error) { - Log.e(TAG, "Failed to load cloudkitmodule C++ library! Is it properly installed and linked? " + - "Is the name correct? (see `CMakeLists.txt`, at `add_library(...)`)", e) - throw e - } - } - } -} diff --git a/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/CloudKitModule+autolinking.rb b/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/CloudKitModule+autolinking.rb deleted file mode 100644 index d01ec37..0000000 --- a/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/CloudKitModule+autolinking.rb +++ /dev/null @@ -1,60 +0,0 @@ -# -# CloudKitModule+autolinking.rb -# This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -# https://github.com/mrousavy/nitro -# Copyright © 2026 Marc Rousavy @ Margelo -# - -# This is a Ruby script that adds all files generated by Nitrogen -# to the given podspec. -# -# To use it, add this to your .podspec: -# ```ruby -# Pod::Spec.new do |spec| -# # ... -# -# # Add all files generated by Nitrogen -# load 'nitrogen/generated/ios/CloudKitModule+autolinking.rb' -# add_nitrogen_files(spec) -# end -# ``` - -def add_nitrogen_files(spec) - Pod::UI.puts "[NitroModules] 🔥 CloudKitModule is boosted by nitro!" - - spec.dependency "NitroModules" - - current_source_files = Array(spec.attributes_hash['source_files']) - spec.source_files = current_source_files + [ - # Generated cross-platform specs - "nitrogen/generated/shared/**/*.{h,hpp,c,cpp,swift}", - # Generated bridges for the cross-platform specs - "nitrogen/generated/ios/**/*.{h,hpp,c,cpp,mm,swift}", - ] - - current_public_header_files = Array(spec.attributes_hash['public_header_files']) - spec.public_header_files = current_public_header_files + [ - # Generated specs - "nitrogen/generated/shared/**/*.{h,hpp}", - # Swift to C++ bridging helpers - "nitrogen/generated/ios/CloudKitModule-Swift-Cxx-Bridge.hpp" - ] - - current_private_header_files = Array(spec.attributes_hash['private_header_files']) - spec.private_header_files = current_private_header_files + [ - # iOS specific specs - "nitrogen/generated/ios/c++/**/*.{h,hpp}", - # Views are framework-specific and should be private - "nitrogen/generated/shared/**/views/**/*" - ] - - current_pod_target_xcconfig = spec.attributes_hash['pod_target_xcconfig'] || {} - spec.pod_target_xcconfig = current_pod_target_xcconfig.merge({ - # Use C++ 20 - "CLANG_CXX_LANGUAGE_STANDARD" => "c++20", - # Enables C++ <-> Swift interop (by default it's only C) - "SWIFT_OBJC_INTEROP_MODE" => "objcxx", - # Enables stricter modular headers - "DEFINES_MODULE" => "YES", - }) -end diff --git a/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/CloudKitModule-Swift-Cxx-Bridge.cpp b/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/CloudKitModule-Swift-Cxx-Bridge.cpp deleted file mode 100644 index 4e2a57c..0000000 --- a/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/CloudKitModule-Swift-Cxx-Bridge.cpp +++ /dev/null @@ -1,89 +0,0 @@ -/// -/// CloudKitModule-Swift-Cxx-Bridge.cpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#include "CloudKitModule-Swift-Cxx-Bridge.hpp" - -// Include C++ implementation defined types -#include "CloudKitModule-Swift-Cxx-Umbrella.hpp" -#include "HybridCloudKitModuleSpecSwift.hpp" -#include - -namespace margelo::nitro::cloudkitmodule::bridge::swift { - - // pragma MARK: std::function - Func_void_bool create_Func_void_bool(void* NON_NULL swiftClosureWrapper) noexcept { - auto swiftClosure = CloudKitModule::Func_void_bool::fromUnsafe(swiftClosureWrapper); - return [swiftClosure = std::move(swiftClosure)](bool result) mutable -> void { - swiftClosure.call(result); - }; - } - - // pragma MARK: std::function - Func_void_std__exception_ptr create_Func_void_std__exception_ptr(void* NON_NULL swiftClosureWrapper) noexcept { - auto swiftClosure = CloudKitModule::Func_void_std__exception_ptr::fromUnsafe(swiftClosureWrapper); - return [swiftClosure = std::move(swiftClosure)](const std::exception_ptr& error) mutable -> void { - swiftClosure.call(error); - }; - } - - // pragma MARK: std::function - Func_void_AccountInfoResult create_Func_void_AccountInfoResult(void* NON_NULL swiftClosureWrapper) noexcept { - auto swiftClosure = CloudKitModule::Func_void_AccountInfoResult::fromUnsafe(swiftClosureWrapper); - return [swiftClosure = std::move(swiftClosure)](const AccountInfoResult& result) mutable -> void { - swiftClosure.call(result); - }; - } - - // pragma MARK: std::function - Func_void_SaveRecordResult create_Func_void_SaveRecordResult(void* NON_NULL swiftClosureWrapper) noexcept { - auto swiftClosure = CloudKitModule::Func_void_SaveRecordResult::fromUnsafe(swiftClosureWrapper); - return [swiftClosure = std::move(swiftClosure)](const SaveRecordResult& result) mutable -> void { - swiftClosure.call(result); - }; - } - - // pragma MARK: std::function& /* result */)> - Func_void_std__variant_nitro__NullType__RecordResult_ create_Func_void_std__variant_nitro__NullType__RecordResult_(void* NON_NULL swiftClosureWrapper) noexcept { - auto swiftClosure = CloudKitModule::Func_void_std__variant_nitro__NullType__RecordResult_::fromUnsafe(swiftClosureWrapper); - return [swiftClosure = std::move(swiftClosure)](const std::variant& result) mutable -> void { - swiftClosure.call(result); - }; - } - - // pragma MARK: std::function - Func_void create_Func_void(void* NON_NULL swiftClosureWrapper) noexcept { - auto swiftClosure = CloudKitModule::Func_void::fromUnsafe(swiftClosureWrapper); - return [swiftClosure = std::move(swiftClosure)]() mutable -> void { - swiftClosure.call(); - }; - } - - // pragma MARK: std::function - Func_void_QueryRecordsResult create_Func_void_QueryRecordsResult(void* NON_NULL swiftClosureWrapper) noexcept { - auto swiftClosure = CloudKitModule::Func_void_QueryRecordsResult::fromUnsafe(swiftClosureWrapper); - return [swiftClosure = std::move(swiftClosure)](const QueryRecordsResult& result) mutable -> void { - swiftClosure.call(result); - }; - } - - // pragma MARK: std::shared_ptr - std::shared_ptr create_std__shared_ptr_HybridCloudKitModuleSpec_(void* NON_NULL swiftUnsafePointer) noexcept { - CloudKitModule::HybridCloudKitModuleSpec_cxx swiftPart = CloudKitModule::HybridCloudKitModuleSpec_cxx::fromUnsafe(swiftUnsafePointer); - return std::make_shared(swiftPart); - } - void* NON_NULL get_std__shared_ptr_HybridCloudKitModuleSpec_(std__shared_ptr_HybridCloudKitModuleSpec_ cppType) { - std::shared_ptr swiftWrapper = std::dynamic_pointer_cast(cppType); - #ifdef NITRO_DEBUG - if (swiftWrapper == nullptr) [[unlikely]] { - throw std::runtime_error("Class \"HybridCloudKitModuleSpec\" is not implemented in Swift!"); - } - #endif - CloudKitModule::HybridCloudKitModuleSpec_cxx& swiftPart = swiftWrapper->getSwiftPart(); - return swiftPart.toUnsafe(); - } - -} // namespace margelo::nitro::cloudkitmodule::bridge::swift diff --git a/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/CloudKitModule-Swift-Cxx-Bridge.hpp b/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/CloudKitModule-Swift-Cxx-Bridge.hpp deleted file mode 100644 index 0bd0394..0000000 --- a/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/CloudKitModule-Swift-Cxx-Bridge.hpp +++ /dev/null @@ -1,397 +0,0 @@ -/// -/// CloudKitModule-Swift-Cxx-Bridge.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -// Forward declarations of C++ defined types -// Forward declaration of `AccountInfoResult` to properly resolve imports. -namespace margelo::nitro::cloudkitmodule { struct AccountInfoResult; } -// Forward declaration of `HybridCloudKitModuleSpec` to properly resolve imports. -namespace margelo::nitro::cloudkitmodule { class HybridCloudKitModuleSpec; } -// Forward declaration of `QueryRecordsResult` to properly resolve imports. -namespace margelo::nitro::cloudkitmodule { struct QueryRecordsResult; } -// Forward declaration of `RecordResult` to properly resolve imports. -namespace margelo::nitro::cloudkitmodule { struct RecordResult; } -// Forward declaration of `SaveRecordResult` to properly resolve imports. -namespace margelo::nitro::cloudkitmodule { struct SaveRecordResult; } - -// Forward declarations of Swift defined types -// Forward declaration of `HybridCloudKitModuleSpec_cxx` to properly resolve imports. -namespace CloudKitModule { class HybridCloudKitModuleSpec_cxx; } - -// Include C++ defined types -#include "AccountInfoResult.hpp" -#include "HybridCloudKitModuleSpec.hpp" -#include "QueryRecordsResult.hpp" -#include "RecordResult.hpp" -#include "SaveRecordResult.hpp" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/** - * Contains specialized versions of C++ templated types so they can be accessed from Swift, - * as well as helper functions to interact with those C++ types from Swift. - */ -namespace margelo::nitro::cloudkitmodule::bridge::swift { - - // pragma MARK: std::shared_ptr> - /** - * Specialized version of `std::shared_ptr>`. - */ - using std__shared_ptr_Promise_bool__ = std::shared_ptr>; - inline std::shared_ptr> create_std__shared_ptr_Promise_bool__() noexcept { - return Promise::create(); - } - inline PromiseHolder wrap_std__shared_ptr_Promise_bool__(std::shared_ptr> promise) noexcept { - return PromiseHolder(std::move(promise)); - } - - // pragma MARK: std::function - /** - * Specialized version of `std::function`. - */ - using Func_void_bool = std::function; - /** - * Wrapper class for a `std::function`, this can be used from Swift. - */ - class Func_void_bool_Wrapper final { - public: - explicit Func_void_bool_Wrapper(std::function&& func): _function(std::make_unique>(std::move(func))) {} - inline void call(bool result) const noexcept { - _function->operator()(result); - } - private: - std::unique_ptr> _function; - } SWIFT_NONCOPYABLE; - Func_void_bool create_Func_void_bool(void* NON_NULL swiftClosureWrapper) noexcept; - inline Func_void_bool_Wrapper wrap_Func_void_bool(Func_void_bool value) noexcept { - return Func_void_bool_Wrapper(std::move(value)); - } - - // pragma MARK: std::function - /** - * Specialized version of `std::function`. - */ - using Func_void_std__exception_ptr = std::function; - /** - * Wrapper class for a `std::function`, this can be used from Swift. - */ - class Func_void_std__exception_ptr_Wrapper final { - public: - explicit Func_void_std__exception_ptr_Wrapper(std::function&& func): _function(std::make_unique>(std::move(func))) {} - inline void call(std::exception_ptr error) const noexcept { - _function->operator()(error); - } - private: - std::unique_ptr> _function; - } SWIFT_NONCOPYABLE; - Func_void_std__exception_ptr create_Func_void_std__exception_ptr(void* NON_NULL swiftClosureWrapper) noexcept; - inline Func_void_std__exception_ptr_Wrapper wrap_Func_void_std__exception_ptr(Func_void_std__exception_ptr value) noexcept { - return Func_void_std__exception_ptr_Wrapper(std::move(value)); - } - - // pragma MARK: std::optional - /** - * Specialized version of `std::optional`. - */ - using std__optional_std__string_ = std::optional; - inline std::optional create_std__optional_std__string_(const std::string& value) noexcept { - return std::optional(value); - } - inline bool has_value_std__optional_std__string_(const std::optional& optional) noexcept { - return optional.has_value(); - } - inline std::string get_std__optional_std__string_(const std::optional& optional) noexcept { - return *optional; - } - - // pragma MARK: std::shared_ptr> - /** - * Specialized version of `std::shared_ptr>`. - */ - using std__shared_ptr_Promise_AccountInfoResult__ = std::shared_ptr>; - inline std::shared_ptr> create_std__shared_ptr_Promise_AccountInfoResult__() noexcept { - return Promise::create(); - } - inline PromiseHolder wrap_std__shared_ptr_Promise_AccountInfoResult__(std::shared_ptr> promise) noexcept { - return PromiseHolder(std::move(promise)); - } - - // pragma MARK: std::function - /** - * Specialized version of `std::function`. - */ - using Func_void_AccountInfoResult = std::function; - /** - * Wrapper class for a `std::function`, this can be used from Swift. - */ - class Func_void_AccountInfoResult_Wrapper final { - public: - explicit Func_void_AccountInfoResult_Wrapper(std::function&& func): _function(std::make_unique>(std::move(func))) {} - inline void call(AccountInfoResult result) const noexcept { - _function->operator()(result); - } - private: - std::unique_ptr> _function; - } SWIFT_NONCOPYABLE; - Func_void_AccountInfoResult create_Func_void_AccountInfoResult(void* NON_NULL swiftClosureWrapper) noexcept; - inline Func_void_AccountInfoResult_Wrapper wrap_Func_void_AccountInfoResult(Func_void_AccountInfoResult value) noexcept { - return Func_void_AccountInfoResult_Wrapper(std::move(value)); - } - - // pragma MARK: std::shared_ptr> - /** - * Specialized version of `std::shared_ptr>`. - */ - using std__shared_ptr_Promise_SaveRecordResult__ = std::shared_ptr>; - inline std::shared_ptr> create_std__shared_ptr_Promise_SaveRecordResult__() noexcept { - return Promise::create(); - } - inline PromiseHolder wrap_std__shared_ptr_Promise_SaveRecordResult__(std::shared_ptr> promise) noexcept { - return PromiseHolder(std::move(promise)); - } - - // pragma MARK: std::function - /** - * Specialized version of `std::function`. - */ - using Func_void_SaveRecordResult = std::function; - /** - * Wrapper class for a `std::function`, this can be used from Swift. - */ - class Func_void_SaveRecordResult_Wrapper final { - public: - explicit Func_void_SaveRecordResult_Wrapper(std::function&& func): _function(std::make_unique>(std::move(func))) {} - inline void call(SaveRecordResult result) const noexcept { - _function->operator()(result); - } - private: - std::unique_ptr> _function; - } SWIFT_NONCOPYABLE; - Func_void_SaveRecordResult create_Func_void_SaveRecordResult(void* NON_NULL swiftClosureWrapper) noexcept; - inline Func_void_SaveRecordResult_Wrapper wrap_Func_void_SaveRecordResult(Func_void_SaveRecordResult value) noexcept { - return Func_void_SaveRecordResult_Wrapper(std::move(value)); - } - - // pragma MARK: std::variant - /** - * Wrapper struct for `std::variant`. - * std::variant cannot be used in Swift because of a Swift bug. - * Not even specializing it works. So we create a wrapper struct. - */ - struct std__variant_nitro__NullType__RecordResult_ { - std::variant variant; - std__variant_nitro__NullType__RecordResult_(std::variant variant): variant(variant) { } - operator std::variant() const noexcept { - return variant; - } - inline size_t index() const noexcept { - return variant.index(); - } - inline nitro::NullType get_0() const noexcept { - return std::get<0>(variant); - } - inline RecordResult get_1() const noexcept { - return std::get<1>(variant); - } - }; - inline std__variant_nitro__NullType__RecordResult_ create_std__variant_nitro__NullType__RecordResult_(nitro::NullType value) noexcept { - return std__variant_nitro__NullType__RecordResult_(value); - } - inline std__variant_nitro__NullType__RecordResult_ create_std__variant_nitro__NullType__RecordResult_(const RecordResult& value) noexcept { - return std__variant_nitro__NullType__RecordResult_(value); - } - - // pragma MARK: std::shared_ptr>> - /** - * Specialized version of `std::shared_ptr>>`. - */ - using std__shared_ptr_Promise_std__variant_nitro__NullType__RecordResult___ = std::shared_ptr>>; - inline std::shared_ptr>> create_std__shared_ptr_Promise_std__variant_nitro__NullType__RecordResult___() noexcept { - return Promise>::create(); - } - inline PromiseHolder> wrap_std__shared_ptr_Promise_std__variant_nitro__NullType__RecordResult___(std::shared_ptr>> promise) noexcept { - return PromiseHolder>(std::move(promise)); - } - - // pragma MARK: std::function& /* result */)> - /** - * Specialized version of `std::function&)>`. - */ - using Func_void_std__variant_nitro__NullType__RecordResult_ = std::function& /* result */)>; - /** - * Wrapper class for a `std::function& / * result * /)>`, this can be used from Swift. - */ - class Func_void_std__variant_nitro__NullType__RecordResult__Wrapper final { - public: - explicit Func_void_std__variant_nitro__NullType__RecordResult__Wrapper(std::function& /* result */)>&& func): _function(std::make_unique& /* result */)>>(std::move(func))) {} - inline void call(std::variant result) const noexcept { - _function->operator()(result); - } - private: - std::unique_ptr& /* result */)>> _function; - } SWIFT_NONCOPYABLE; - Func_void_std__variant_nitro__NullType__RecordResult_ create_Func_void_std__variant_nitro__NullType__RecordResult_(void* NON_NULL swiftClosureWrapper) noexcept; - inline Func_void_std__variant_nitro__NullType__RecordResult__Wrapper wrap_Func_void_std__variant_nitro__NullType__RecordResult_(Func_void_std__variant_nitro__NullType__RecordResult_ value) noexcept { - return Func_void_std__variant_nitro__NullType__RecordResult__Wrapper(std::move(value)); - } - - // pragma MARK: std::shared_ptr> - /** - * Specialized version of `std::shared_ptr>`. - */ - using std__shared_ptr_Promise_void__ = std::shared_ptr>; - inline std::shared_ptr> create_std__shared_ptr_Promise_void__() noexcept { - return Promise::create(); - } - inline PromiseHolder wrap_std__shared_ptr_Promise_void__(std::shared_ptr> promise) noexcept { - return PromiseHolder(std::move(promise)); - } - - // pragma MARK: std::function - /** - * Specialized version of `std::function`. - */ - using Func_void = std::function; - /** - * Wrapper class for a `std::function`, this can be used from Swift. - */ - class Func_void_Wrapper final { - public: - explicit Func_void_Wrapper(std::function&& func): _function(std::make_unique>(std::move(func))) {} - inline void call() const noexcept { - _function->operator()(); - } - private: - std::unique_ptr> _function; - } SWIFT_NONCOPYABLE; - Func_void create_Func_void(void* NON_NULL swiftClosureWrapper) noexcept; - inline Func_void_Wrapper wrap_Func_void(Func_void value) noexcept { - return Func_void_Wrapper(std::move(value)); - } - - // pragma MARK: std::vector - /** - * Specialized version of `std::vector`. - */ - using std__vector_RecordResult_ = std::vector; - inline std::vector create_std__vector_RecordResult_(size_t size) noexcept { - std::vector vector; - vector.reserve(size); - return vector; - } - - // pragma MARK: std::shared_ptr> - /** - * Specialized version of `std::shared_ptr>`. - */ - using std__shared_ptr_Promise_QueryRecordsResult__ = std::shared_ptr>; - inline std::shared_ptr> create_std__shared_ptr_Promise_QueryRecordsResult__() noexcept { - return Promise::create(); - } - inline PromiseHolder wrap_std__shared_ptr_Promise_QueryRecordsResult__(std::shared_ptr> promise) noexcept { - return PromiseHolder(std::move(promise)); - } - - // pragma MARK: std::function - /** - * Specialized version of `std::function`. - */ - using Func_void_QueryRecordsResult = std::function; - /** - * Wrapper class for a `std::function`, this can be used from Swift. - */ - class Func_void_QueryRecordsResult_Wrapper final { - public: - explicit Func_void_QueryRecordsResult_Wrapper(std::function&& func): _function(std::make_unique>(std::move(func))) {} - inline void call(QueryRecordsResult result) const noexcept { - _function->operator()(result); - } - private: - std::unique_ptr> _function; - } SWIFT_NONCOPYABLE; - Func_void_QueryRecordsResult create_Func_void_QueryRecordsResult(void* NON_NULL swiftClosureWrapper) noexcept; - inline Func_void_QueryRecordsResult_Wrapper wrap_Func_void_QueryRecordsResult(Func_void_QueryRecordsResult value) noexcept { - return Func_void_QueryRecordsResult_Wrapper(std::move(value)); - } - - // pragma MARK: std::shared_ptr - /** - * Specialized version of `std::shared_ptr`. - */ - using std__shared_ptr_HybridCloudKitModuleSpec_ = std::shared_ptr; - std::shared_ptr create_std__shared_ptr_HybridCloudKitModuleSpec_(void* NON_NULL swiftUnsafePointer) noexcept; - void* NON_NULL get_std__shared_ptr_HybridCloudKitModuleSpec_(std__shared_ptr_HybridCloudKitModuleSpec_ cppType); - - // pragma MARK: std::weak_ptr - using std__weak_ptr_HybridCloudKitModuleSpec_ = std::weak_ptr; - inline std__weak_ptr_HybridCloudKitModuleSpec_ weakify_std__shared_ptr_HybridCloudKitModuleSpec_(const std::shared_ptr& strong) noexcept { return strong; } - - // pragma MARK: Result>> - using Result_std__shared_ptr_Promise_bool___ = Result>>; - inline Result_std__shared_ptr_Promise_bool___ create_Result_std__shared_ptr_Promise_bool___(const std::shared_ptr>& value) noexcept { - return Result>>::withValue(value); - } - inline Result_std__shared_ptr_Promise_bool___ create_Result_std__shared_ptr_Promise_bool___(const std::exception_ptr& error) noexcept { - return Result>>::withError(error); - } - - // pragma MARK: Result>> - using Result_std__shared_ptr_Promise_AccountInfoResult___ = Result>>; - inline Result_std__shared_ptr_Promise_AccountInfoResult___ create_Result_std__shared_ptr_Promise_AccountInfoResult___(const std::shared_ptr>& value) noexcept { - return Result>>::withValue(value); - } - inline Result_std__shared_ptr_Promise_AccountInfoResult___ create_Result_std__shared_ptr_Promise_AccountInfoResult___(const std::exception_ptr& error) noexcept { - return Result>>::withError(error); - } - - // pragma MARK: Result>> - using Result_std__shared_ptr_Promise_SaveRecordResult___ = Result>>; - inline Result_std__shared_ptr_Promise_SaveRecordResult___ create_Result_std__shared_ptr_Promise_SaveRecordResult___(const std::shared_ptr>& value) noexcept { - return Result>>::withValue(value); - } - inline Result_std__shared_ptr_Promise_SaveRecordResult___ create_Result_std__shared_ptr_Promise_SaveRecordResult___(const std::exception_ptr& error) noexcept { - return Result>>::withError(error); - } - - // pragma MARK: Result>>> - using Result_std__shared_ptr_Promise_std__variant_nitro__NullType__RecordResult____ = Result>>>; - inline Result_std__shared_ptr_Promise_std__variant_nitro__NullType__RecordResult____ create_Result_std__shared_ptr_Promise_std__variant_nitro__NullType__RecordResult____(const std::shared_ptr>>& value) noexcept { - return Result>>>::withValue(value); - } - inline Result_std__shared_ptr_Promise_std__variant_nitro__NullType__RecordResult____ create_Result_std__shared_ptr_Promise_std__variant_nitro__NullType__RecordResult____(const std::exception_ptr& error) noexcept { - return Result>>>::withError(error); - } - - // pragma MARK: Result>> - using Result_std__shared_ptr_Promise_void___ = Result>>; - inline Result_std__shared_ptr_Promise_void___ create_Result_std__shared_ptr_Promise_void___(const std::shared_ptr>& value) noexcept { - return Result>>::withValue(value); - } - inline Result_std__shared_ptr_Promise_void___ create_Result_std__shared_ptr_Promise_void___(const std::exception_ptr& error) noexcept { - return Result>>::withError(error); - } - - // pragma MARK: Result>> - using Result_std__shared_ptr_Promise_QueryRecordsResult___ = Result>>; - inline Result_std__shared_ptr_Promise_QueryRecordsResult___ create_Result_std__shared_ptr_Promise_QueryRecordsResult___(const std::shared_ptr>& value) noexcept { - return Result>>::withValue(value); - } - inline Result_std__shared_ptr_Promise_QueryRecordsResult___ create_Result_std__shared_ptr_Promise_QueryRecordsResult___(const std::exception_ptr& error) noexcept { - return Result>>::withError(error); - } - -} // namespace margelo::nitro::cloudkitmodule::bridge::swift diff --git a/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/CloudKitModule-Swift-Cxx-Umbrella.hpp b/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/CloudKitModule-Swift-Cxx-Umbrella.hpp deleted file mode 100644 index 092cce1..0000000 --- a/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/CloudKitModule-Swift-Cxx-Umbrella.hpp +++ /dev/null @@ -1,76 +0,0 @@ -/// -/// CloudKitModule-Swift-Cxx-Umbrella.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -// Forward declarations of C++ defined types -// Forward declaration of `AccountInfoResult` to properly resolve imports. -namespace margelo::nitro::cloudkitmodule { struct AccountInfoResult; } -// Forward declaration of `DeleteRecordParams` to properly resolve imports. -namespace margelo::nitro::cloudkitmodule { struct DeleteRecordParams; } -// Forward declaration of `FetchRecordParams` to properly resolve imports. -namespace margelo::nitro::cloudkitmodule { struct FetchRecordParams; } -// Forward declaration of `HybridCloudKitModuleSpec` to properly resolve imports. -namespace margelo::nitro::cloudkitmodule { class HybridCloudKitModuleSpec; } -// Forward declaration of `QueryRecordsParams` to properly resolve imports. -namespace margelo::nitro::cloudkitmodule { struct QueryRecordsParams; } -// Forward declaration of `QueryRecordsResult` to properly resolve imports. -namespace margelo::nitro::cloudkitmodule { struct QueryRecordsResult; } -// Forward declaration of `RecordExistsParams` to properly resolve imports. -namespace margelo::nitro::cloudkitmodule { struct RecordExistsParams; } -// Forward declaration of `RecordResult` to properly resolve imports. -namespace margelo::nitro::cloudkitmodule { struct RecordResult; } -// Forward declaration of `SaveRecordParams` to properly resolve imports. -namespace margelo::nitro::cloudkitmodule { struct SaveRecordParams; } -// Forward declaration of `SaveRecordResult` to properly resolve imports. -namespace margelo::nitro::cloudkitmodule { struct SaveRecordResult; } - -// Include C++ defined types -#include "AccountInfoResult.hpp" -#include "DeleteRecordParams.hpp" -#include "FetchRecordParams.hpp" -#include "HybridCloudKitModuleSpec.hpp" -#include "QueryRecordsParams.hpp" -#include "QueryRecordsResult.hpp" -#include "RecordExistsParams.hpp" -#include "RecordResult.hpp" -#include "SaveRecordParams.hpp" -#include "SaveRecordResult.hpp" -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// C++ helpers for Swift -#include "CloudKitModule-Swift-Cxx-Bridge.hpp" - -// Common C++ types used in Swift -#include -#include -#include -#include - -// Forward declarations of Swift defined types -// Forward declaration of `HybridCloudKitModuleSpec_cxx` to properly resolve imports. -namespace CloudKitModule { class HybridCloudKitModuleSpec_cxx; } - -// Include Swift defined types -#if __has_include("CloudKitModule-Swift.h") -// This header is generated by Xcode/Swift on every app build. -// If it cannot be found, make sure the Swift module's name (= podspec name) is actually "CloudKitModule". -#include "CloudKitModule-Swift.h" -// Same as above, but used when building with frameworks (`use_frameworks`) -#elif __has_include() -#include -#else -#error CloudKitModule's autogenerated Swift header cannot be found! Make sure the Swift module's name (= podspec name) is actually "CloudKitModule", and try building the app first. -#endif diff --git a/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/CloudKitModuleAutolinking.mm b/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/CloudKitModuleAutolinking.mm deleted file mode 100644 index f9c008c..0000000 --- a/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/CloudKitModuleAutolinking.mm +++ /dev/null @@ -1,33 +0,0 @@ -/// -/// CloudKitModuleAutolinking.mm -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#import -#import -#import "CloudKitModule-Swift-Cxx-Umbrella.hpp" -#import - -#include "HybridCloudKitModuleSpecSwift.hpp" - -@interface CloudKitModuleAutolinking : NSObject -@end - -@implementation CloudKitModuleAutolinking - -+ (void) load { - using namespace margelo::nitro; - using namespace margelo::nitro::cloudkitmodule; - - HybridObjectRegistry::registerHybridObjectConstructor( - "CloudKitModule", - []() -> std::shared_ptr { - std::shared_ptr hybridObject = CloudKitModule::CloudKitModuleAutolinking::createCloudKitModule(); - return hybridObject; - } - ); -} - -@end diff --git a/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/CloudKitModuleAutolinking.swift b/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/CloudKitModuleAutolinking.swift deleted file mode 100644 index bbd1766..0000000 --- a/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/CloudKitModuleAutolinking.swift +++ /dev/null @@ -1,25 +0,0 @@ -/// -/// CloudKitModuleAutolinking.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -public final class CloudKitModuleAutolinking { - public typealias bridge = margelo.nitro.cloudkitmodule.bridge.swift - - /** - * Creates an instance of a Swift class that implements `HybridCloudKitModuleSpec`, - * and wraps it in a Swift class that can directly interop with C++ (`HybridCloudKitModuleSpec_cxx`) - * - * This is generated by Nitrogen and will initialize the class specified - * in the `"autolinking"` property of `nitro.json` (in this case, `CloudKitModule`). - */ - public static func createCloudKitModule() -> bridge.std__shared_ptr_HybridCloudKitModuleSpec_ { - let hybridObject = CloudKitModule() - return { () -> bridge.std__shared_ptr_HybridCloudKitModuleSpec_ in - let __cxxWrapped = hybridObject.getCxxWrapper() - return __cxxWrapped.getCxxPart() - }() - } -} diff --git a/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/c++/HybridCloudKitModuleSpecSwift.cpp b/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/c++/HybridCloudKitModuleSpecSwift.cpp deleted file mode 100644 index 2a6227e..0000000 --- a/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/c++/HybridCloudKitModuleSpecSwift.cpp +++ /dev/null @@ -1,11 +0,0 @@ -/// -/// HybridCloudKitModuleSpecSwift.cpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#include "HybridCloudKitModuleSpecSwift.hpp" - -namespace margelo::nitro::cloudkitmodule { -} // namespace margelo::nitro::cloudkitmodule diff --git a/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/c++/HybridCloudKitModuleSpecSwift.hpp b/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/c++/HybridCloudKitModuleSpecSwift.hpp deleted file mode 100644 index 34b0bef..0000000 --- a/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/c++/HybridCloudKitModuleSpecSwift.hpp +++ /dev/null @@ -1,155 +0,0 @@ -/// -/// HybridCloudKitModuleSpecSwift.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#include "HybridCloudKitModuleSpec.hpp" - -// Forward declaration of `HybridCloudKitModuleSpec_cxx` to properly resolve imports. -namespace CloudKitModule { class HybridCloudKitModuleSpec_cxx; } - -// Forward declaration of `AccountInfoResult` to properly resolve imports. -namespace margelo::nitro::cloudkitmodule { struct AccountInfoResult; } -// Forward declaration of `SaveRecordResult` to properly resolve imports. -namespace margelo::nitro::cloudkitmodule { struct SaveRecordResult; } -// Forward declaration of `SaveRecordParams` to properly resolve imports. -namespace margelo::nitro::cloudkitmodule { struct SaveRecordParams; } -// Forward declaration of `RecordResult` to properly resolve imports. -namespace margelo::nitro::cloudkitmodule { struct RecordResult; } -// Forward declaration of `FetchRecordParams` to properly resolve imports. -namespace margelo::nitro::cloudkitmodule { struct FetchRecordParams; } -// Forward declaration of `DeleteRecordParams` to properly resolve imports. -namespace margelo::nitro::cloudkitmodule { struct DeleteRecordParams; } -// Forward declaration of `RecordExistsParams` to properly resolve imports. -namespace margelo::nitro::cloudkitmodule { struct RecordExistsParams; } -// Forward declaration of `QueryRecordsResult` to properly resolve imports. -namespace margelo::nitro::cloudkitmodule { struct QueryRecordsResult; } -// Forward declaration of `QueryRecordsParams` to properly resolve imports. -namespace margelo::nitro::cloudkitmodule { struct QueryRecordsParams; } - -#include -#include "AccountInfoResult.hpp" -#include -#include -#include "SaveRecordResult.hpp" -#include "SaveRecordParams.hpp" -#include -#include "RecordResult.hpp" -#include -#include "FetchRecordParams.hpp" -#include "DeleteRecordParams.hpp" -#include "RecordExistsParams.hpp" -#include "QueryRecordsResult.hpp" -#include -#include "QueryRecordsParams.hpp" - -#include "CloudKitModule-Swift-Cxx-Umbrella.hpp" - -namespace margelo::nitro::cloudkitmodule { - - /** - * The C++ part of HybridCloudKitModuleSpec_cxx.swift. - * - * HybridCloudKitModuleSpecSwift (C++) accesses HybridCloudKitModuleSpec_cxx (Swift), and might - * contain some additional bridging code for C++ <> Swift interop. - * - * Since this obviously introduces an overhead, I hope at some point in - * the future, HybridCloudKitModuleSpec_cxx can directly inherit from the C++ class HybridCloudKitModuleSpec - * to simplify the whole structure and memory management. - */ - class HybridCloudKitModuleSpecSwift: public virtual HybridCloudKitModuleSpec { - public: - // Constructor from a Swift instance - explicit HybridCloudKitModuleSpecSwift(const CloudKitModule::HybridCloudKitModuleSpec_cxx& swiftPart): - HybridObject(HybridCloudKitModuleSpec::TAG), - _swiftPart(swiftPart) { } - - public: - // Get the Swift part - inline CloudKitModule::HybridCloudKitModuleSpec_cxx& getSwiftPart() noexcept { - return _swiftPart; - } - - public: - inline size_t getExternalMemorySize() noexcept override { - return _swiftPart.getMemorySize(); - } - void dispose() noexcept override { - _swiftPart.dispose(); - } - std::string toString() override { - return _swiftPart.toString(); - } - - public: - // Properties - - - public: - // Methods - inline std::shared_ptr> isAvailable() override { - auto __result = _swiftPart.isAvailable(); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - auto __value = std::move(__result.value()); - return __value; - } - inline std::shared_ptr> getAccountInfo() override { - auto __result = _swiftPart.getAccountInfo(); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - auto __value = std::move(__result.value()); - return __value; - } - inline std::shared_ptr> saveRecord(const SaveRecordParams& params) override { - auto __result = _swiftPart.saveRecord(std::forward(params)); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - auto __value = std::move(__result.value()); - return __value; - } - inline std::shared_ptr>> fetchRecord(const FetchRecordParams& params) override { - auto __result = _swiftPart.fetchRecord(std::forward(params)); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - auto __value = std::move(__result.value()); - return __value; - } - inline std::shared_ptr> deleteRecord(const DeleteRecordParams& params) override { - auto __result = _swiftPart.deleteRecord(std::forward(params)); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - auto __value = std::move(__result.value()); - return __value; - } - inline std::shared_ptr> recordExists(const RecordExistsParams& params) override { - auto __result = _swiftPart.recordExists(std::forward(params)); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - auto __value = std::move(__result.value()); - return __value; - } - inline std::shared_ptr> queryRecords(const QueryRecordsParams& params) override { - auto __result = _swiftPart.queryRecords(std::forward(params)); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - auto __value = std::move(__result.value()); - return __value; - } - - private: - CloudKitModule::HybridCloudKitModuleSpec_cxx _swiftPart; - }; - -} // namespace margelo::nitro::cloudkitmodule diff --git a/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/swift/AccountInfoResult.swift b/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/swift/AccountInfoResult.swift deleted file mode 100644 index 36dedd5..0000000 --- a/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/swift/AccountInfoResult.swift +++ /dev/null @@ -1,77 +0,0 @@ -/// -/// AccountInfoResult.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Represents an instance of `AccountInfoResult`, backed by a C++ struct. - */ -public typealias AccountInfoResult = margelo.nitro.cloudkitmodule.AccountInfoResult - -public extension AccountInfoResult { - private typealias bridge = margelo.nitro.cloudkitmodule.bridge.swift - - /** - * Create a new instance of `AccountInfoResult`. - */ - init(status: Double, statusName: String, containerUserId: String?) { - self.init(status, std.string(statusName), { () -> bridge.std__optional_std__string_ in - if let __unwrappedValue = containerUserId { - return bridge.create_std__optional_std__string_(std.string(__unwrappedValue)) - } else { - return .init() - } - }()) - } - - var status: Double { - @inline(__always) - get { - return self.__status - } - @inline(__always) - set { - self.__status = newValue - } - } - - var statusName: String { - @inline(__always) - get { - return String(self.__statusName) - } - @inline(__always) - set { - self.__statusName = std.string(newValue) - } - } - - var containerUserId: String? { - @inline(__always) - get { - return { () -> String? in - if bridge.has_value_std__optional_std__string_(self.__containerUserId) { - let __unwrapped = bridge.get_std__optional_std__string_(self.__containerUserId) - return String(__unwrapped) - } else { - return nil - } - }() - } - @inline(__always) - set { - self.__containerUserId = { () -> bridge.std__optional_std__string_ in - if let __unwrappedValue = newValue { - return bridge.create_std__optional_std__string_(std.string(__unwrappedValue)) - } else { - return .init() - } - }() - } - } -} diff --git a/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/swift/DeleteRecordParams.swift b/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/swift/DeleteRecordParams.swift deleted file mode 100644 index 29ce2c8..0000000 --- a/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/swift/DeleteRecordParams.swift +++ /dev/null @@ -1,47 +0,0 @@ -/// -/// DeleteRecordParams.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Represents an instance of `DeleteRecordParams`, backed by a C++ struct. - */ -public typealias DeleteRecordParams = margelo.nitro.cloudkitmodule.DeleteRecordParams - -public extension DeleteRecordParams { - private typealias bridge = margelo.nitro.cloudkitmodule.bridge.swift - - /** - * Create a new instance of `DeleteRecordParams`. - */ - init(recordType: String, recordID: String) { - self.init(std.string(recordType), std.string(recordID)) - } - - var recordType: String { - @inline(__always) - get { - return String(self.__recordType) - } - @inline(__always) - set { - self.__recordType = std.string(newValue) - } - } - - var recordID: String { - @inline(__always) - get { - return String(self.__recordID) - } - @inline(__always) - set { - self.__recordID = std.string(newValue) - } - } -} diff --git a/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/swift/FetchRecordParams.swift b/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/swift/FetchRecordParams.swift deleted file mode 100644 index 89b8cd9..0000000 --- a/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/swift/FetchRecordParams.swift +++ /dev/null @@ -1,47 +0,0 @@ -/// -/// FetchRecordParams.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Represents an instance of `FetchRecordParams`, backed by a C++ struct. - */ -public typealias FetchRecordParams = margelo.nitro.cloudkitmodule.FetchRecordParams - -public extension FetchRecordParams { - private typealias bridge = margelo.nitro.cloudkitmodule.bridge.swift - - /** - * Create a new instance of `FetchRecordParams`. - */ - init(recordType: String, recordID: String) { - self.init(std.string(recordType), std.string(recordID)) - } - - var recordType: String { - @inline(__always) - get { - return String(self.__recordType) - } - @inline(__always) - set { - self.__recordType = std.string(newValue) - } - } - - var recordID: String { - @inline(__always) - get { - return String(self.__recordID) - } - @inline(__always) - set { - self.__recordID = std.string(newValue) - } - } -} diff --git a/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/swift/Func_void.swift b/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/swift/Func_void.swift deleted file mode 100644 index 46a5645..0000000 --- a/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/swift/Func_void.swift +++ /dev/null @@ -1,47 +0,0 @@ -/// -/// Func_void.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Wraps a Swift `() -> Void` as a class. - * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`. - */ -public final class Func_void { - public typealias bridge = margelo.nitro.cloudkitmodule.bridge.swift - - private let closure: () -> Void - - public init(_ closure: @escaping () -> Void) { - self.closure = closure - } - - @inline(__always) - public func call() -> Void { - self.closure() - } - - /** - * Casts this instance to a retained unsafe raw pointer. - * This acquires one additional strong reference on the object! - */ - @inline(__always) - public func toUnsafe() -> UnsafeMutableRawPointer { - return Unmanaged.passRetained(self).toOpaque() - } - - /** - * Casts an unsafe pointer to a `Func_void`. - * The pointer has to be a retained opaque `Unmanaged`. - * This removes one strong reference from the object! - */ - @inline(__always) - public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void { - return Unmanaged.fromOpaque(pointer).takeRetainedValue() - } -} diff --git a/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/swift/Func_void_AccountInfoResult.swift b/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/swift/Func_void_AccountInfoResult.swift deleted file mode 100644 index 1da038b..0000000 --- a/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/swift/Func_void_AccountInfoResult.swift +++ /dev/null @@ -1,47 +0,0 @@ -/// -/// Func_void_AccountInfoResult.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Wraps a Swift `(_ value: AccountInfoResult) -> Void` as a class. - * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`. - */ -public final class Func_void_AccountInfoResult { - public typealias bridge = margelo.nitro.cloudkitmodule.bridge.swift - - private let closure: (_ value: AccountInfoResult) -> Void - - public init(_ closure: @escaping (_ value: AccountInfoResult) -> Void) { - self.closure = closure - } - - @inline(__always) - public func call(value: AccountInfoResult) -> Void { - self.closure(value) - } - - /** - * Casts this instance to a retained unsafe raw pointer. - * This acquires one additional strong reference on the object! - */ - @inline(__always) - public func toUnsafe() -> UnsafeMutableRawPointer { - return Unmanaged.passRetained(self).toOpaque() - } - - /** - * Casts an unsafe pointer to a `Func_void_AccountInfoResult`. - * The pointer has to be a retained opaque `Unmanaged`. - * This removes one strong reference from the object! - */ - @inline(__always) - public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_AccountInfoResult { - return Unmanaged.fromOpaque(pointer).takeRetainedValue() - } -} diff --git a/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/swift/Func_void_QueryRecordsResult.swift b/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/swift/Func_void_QueryRecordsResult.swift deleted file mode 100644 index 4aff7bd..0000000 --- a/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/swift/Func_void_QueryRecordsResult.swift +++ /dev/null @@ -1,47 +0,0 @@ -/// -/// Func_void_QueryRecordsResult.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Wraps a Swift `(_ value: QueryRecordsResult) -> Void` as a class. - * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`. - */ -public final class Func_void_QueryRecordsResult { - public typealias bridge = margelo.nitro.cloudkitmodule.bridge.swift - - private let closure: (_ value: QueryRecordsResult) -> Void - - public init(_ closure: @escaping (_ value: QueryRecordsResult) -> Void) { - self.closure = closure - } - - @inline(__always) - public func call(value: QueryRecordsResult) -> Void { - self.closure(value) - } - - /** - * Casts this instance to a retained unsafe raw pointer. - * This acquires one additional strong reference on the object! - */ - @inline(__always) - public func toUnsafe() -> UnsafeMutableRawPointer { - return Unmanaged.passRetained(self).toOpaque() - } - - /** - * Casts an unsafe pointer to a `Func_void_QueryRecordsResult`. - * The pointer has to be a retained opaque `Unmanaged`. - * This removes one strong reference from the object! - */ - @inline(__always) - public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_QueryRecordsResult { - return Unmanaged.fromOpaque(pointer).takeRetainedValue() - } -} diff --git a/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/swift/Func_void_SaveRecordResult.swift b/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/swift/Func_void_SaveRecordResult.swift deleted file mode 100644 index 9d0cd51..0000000 --- a/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/swift/Func_void_SaveRecordResult.swift +++ /dev/null @@ -1,47 +0,0 @@ -/// -/// Func_void_SaveRecordResult.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Wraps a Swift `(_ value: SaveRecordResult) -> Void` as a class. - * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`. - */ -public final class Func_void_SaveRecordResult { - public typealias bridge = margelo.nitro.cloudkitmodule.bridge.swift - - private let closure: (_ value: SaveRecordResult) -> Void - - public init(_ closure: @escaping (_ value: SaveRecordResult) -> Void) { - self.closure = closure - } - - @inline(__always) - public func call(value: SaveRecordResult) -> Void { - self.closure(value) - } - - /** - * Casts this instance to a retained unsafe raw pointer. - * This acquires one additional strong reference on the object! - */ - @inline(__always) - public func toUnsafe() -> UnsafeMutableRawPointer { - return Unmanaged.passRetained(self).toOpaque() - } - - /** - * Casts an unsafe pointer to a `Func_void_SaveRecordResult`. - * The pointer has to be a retained opaque `Unmanaged`. - * This removes one strong reference from the object! - */ - @inline(__always) - public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_SaveRecordResult { - return Unmanaged.fromOpaque(pointer).takeRetainedValue() - } -} diff --git a/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/swift/Func_void_bool.swift b/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/swift/Func_void_bool.swift deleted file mode 100644 index 874654a..0000000 --- a/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/swift/Func_void_bool.swift +++ /dev/null @@ -1,47 +0,0 @@ -/// -/// Func_void_bool.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Wraps a Swift `(_ value: Bool) -> Void` as a class. - * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`. - */ -public final class Func_void_bool { - public typealias bridge = margelo.nitro.cloudkitmodule.bridge.swift - - private let closure: (_ value: Bool) -> Void - - public init(_ closure: @escaping (_ value: Bool) -> Void) { - self.closure = closure - } - - @inline(__always) - public func call(value: Bool) -> Void { - self.closure(value) - } - - /** - * Casts this instance to a retained unsafe raw pointer. - * This acquires one additional strong reference on the object! - */ - @inline(__always) - public func toUnsafe() -> UnsafeMutableRawPointer { - return Unmanaged.passRetained(self).toOpaque() - } - - /** - * Casts an unsafe pointer to a `Func_void_bool`. - * The pointer has to be a retained opaque `Unmanaged`. - * This removes one strong reference from the object! - */ - @inline(__always) - public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_bool { - return Unmanaged.fromOpaque(pointer).takeRetainedValue() - } -} diff --git a/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift b/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift deleted file mode 100644 index b06f923..0000000 --- a/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +++ /dev/null @@ -1,47 +0,0 @@ -/// -/// Func_void_std__exception_ptr.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Wraps a Swift `(_ error: Error) -> Void` as a class. - * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`. - */ -public final class Func_void_std__exception_ptr { - public typealias bridge = margelo.nitro.cloudkitmodule.bridge.swift - - private let closure: (_ error: Error) -> Void - - public init(_ closure: @escaping (_ error: Error) -> Void) { - self.closure = closure - } - - @inline(__always) - public func call(error: std.exception_ptr) -> Void { - self.closure(RuntimeError.from(cppError: error)) - } - - /** - * Casts this instance to a retained unsafe raw pointer. - * This acquires one additional strong reference on the object! - */ - @inline(__always) - public func toUnsafe() -> UnsafeMutableRawPointer { - return Unmanaged.passRetained(self).toOpaque() - } - - /** - * Casts an unsafe pointer to a `Func_void_std__exception_ptr`. - * The pointer has to be a retained opaque `Unmanaged`. - * This removes one strong reference from the object! - */ - @inline(__always) - public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_std__exception_ptr { - return Unmanaged.fromOpaque(pointer).takeRetainedValue() - } -} diff --git a/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/swift/Func_void_std__variant_nitro__NullType__RecordResult_.swift b/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/swift/Func_void_std__variant_nitro__NullType__RecordResult_.swift deleted file mode 100644 index 1720bb6..0000000 --- a/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/swift/Func_void_std__variant_nitro__NullType__RecordResult_.swift +++ /dev/null @@ -1,59 +0,0 @@ -/// -/// Func_void_std__variant_nitro__NullType__RecordResult_.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Wraps a Swift `(_ value: Variant_NullType_RecordResult) -> Void` as a class. - * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`. - */ -public final class Func_void_std__variant_nitro__NullType__RecordResult_ { - public typealias bridge = margelo.nitro.cloudkitmodule.bridge.swift - - private let closure: (_ value: Variant_NullType_RecordResult) -> Void - - public init(_ closure: @escaping (_ value: Variant_NullType_RecordResult) -> Void) { - self.closure = closure - } - - @inline(__always) - public func call(value: bridge.std__variant_nitro__NullType__RecordResult_) -> Void { - self.closure({ () -> Variant_NullType_RecordResult in - let __variant = value - switch __variant.index() { - case 0: - let __actual = __variant.get_0() - return .first(NullType.null) - case 1: - let __actual = __variant.get_1() - return .second(__actual) - default: - fatalError("Variant can never have index \(__variant.index())!") - } - }()) - } - - /** - * Casts this instance to a retained unsafe raw pointer. - * This acquires one additional strong reference on the object! - */ - @inline(__always) - public func toUnsafe() -> UnsafeMutableRawPointer { - return Unmanaged.passRetained(self).toOpaque() - } - - /** - * Casts an unsafe pointer to a `Func_void_std__variant_nitro__NullType__RecordResult_`. - * The pointer has to be a retained opaque `Unmanaged`. - * This removes one strong reference from the object! - */ - @inline(__always) - public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_std__variant_nitro__NullType__RecordResult_ { - return Unmanaged.fromOpaque(pointer).takeRetainedValue() - } -} diff --git a/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/swift/HybridCloudKitModuleSpec.swift b/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/swift/HybridCloudKitModuleSpec.swift deleted file mode 100644 index 12cd731..0000000 --- a/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/swift/HybridCloudKitModuleSpec.swift +++ /dev/null @@ -1,62 +0,0 @@ -/// -/// HybridCloudKitModuleSpec.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/// See ``HybridCloudKitModuleSpec`` -public protocol HybridCloudKitModuleSpec_protocol: HybridObject { - // Properties - - - // Methods - func isAvailable() throws -> Promise - func getAccountInfo() throws -> Promise - func saveRecord(params: SaveRecordParams) throws -> Promise - func fetchRecord(params: FetchRecordParams) throws -> Promise - func deleteRecord(params: DeleteRecordParams) throws -> Promise - func recordExists(params: RecordExistsParams) throws -> Promise - func queryRecords(params: QueryRecordsParams) throws -> Promise -} - -public extension HybridCloudKitModuleSpec_protocol { - /// Default implementation of ``HybridObject.toString`` - func toString() -> String { - return "[HybridObject CloudKitModule]" - } -} - -/// See ``HybridCloudKitModuleSpec`` -open class HybridCloudKitModuleSpec_base { - private weak var cxxWrapper: HybridCloudKitModuleSpec_cxx? = nil - public init() { } - public func getCxxWrapper() -> HybridCloudKitModuleSpec_cxx { - #if DEBUG - guard self is HybridCloudKitModuleSpec else { - fatalError("`self` is not a `HybridCloudKitModuleSpec`! Did you accidentally inherit from `HybridCloudKitModuleSpec_base` instead of `HybridCloudKitModuleSpec`?") - } - #endif - if let cxxWrapper = self.cxxWrapper { - return cxxWrapper - } else { - let cxxWrapper = HybridCloudKitModuleSpec_cxx(self as! HybridCloudKitModuleSpec) - self.cxxWrapper = cxxWrapper - return cxxWrapper - } - } -} - -/** - * A Swift base-protocol representing the CloudKitModule HybridObject. - * Implement this protocol to create Swift-based instances of CloudKitModule. - * ```swift - * class HybridCloudKitModule : HybridCloudKitModuleSpec { - * // ... - * } - * ``` - */ -public typealias HybridCloudKitModuleSpec = HybridCloudKitModuleSpec_protocol & HybridCloudKitModuleSpec_base diff --git a/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/swift/HybridCloudKitModuleSpec_cxx.swift b/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/swift/HybridCloudKitModuleSpec_cxx.swift deleted file mode 100644 index 41a5547..0000000 --- a/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/swift/HybridCloudKitModuleSpec_cxx.swift +++ /dev/null @@ -1,259 +0,0 @@ -/// -/// HybridCloudKitModuleSpec_cxx.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * A class implementation that bridges HybridCloudKitModuleSpec over to C++. - * In C++, we cannot use Swift protocols - so we need to wrap it in a class to make it strongly defined. - * - * Also, some Swift types need to be bridged with special handling: - * - Enums need to be wrapped in Structs, otherwise they cannot be accessed bi-directionally (Swift bug: https://github.com/swiftlang/swift/issues/75330) - * - Other HybridObjects need to be wrapped/unwrapped from the Swift TCxx wrapper - * - Throwing methods need to be wrapped with a Result type, as exceptions cannot be propagated to C++ - */ -open class HybridCloudKitModuleSpec_cxx { - /** - * The Swift <> C++ bridge's namespace (`margelo::nitro::cloudkitmodule::bridge::swift`) - * from `CloudKitModule-Swift-Cxx-Bridge.hpp`. - * This contains specialized C++ templates, and C++ helper functions that can be accessed from Swift. - */ - public typealias bridge = margelo.nitro.cloudkitmodule.bridge.swift - - /** - * Holds an instance of the `HybridCloudKitModuleSpec` Swift protocol. - */ - private var __implementation: any HybridCloudKitModuleSpec - - /** - * Holds a weak pointer to the C++ class that wraps the Swift class. - */ - private var __cxxPart: bridge.std__weak_ptr_HybridCloudKitModuleSpec_ - - /** - * Create a new `HybridCloudKitModuleSpec_cxx` that wraps the given `HybridCloudKitModuleSpec`. - * All properties and methods bridge to C++ types. - */ - public init(_ implementation: any HybridCloudKitModuleSpec) { - self.__implementation = implementation - self.__cxxPart = .init() - /* no base class */ - } - - /** - * Get the actual `HybridCloudKitModuleSpec` instance this class wraps. - */ - @inline(__always) - public func getHybridCloudKitModuleSpec() -> any HybridCloudKitModuleSpec { - return __implementation - } - - /** - * Casts this instance to a retained unsafe raw pointer. - * This acquires one additional strong reference on the object! - */ - public func toUnsafe() -> UnsafeMutableRawPointer { - return Unmanaged.passRetained(self).toOpaque() - } - - /** - * Casts an unsafe pointer to a `HybridCloudKitModuleSpec_cxx`. - * The pointer has to be a retained opaque `Unmanaged`. - * This removes one strong reference from the object! - */ - public class func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> HybridCloudKitModuleSpec_cxx { - return Unmanaged.fromOpaque(pointer).takeRetainedValue() - } - - /** - * Gets (or creates) the C++ part of this Hybrid Object. - * The C++ part is a `std::shared_ptr`. - */ - public func getCxxPart() -> bridge.std__shared_ptr_HybridCloudKitModuleSpec_ { - let cachedCxxPart = self.__cxxPart.lock() - if Bool(fromCxx: cachedCxxPart) { - return cachedCxxPart - } else { - let newCxxPart = bridge.create_std__shared_ptr_HybridCloudKitModuleSpec_(self.toUnsafe()) - __cxxPart = bridge.weakify_std__shared_ptr_HybridCloudKitModuleSpec_(newCxxPart) - return newCxxPart - } - } - - - - /** - * Get the memory size of the Swift class (plus size of any other allocations) - * so the JS VM can properly track it and garbage-collect the JS object if needed. - */ - @inline(__always) - public var memorySize: Int { - return MemoryHelper.getSizeOf(self.__implementation) + self.__implementation.memorySize - } - - /** - * Call dispose() on the Swift class. - * This _may_ be called manually from JS. - */ - @inline(__always) - public func dispose() { - self.__implementation.dispose() - } - - /** - * Call toString() on the Swift class. - */ - @inline(__always) - public func toString() -> String { - return self.__implementation.toString() - } - - // Properties - - - // Methods - @inline(__always) - public final func isAvailable() -> bridge.Result_std__shared_ptr_Promise_bool___ { - do { - let __result = try self.__implementation.isAvailable() - let __resultCpp = { () -> bridge.std__shared_ptr_Promise_bool__ in - let __promise = bridge.create_std__shared_ptr_Promise_bool__() - let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_bool__(__promise) - __result - .then({ __result in __promiseHolder.resolve(__result) }) - .catch({ __error in __promiseHolder.reject(__error.toCpp()) }) - return __promise - }() - return bridge.create_Result_std__shared_ptr_Promise_bool___(__resultCpp) - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_std__shared_ptr_Promise_bool___(__exceptionPtr) - } - } - - @inline(__always) - public final func getAccountInfo() -> bridge.Result_std__shared_ptr_Promise_AccountInfoResult___ { - do { - let __result = try self.__implementation.getAccountInfo() - let __resultCpp = { () -> bridge.std__shared_ptr_Promise_AccountInfoResult__ in - let __promise = bridge.create_std__shared_ptr_Promise_AccountInfoResult__() - let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_AccountInfoResult__(__promise) - __result - .then({ __result in __promiseHolder.resolve(__result) }) - .catch({ __error in __promiseHolder.reject(__error.toCpp()) }) - return __promise - }() - return bridge.create_Result_std__shared_ptr_Promise_AccountInfoResult___(__resultCpp) - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_std__shared_ptr_Promise_AccountInfoResult___(__exceptionPtr) - } - } - - @inline(__always) - public final func saveRecord(params: SaveRecordParams) -> bridge.Result_std__shared_ptr_Promise_SaveRecordResult___ { - do { - let __result = try self.__implementation.saveRecord(params: params) - let __resultCpp = { () -> bridge.std__shared_ptr_Promise_SaveRecordResult__ in - let __promise = bridge.create_std__shared_ptr_Promise_SaveRecordResult__() - let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_SaveRecordResult__(__promise) - __result - .then({ __result in __promiseHolder.resolve(__result) }) - .catch({ __error in __promiseHolder.reject(__error.toCpp()) }) - return __promise - }() - return bridge.create_Result_std__shared_ptr_Promise_SaveRecordResult___(__resultCpp) - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_std__shared_ptr_Promise_SaveRecordResult___(__exceptionPtr) - } - } - - @inline(__always) - public final func fetchRecord(params: FetchRecordParams) -> bridge.Result_std__shared_ptr_Promise_std__variant_nitro__NullType__RecordResult____ { - do { - let __result = try self.__implementation.fetchRecord(params: params) - let __resultCpp = { () -> bridge.std__shared_ptr_Promise_std__variant_nitro__NullType__RecordResult___ in - let __promise = bridge.create_std__shared_ptr_Promise_std__variant_nitro__NullType__RecordResult___() - let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_std__variant_nitro__NullType__RecordResult___(__promise) - __result - .then({ __result in __promiseHolder.resolve({ () -> bridge.std__variant_nitro__NullType__RecordResult_ in - switch __result { - case .first(let __value): - return bridge.create_std__variant_nitro__NullType__RecordResult_(margelo.nitro.NullType.null) - case .second(let __value): - return bridge.create_std__variant_nitro__NullType__RecordResult_(__value) - } - }().variant) }) - .catch({ __error in __promiseHolder.reject(__error.toCpp()) }) - return __promise - }() - return bridge.create_Result_std__shared_ptr_Promise_std__variant_nitro__NullType__RecordResult____(__resultCpp) - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_std__shared_ptr_Promise_std__variant_nitro__NullType__RecordResult____(__exceptionPtr) - } - } - - @inline(__always) - public final func deleteRecord(params: DeleteRecordParams) -> bridge.Result_std__shared_ptr_Promise_void___ { - do { - let __result = try self.__implementation.deleteRecord(params: params) - let __resultCpp = { () -> bridge.std__shared_ptr_Promise_void__ in - let __promise = bridge.create_std__shared_ptr_Promise_void__() - let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_void__(__promise) - __result - .then({ __result in __promiseHolder.resolve() }) - .catch({ __error in __promiseHolder.reject(__error.toCpp()) }) - return __promise - }() - return bridge.create_Result_std__shared_ptr_Promise_void___(__resultCpp) - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_std__shared_ptr_Promise_void___(__exceptionPtr) - } - } - - @inline(__always) - public final func recordExists(params: RecordExistsParams) -> bridge.Result_std__shared_ptr_Promise_bool___ { - do { - let __result = try self.__implementation.recordExists(params: params) - let __resultCpp = { () -> bridge.std__shared_ptr_Promise_bool__ in - let __promise = bridge.create_std__shared_ptr_Promise_bool__() - let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_bool__(__promise) - __result - .then({ __result in __promiseHolder.resolve(__result) }) - .catch({ __error in __promiseHolder.reject(__error.toCpp()) }) - return __promise - }() - return bridge.create_Result_std__shared_ptr_Promise_bool___(__resultCpp) - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_std__shared_ptr_Promise_bool___(__exceptionPtr) - } - } - - @inline(__always) - public final func queryRecords(params: QueryRecordsParams) -> bridge.Result_std__shared_ptr_Promise_QueryRecordsResult___ { - do { - let __result = try self.__implementation.queryRecords(params: params) - let __resultCpp = { () -> bridge.std__shared_ptr_Promise_QueryRecordsResult__ in - let __promise = bridge.create_std__shared_ptr_Promise_QueryRecordsResult__() - let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_QueryRecordsResult__(__promise) - __result - .then({ __result in __promiseHolder.resolve(__result) }) - .catch({ __error in __promiseHolder.reject(__error.toCpp()) }) - return __promise - }() - return bridge.create_Result_std__shared_ptr_Promise_QueryRecordsResult___(__resultCpp) - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_std__shared_ptr_Promise_QueryRecordsResult___(__exceptionPtr) - } - } -} diff --git a/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/swift/QueryRecordsParams.swift b/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/swift/QueryRecordsParams.swift deleted file mode 100644 index adfe402..0000000 --- a/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/swift/QueryRecordsParams.swift +++ /dev/null @@ -1,36 +0,0 @@ -/// -/// QueryRecordsParams.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Represents an instance of `QueryRecordsParams`, backed by a C++ struct. - */ -public typealias QueryRecordsParams = margelo.nitro.cloudkitmodule.QueryRecordsParams - -public extension QueryRecordsParams { - private typealias bridge = margelo.nitro.cloudkitmodule.bridge.swift - - /** - * Create a new instance of `QueryRecordsParams`. - */ - init(recordType: String) { - self.init(std.string(recordType)) - } - - var recordType: String { - @inline(__always) - get { - return String(self.__recordType) - } - @inline(__always) - set { - self.__recordType = std.string(newValue) - } - } -} diff --git a/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/swift/QueryRecordsResult.swift b/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/swift/QueryRecordsResult.swift deleted file mode 100644 index 3f3bf4a..0000000 --- a/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/swift/QueryRecordsResult.swift +++ /dev/null @@ -1,48 +0,0 @@ -/// -/// QueryRecordsResult.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Represents an instance of `QueryRecordsResult`, backed by a C++ struct. - */ -public typealias QueryRecordsResult = margelo.nitro.cloudkitmodule.QueryRecordsResult - -public extension QueryRecordsResult { - private typealias bridge = margelo.nitro.cloudkitmodule.bridge.swift - - /** - * Create a new instance of `QueryRecordsResult`. - */ - init(records: [RecordResult]) { - self.init({ () -> bridge.std__vector_RecordResult_ in - var __vector = bridge.create_std__vector_RecordResult_(records.count) - for __item in records { - __vector.push_back(__item) - } - return __vector - }()) - } - - var records: [RecordResult] { - @inline(__always) - get { - return self.__records.map({ __item in __item }) - } - @inline(__always) - set { - self.__records = { () -> bridge.std__vector_RecordResult_ in - var __vector = bridge.create_std__vector_RecordResult_(newValue.count) - for __item in newValue { - __vector.push_back(__item) - } - return __vector - }() - } - } -} diff --git a/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/swift/RecordExistsParams.swift b/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/swift/RecordExistsParams.swift deleted file mode 100644 index 6d712ef..0000000 --- a/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/swift/RecordExistsParams.swift +++ /dev/null @@ -1,47 +0,0 @@ -/// -/// RecordExistsParams.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Represents an instance of `RecordExistsParams`, backed by a C++ struct. - */ -public typealias RecordExistsParams = margelo.nitro.cloudkitmodule.RecordExistsParams - -public extension RecordExistsParams { - private typealias bridge = margelo.nitro.cloudkitmodule.bridge.swift - - /** - * Create a new instance of `RecordExistsParams`. - */ - init(recordType: String, recordID: String) { - self.init(std.string(recordType), std.string(recordID)) - } - - var recordType: String { - @inline(__always) - get { - return String(self.__recordType) - } - @inline(__always) - set { - self.__recordType = std.string(newValue) - } - } - - var recordID: String { - @inline(__always) - get { - return String(self.__recordID) - } - @inline(__always) - set { - self.__recordID = std.string(newValue) - } - } -} diff --git a/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/swift/RecordResult.swift b/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/swift/RecordResult.swift deleted file mode 100644 index 2368ce9..0000000 --- a/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/swift/RecordResult.swift +++ /dev/null @@ -1,91 +0,0 @@ -/// -/// RecordResult.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Represents an instance of `RecordResult`, backed by a C++ struct. - */ -public typealias RecordResult = margelo.nitro.cloudkitmodule.RecordResult - -public extension RecordResult { - private typealias bridge = margelo.nitro.cloudkitmodule.bridge.swift - - /** - * Create a new instance of `RecordResult`. - */ - init(recordID: String, recordType: String, data: String, meta: String, createdAt: Double, modifiedAt: Double) { - self.init(std.string(recordID), std.string(recordType), std.string(data), std.string(meta), createdAt, modifiedAt) - } - - var recordID: String { - @inline(__always) - get { - return String(self.__recordID) - } - @inline(__always) - set { - self.__recordID = std.string(newValue) - } - } - - var recordType: String { - @inline(__always) - get { - return String(self.__recordType) - } - @inline(__always) - set { - self.__recordType = std.string(newValue) - } - } - - var data: String { - @inline(__always) - get { - return String(self.__data) - } - @inline(__always) - set { - self.__data = std.string(newValue) - } - } - - var meta: String { - @inline(__always) - get { - return String(self.__meta) - } - @inline(__always) - set { - self.__meta = std.string(newValue) - } - } - - var createdAt: Double { - @inline(__always) - get { - return self.__createdAt - } - @inline(__always) - set { - self.__createdAt = newValue - } - } - - var modifiedAt: Double { - @inline(__always) - get { - return self.__modifiedAt - } - @inline(__always) - set { - self.__modifiedAt = newValue - } - } -} diff --git a/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/swift/SaveRecordParams.swift b/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/swift/SaveRecordParams.swift deleted file mode 100644 index b7ff93e..0000000 --- a/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/swift/SaveRecordParams.swift +++ /dev/null @@ -1,69 +0,0 @@ -/// -/// SaveRecordParams.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Represents an instance of `SaveRecordParams`, backed by a C++ struct. - */ -public typealias SaveRecordParams = margelo.nitro.cloudkitmodule.SaveRecordParams - -public extension SaveRecordParams { - private typealias bridge = margelo.nitro.cloudkitmodule.bridge.swift - - /** - * Create a new instance of `SaveRecordParams`. - */ - init(recordType: String, recordID: String, data: String, meta: String) { - self.init(std.string(recordType), std.string(recordID), std.string(data), std.string(meta)) - } - - var recordType: String { - @inline(__always) - get { - return String(self.__recordType) - } - @inline(__always) - set { - self.__recordType = std.string(newValue) - } - } - - var recordID: String { - @inline(__always) - get { - return String(self.__recordID) - } - @inline(__always) - set { - self.__recordID = std.string(newValue) - } - } - - var data: String { - @inline(__always) - get { - return String(self.__data) - } - @inline(__always) - set { - self.__data = std.string(newValue) - } - } - - var meta: String { - @inline(__always) - get { - return String(self.__meta) - } - @inline(__always) - set { - self.__meta = std.string(newValue) - } - } -} diff --git a/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/swift/SaveRecordResult.swift b/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/swift/SaveRecordResult.swift deleted file mode 100644 index 003090a..0000000 --- a/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/swift/SaveRecordResult.swift +++ /dev/null @@ -1,47 +0,0 @@ -/// -/// SaveRecordResult.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Represents an instance of `SaveRecordResult`, backed by a C++ struct. - */ -public typealias SaveRecordResult = margelo.nitro.cloudkitmodule.SaveRecordResult - -public extension SaveRecordResult { - private typealias bridge = margelo.nitro.cloudkitmodule.bridge.swift - - /** - * Create a new instance of `SaveRecordResult`. - */ - init(recordID: String, createdAt: Double) { - self.init(std.string(recordID), createdAt) - } - - var recordID: String { - @inline(__always) - get { - return String(self.__recordID) - } - @inline(__always) - set { - self.__recordID = std.string(newValue) - } - } - - var createdAt: Double { - @inline(__always) - get { - return self.__createdAt - } - @inline(__always) - set { - self.__createdAt = newValue - } - } -} diff --git a/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/swift/Variant_NullType_RecordResult.swift b/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/swift/Variant_NullType_RecordResult.swift deleted file mode 100644 index 937e58e..0000000 --- a/native-modules/react-native-cloud-kit-module/nitrogen/generated/ios/swift/Variant_NullType_RecordResult.swift +++ /dev/null @@ -1,18 +0,0 @@ -/// -/// Variant_NullType_RecordResult.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import NitroModules - -/** - * An Swift enum with associated values representing a Variant/Union type. - * JS type: `null | struct` - */ -@frozen -public indirect enum Variant_NullType_RecordResult { - case first(NullType) - case second(RecordResult) -} diff --git a/native-modules/react-native-cloud-kit-module/nitrogen/generated/shared/c++/AccountInfoResult.hpp b/native-modules/react-native-cloud-kit-module/nitrogen/generated/shared/c++/AccountInfoResult.hpp deleted file mode 100644 index 7b51267..0000000 --- a/native-modules/react-native-cloud-kit-module/nitrogen/generated/shared/c++/AccountInfoResult.hpp +++ /dev/null @@ -1,84 +0,0 @@ -/// -/// AccountInfoResult.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif - - - -#include -#include - -namespace margelo::nitro::cloudkitmodule { - - /** - * A struct which can be represented as a JavaScript object (AccountInfoResult). - */ - struct AccountInfoResult { - public: - double status SWIFT_PRIVATE; - std::string statusName SWIFT_PRIVATE; - std::optional containerUserId SWIFT_PRIVATE; - - public: - AccountInfoResult() = default; - explicit AccountInfoResult(double status, std::string statusName, std::optional containerUserId): status(status), statusName(statusName), containerUserId(containerUserId) {} - }; - -} // namespace margelo::nitro::cloudkitmodule - -namespace margelo::nitro { - - // C++ AccountInfoResult <> JS AccountInfoResult (object) - template <> - struct JSIConverter final { - static inline margelo::nitro::cloudkitmodule::AccountInfoResult fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { - jsi::Object obj = arg.asObject(runtime); - return margelo::nitro::cloudkitmodule::AccountInfoResult( - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "status")), - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "statusName")), - JSIConverter>::fromJSI(runtime, obj.getProperty(runtime, "containerUserId")) - ); - } - static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::cloudkitmodule::AccountInfoResult& arg) { - jsi::Object obj(runtime); - obj.setProperty(runtime, "status", JSIConverter::toJSI(runtime, arg.status)); - obj.setProperty(runtime, "statusName", JSIConverter::toJSI(runtime, arg.statusName)); - obj.setProperty(runtime, "containerUserId", JSIConverter>::toJSI(runtime, arg.containerUserId)); - return obj; - } - static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) { - if (!value.isObject()) { - return false; - } - jsi::Object obj = value.getObject(runtime); - if (!nitro::isPlainObject(runtime, obj)) { - return false; - } - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "status"))) return false; - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "statusName"))) return false; - if (!JSIConverter>::canConvert(runtime, obj.getProperty(runtime, "containerUserId"))) return false; - return true; - } - }; - -} // namespace margelo::nitro diff --git a/native-modules/react-native-cloud-kit-module/nitrogen/generated/shared/c++/DeleteRecordParams.hpp b/native-modules/react-native-cloud-kit-module/nitrogen/generated/shared/c++/DeleteRecordParams.hpp deleted file mode 100644 index 94f3dc6..0000000 --- a/native-modules/react-native-cloud-kit-module/nitrogen/generated/shared/c++/DeleteRecordParams.hpp +++ /dev/null @@ -1,79 +0,0 @@ -/// -/// DeleteRecordParams.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif - - - -#include - -namespace margelo::nitro::cloudkitmodule { - - /** - * A struct which can be represented as a JavaScript object (DeleteRecordParams). - */ - struct DeleteRecordParams { - public: - std::string recordType SWIFT_PRIVATE; - std::string recordID SWIFT_PRIVATE; - - public: - DeleteRecordParams() = default; - explicit DeleteRecordParams(std::string recordType, std::string recordID): recordType(recordType), recordID(recordID) {} - }; - -} // namespace margelo::nitro::cloudkitmodule - -namespace margelo::nitro { - - // C++ DeleteRecordParams <> JS DeleteRecordParams (object) - template <> - struct JSIConverter final { - static inline margelo::nitro::cloudkitmodule::DeleteRecordParams fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { - jsi::Object obj = arg.asObject(runtime); - return margelo::nitro::cloudkitmodule::DeleteRecordParams( - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "recordType")), - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "recordID")) - ); - } - static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::cloudkitmodule::DeleteRecordParams& arg) { - jsi::Object obj(runtime); - obj.setProperty(runtime, "recordType", JSIConverter::toJSI(runtime, arg.recordType)); - obj.setProperty(runtime, "recordID", JSIConverter::toJSI(runtime, arg.recordID)); - return obj; - } - static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) { - if (!value.isObject()) { - return false; - } - jsi::Object obj = value.getObject(runtime); - if (!nitro::isPlainObject(runtime, obj)) { - return false; - } - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "recordType"))) return false; - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "recordID"))) return false; - return true; - } - }; - -} // namespace margelo::nitro diff --git a/native-modules/react-native-cloud-kit-module/nitrogen/generated/shared/c++/FetchRecordParams.hpp b/native-modules/react-native-cloud-kit-module/nitrogen/generated/shared/c++/FetchRecordParams.hpp deleted file mode 100644 index 62083a7..0000000 --- a/native-modules/react-native-cloud-kit-module/nitrogen/generated/shared/c++/FetchRecordParams.hpp +++ /dev/null @@ -1,79 +0,0 @@ -/// -/// FetchRecordParams.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif - - - -#include - -namespace margelo::nitro::cloudkitmodule { - - /** - * A struct which can be represented as a JavaScript object (FetchRecordParams). - */ - struct FetchRecordParams { - public: - std::string recordType SWIFT_PRIVATE; - std::string recordID SWIFT_PRIVATE; - - public: - FetchRecordParams() = default; - explicit FetchRecordParams(std::string recordType, std::string recordID): recordType(recordType), recordID(recordID) {} - }; - -} // namespace margelo::nitro::cloudkitmodule - -namespace margelo::nitro { - - // C++ FetchRecordParams <> JS FetchRecordParams (object) - template <> - struct JSIConverter final { - static inline margelo::nitro::cloudkitmodule::FetchRecordParams fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { - jsi::Object obj = arg.asObject(runtime); - return margelo::nitro::cloudkitmodule::FetchRecordParams( - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "recordType")), - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "recordID")) - ); - } - static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::cloudkitmodule::FetchRecordParams& arg) { - jsi::Object obj(runtime); - obj.setProperty(runtime, "recordType", JSIConverter::toJSI(runtime, arg.recordType)); - obj.setProperty(runtime, "recordID", JSIConverter::toJSI(runtime, arg.recordID)); - return obj; - } - static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) { - if (!value.isObject()) { - return false; - } - jsi::Object obj = value.getObject(runtime); - if (!nitro::isPlainObject(runtime, obj)) { - return false; - } - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "recordType"))) return false; - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "recordID"))) return false; - return true; - } - }; - -} // namespace margelo::nitro diff --git a/native-modules/react-native-cloud-kit-module/nitrogen/generated/shared/c++/HybridCloudKitModuleSpec.cpp b/native-modules/react-native-cloud-kit-module/nitrogen/generated/shared/c++/HybridCloudKitModuleSpec.cpp deleted file mode 100644 index 3feb7ae..0000000 --- a/native-modules/react-native-cloud-kit-module/nitrogen/generated/shared/c++/HybridCloudKitModuleSpec.cpp +++ /dev/null @@ -1,27 +0,0 @@ -/// -/// HybridCloudKitModuleSpec.cpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#include "HybridCloudKitModuleSpec.hpp" - -namespace margelo::nitro::cloudkitmodule { - - void HybridCloudKitModuleSpec::loadHybridMethods() { - // load base methods/properties - HybridObject::loadHybridMethods(); - // load custom methods/properties - registerHybrids(this, [](Prototype& prototype) { - prototype.registerHybridMethod("isAvailable", &HybridCloudKitModuleSpec::isAvailable); - prototype.registerHybridMethod("getAccountInfo", &HybridCloudKitModuleSpec::getAccountInfo); - prototype.registerHybridMethod("saveRecord", &HybridCloudKitModuleSpec::saveRecord); - prototype.registerHybridMethod("fetchRecord", &HybridCloudKitModuleSpec::fetchRecord); - prototype.registerHybridMethod("deleteRecord", &HybridCloudKitModuleSpec::deleteRecord); - prototype.registerHybridMethod("recordExists", &HybridCloudKitModuleSpec::recordExists); - prototype.registerHybridMethod("queryRecords", &HybridCloudKitModuleSpec::queryRecords); - }); - } - -} // namespace margelo::nitro::cloudkitmodule diff --git a/native-modules/react-native-cloud-kit-module/nitrogen/generated/shared/c++/HybridCloudKitModuleSpec.hpp b/native-modules/react-native-cloud-kit-module/nitrogen/generated/shared/c++/HybridCloudKitModuleSpec.hpp deleted file mode 100644 index c35c1c3..0000000 --- a/native-modules/react-native-cloud-kit-module/nitrogen/generated/shared/c++/HybridCloudKitModuleSpec.hpp +++ /dev/null @@ -1,96 +0,0 @@ -/// -/// HybridCloudKitModuleSpec.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif - -// Forward declaration of `AccountInfoResult` to properly resolve imports. -namespace margelo::nitro::cloudkitmodule { struct AccountInfoResult; } -// Forward declaration of `SaveRecordResult` to properly resolve imports. -namespace margelo::nitro::cloudkitmodule { struct SaveRecordResult; } -// Forward declaration of `SaveRecordParams` to properly resolve imports. -namespace margelo::nitro::cloudkitmodule { struct SaveRecordParams; } -// Forward declaration of `RecordResult` to properly resolve imports. -namespace margelo::nitro::cloudkitmodule { struct RecordResult; } -// Forward declaration of `FetchRecordParams` to properly resolve imports. -namespace margelo::nitro::cloudkitmodule { struct FetchRecordParams; } -// Forward declaration of `DeleteRecordParams` to properly resolve imports. -namespace margelo::nitro::cloudkitmodule { struct DeleteRecordParams; } -// Forward declaration of `RecordExistsParams` to properly resolve imports. -namespace margelo::nitro::cloudkitmodule { struct RecordExistsParams; } -// Forward declaration of `QueryRecordsResult` to properly resolve imports. -namespace margelo::nitro::cloudkitmodule { struct QueryRecordsResult; } -// Forward declaration of `QueryRecordsParams` to properly resolve imports. -namespace margelo::nitro::cloudkitmodule { struct QueryRecordsParams; } - -#include -#include "AccountInfoResult.hpp" -#include "SaveRecordResult.hpp" -#include "SaveRecordParams.hpp" -#include -#include "RecordResult.hpp" -#include -#include "FetchRecordParams.hpp" -#include "DeleteRecordParams.hpp" -#include "RecordExistsParams.hpp" -#include "QueryRecordsResult.hpp" -#include "QueryRecordsParams.hpp" - -namespace margelo::nitro::cloudkitmodule { - - using namespace margelo::nitro; - - /** - * An abstract base class for `CloudKitModule` - * Inherit this class to create instances of `HybridCloudKitModuleSpec` in C++. - * You must explicitly call `HybridObject`'s constructor yourself, because it is virtual. - * @example - * ```cpp - * class HybridCloudKitModule: public HybridCloudKitModuleSpec { - * public: - * HybridCloudKitModule(...): HybridObject(TAG) { ... } - * // ... - * }; - * ``` - */ - class HybridCloudKitModuleSpec: public virtual HybridObject { - public: - // Constructor - explicit HybridCloudKitModuleSpec(): HybridObject(TAG) { } - - // Destructor - ~HybridCloudKitModuleSpec() override = default; - - public: - // Properties - - - public: - // Methods - virtual std::shared_ptr> isAvailable() = 0; - virtual std::shared_ptr> getAccountInfo() = 0; - virtual std::shared_ptr> saveRecord(const SaveRecordParams& params) = 0; - virtual std::shared_ptr>> fetchRecord(const FetchRecordParams& params) = 0; - virtual std::shared_ptr> deleteRecord(const DeleteRecordParams& params) = 0; - virtual std::shared_ptr> recordExists(const RecordExistsParams& params) = 0; - virtual std::shared_ptr> queryRecords(const QueryRecordsParams& params) = 0; - - protected: - // Hybrid Setup - void loadHybridMethods() override; - - protected: - // Tag for logging - static constexpr auto TAG = "CloudKitModule"; - }; - -} // namespace margelo::nitro::cloudkitmodule diff --git a/native-modules/react-native-cloud-kit-module/nitrogen/generated/shared/c++/QueryRecordsParams.hpp b/native-modules/react-native-cloud-kit-module/nitrogen/generated/shared/c++/QueryRecordsParams.hpp deleted file mode 100644 index 39a08a5..0000000 --- a/native-modules/react-native-cloud-kit-module/nitrogen/generated/shared/c++/QueryRecordsParams.hpp +++ /dev/null @@ -1,75 +0,0 @@ -/// -/// QueryRecordsParams.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif - - - -#include - -namespace margelo::nitro::cloudkitmodule { - - /** - * A struct which can be represented as a JavaScript object (QueryRecordsParams). - */ - struct QueryRecordsParams { - public: - std::string recordType SWIFT_PRIVATE; - - public: - QueryRecordsParams() = default; - explicit QueryRecordsParams(std::string recordType): recordType(recordType) {} - }; - -} // namespace margelo::nitro::cloudkitmodule - -namespace margelo::nitro { - - // C++ QueryRecordsParams <> JS QueryRecordsParams (object) - template <> - struct JSIConverter final { - static inline margelo::nitro::cloudkitmodule::QueryRecordsParams fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { - jsi::Object obj = arg.asObject(runtime); - return margelo::nitro::cloudkitmodule::QueryRecordsParams( - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "recordType")) - ); - } - static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::cloudkitmodule::QueryRecordsParams& arg) { - jsi::Object obj(runtime); - obj.setProperty(runtime, "recordType", JSIConverter::toJSI(runtime, arg.recordType)); - return obj; - } - static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) { - if (!value.isObject()) { - return false; - } - jsi::Object obj = value.getObject(runtime); - if (!nitro::isPlainObject(runtime, obj)) { - return false; - } - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "recordType"))) return false; - return true; - } - }; - -} // namespace margelo::nitro diff --git a/native-modules/react-native-cloud-kit-module/nitrogen/generated/shared/c++/QueryRecordsResult.hpp b/native-modules/react-native-cloud-kit-module/nitrogen/generated/shared/c++/QueryRecordsResult.hpp deleted file mode 100644 index 3c05b2f..0000000 --- a/native-modules/react-native-cloud-kit-module/nitrogen/generated/shared/c++/QueryRecordsResult.hpp +++ /dev/null @@ -1,77 +0,0 @@ -/// -/// QueryRecordsResult.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif - -// Forward declaration of `RecordResult` to properly resolve imports. -namespace margelo::nitro::cloudkitmodule { struct RecordResult; } - -#include "RecordResult.hpp" -#include - -namespace margelo::nitro::cloudkitmodule { - - /** - * A struct which can be represented as a JavaScript object (QueryRecordsResult). - */ - struct QueryRecordsResult { - public: - std::vector records SWIFT_PRIVATE; - - public: - QueryRecordsResult() = default; - explicit QueryRecordsResult(std::vector records): records(records) {} - }; - -} // namespace margelo::nitro::cloudkitmodule - -namespace margelo::nitro { - - // C++ QueryRecordsResult <> JS QueryRecordsResult (object) - template <> - struct JSIConverter final { - static inline margelo::nitro::cloudkitmodule::QueryRecordsResult fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { - jsi::Object obj = arg.asObject(runtime); - return margelo::nitro::cloudkitmodule::QueryRecordsResult( - JSIConverter>::fromJSI(runtime, obj.getProperty(runtime, "records")) - ); - } - static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::cloudkitmodule::QueryRecordsResult& arg) { - jsi::Object obj(runtime); - obj.setProperty(runtime, "records", JSIConverter>::toJSI(runtime, arg.records)); - return obj; - } - static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) { - if (!value.isObject()) { - return false; - } - jsi::Object obj = value.getObject(runtime); - if (!nitro::isPlainObject(runtime, obj)) { - return false; - } - if (!JSIConverter>::canConvert(runtime, obj.getProperty(runtime, "records"))) return false; - return true; - } - }; - -} // namespace margelo::nitro diff --git a/native-modules/react-native-cloud-kit-module/nitrogen/generated/shared/c++/RecordExistsParams.hpp b/native-modules/react-native-cloud-kit-module/nitrogen/generated/shared/c++/RecordExistsParams.hpp deleted file mode 100644 index e939627..0000000 --- a/native-modules/react-native-cloud-kit-module/nitrogen/generated/shared/c++/RecordExistsParams.hpp +++ /dev/null @@ -1,79 +0,0 @@ -/// -/// RecordExistsParams.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif - - - -#include - -namespace margelo::nitro::cloudkitmodule { - - /** - * A struct which can be represented as a JavaScript object (RecordExistsParams). - */ - struct RecordExistsParams { - public: - std::string recordType SWIFT_PRIVATE; - std::string recordID SWIFT_PRIVATE; - - public: - RecordExistsParams() = default; - explicit RecordExistsParams(std::string recordType, std::string recordID): recordType(recordType), recordID(recordID) {} - }; - -} // namespace margelo::nitro::cloudkitmodule - -namespace margelo::nitro { - - // C++ RecordExistsParams <> JS RecordExistsParams (object) - template <> - struct JSIConverter final { - static inline margelo::nitro::cloudkitmodule::RecordExistsParams fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { - jsi::Object obj = arg.asObject(runtime); - return margelo::nitro::cloudkitmodule::RecordExistsParams( - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "recordType")), - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "recordID")) - ); - } - static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::cloudkitmodule::RecordExistsParams& arg) { - jsi::Object obj(runtime); - obj.setProperty(runtime, "recordType", JSIConverter::toJSI(runtime, arg.recordType)); - obj.setProperty(runtime, "recordID", JSIConverter::toJSI(runtime, arg.recordID)); - return obj; - } - static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) { - if (!value.isObject()) { - return false; - } - jsi::Object obj = value.getObject(runtime); - if (!nitro::isPlainObject(runtime, obj)) { - return false; - } - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "recordType"))) return false; - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "recordID"))) return false; - return true; - } - }; - -} // namespace margelo::nitro diff --git a/native-modules/react-native-cloud-kit-module/nitrogen/generated/shared/c++/RecordResult.hpp b/native-modules/react-native-cloud-kit-module/nitrogen/generated/shared/c++/RecordResult.hpp deleted file mode 100644 index 6be74bd..0000000 --- a/native-modules/react-native-cloud-kit-module/nitrogen/generated/shared/c++/RecordResult.hpp +++ /dev/null @@ -1,95 +0,0 @@ -/// -/// RecordResult.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif - - - -#include - -namespace margelo::nitro::cloudkitmodule { - - /** - * A struct which can be represented as a JavaScript object (RecordResult). - */ - struct RecordResult { - public: - std::string recordID SWIFT_PRIVATE; - std::string recordType SWIFT_PRIVATE; - std::string data SWIFT_PRIVATE; - std::string meta SWIFT_PRIVATE; - double createdAt SWIFT_PRIVATE; - double modifiedAt SWIFT_PRIVATE; - - public: - RecordResult() = default; - explicit RecordResult(std::string recordID, std::string recordType, std::string data, std::string meta, double createdAt, double modifiedAt): recordID(recordID), recordType(recordType), data(data), meta(meta), createdAt(createdAt), modifiedAt(modifiedAt) {} - }; - -} // namespace margelo::nitro::cloudkitmodule - -namespace margelo::nitro { - - // C++ RecordResult <> JS RecordResult (object) - template <> - struct JSIConverter final { - static inline margelo::nitro::cloudkitmodule::RecordResult fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { - jsi::Object obj = arg.asObject(runtime); - return margelo::nitro::cloudkitmodule::RecordResult( - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "recordID")), - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "recordType")), - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "data")), - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "meta")), - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "createdAt")), - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "modifiedAt")) - ); - } - static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::cloudkitmodule::RecordResult& arg) { - jsi::Object obj(runtime); - obj.setProperty(runtime, "recordID", JSIConverter::toJSI(runtime, arg.recordID)); - obj.setProperty(runtime, "recordType", JSIConverter::toJSI(runtime, arg.recordType)); - obj.setProperty(runtime, "data", JSIConverter::toJSI(runtime, arg.data)); - obj.setProperty(runtime, "meta", JSIConverter::toJSI(runtime, arg.meta)); - obj.setProperty(runtime, "createdAt", JSIConverter::toJSI(runtime, arg.createdAt)); - obj.setProperty(runtime, "modifiedAt", JSIConverter::toJSI(runtime, arg.modifiedAt)); - return obj; - } - static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) { - if (!value.isObject()) { - return false; - } - jsi::Object obj = value.getObject(runtime); - if (!nitro::isPlainObject(runtime, obj)) { - return false; - } - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "recordID"))) return false; - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "recordType"))) return false; - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "data"))) return false; - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "meta"))) return false; - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "createdAt"))) return false; - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "modifiedAt"))) return false; - return true; - } - }; - -} // namespace margelo::nitro diff --git a/native-modules/react-native-cloud-kit-module/nitrogen/generated/shared/c++/SaveRecordParams.hpp b/native-modules/react-native-cloud-kit-module/nitrogen/generated/shared/c++/SaveRecordParams.hpp deleted file mode 100644 index 5cde41c..0000000 --- a/native-modules/react-native-cloud-kit-module/nitrogen/generated/shared/c++/SaveRecordParams.hpp +++ /dev/null @@ -1,87 +0,0 @@ -/// -/// SaveRecordParams.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif - - - -#include - -namespace margelo::nitro::cloudkitmodule { - - /** - * A struct which can be represented as a JavaScript object (SaveRecordParams). - */ - struct SaveRecordParams { - public: - std::string recordType SWIFT_PRIVATE; - std::string recordID SWIFT_PRIVATE; - std::string data SWIFT_PRIVATE; - std::string meta SWIFT_PRIVATE; - - public: - SaveRecordParams() = default; - explicit SaveRecordParams(std::string recordType, std::string recordID, std::string data, std::string meta): recordType(recordType), recordID(recordID), data(data), meta(meta) {} - }; - -} // namespace margelo::nitro::cloudkitmodule - -namespace margelo::nitro { - - // C++ SaveRecordParams <> JS SaveRecordParams (object) - template <> - struct JSIConverter final { - static inline margelo::nitro::cloudkitmodule::SaveRecordParams fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { - jsi::Object obj = arg.asObject(runtime); - return margelo::nitro::cloudkitmodule::SaveRecordParams( - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "recordType")), - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "recordID")), - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "data")), - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "meta")) - ); - } - static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::cloudkitmodule::SaveRecordParams& arg) { - jsi::Object obj(runtime); - obj.setProperty(runtime, "recordType", JSIConverter::toJSI(runtime, arg.recordType)); - obj.setProperty(runtime, "recordID", JSIConverter::toJSI(runtime, arg.recordID)); - obj.setProperty(runtime, "data", JSIConverter::toJSI(runtime, arg.data)); - obj.setProperty(runtime, "meta", JSIConverter::toJSI(runtime, arg.meta)); - return obj; - } - static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) { - if (!value.isObject()) { - return false; - } - jsi::Object obj = value.getObject(runtime); - if (!nitro::isPlainObject(runtime, obj)) { - return false; - } - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "recordType"))) return false; - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "recordID"))) return false; - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "data"))) return false; - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "meta"))) return false; - return true; - } - }; - -} // namespace margelo::nitro diff --git a/native-modules/react-native-cloud-kit-module/nitrogen/generated/shared/c++/SaveRecordResult.hpp b/native-modules/react-native-cloud-kit-module/nitrogen/generated/shared/c++/SaveRecordResult.hpp deleted file mode 100644 index e929f9a..0000000 --- a/native-modules/react-native-cloud-kit-module/nitrogen/generated/shared/c++/SaveRecordResult.hpp +++ /dev/null @@ -1,79 +0,0 @@ -/// -/// SaveRecordResult.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif - - - -#include - -namespace margelo::nitro::cloudkitmodule { - - /** - * A struct which can be represented as a JavaScript object (SaveRecordResult). - */ - struct SaveRecordResult { - public: - std::string recordID SWIFT_PRIVATE; - double createdAt SWIFT_PRIVATE; - - public: - SaveRecordResult() = default; - explicit SaveRecordResult(std::string recordID, double createdAt): recordID(recordID), createdAt(createdAt) {} - }; - -} // namespace margelo::nitro::cloudkitmodule - -namespace margelo::nitro { - - // C++ SaveRecordResult <> JS SaveRecordResult (object) - template <> - struct JSIConverter final { - static inline margelo::nitro::cloudkitmodule::SaveRecordResult fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { - jsi::Object obj = arg.asObject(runtime); - return margelo::nitro::cloudkitmodule::SaveRecordResult( - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "recordID")), - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "createdAt")) - ); - } - static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::cloudkitmodule::SaveRecordResult& arg) { - jsi::Object obj(runtime); - obj.setProperty(runtime, "recordID", JSIConverter::toJSI(runtime, arg.recordID)); - obj.setProperty(runtime, "createdAt", JSIConverter::toJSI(runtime, arg.createdAt)); - return obj; - } - static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) { - if (!value.isObject()) { - return false; - } - jsi::Object obj = value.getObject(runtime); - if (!nitro::isPlainObject(runtime, obj)) { - return false; - } - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "recordID"))) return false; - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "createdAt"))) return false; - return true; - } - }; - -} // namespace margelo::nitro diff --git a/native-modules/react-native-device-utils/nitrogen/generated/.gitattributes b/native-modules/react-native-device-utils/nitrogen/generated/.gitattributes deleted file mode 100644 index fb7a0d5..0000000 --- a/native-modules/react-native-device-utils/nitrogen/generated/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -** linguist-generated=true diff --git a/native-modules/react-native-device-utils/nitrogen/generated/android/c++/JDualScreenInfoRect.hpp b/native-modules/react-native-device-utils/nitrogen/generated/android/c++/JDualScreenInfoRect.hpp deleted file mode 100644 index 5173949..0000000 --- a/native-modules/react-native-device-utils/nitrogen/generated/android/c++/JDualScreenInfoRect.hpp +++ /dev/null @@ -1,69 +0,0 @@ -/// -/// JDualScreenInfoRect.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#include -#include "DualScreenInfoRect.hpp" - - - -namespace margelo::nitro::reactnativedeviceutils { - - using namespace facebook; - - /** - * The C++ JNI bridge between the C++ struct "DualScreenInfoRect" and the the Kotlin data class "DualScreenInfoRect". - */ - struct JDualScreenInfoRect final: public jni::JavaClass { - public: - static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/reactnativedeviceutils/DualScreenInfoRect;"; - - public: - /** - * Convert this Java/Kotlin-based struct to the C++ struct DualScreenInfoRect by copying all values to C++. - */ - [[maybe_unused]] - [[nodiscard]] - DualScreenInfoRect toCpp() const { - static const auto clazz = javaClassStatic(); - static const auto fieldX = clazz->getField("x"); - double x = this->getFieldValue(fieldX); - static const auto fieldY = clazz->getField("y"); - double y = this->getFieldValue(fieldY); - static const auto fieldWidth = clazz->getField("width"); - double width = this->getFieldValue(fieldWidth); - static const auto fieldHeight = clazz->getField("height"); - double height = this->getFieldValue(fieldHeight); - return DualScreenInfoRect( - x, - y, - width, - height - ); - } - - public: - /** - * Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java. - */ - [[maybe_unused]] - static jni::local_ref fromCpp(const DualScreenInfoRect& value) { - using JSignature = JDualScreenInfoRect(double, double, double, double); - static const auto clazz = javaClassStatic(); - static const auto create = clazz->getStaticMethod("fromCpp"); - return create( - clazz, - value.x, - value.y, - value.width, - value.height - ); - } - }; - -} // namespace margelo::nitro::reactnativedeviceutils diff --git a/native-modules/react-native-device-utils/nitrogen/generated/android/c++/JFunc_void_bool.hpp b/native-modules/react-native-device-utils/nitrogen/generated/android/c++/JFunc_void_bool.hpp deleted file mode 100644 index ad529d5..0000000 --- a/native-modules/react-native-device-utils/nitrogen/generated/android/c++/JFunc_void_bool.hpp +++ /dev/null @@ -1,75 +0,0 @@ -/// -/// JFunc_void_bool.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#include -#include - -#include -#include - -namespace margelo::nitro::reactnativedeviceutils { - - using namespace facebook; - - /** - * Represents the Java/Kotlin callback `(isSpanning: Boolean) -> Unit`. - * This can be passed around between C++ and Java/Kotlin. - */ - struct JFunc_void_bool: public jni::JavaClass { - public: - static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/reactnativedeviceutils/Func_void_bool;"; - - public: - /** - * Invokes the function this `JFunc_void_bool` instance holds through JNI. - */ - void invoke(bool isSpanning) const { - static const auto method = javaClassStatic()->getMethod("invoke"); - method(self(), isSpanning); - } - }; - - /** - * An implementation of Func_void_bool that is backed by a C++ implementation (using `std::function<...>`) - */ - class JFunc_void_bool_cxx final: public jni::HybridClass { - public: - static jni::local_ref fromCpp(const std::function& func) { - return JFunc_void_bool_cxx::newObjectCxxArgs(func); - } - - public: - /** - * Invokes the C++ `std::function<...>` this `JFunc_void_bool_cxx` instance holds. - */ - void invoke_cxx(jboolean isSpanning) { - _func(static_cast(isSpanning)); - } - - public: - [[nodiscard]] - inline const std::function& getFunction() const { - return _func; - } - - public: - static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/reactnativedeviceutils/Func_void_bool_cxx;"; - static void registerNatives() { - registerHybrid({makeNativeMethod("invoke_cxx", JFunc_void_bool_cxx::invoke_cxx)}); - } - - private: - explicit JFunc_void_bool_cxx(const std::function& func): _func(func) { } - - private: - friend HybridBase; - std::function _func; - }; - -} // namespace margelo::nitro::reactnativedeviceutils diff --git a/native-modules/react-native-device-utils/nitrogen/generated/android/c++/JGooglePlayServicesStatus.hpp b/native-modules/react-native-device-utils/nitrogen/generated/android/c++/JGooglePlayServicesStatus.hpp deleted file mode 100644 index e6c9ce1..0000000 --- a/native-modules/react-native-device-utils/nitrogen/generated/android/c++/JGooglePlayServicesStatus.hpp +++ /dev/null @@ -1,61 +0,0 @@ -/// -/// JGooglePlayServicesStatus.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#include -#include "GooglePlayServicesStatus.hpp" - - - -namespace margelo::nitro::reactnativedeviceutils { - - using namespace facebook; - - /** - * The C++ JNI bridge between the C++ struct "GooglePlayServicesStatus" and the the Kotlin data class "GooglePlayServicesStatus". - */ - struct JGooglePlayServicesStatus final: public jni::JavaClass { - public: - static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/reactnativedeviceutils/GooglePlayServicesStatus;"; - - public: - /** - * Convert this Java/Kotlin-based struct to the C++ struct GooglePlayServicesStatus by copying all values to C++. - */ - [[maybe_unused]] - [[nodiscard]] - GooglePlayServicesStatus toCpp() const { - static const auto clazz = javaClassStatic(); - static const auto fieldStatus = clazz->getField("status"); - double status = this->getFieldValue(fieldStatus); - static const auto fieldIsAvailable = clazz->getField("isAvailable"); - jboolean isAvailable = this->getFieldValue(fieldIsAvailable); - return GooglePlayServicesStatus( - status, - static_cast(isAvailable) - ); - } - - public: - /** - * Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java. - */ - [[maybe_unused]] - static jni::local_ref fromCpp(const GooglePlayServicesStatus& value) { - using JSignature = JGooglePlayServicesStatus(double, jboolean); - static const auto clazz = javaClassStatic(); - static const auto create = clazz->getStaticMethod("fromCpp"); - return create( - clazz, - value.status, - value.isAvailable - ); - } - }; - -} // namespace margelo::nitro::reactnativedeviceutils diff --git a/native-modules/react-native-device-utils/nitrogen/generated/android/c++/JHybridReactNativeDeviceUtilsSpec.cpp b/native-modules/react-native-device-utils/nitrogen/generated/android/c++/JHybridReactNativeDeviceUtilsSpec.cpp deleted file mode 100644 index 1f301b8..0000000 --- a/native-modules/react-native-device-utils/nitrogen/generated/android/c++/JHybridReactNativeDeviceUtilsSpec.cpp +++ /dev/null @@ -1,276 +0,0 @@ -/// -/// JHybridReactNativeDeviceUtilsSpec.cpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#include "JHybridReactNativeDeviceUtilsSpec.hpp" - -// Forward declaration of `DualScreenInfoRect` to properly resolve imports. -namespace margelo::nitro::reactnativedeviceutils { struct DualScreenInfoRect; } -// Forward declaration of `LaunchOptions` to properly resolve imports. -namespace margelo::nitro::reactnativedeviceutils { struct LaunchOptions; } -// Forward declaration of `WebViewPackageInfo` to properly resolve imports. -namespace margelo::nitro::reactnativedeviceutils { struct WebViewPackageInfo; } -// Forward declaration of `GooglePlayServicesStatus` to properly resolve imports. -namespace margelo::nitro::reactnativedeviceutils { struct GooglePlayServicesStatus; } -// Forward declaration of `UserInterfaceStyle` to properly resolve imports. -namespace margelo::nitro::reactnativedeviceutils { enum class UserInterfaceStyle; } - -#include "DualScreenInfoRect.hpp" -#include -#include -#include -#include "JDualScreenInfoRect.hpp" -#include "LaunchOptions.hpp" -#include "JLaunchOptions.hpp" -#include -#include -#include "WebViewPackageInfo.hpp" -#include "JWebViewPackageInfo.hpp" -#include "GooglePlayServicesStatus.hpp" -#include "JGooglePlayServicesStatus.hpp" -#include -#include "JFunc_void_bool.hpp" -#include -#include "UserInterfaceStyle.hpp" -#include "JUserInterfaceStyle.hpp" - -namespace margelo::nitro::reactnativedeviceutils { - - jni::local_ref JHybridReactNativeDeviceUtilsSpec::initHybrid(jni::alias_ref jThis) { - return makeCxxInstance(jThis); - } - - void JHybridReactNativeDeviceUtilsSpec::registerNatives() { - registerHybrid({ - makeNativeMethod("initHybrid", JHybridReactNativeDeviceUtilsSpec::initHybrid), - }); - } - - size_t JHybridReactNativeDeviceUtilsSpec::getExternalMemorySize() noexcept { - static const auto method = javaClassStatic()->getMethod("getMemorySize"); - return method(_javaPart); - } - - void JHybridReactNativeDeviceUtilsSpec::dispose() noexcept { - static const auto method = javaClassStatic()->getMethod("dispose"); - method(_javaPart); - } - - std::string JHybridReactNativeDeviceUtilsSpec::toString() { - static const auto method = javaClassStatic()->getMethod("toString"); - auto javaString = method(_javaPart); - return javaString->toStdString(); - } - - // Properties - - - // Methods - void JHybridReactNativeDeviceUtilsSpec::initEventListeners() { - static const auto method = javaClassStatic()->getMethod("initEventListeners"); - method(_javaPart); - } - bool JHybridReactNativeDeviceUtilsSpec::isDualScreenDevice() { - static const auto method = javaClassStatic()->getMethod("isDualScreenDevice"); - auto __result = method(_javaPart); - return static_cast(__result); - } - bool JHybridReactNativeDeviceUtilsSpec::isSpanning() { - static const auto method = javaClassStatic()->getMethod("isSpanning"); - auto __result = method(_javaPart); - return static_cast(__result); - } - std::shared_ptr>> JHybridReactNativeDeviceUtilsSpec::getWindowRects() { - static const auto method = javaClassStatic()->getMethod()>("getWindowRects"); - auto __result = method(_javaPart); - return [&]() { - auto __promise = Promise>::create(); - __result->cthis()->addOnResolvedListener([=](const jni::alias_ref& __boxedResult) { - auto __result = jni::static_ref_cast>(__boxedResult); - __promise->resolve([&]() { - size_t __size = __result->size(); - std::vector __vector; - __vector.reserve(__size); - for (size_t __i = 0; __i < __size; __i++) { - auto __element = __result->getElement(__i); - __vector.push_back(__element->toCpp()); - } - return __vector; - }()); - }); - __result->cthis()->addOnRejectedListener([=](const jni::alias_ref& __throwable) { - jni::JniException __jniError(__throwable); - __promise->reject(std::make_exception_ptr(__jniError)); - }); - return __promise; - }(); - } - std::shared_ptr> JHybridReactNativeDeviceUtilsSpec::getHingeBounds() { - static const auto method = javaClassStatic()->getMethod()>("getHingeBounds"); - auto __result = method(_javaPart); - return [&]() { - auto __promise = Promise::create(); - __result->cthis()->addOnResolvedListener([=](const jni::alias_ref& __boxedResult) { - auto __result = jni::static_ref_cast(__boxedResult); - __promise->resolve(__result->toCpp()); - }); - __result->cthis()->addOnRejectedListener([=](const jni::alias_ref& __throwable) { - jni::JniException __jniError(__throwable); - __promise->reject(std::make_exception_ptr(__jniError)); - }); - return __promise; - }(); - } - void JHybridReactNativeDeviceUtilsSpec::changeBackgroundColor(double r, double g, double b, double a) { - static const auto method = javaClassStatic()->getMethod("changeBackgroundColor"); - method(_javaPart, r, g, b, a); - } - double JHybridReactNativeDeviceUtilsSpec::addSpanningChangedListener(const std::function& callback) { - static const auto method = javaClassStatic()->getMethod /* callback */)>("addSpanningChangedListener_cxx"); - auto __result = method(_javaPart, JFunc_void_bool_cxx::fromCpp(callback)); - return __result; - } - void JHybridReactNativeDeviceUtilsSpec::removeSpanningChangedListener(double id) { - static const auto method = javaClassStatic()->getMethod("removeSpanningChangedListener"); - method(_javaPart, id); - } - void JHybridReactNativeDeviceUtilsSpec::setUserInterfaceStyle(UserInterfaceStyle style) { - static const auto method = javaClassStatic()->getMethod /* style */)>("setUserInterfaceStyle"); - method(_javaPart, JUserInterfaceStyle::fromCpp(style)); - } - std::shared_ptr> JHybridReactNativeDeviceUtilsSpec::getLaunchOptions() { - static const auto method = javaClassStatic()->getMethod()>("getLaunchOptions"); - auto __result = method(_javaPart); - return [&]() { - auto __promise = Promise::create(); - __result->cthis()->addOnResolvedListener([=](const jni::alias_ref& __boxedResult) { - auto __result = jni::static_ref_cast(__boxedResult); - __promise->resolve(__result->toCpp()); - }); - __result->cthis()->addOnRejectedListener([=](const jni::alias_ref& __throwable) { - jni::JniException __jniError(__throwable); - __promise->reject(std::make_exception_ptr(__jniError)); - }); - return __promise; - }(); - } - std::shared_ptr> JHybridReactNativeDeviceUtilsSpec::clearLaunchOptions() { - static const auto method = javaClassStatic()->getMethod()>("clearLaunchOptions"); - auto __result = method(_javaPart); - return [&]() { - auto __promise = Promise::create(); - __result->cthis()->addOnResolvedListener([=](const jni::alias_ref& __boxedResult) { - auto __result = jni::static_ref_cast(__boxedResult); - __promise->resolve(static_cast(__result->value())); - }); - __result->cthis()->addOnRejectedListener([=](const jni::alias_ref& __throwable) { - jni::JniException __jniError(__throwable); - __promise->reject(std::make_exception_ptr(__jniError)); - }); - return __promise; - }(); - } - std::shared_ptr> JHybridReactNativeDeviceUtilsSpec::getDeviceToken() { - static const auto method = javaClassStatic()->getMethod()>("getDeviceToken"); - auto __result = method(_javaPart); - return [&]() { - auto __promise = Promise::create(); - __result->cthis()->addOnResolvedListener([=](const jni::alias_ref& __boxedResult) { - auto __result = jni::static_ref_cast(__boxedResult); - __promise->resolve(__result->toStdString()); - }); - __result->cthis()->addOnRejectedListener([=](const jni::alias_ref& __throwable) { - jni::JniException __jniError(__throwable); - __promise->reject(std::make_exception_ptr(__jniError)); - }); - return __promise; - }(); - } - std::shared_ptr> JHybridReactNativeDeviceUtilsSpec::saveDeviceToken(const std::string& token) { - static const auto method = javaClassStatic()->getMethod(jni::alias_ref /* token */)>("saveDeviceToken"); - auto __result = method(_javaPart, jni::make_jstring(token)); - return [&]() { - auto __promise = Promise::create(); - __result->cthis()->addOnResolvedListener([=](const jni::alias_ref& /* unit */) { - __promise->resolve(); - }); - __result->cthis()->addOnRejectedListener([=](const jni::alias_ref& __throwable) { - jni::JniException __jniError(__throwable); - __promise->reject(std::make_exception_ptr(__jniError)); - }); - return __promise; - }(); - } - std::shared_ptr> JHybridReactNativeDeviceUtilsSpec::registerDeviceToken() { - static const auto method = javaClassStatic()->getMethod()>("registerDeviceToken"); - auto __result = method(_javaPart); - return [&]() { - auto __promise = Promise::create(); - __result->cthis()->addOnResolvedListener([=](const jni::alias_ref& __boxedResult) { - auto __result = jni::static_ref_cast(__boxedResult); - __promise->resolve(static_cast(__result->value())); - }); - __result->cthis()->addOnRejectedListener([=](const jni::alias_ref& __throwable) { - jni::JniException __jniError(__throwable); - __promise->reject(std::make_exception_ptr(__jniError)); - }); - return __promise; - }(); - } - std::shared_ptr> JHybridReactNativeDeviceUtilsSpec::getStartupTime() { - static const auto method = javaClassStatic()->getMethod()>("getStartupTime"); - auto __result = method(_javaPart); - return [&]() { - auto __promise = Promise::create(); - __result->cthis()->addOnResolvedListener([=](const jni::alias_ref& __boxedResult) { - auto __result = jni::static_ref_cast(__boxedResult); - __promise->resolve(__result->value()); - }); - __result->cthis()->addOnRejectedListener([=](const jni::alias_ref& __throwable) { - jni::JniException __jniError(__throwable); - __promise->reject(std::make_exception_ptr(__jniError)); - }); - return __promise; - }(); - } - void JHybridReactNativeDeviceUtilsSpec::exitApp() { - static const auto method = javaClassStatic()->getMethod("exitApp"); - method(_javaPart); - } - std::shared_ptr> JHybridReactNativeDeviceUtilsSpec::getCurrentWebViewPackageInfo() { - static const auto method = javaClassStatic()->getMethod()>("getCurrentWebViewPackageInfo"); - auto __result = method(_javaPart); - return [&]() { - auto __promise = Promise::create(); - __result->cthis()->addOnResolvedListener([=](const jni::alias_ref& __boxedResult) { - auto __result = jni::static_ref_cast(__boxedResult); - __promise->resolve(__result->toCpp()); - }); - __result->cthis()->addOnRejectedListener([=](const jni::alias_ref& __throwable) { - jni::JniException __jniError(__throwable); - __promise->reject(std::make_exception_ptr(__jniError)); - }); - return __promise; - }(); - } - std::shared_ptr> JHybridReactNativeDeviceUtilsSpec::isGooglePlayServicesAvailable() { - static const auto method = javaClassStatic()->getMethod()>("isGooglePlayServicesAvailable"); - auto __result = method(_javaPart); - return [&]() { - auto __promise = Promise::create(); - __result->cthis()->addOnResolvedListener([=](const jni::alias_ref& __boxedResult) { - auto __result = jni::static_ref_cast(__boxedResult); - __promise->resolve(__result->toCpp()); - }); - __result->cthis()->addOnRejectedListener([=](const jni::alias_ref& __throwable) { - jni::JniException __jniError(__throwable); - __promise->reject(std::make_exception_ptr(__jniError)); - }); - return __promise; - }(); - } - -} // namespace margelo::nitro::reactnativedeviceutils diff --git a/native-modules/react-native-device-utils/nitrogen/generated/android/c++/JHybridReactNativeDeviceUtilsSpec.hpp b/native-modules/react-native-device-utils/nitrogen/generated/android/c++/JHybridReactNativeDeviceUtilsSpec.hpp deleted file mode 100644 index f925810..0000000 --- a/native-modules/react-native-device-utils/nitrogen/generated/android/c++/JHybridReactNativeDeviceUtilsSpec.hpp +++ /dev/null @@ -1,82 +0,0 @@ -/// -/// HybridReactNativeDeviceUtilsSpec.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#include -#include -#include "HybridReactNativeDeviceUtilsSpec.hpp" - - - - -namespace margelo::nitro::reactnativedeviceutils { - - using namespace facebook; - - class JHybridReactNativeDeviceUtilsSpec: public jni::HybridClass, - public virtual HybridReactNativeDeviceUtilsSpec { - public: - static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/reactnativedeviceutils/HybridReactNativeDeviceUtilsSpec;"; - static jni::local_ref initHybrid(jni::alias_ref jThis); - static void registerNatives(); - - protected: - // C++ constructor (called from Java via `initHybrid()`) - explicit JHybridReactNativeDeviceUtilsSpec(jni::alias_ref jThis) : - HybridObject(HybridReactNativeDeviceUtilsSpec::TAG), - HybridBase(jThis), - _javaPart(jni::make_global(jThis)) {} - - public: - ~JHybridReactNativeDeviceUtilsSpec() override { - // Hermes GC can destroy JS objects on a non-JNI Thread. - jni::ThreadScope::WithClassLoader([&] { _javaPart.reset(); }); - } - - public: - size_t getExternalMemorySize() noexcept override; - void dispose() noexcept override; - std::string toString() override; - - public: - inline const jni::global_ref& getJavaPart() const noexcept { - return _javaPart; - } - - public: - // Properties - - - public: - // Methods - void initEventListeners() override; - bool isDualScreenDevice() override; - bool isSpanning() override; - std::shared_ptr>> getWindowRects() override; - std::shared_ptr> getHingeBounds() override; - void changeBackgroundColor(double r, double g, double b, double a) override; - double addSpanningChangedListener(const std::function& callback) override; - void removeSpanningChangedListener(double id) override; - void setUserInterfaceStyle(UserInterfaceStyle style) override; - std::shared_ptr> getLaunchOptions() override; - std::shared_ptr> clearLaunchOptions() override; - std::shared_ptr> getDeviceToken() override; - std::shared_ptr> saveDeviceToken(const std::string& token) override; - std::shared_ptr> registerDeviceToken() override; - std::shared_ptr> getStartupTime() override; - void exitApp() override; - std::shared_ptr> getCurrentWebViewPackageInfo() override; - std::shared_ptr> isGooglePlayServicesAvailable() override; - - private: - friend HybridBase; - using HybridBase::HybridBase; - jni::global_ref _javaPart; - }; - -} // namespace margelo::nitro::reactnativedeviceutils diff --git a/native-modules/react-native-device-utils/nitrogen/generated/android/c++/JLaunchOptions.hpp b/native-modules/react-native-device-utils/nitrogen/generated/android/c++/JLaunchOptions.hpp deleted file mode 100644 index 9e013ee..0000000 --- a/native-modules/react-native-device-utils/nitrogen/generated/android/c++/JLaunchOptions.hpp +++ /dev/null @@ -1,62 +0,0 @@ -/// -/// JLaunchOptions.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#include -#include "LaunchOptions.hpp" - -#include -#include - -namespace margelo::nitro::reactnativedeviceutils { - - using namespace facebook; - - /** - * The C++ JNI bridge between the C++ struct "LaunchOptions" and the the Kotlin data class "LaunchOptions". - */ - struct JLaunchOptions final: public jni::JavaClass { - public: - static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/reactnativedeviceutils/LaunchOptions;"; - - public: - /** - * Convert this Java/Kotlin-based struct to the C++ struct LaunchOptions by copying all values to C++. - */ - [[maybe_unused]] - [[nodiscard]] - LaunchOptions toCpp() const { - static const auto clazz = javaClassStatic(); - static const auto fieldLaunchType = clazz->getField("launchType"); - jni::local_ref launchType = this->getFieldValue(fieldLaunchType); - static const auto fieldDeepLink = clazz->getField("deepLink"); - jni::local_ref deepLink = this->getFieldValue(fieldDeepLink); - return LaunchOptions( - launchType->toStdString(), - deepLink != nullptr ? std::make_optional(deepLink->toStdString()) : std::nullopt - ); - } - - public: - /** - * Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java. - */ - [[maybe_unused]] - static jni::local_ref fromCpp(const LaunchOptions& value) { - using JSignature = JLaunchOptions(jni::alias_ref, jni::alias_ref); - static const auto clazz = javaClassStatic(); - static const auto create = clazz->getStaticMethod("fromCpp"); - return create( - clazz, - jni::make_jstring(value.launchType), - value.deepLink.has_value() ? jni::make_jstring(value.deepLink.value()) : nullptr - ); - } - }; - -} // namespace margelo::nitro::reactnativedeviceutils diff --git a/native-modules/react-native-device-utils/nitrogen/generated/android/c++/JUserInterfaceStyle.hpp b/native-modules/react-native-device-utils/nitrogen/generated/android/c++/JUserInterfaceStyle.hpp deleted file mode 100644 index b8e4289..0000000 --- a/native-modules/react-native-device-utils/nitrogen/generated/android/c++/JUserInterfaceStyle.hpp +++ /dev/null @@ -1,62 +0,0 @@ -/// -/// JUserInterfaceStyle.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#include -#include "UserInterfaceStyle.hpp" - -namespace margelo::nitro::reactnativedeviceutils { - - using namespace facebook; - - /** - * The C++ JNI bridge between the C++ enum "UserInterfaceStyle" and the the Kotlin enum "UserInterfaceStyle". - */ - struct JUserInterfaceStyle final: public jni::JavaClass { - public: - static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/reactnativedeviceutils/UserInterfaceStyle;"; - - public: - /** - * Convert this Java/Kotlin-based enum to the C++ enum UserInterfaceStyle. - */ - [[maybe_unused]] - [[nodiscard]] - UserInterfaceStyle toCpp() const { - static const auto clazz = javaClassStatic(); - static const auto fieldOrdinal = clazz->getField("value"); - int ordinal = this->getFieldValue(fieldOrdinal); - return static_cast(ordinal); - } - - public: - /** - * Create a Java/Kotlin-based enum with the given C++ enum's value. - */ - [[maybe_unused]] - static jni::alias_ref fromCpp(UserInterfaceStyle value) { - static const auto clazz = javaClassStatic(); - static const auto fieldLIGHT = clazz->getStaticField("LIGHT"); - static const auto fieldDARK = clazz->getStaticField("DARK"); - static const auto fieldUNSPECIFIED = clazz->getStaticField("UNSPECIFIED"); - - switch (value) { - case UserInterfaceStyle::LIGHT: - return clazz->getStaticFieldValue(fieldLIGHT); - case UserInterfaceStyle::DARK: - return clazz->getStaticFieldValue(fieldDARK); - case UserInterfaceStyle::UNSPECIFIED: - return clazz->getStaticFieldValue(fieldUNSPECIFIED); - default: - std::string stringValue = std::to_string(static_cast(value)); - throw std::invalid_argument("Invalid enum value (" + stringValue + "!"); - } - } - }; - -} // namespace margelo::nitro::reactnativedeviceutils diff --git a/native-modules/react-native-device-utils/nitrogen/generated/android/c++/JWebViewPackageInfo.hpp b/native-modules/react-native-device-utils/nitrogen/generated/android/c++/JWebViewPackageInfo.hpp deleted file mode 100644 index 15084b8..0000000 --- a/native-modules/react-native-device-utils/nitrogen/generated/android/c++/JWebViewPackageInfo.hpp +++ /dev/null @@ -1,65 +0,0 @@ -/// -/// JWebViewPackageInfo.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#include -#include "WebViewPackageInfo.hpp" - -#include - -namespace margelo::nitro::reactnativedeviceutils { - - using namespace facebook; - - /** - * The C++ JNI bridge between the C++ struct "WebViewPackageInfo" and the the Kotlin data class "WebViewPackageInfo". - */ - struct JWebViewPackageInfo final: public jni::JavaClass { - public: - static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/reactnativedeviceutils/WebViewPackageInfo;"; - - public: - /** - * Convert this Java/Kotlin-based struct to the C++ struct WebViewPackageInfo by copying all values to C++. - */ - [[maybe_unused]] - [[nodiscard]] - WebViewPackageInfo toCpp() const { - static const auto clazz = javaClassStatic(); - static const auto fieldPackageName = clazz->getField("packageName"); - jni::local_ref packageName = this->getFieldValue(fieldPackageName); - static const auto fieldVersionName = clazz->getField("versionName"); - jni::local_ref versionName = this->getFieldValue(fieldVersionName); - static const auto fieldVersionCode = clazz->getField("versionCode"); - double versionCode = this->getFieldValue(fieldVersionCode); - return WebViewPackageInfo( - packageName->toStdString(), - versionName->toStdString(), - versionCode - ); - } - - public: - /** - * Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java. - */ - [[maybe_unused]] - static jni::local_ref fromCpp(const WebViewPackageInfo& value) { - using JSignature = JWebViewPackageInfo(jni::alias_ref, jni::alias_ref, double); - static const auto clazz = javaClassStatic(); - static const auto create = clazz->getStaticMethod("fromCpp"); - return create( - clazz, - jni::make_jstring(value.packageName), - jni::make_jstring(value.versionName), - value.versionCode - ); - } - }; - -} // namespace margelo::nitro::reactnativedeviceutils diff --git a/native-modules/react-native-device-utils/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativedeviceutils/DualScreenInfoRect.kt b/native-modules/react-native-device-utils/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativedeviceutils/DualScreenInfoRect.kt deleted file mode 100644 index 04cdaa7..0000000 --- a/native-modules/react-native-device-utils/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativedeviceutils/DualScreenInfoRect.kt +++ /dev/null @@ -1,47 +0,0 @@ -/// -/// DualScreenInfoRect.kt -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -package com.margelo.nitro.reactnativedeviceutils - -import androidx.annotation.Keep -import com.facebook.proguard.annotations.DoNotStrip - - -/** - * Represents the JavaScript object/struct "DualScreenInfoRect". - */ -@DoNotStrip -@Keep -data class DualScreenInfoRect( - @DoNotStrip - @Keep - val x: Double, - @DoNotStrip - @Keep - val y: Double, - @DoNotStrip - @Keep - val width: Double, - @DoNotStrip - @Keep - val height: Double -) { - /* primary constructor */ - - private companion object { - /** - * Constructor called from C++ - */ - @DoNotStrip - @Keep - @Suppress("unused") - @JvmStatic - private fun fromCpp(x: Double, y: Double, width: Double, height: Double): DualScreenInfoRect { - return DualScreenInfoRect(x, y, width, height) - } - } -} diff --git a/native-modules/react-native-device-utils/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativedeviceutils/Func_void_bool.kt b/native-modules/react-native-device-utils/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativedeviceutils/Func_void_bool.kt deleted file mode 100644 index 4f068ae..0000000 --- a/native-modules/react-native-device-utils/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativedeviceutils/Func_void_bool.kt +++ /dev/null @@ -1,80 +0,0 @@ -/// -/// Func_void_bool.kt -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -package com.margelo.nitro.reactnativedeviceutils - -import androidx.annotation.Keep -import com.facebook.jni.HybridData -import com.facebook.proguard.annotations.DoNotStrip -import dalvik.annotation.optimization.FastNative - - -/** - * Represents the JavaScript callback `(isSpanning: boolean) => void`. - * This can be either implemented in C++ (in which case it might be a callback coming from JS), - * or in Kotlin/Java (in which case it is a native callback). - */ -@DoNotStrip -@Keep -@Suppress("ClassName", "RedundantUnitReturnType") -fun interface Func_void_bool: (Boolean) -> Unit { - /** - * Call the given JS callback. - * @throws Throwable if the JS function itself throws an error, or if the JS function/runtime has already been deleted. - */ - @DoNotStrip - @Keep - override fun invoke(isSpanning: Boolean): Unit -} - -/** - * Represents the JavaScript callback `(isSpanning: boolean) => void`. - * This is implemented in C++, via a `std::function<...>`. - * The callback might be coming from JS. - */ -@DoNotStrip -@Keep -@Suppress( - "KotlinJniMissingFunction", "unused", - "RedundantSuppression", "RedundantUnitReturnType", "FunctionName", - "ConvertSecondaryConstructorToPrimary", "ClassName", "LocalVariableName", -) -class Func_void_bool_cxx: Func_void_bool { - @DoNotStrip - @Keep - private val mHybridData: HybridData - - @DoNotStrip - @Keep - private constructor(hybridData: HybridData) { - mHybridData = hybridData - } - - @DoNotStrip - @Keep - override fun invoke(isSpanning: Boolean): Unit - = invoke_cxx(isSpanning) - - @FastNative - private external fun invoke_cxx(isSpanning: Boolean): Unit -} - -/** - * Represents the JavaScript callback `(isSpanning: boolean) => void`. - * This is implemented in Java/Kotlin, via a `(Boolean) -> Unit`. - * The callback is always coming from native. - */ -@DoNotStrip -@Keep -@Suppress("ClassName", "RedundantUnitReturnType", "unused") -class Func_void_bool_java(private val function: (Boolean) -> Unit): Func_void_bool { - @DoNotStrip - @Keep - override fun invoke(isSpanning: Boolean): Unit { - return this.function(isSpanning) - } -} diff --git a/native-modules/react-native-device-utils/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativedeviceutils/GooglePlayServicesStatus.kt b/native-modules/react-native-device-utils/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativedeviceutils/GooglePlayServicesStatus.kt deleted file mode 100644 index bd0ad79..0000000 --- a/native-modules/react-native-device-utils/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativedeviceutils/GooglePlayServicesStatus.kt +++ /dev/null @@ -1,41 +0,0 @@ -/// -/// GooglePlayServicesStatus.kt -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -package com.margelo.nitro.reactnativedeviceutils - -import androidx.annotation.Keep -import com.facebook.proguard.annotations.DoNotStrip - - -/** - * Represents the JavaScript object/struct "GooglePlayServicesStatus". - */ -@DoNotStrip -@Keep -data class GooglePlayServicesStatus( - @DoNotStrip - @Keep - val status: Double, - @DoNotStrip - @Keep - val isAvailable: Boolean -) { - /* primary constructor */ - - private companion object { - /** - * Constructor called from C++ - */ - @DoNotStrip - @Keep - @Suppress("unused") - @JvmStatic - private fun fromCpp(status: Double, isAvailable: Boolean): GooglePlayServicesStatus { - return GooglePlayServicesStatus(status, isAvailable) - } - } -} diff --git a/native-modules/react-native-device-utils/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativedeviceutils/HybridReactNativeDeviceUtilsSpec.kt b/native-modules/react-native-device-utils/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativedeviceutils/HybridReactNativeDeviceUtilsSpec.kt deleted file mode 100644 index 10ea603..0000000 --- a/native-modules/react-native-device-utils/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativedeviceutils/HybridReactNativeDeviceUtilsSpec.kt +++ /dev/null @@ -1,131 +0,0 @@ -/// -/// HybridReactNativeDeviceUtilsSpec.kt -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -package com.margelo.nitro.reactnativedeviceutils - -import androidx.annotation.Keep -import com.facebook.jni.HybridData -import com.facebook.proguard.annotations.DoNotStrip -import com.margelo.nitro.core.Promise -import com.margelo.nitro.core.HybridObject - -/** - * A Kotlin class representing the ReactNativeDeviceUtils HybridObject. - * Implement this abstract class to create Kotlin-based instances of ReactNativeDeviceUtils. - */ -@DoNotStrip -@Keep -@Suppress( - "KotlinJniMissingFunction", "unused", - "RedundantSuppression", "RedundantUnitReturnType", "SimpleRedundantLet", - "LocalVariableName", "PropertyName", "PrivatePropertyName", "FunctionName" -) -abstract class HybridReactNativeDeviceUtilsSpec: HybridObject() { - @DoNotStrip - private var mHybridData: HybridData = initHybrid() - - init { - super.updateNative(mHybridData) - } - - override fun updateNative(hybridData: HybridData) { - mHybridData = hybridData - super.updateNative(hybridData) - } - - // Default implementation of `HybridObject.toString()` - override fun toString(): String { - return "[HybridObject ReactNativeDeviceUtils]" - } - - // Properties - - - // Methods - @DoNotStrip - @Keep - abstract fun initEventListeners(): Unit - - @DoNotStrip - @Keep - abstract fun isDualScreenDevice(): Boolean - - @DoNotStrip - @Keep - abstract fun isSpanning(): Boolean - - @DoNotStrip - @Keep - abstract fun getWindowRects(): Promise> - - @DoNotStrip - @Keep - abstract fun getHingeBounds(): Promise - - @DoNotStrip - @Keep - abstract fun changeBackgroundColor(r: Double, g: Double, b: Double, a: Double): Unit - - abstract fun addSpanningChangedListener(callback: (isSpanning: Boolean) -> Unit): Double - - @DoNotStrip - @Keep - private fun addSpanningChangedListener_cxx(callback: Func_void_bool): Double { - val __result = addSpanningChangedListener(callback) - return __result - } - - @DoNotStrip - @Keep - abstract fun removeSpanningChangedListener(id: Double): Unit - - @DoNotStrip - @Keep - abstract fun setUserInterfaceStyle(style: UserInterfaceStyle): Unit - - @DoNotStrip - @Keep - abstract fun getLaunchOptions(): Promise - - @DoNotStrip - @Keep - abstract fun clearLaunchOptions(): Promise - - @DoNotStrip - @Keep - abstract fun getDeviceToken(): Promise - - @DoNotStrip - @Keep - abstract fun saveDeviceToken(token: String): Promise - - @DoNotStrip - @Keep - abstract fun registerDeviceToken(): Promise - - @DoNotStrip - @Keep - abstract fun getStartupTime(): Promise - - @DoNotStrip - @Keep - abstract fun exitApp(): Unit - - @DoNotStrip - @Keep - abstract fun getCurrentWebViewPackageInfo(): Promise - - @DoNotStrip - @Keep - abstract fun isGooglePlayServicesAvailable(): Promise - - private external fun initHybrid(): HybridData - - companion object { - protected const val TAG = "HybridReactNativeDeviceUtilsSpec" - } -} diff --git a/native-modules/react-native-device-utils/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativedeviceutils/LaunchOptions.kt b/native-modules/react-native-device-utils/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativedeviceutils/LaunchOptions.kt deleted file mode 100644 index 6e43867..0000000 --- a/native-modules/react-native-device-utils/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativedeviceutils/LaunchOptions.kt +++ /dev/null @@ -1,41 +0,0 @@ -/// -/// LaunchOptions.kt -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -package com.margelo.nitro.reactnativedeviceutils - -import androidx.annotation.Keep -import com.facebook.proguard.annotations.DoNotStrip - - -/** - * Represents the JavaScript object/struct "LaunchOptions". - */ -@DoNotStrip -@Keep -data class LaunchOptions( - @DoNotStrip - @Keep - val launchType: String, - @DoNotStrip - @Keep - val deepLink: String? -) { - /* primary constructor */ - - private companion object { - /** - * Constructor called from C++ - */ - @DoNotStrip - @Keep - @Suppress("unused") - @JvmStatic - private fun fromCpp(launchType: String, deepLink: String?): LaunchOptions { - return LaunchOptions(launchType, deepLink) - } - } -} diff --git a/native-modules/react-native-device-utils/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativedeviceutils/UserInterfaceStyle.kt b/native-modules/react-native-device-utils/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativedeviceutils/UserInterfaceStyle.kt deleted file mode 100644 index c4c0ce1..0000000 --- a/native-modules/react-native-device-utils/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativedeviceutils/UserInterfaceStyle.kt +++ /dev/null @@ -1,22 +0,0 @@ -/// -/// UserInterfaceStyle.kt -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -package com.margelo.nitro.reactnativedeviceutils - -import androidx.annotation.Keep -import com.facebook.proguard.annotations.DoNotStrip - -/** - * Represents the JavaScript enum/union "UserInterfaceStyle". - */ -@DoNotStrip -@Keep -enum class UserInterfaceStyle(@DoNotStrip @Keep val value: Int) { - LIGHT(0), - DARK(1), - UNSPECIFIED(2); -} diff --git a/native-modules/react-native-device-utils/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativedeviceutils/WebViewPackageInfo.kt b/native-modules/react-native-device-utils/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativedeviceutils/WebViewPackageInfo.kt deleted file mode 100644 index f961bc4..0000000 --- a/native-modules/react-native-device-utils/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativedeviceutils/WebViewPackageInfo.kt +++ /dev/null @@ -1,44 +0,0 @@ -/// -/// WebViewPackageInfo.kt -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -package com.margelo.nitro.reactnativedeviceutils - -import androidx.annotation.Keep -import com.facebook.proguard.annotations.DoNotStrip - - -/** - * Represents the JavaScript object/struct "WebViewPackageInfo". - */ -@DoNotStrip -@Keep -data class WebViewPackageInfo( - @DoNotStrip - @Keep - val packageName: String, - @DoNotStrip - @Keep - val versionName: String, - @DoNotStrip - @Keep - val versionCode: Double -) { - /* primary constructor */ - - private companion object { - /** - * Constructor called from C++ - */ - @DoNotStrip - @Keep - @Suppress("unused") - @JvmStatic - private fun fromCpp(packageName: String, versionName: String, versionCode: Double): WebViewPackageInfo { - return WebViewPackageInfo(packageName, versionName, versionCode) - } - } -} diff --git a/native-modules/react-native-device-utils/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativedeviceutils/reactnativedeviceutilsOnLoad.kt b/native-modules/react-native-device-utils/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativedeviceutils/reactnativedeviceutilsOnLoad.kt deleted file mode 100644 index 557e432..0000000 --- a/native-modules/react-native-device-utils/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativedeviceutils/reactnativedeviceutilsOnLoad.kt +++ /dev/null @@ -1,35 +0,0 @@ -/// -/// reactnativedeviceutilsOnLoad.kt -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -package com.margelo.nitro.reactnativedeviceutils - -import android.util.Log - -internal class reactnativedeviceutilsOnLoad { - companion object { - private const val TAG = "reactnativedeviceutilsOnLoad" - private var didLoad = false - /** - * Initializes the native part of "reactnativedeviceutils". - * This method is idempotent and can be called more than once. - */ - @JvmStatic - fun initializeNative() { - if (didLoad) return - try { - Log.i(TAG, "Loading reactnativedeviceutils C++ library...") - System.loadLibrary("reactnativedeviceutils") - Log.i(TAG, "Successfully loaded reactnativedeviceutils C++ library!") - didLoad = true - } catch (e: Error) { - Log.e(TAG, "Failed to load reactnativedeviceutils C++ library! Is it properly installed and linked? " + - "Is the name correct? (see `CMakeLists.txt`, at `add_library(...)`)", e) - throw e - } - } - } -} diff --git a/native-modules/react-native-device-utils/nitrogen/generated/android/reactnativedeviceutils+autolinking.cmake b/native-modules/react-native-device-utils/nitrogen/generated/android/reactnativedeviceutils+autolinking.cmake deleted file mode 100644 index 9838bcf..0000000 --- a/native-modules/react-native-device-utils/nitrogen/generated/android/reactnativedeviceutils+autolinking.cmake +++ /dev/null @@ -1,81 +0,0 @@ -# -# reactnativedeviceutils+autolinking.cmake -# This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -# https://github.com/mrousavy/nitro -# Copyright © 2026 Marc Rousavy @ Margelo -# - -# This is a CMake file that adds all files generated by Nitrogen -# to the current CMake project. -# -# To use it, add this to your CMakeLists.txt: -# ```cmake -# include(${CMAKE_SOURCE_DIR}/../nitrogen/generated/android/reactnativedeviceutils+autolinking.cmake) -# ``` - -# Define a flag to check if we are building properly -add_definitions(-DBUILDING_REACTNATIVEDEVICEUTILS_WITH_GENERATED_CMAKE_PROJECT) - -# Enable Raw Props parsing in react-native (for Nitro Views) -add_definitions(-DRN_SERIALIZABLE_STATE) - -# Add all headers that were generated by Nitrogen -include_directories( - "../nitrogen/generated/shared/c++" - "../nitrogen/generated/android/c++" - "../nitrogen/generated/android/" -) - -# Add all .cpp sources that were generated by Nitrogen -target_sources( - # CMake project name (Android C++ library name) - reactnativedeviceutils PRIVATE - # Autolinking Setup - ../nitrogen/generated/android/reactnativedeviceutilsOnLoad.cpp - # Shared Nitrogen C++ sources - ../nitrogen/generated/shared/c++/HybridReactNativeDeviceUtilsSpec.cpp - # Android-specific Nitrogen C++ sources - ../nitrogen/generated/android/c++/JHybridReactNativeDeviceUtilsSpec.cpp -) - -# From node_modules/react-native/ReactAndroid/cmake-utils/folly-flags.cmake -# Used in node_modules/react-native/ReactAndroid/cmake-utils/ReactNative-application.cmake -target_compile_definitions( - reactnativedeviceutils PRIVATE - -DFOLLY_NO_CONFIG=1 - -DFOLLY_HAVE_CLOCK_GETTIME=1 - -DFOLLY_USE_LIBCPP=1 - -DFOLLY_CFG_NO_COROUTINES=1 - -DFOLLY_MOBILE=1 - -DFOLLY_HAVE_RECVMMSG=1 - -DFOLLY_HAVE_PTHREAD=1 - # Once we target android-23 above, we can comment - # the following line. NDK uses GNU style stderror_r() after API 23. - -DFOLLY_HAVE_XSI_STRERROR_R=1 -) - -# Add all libraries required by the generated specs -find_package(fbjni REQUIRED) # <-- Used for communication between Java <-> C++ -find_package(ReactAndroid REQUIRED) # <-- Used to set up React Native bindings (e.g. CallInvoker/TurboModule) -find_package(react-native-nitro-modules REQUIRED) # <-- Used to create all HybridObjects and use the Nitro core library - -# Link all libraries together -target_link_libraries( - reactnativedeviceutils - fbjni::fbjni # <-- Facebook C++ JNI helpers - ReactAndroid::jsi # <-- RN: JSI - react-native-nitro-modules::NitroModules # <-- NitroModules Core :) -) - -# Link react-native (different prefab between RN 0.75 and RN 0.76) -if(ReactAndroid_VERSION_MINOR GREATER_EQUAL 76) - target_link_libraries( - reactnativedeviceutils - ReactAndroid::reactnative # <-- RN: Native Modules umbrella prefab - ) -else() - target_link_libraries( - reactnativedeviceutils - ReactAndroid::react_nativemodule_core # <-- RN: TurboModules Core - ) -endif() diff --git a/native-modules/react-native-device-utils/nitrogen/generated/android/reactnativedeviceutils+autolinking.gradle b/native-modules/react-native-device-utils/nitrogen/generated/android/reactnativedeviceutils+autolinking.gradle deleted file mode 100644 index f469a0e..0000000 --- a/native-modules/react-native-device-utils/nitrogen/generated/android/reactnativedeviceutils+autolinking.gradle +++ /dev/null @@ -1,27 +0,0 @@ -/// -/// reactnativedeviceutils+autolinking.gradle -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -/// This is a Gradle file that adds all files generated by Nitrogen -/// to the current Gradle project. -/// -/// To use it, add this to your build.gradle: -/// ```gradle -/// apply from: '../nitrogen/generated/android/reactnativedeviceutils+autolinking.gradle' -/// ``` - -logger.warn("[NitroModules] 🔥 reactnativedeviceutils is boosted by nitro!") - -android { - sourceSets { - main { - java.srcDirs += [ - // Nitrogen files - "${project.projectDir}/../nitrogen/generated/android/kotlin" - ] - } - } -} diff --git a/native-modules/react-native-device-utils/nitrogen/generated/android/reactnativedeviceutilsOnLoad.cpp b/native-modules/react-native-device-utils/nitrogen/generated/android/reactnativedeviceutilsOnLoad.cpp deleted file mode 100644 index 1198a98..0000000 --- a/native-modules/react-native-device-utils/nitrogen/generated/android/reactnativedeviceutilsOnLoad.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/// -/// reactnativedeviceutilsOnLoad.cpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#ifndef BUILDING_REACTNATIVEDEVICEUTILS_WITH_GENERATED_CMAKE_PROJECT -#error reactnativedeviceutilsOnLoad.cpp is not being built with the autogenerated CMakeLists.txt project. Is a different CMakeLists.txt building this? -#endif - -#include "reactnativedeviceutilsOnLoad.hpp" - -#include -#include -#include - -#include "JHybridReactNativeDeviceUtilsSpec.hpp" -#include "JFunc_void_bool.hpp" -#include - -namespace margelo::nitro::reactnativedeviceutils { - -int initialize(JavaVM* vm) { - using namespace margelo::nitro; - using namespace margelo::nitro::reactnativedeviceutils; - using namespace facebook; - - return facebook::jni::initialize(vm, [] { - // Register native JNI methods - margelo::nitro::reactnativedeviceutils::JHybridReactNativeDeviceUtilsSpec::registerNatives(); - margelo::nitro::reactnativedeviceutils::JFunc_void_bool_cxx::registerNatives(); - - // Register Nitro Hybrid Objects - HybridObjectRegistry::registerHybridObjectConstructor( - "ReactNativeDeviceUtils", - []() -> std::shared_ptr { - static DefaultConstructableObject object("com/margelo/nitro/reactnativedeviceutils/ReactNativeDeviceUtils"); - auto instance = object.create(); - return instance->cthis()->shared(); - } - ); - }); -} - -} // namespace margelo::nitro::reactnativedeviceutils diff --git a/native-modules/react-native-device-utils/nitrogen/generated/android/reactnativedeviceutilsOnLoad.hpp b/native-modules/react-native-device-utils/nitrogen/generated/android/reactnativedeviceutilsOnLoad.hpp deleted file mode 100644 index 6f48df4..0000000 --- a/native-modules/react-native-device-utils/nitrogen/generated/android/reactnativedeviceutilsOnLoad.hpp +++ /dev/null @@ -1,25 +0,0 @@ -/// -/// reactnativedeviceutilsOnLoad.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#include -#include - -namespace margelo::nitro::reactnativedeviceutils { - - /** - * Initializes the native (C++) part of reactnativedeviceutils, and autolinks all Hybrid Objects. - * Call this in your `JNI_OnLoad` function (probably inside `cpp-adapter.cpp`). - * Example: - * ```cpp (cpp-adapter.cpp) - * JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void*) { - * return margelo::nitro::reactnativedeviceutils::initialize(vm); - * } - * ``` - */ - int initialize(JavaVM* vm); - -} // namespace margelo::nitro::reactnativedeviceutils diff --git a/native-modules/react-native-device-utils/nitrogen/generated/ios/ReactNativeDeviceUtils+autolinking.rb b/native-modules/react-native-device-utils/nitrogen/generated/ios/ReactNativeDeviceUtils+autolinking.rb deleted file mode 100644 index a64e26f..0000000 --- a/native-modules/react-native-device-utils/nitrogen/generated/ios/ReactNativeDeviceUtils+autolinking.rb +++ /dev/null @@ -1,60 +0,0 @@ -# -# ReactNativeDeviceUtils+autolinking.rb -# This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -# https://github.com/mrousavy/nitro -# Copyright © 2026 Marc Rousavy @ Margelo -# - -# This is a Ruby script that adds all files generated by Nitrogen -# to the given podspec. -# -# To use it, add this to your .podspec: -# ```ruby -# Pod::Spec.new do |spec| -# # ... -# -# # Add all files generated by Nitrogen -# load 'nitrogen/generated/ios/ReactNativeDeviceUtils+autolinking.rb' -# add_nitrogen_files(spec) -# end -# ``` - -def add_nitrogen_files(spec) - Pod::UI.puts "[NitroModules] 🔥 ReactNativeDeviceUtils is boosted by nitro!" - - spec.dependency "NitroModules" - - current_source_files = Array(spec.attributes_hash['source_files']) - spec.source_files = current_source_files + [ - # Generated cross-platform specs - "nitrogen/generated/shared/**/*.{h,hpp,c,cpp,swift}", - # Generated bridges for the cross-platform specs - "nitrogen/generated/ios/**/*.{h,hpp,c,cpp,mm,swift}", - ] - - current_public_header_files = Array(spec.attributes_hash['public_header_files']) - spec.public_header_files = current_public_header_files + [ - # Generated specs - "nitrogen/generated/shared/**/*.{h,hpp}", - # Swift to C++ bridging helpers - "nitrogen/generated/ios/ReactNativeDeviceUtils-Swift-Cxx-Bridge.hpp" - ] - - current_private_header_files = Array(spec.attributes_hash['private_header_files']) - spec.private_header_files = current_private_header_files + [ - # iOS specific specs - "nitrogen/generated/ios/c++/**/*.{h,hpp}", - # Views are framework-specific and should be private - "nitrogen/generated/shared/**/views/**/*" - ] - - current_pod_target_xcconfig = spec.attributes_hash['pod_target_xcconfig'] || {} - spec.pod_target_xcconfig = current_pod_target_xcconfig.merge({ - # Use C++ 20 - "CLANG_CXX_LANGUAGE_STANDARD" => "c++20", - # Enables C++ <-> Swift interop (by default it's only C) - "SWIFT_OBJC_INTEROP_MODE" => "objcxx", - # Enables stricter modular headers - "DEFINES_MODULE" => "YES", - }) -end diff --git a/native-modules/react-native-device-utils/nitrogen/generated/ios/ReactNativeDeviceUtils-Swift-Cxx-Bridge.cpp b/native-modules/react-native-device-utils/nitrogen/generated/ios/ReactNativeDeviceUtils-Swift-Cxx-Bridge.cpp deleted file mode 100644 index 1ec81f9..0000000 --- a/native-modules/react-native-device-utils/nitrogen/generated/ios/ReactNativeDeviceUtils-Swift-Cxx-Bridge.cpp +++ /dev/null @@ -1,113 +0,0 @@ -/// -/// ReactNativeDeviceUtils-Swift-Cxx-Bridge.cpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#include "ReactNativeDeviceUtils-Swift-Cxx-Bridge.hpp" - -// Include C++ implementation defined types -#include "HybridReactNativeDeviceUtilsSpecSwift.hpp" -#include "ReactNativeDeviceUtils-Swift-Cxx-Umbrella.hpp" -#include - -namespace margelo::nitro::reactnativedeviceutils::bridge::swift { - - // pragma MARK: std::function& /* result */)> - Func_void_std__vector_DualScreenInfoRect_ create_Func_void_std__vector_DualScreenInfoRect_(void* NON_NULL swiftClosureWrapper) noexcept { - auto swiftClosure = ReactNativeDeviceUtils::Func_void_std__vector_DualScreenInfoRect_::fromUnsafe(swiftClosureWrapper); - return [swiftClosure = std::move(swiftClosure)](const std::vector& result) mutable -> void { - swiftClosure.call(result); - }; - } - - // pragma MARK: std::function - Func_void_std__exception_ptr create_Func_void_std__exception_ptr(void* NON_NULL swiftClosureWrapper) noexcept { - auto swiftClosure = ReactNativeDeviceUtils::Func_void_std__exception_ptr::fromUnsafe(swiftClosureWrapper); - return [swiftClosure = std::move(swiftClosure)](const std::exception_ptr& error) mutable -> void { - swiftClosure.call(error); - }; - } - - // pragma MARK: std::function - Func_void_DualScreenInfoRect create_Func_void_DualScreenInfoRect(void* NON_NULL swiftClosureWrapper) noexcept { - auto swiftClosure = ReactNativeDeviceUtils::Func_void_DualScreenInfoRect::fromUnsafe(swiftClosureWrapper); - return [swiftClosure = std::move(swiftClosure)](const DualScreenInfoRect& result) mutable -> void { - swiftClosure.call(result); - }; - } - - // pragma MARK: std::function - Func_void_bool create_Func_void_bool(void* NON_NULL swiftClosureWrapper) noexcept { - auto swiftClosure = ReactNativeDeviceUtils::Func_void_bool::fromUnsafe(swiftClosureWrapper); - return [swiftClosure = std::move(swiftClosure)](bool isSpanning) mutable -> void { - swiftClosure.call(isSpanning); - }; - } - - // pragma MARK: std::function - Func_void_LaunchOptions create_Func_void_LaunchOptions(void* NON_NULL swiftClosureWrapper) noexcept { - auto swiftClosure = ReactNativeDeviceUtils::Func_void_LaunchOptions::fromUnsafe(swiftClosureWrapper); - return [swiftClosure = std::move(swiftClosure)](const LaunchOptions& result) mutable -> void { - swiftClosure.call(result); - }; - } - - // pragma MARK: std::function - Func_void_std__string create_Func_void_std__string(void* NON_NULL swiftClosureWrapper) noexcept { - auto swiftClosure = ReactNativeDeviceUtils::Func_void_std__string::fromUnsafe(swiftClosureWrapper); - return [swiftClosure = std::move(swiftClosure)](const std::string& result) mutable -> void { - swiftClosure.call(result); - }; - } - - // pragma MARK: std::function - Func_void create_Func_void(void* NON_NULL swiftClosureWrapper) noexcept { - auto swiftClosure = ReactNativeDeviceUtils::Func_void::fromUnsafe(swiftClosureWrapper); - return [swiftClosure = std::move(swiftClosure)]() mutable -> void { - swiftClosure.call(); - }; - } - - // pragma MARK: std::function - Func_void_double create_Func_void_double(void* NON_NULL swiftClosureWrapper) noexcept { - auto swiftClosure = ReactNativeDeviceUtils::Func_void_double::fromUnsafe(swiftClosureWrapper); - return [swiftClosure = std::move(swiftClosure)](double result) mutable -> void { - swiftClosure.call(result); - }; - } - - // pragma MARK: std::function - Func_void_WebViewPackageInfo create_Func_void_WebViewPackageInfo(void* NON_NULL swiftClosureWrapper) noexcept { - auto swiftClosure = ReactNativeDeviceUtils::Func_void_WebViewPackageInfo::fromUnsafe(swiftClosureWrapper); - return [swiftClosure = std::move(swiftClosure)](const WebViewPackageInfo& result) mutable -> void { - swiftClosure.call(result); - }; - } - - // pragma MARK: std::function - Func_void_GooglePlayServicesStatus create_Func_void_GooglePlayServicesStatus(void* NON_NULL swiftClosureWrapper) noexcept { - auto swiftClosure = ReactNativeDeviceUtils::Func_void_GooglePlayServicesStatus::fromUnsafe(swiftClosureWrapper); - return [swiftClosure = std::move(swiftClosure)](const GooglePlayServicesStatus& result) mutable -> void { - swiftClosure.call(result); - }; - } - - // pragma MARK: std::shared_ptr - std::shared_ptr create_std__shared_ptr_HybridReactNativeDeviceUtilsSpec_(void* NON_NULL swiftUnsafePointer) noexcept { - ReactNativeDeviceUtils::HybridReactNativeDeviceUtilsSpec_cxx swiftPart = ReactNativeDeviceUtils::HybridReactNativeDeviceUtilsSpec_cxx::fromUnsafe(swiftUnsafePointer); - return std::make_shared(swiftPart); - } - void* NON_NULL get_std__shared_ptr_HybridReactNativeDeviceUtilsSpec_(std__shared_ptr_HybridReactNativeDeviceUtilsSpec_ cppType) { - std::shared_ptr swiftWrapper = std::dynamic_pointer_cast(cppType); - #ifdef NITRO_DEBUG - if (swiftWrapper == nullptr) [[unlikely]] { - throw std::runtime_error("Class \"HybridReactNativeDeviceUtilsSpec\" is not implemented in Swift!"); - } - #endif - ReactNativeDeviceUtils::HybridReactNativeDeviceUtilsSpec_cxx& swiftPart = swiftWrapper->getSwiftPart(); - return swiftPart.toUnsafe(); - } - -} // namespace margelo::nitro::reactnativedeviceutils::bridge::swift diff --git a/native-modules/react-native-device-utils/nitrogen/generated/ios/ReactNativeDeviceUtils-Swift-Cxx-Bridge.hpp b/native-modules/react-native-device-utils/nitrogen/generated/ios/ReactNativeDeviceUtils-Swift-Cxx-Bridge.hpp deleted file mode 100644 index 697c0e4..0000000 --- a/native-modules/react-native-device-utils/nitrogen/generated/ios/ReactNativeDeviceUtils-Swift-Cxx-Bridge.hpp +++ /dev/null @@ -1,522 +0,0 @@ -/// -/// ReactNativeDeviceUtils-Swift-Cxx-Bridge.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -// Forward declarations of C++ defined types -// Forward declaration of `DualScreenInfoRect` to properly resolve imports. -namespace margelo::nitro::reactnativedeviceutils { struct DualScreenInfoRect; } -// Forward declaration of `GooglePlayServicesStatus` to properly resolve imports. -namespace margelo::nitro::reactnativedeviceutils { struct GooglePlayServicesStatus; } -// Forward declaration of `HybridReactNativeDeviceUtilsSpec` to properly resolve imports. -namespace margelo::nitro::reactnativedeviceutils { class HybridReactNativeDeviceUtilsSpec; } -// Forward declaration of `LaunchOptions` to properly resolve imports. -namespace margelo::nitro::reactnativedeviceutils { struct LaunchOptions; } -// Forward declaration of `WebViewPackageInfo` to properly resolve imports. -namespace margelo::nitro::reactnativedeviceutils { struct WebViewPackageInfo; } - -// Forward declarations of Swift defined types -// Forward declaration of `HybridReactNativeDeviceUtilsSpec_cxx` to properly resolve imports. -namespace ReactNativeDeviceUtils { class HybridReactNativeDeviceUtilsSpec_cxx; } - -// Include C++ defined types -#include "DualScreenInfoRect.hpp" -#include "GooglePlayServicesStatus.hpp" -#include "HybridReactNativeDeviceUtilsSpec.hpp" -#include "LaunchOptions.hpp" -#include "WebViewPackageInfo.hpp" -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/** - * Contains specialized versions of C++ templated types so they can be accessed from Swift, - * as well as helper functions to interact with those C++ types from Swift. - */ -namespace margelo::nitro::reactnativedeviceutils::bridge::swift { - - // pragma MARK: std::vector - /** - * Specialized version of `std::vector`. - */ - using std__vector_DualScreenInfoRect_ = std::vector; - inline std::vector create_std__vector_DualScreenInfoRect_(size_t size) noexcept { - std::vector vector; - vector.reserve(size); - return vector; - } - - // pragma MARK: std::shared_ptr>> - /** - * Specialized version of `std::shared_ptr>>`. - */ - using std__shared_ptr_Promise_std__vector_DualScreenInfoRect___ = std::shared_ptr>>; - inline std::shared_ptr>> create_std__shared_ptr_Promise_std__vector_DualScreenInfoRect___() noexcept { - return Promise>::create(); - } - inline PromiseHolder> wrap_std__shared_ptr_Promise_std__vector_DualScreenInfoRect___(std::shared_ptr>> promise) noexcept { - return PromiseHolder>(std::move(promise)); - } - - // pragma MARK: std::function& /* result */)> - /** - * Specialized version of `std::function&)>`. - */ - using Func_void_std__vector_DualScreenInfoRect_ = std::function& /* result */)>; - /** - * Wrapper class for a `std::function& / * result * /)>`, this can be used from Swift. - */ - class Func_void_std__vector_DualScreenInfoRect__Wrapper final { - public: - explicit Func_void_std__vector_DualScreenInfoRect__Wrapper(std::function& /* result */)>&& func): _function(std::make_unique& /* result */)>>(std::move(func))) {} - inline void call(std::vector result) const noexcept { - _function->operator()(result); - } - private: - std::unique_ptr& /* result */)>> _function; - } SWIFT_NONCOPYABLE; - Func_void_std__vector_DualScreenInfoRect_ create_Func_void_std__vector_DualScreenInfoRect_(void* NON_NULL swiftClosureWrapper) noexcept; - inline Func_void_std__vector_DualScreenInfoRect__Wrapper wrap_Func_void_std__vector_DualScreenInfoRect_(Func_void_std__vector_DualScreenInfoRect_ value) noexcept { - return Func_void_std__vector_DualScreenInfoRect__Wrapper(std::move(value)); - } - - // pragma MARK: std::function - /** - * Specialized version of `std::function`. - */ - using Func_void_std__exception_ptr = std::function; - /** - * Wrapper class for a `std::function`, this can be used from Swift. - */ - class Func_void_std__exception_ptr_Wrapper final { - public: - explicit Func_void_std__exception_ptr_Wrapper(std::function&& func): _function(std::make_unique>(std::move(func))) {} - inline void call(std::exception_ptr error) const noexcept { - _function->operator()(error); - } - private: - std::unique_ptr> _function; - } SWIFT_NONCOPYABLE; - Func_void_std__exception_ptr create_Func_void_std__exception_ptr(void* NON_NULL swiftClosureWrapper) noexcept; - inline Func_void_std__exception_ptr_Wrapper wrap_Func_void_std__exception_ptr(Func_void_std__exception_ptr value) noexcept { - return Func_void_std__exception_ptr_Wrapper(std::move(value)); - } - - // pragma MARK: std::shared_ptr> - /** - * Specialized version of `std::shared_ptr>`. - */ - using std__shared_ptr_Promise_DualScreenInfoRect__ = std::shared_ptr>; - inline std::shared_ptr> create_std__shared_ptr_Promise_DualScreenInfoRect__() noexcept { - return Promise::create(); - } - inline PromiseHolder wrap_std__shared_ptr_Promise_DualScreenInfoRect__(std::shared_ptr> promise) noexcept { - return PromiseHolder(std::move(promise)); - } - - // pragma MARK: std::function - /** - * Specialized version of `std::function`. - */ - using Func_void_DualScreenInfoRect = std::function; - /** - * Wrapper class for a `std::function`, this can be used from Swift. - */ - class Func_void_DualScreenInfoRect_Wrapper final { - public: - explicit Func_void_DualScreenInfoRect_Wrapper(std::function&& func): _function(std::make_unique>(std::move(func))) {} - inline void call(DualScreenInfoRect result) const noexcept { - _function->operator()(result); - } - private: - std::unique_ptr> _function; - } SWIFT_NONCOPYABLE; - Func_void_DualScreenInfoRect create_Func_void_DualScreenInfoRect(void* NON_NULL swiftClosureWrapper) noexcept; - inline Func_void_DualScreenInfoRect_Wrapper wrap_Func_void_DualScreenInfoRect(Func_void_DualScreenInfoRect value) noexcept { - return Func_void_DualScreenInfoRect_Wrapper(std::move(value)); - } - - // pragma MARK: std::function - /** - * Specialized version of `std::function`. - */ - using Func_void_bool = std::function; - /** - * Wrapper class for a `std::function`, this can be used from Swift. - */ - class Func_void_bool_Wrapper final { - public: - explicit Func_void_bool_Wrapper(std::function&& func): _function(std::make_unique>(std::move(func))) {} - inline void call(bool isSpanning) const noexcept { - _function->operator()(isSpanning); - } - private: - std::unique_ptr> _function; - } SWIFT_NONCOPYABLE; - Func_void_bool create_Func_void_bool(void* NON_NULL swiftClosureWrapper) noexcept; - inline Func_void_bool_Wrapper wrap_Func_void_bool(Func_void_bool value) noexcept { - return Func_void_bool_Wrapper(std::move(value)); - } - - // pragma MARK: std::optional - /** - * Specialized version of `std::optional`. - */ - using std__optional_std__string_ = std::optional; - inline std::optional create_std__optional_std__string_(const std::string& value) noexcept { - return std::optional(value); - } - inline bool has_value_std__optional_std__string_(const std::optional& optional) noexcept { - return optional.has_value(); - } - inline std::string get_std__optional_std__string_(const std::optional& optional) noexcept { - return *optional; - } - - // pragma MARK: std::shared_ptr> - /** - * Specialized version of `std::shared_ptr>`. - */ - using std__shared_ptr_Promise_LaunchOptions__ = std::shared_ptr>; - inline std::shared_ptr> create_std__shared_ptr_Promise_LaunchOptions__() noexcept { - return Promise::create(); - } - inline PromiseHolder wrap_std__shared_ptr_Promise_LaunchOptions__(std::shared_ptr> promise) noexcept { - return PromiseHolder(std::move(promise)); - } - - // pragma MARK: std::function - /** - * Specialized version of `std::function`. - */ - using Func_void_LaunchOptions = std::function; - /** - * Wrapper class for a `std::function`, this can be used from Swift. - */ - class Func_void_LaunchOptions_Wrapper final { - public: - explicit Func_void_LaunchOptions_Wrapper(std::function&& func): _function(std::make_unique>(std::move(func))) {} - inline void call(LaunchOptions result) const noexcept { - _function->operator()(result); - } - private: - std::unique_ptr> _function; - } SWIFT_NONCOPYABLE; - Func_void_LaunchOptions create_Func_void_LaunchOptions(void* NON_NULL swiftClosureWrapper) noexcept; - inline Func_void_LaunchOptions_Wrapper wrap_Func_void_LaunchOptions(Func_void_LaunchOptions value) noexcept { - return Func_void_LaunchOptions_Wrapper(std::move(value)); - } - - // pragma MARK: std::shared_ptr> - /** - * Specialized version of `std::shared_ptr>`. - */ - using std__shared_ptr_Promise_bool__ = std::shared_ptr>; - inline std::shared_ptr> create_std__shared_ptr_Promise_bool__() noexcept { - return Promise::create(); - } - inline PromiseHolder wrap_std__shared_ptr_Promise_bool__(std::shared_ptr> promise) noexcept { - return PromiseHolder(std::move(promise)); - } - - // pragma MARK: std::shared_ptr> - /** - * Specialized version of `std::shared_ptr>`. - */ - using std__shared_ptr_Promise_std__string__ = std::shared_ptr>; - inline std::shared_ptr> create_std__shared_ptr_Promise_std__string__() noexcept { - return Promise::create(); - } - inline PromiseHolder wrap_std__shared_ptr_Promise_std__string__(std::shared_ptr> promise) noexcept { - return PromiseHolder(std::move(promise)); - } - - // pragma MARK: std::function - /** - * Specialized version of `std::function`. - */ - using Func_void_std__string = std::function; - /** - * Wrapper class for a `std::function`, this can be used from Swift. - */ - class Func_void_std__string_Wrapper final { - public: - explicit Func_void_std__string_Wrapper(std::function&& func): _function(std::make_unique>(std::move(func))) {} - inline void call(std::string result) const noexcept { - _function->operator()(result); - } - private: - std::unique_ptr> _function; - } SWIFT_NONCOPYABLE; - Func_void_std__string create_Func_void_std__string(void* NON_NULL swiftClosureWrapper) noexcept; - inline Func_void_std__string_Wrapper wrap_Func_void_std__string(Func_void_std__string value) noexcept { - return Func_void_std__string_Wrapper(std::move(value)); - } - - // pragma MARK: std::shared_ptr> - /** - * Specialized version of `std::shared_ptr>`. - */ - using std__shared_ptr_Promise_void__ = std::shared_ptr>; - inline std::shared_ptr> create_std__shared_ptr_Promise_void__() noexcept { - return Promise::create(); - } - inline PromiseHolder wrap_std__shared_ptr_Promise_void__(std::shared_ptr> promise) noexcept { - return PromiseHolder(std::move(promise)); - } - - // pragma MARK: std::function - /** - * Specialized version of `std::function`. - */ - using Func_void = std::function; - /** - * Wrapper class for a `std::function`, this can be used from Swift. - */ - class Func_void_Wrapper final { - public: - explicit Func_void_Wrapper(std::function&& func): _function(std::make_unique>(std::move(func))) {} - inline void call() const noexcept { - _function->operator()(); - } - private: - std::unique_ptr> _function; - } SWIFT_NONCOPYABLE; - Func_void create_Func_void(void* NON_NULL swiftClosureWrapper) noexcept; - inline Func_void_Wrapper wrap_Func_void(Func_void value) noexcept { - return Func_void_Wrapper(std::move(value)); - } - - // pragma MARK: std::shared_ptr> - /** - * Specialized version of `std::shared_ptr>`. - */ - using std__shared_ptr_Promise_double__ = std::shared_ptr>; - inline std::shared_ptr> create_std__shared_ptr_Promise_double__() noexcept { - return Promise::create(); - } - inline PromiseHolder wrap_std__shared_ptr_Promise_double__(std::shared_ptr> promise) noexcept { - return PromiseHolder(std::move(promise)); - } - - // pragma MARK: std::function - /** - * Specialized version of `std::function`. - */ - using Func_void_double = std::function; - /** - * Wrapper class for a `std::function`, this can be used from Swift. - */ - class Func_void_double_Wrapper final { - public: - explicit Func_void_double_Wrapper(std::function&& func): _function(std::make_unique>(std::move(func))) {} - inline void call(double result) const noexcept { - _function->operator()(result); - } - private: - std::unique_ptr> _function; - } SWIFT_NONCOPYABLE; - Func_void_double create_Func_void_double(void* NON_NULL swiftClosureWrapper) noexcept; - inline Func_void_double_Wrapper wrap_Func_void_double(Func_void_double value) noexcept { - return Func_void_double_Wrapper(std::move(value)); - } - - // pragma MARK: std::shared_ptr> - /** - * Specialized version of `std::shared_ptr>`. - */ - using std__shared_ptr_Promise_WebViewPackageInfo__ = std::shared_ptr>; - inline std::shared_ptr> create_std__shared_ptr_Promise_WebViewPackageInfo__() noexcept { - return Promise::create(); - } - inline PromiseHolder wrap_std__shared_ptr_Promise_WebViewPackageInfo__(std::shared_ptr> promise) noexcept { - return PromiseHolder(std::move(promise)); - } - - // pragma MARK: std::function - /** - * Specialized version of `std::function`. - */ - using Func_void_WebViewPackageInfo = std::function; - /** - * Wrapper class for a `std::function`, this can be used from Swift. - */ - class Func_void_WebViewPackageInfo_Wrapper final { - public: - explicit Func_void_WebViewPackageInfo_Wrapper(std::function&& func): _function(std::make_unique>(std::move(func))) {} - inline void call(WebViewPackageInfo result) const noexcept { - _function->operator()(result); - } - private: - std::unique_ptr> _function; - } SWIFT_NONCOPYABLE; - Func_void_WebViewPackageInfo create_Func_void_WebViewPackageInfo(void* NON_NULL swiftClosureWrapper) noexcept; - inline Func_void_WebViewPackageInfo_Wrapper wrap_Func_void_WebViewPackageInfo(Func_void_WebViewPackageInfo value) noexcept { - return Func_void_WebViewPackageInfo_Wrapper(std::move(value)); - } - - // pragma MARK: std::shared_ptr> - /** - * Specialized version of `std::shared_ptr>`. - */ - using std__shared_ptr_Promise_GooglePlayServicesStatus__ = std::shared_ptr>; - inline std::shared_ptr> create_std__shared_ptr_Promise_GooglePlayServicesStatus__() noexcept { - return Promise::create(); - } - inline PromiseHolder wrap_std__shared_ptr_Promise_GooglePlayServicesStatus__(std::shared_ptr> promise) noexcept { - return PromiseHolder(std::move(promise)); - } - - // pragma MARK: std::function - /** - * Specialized version of `std::function`. - */ - using Func_void_GooglePlayServicesStatus = std::function; - /** - * Wrapper class for a `std::function`, this can be used from Swift. - */ - class Func_void_GooglePlayServicesStatus_Wrapper final { - public: - explicit Func_void_GooglePlayServicesStatus_Wrapper(std::function&& func): _function(std::make_unique>(std::move(func))) {} - inline void call(GooglePlayServicesStatus result) const noexcept { - _function->operator()(result); - } - private: - std::unique_ptr> _function; - } SWIFT_NONCOPYABLE; - Func_void_GooglePlayServicesStatus create_Func_void_GooglePlayServicesStatus(void* NON_NULL swiftClosureWrapper) noexcept; - inline Func_void_GooglePlayServicesStatus_Wrapper wrap_Func_void_GooglePlayServicesStatus(Func_void_GooglePlayServicesStatus value) noexcept { - return Func_void_GooglePlayServicesStatus_Wrapper(std::move(value)); - } - - // pragma MARK: std::shared_ptr - /** - * Specialized version of `std::shared_ptr`. - */ - using std__shared_ptr_HybridReactNativeDeviceUtilsSpec_ = std::shared_ptr; - std::shared_ptr create_std__shared_ptr_HybridReactNativeDeviceUtilsSpec_(void* NON_NULL swiftUnsafePointer) noexcept; - void* NON_NULL get_std__shared_ptr_HybridReactNativeDeviceUtilsSpec_(std__shared_ptr_HybridReactNativeDeviceUtilsSpec_ cppType); - - // pragma MARK: std::weak_ptr - using std__weak_ptr_HybridReactNativeDeviceUtilsSpec_ = std::weak_ptr; - inline std__weak_ptr_HybridReactNativeDeviceUtilsSpec_ weakify_std__shared_ptr_HybridReactNativeDeviceUtilsSpec_(const std::shared_ptr& strong) noexcept { return strong; } - - // pragma MARK: Result - using Result_void_ = Result; - inline Result_void_ create_Result_void_() noexcept { - return Result::withValue(); - } - inline Result_void_ create_Result_void_(const std::exception_ptr& error) noexcept { - return Result::withError(error); - } - - // pragma MARK: Result - using Result_bool_ = Result; - inline Result_bool_ create_Result_bool_(bool value) noexcept { - return Result::withValue(std::move(value)); - } - inline Result_bool_ create_Result_bool_(const std::exception_ptr& error) noexcept { - return Result::withError(error); - } - - // pragma MARK: Result>>> - using Result_std__shared_ptr_Promise_std__vector_DualScreenInfoRect____ = Result>>>; - inline Result_std__shared_ptr_Promise_std__vector_DualScreenInfoRect____ create_Result_std__shared_ptr_Promise_std__vector_DualScreenInfoRect____(const std::shared_ptr>>& value) noexcept { - return Result>>>::withValue(value); - } - inline Result_std__shared_ptr_Promise_std__vector_DualScreenInfoRect____ create_Result_std__shared_ptr_Promise_std__vector_DualScreenInfoRect____(const std::exception_ptr& error) noexcept { - return Result>>>::withError(error); - } - - // pragma MARK: Result>> - using Result_std__shared_ptr_Promise_DualScreenInfoRect___ = Result>>; - inline Result_std__shared_ptr_Promise_DualScreenInfoRect___ create_Result_std__shared_ptr_Promise_DualScreenInfoRect___(const std::shared_ptr>& value) noexcept { - return Result>>::withValue(value); - } - inline Result_std__shared_ptr_Promise_DualScreenInfoRect___ create_Result_std__shared_ptr_Promise_DualScreenInfoRect___(const std::exception_ptr& error) noexcept { - return Result>>::withError(error); - } - - // pragma MARK: Result - using Result_double_ = Result; - inline Result_double_ create_Result_double_(double value) noexcept { - return Result::withValue(std::move(value)); - } - inline Result_double_ create_Result_double_(const std::exception_ptr& error) noexcept { - return Result::withError(error); - } - - // pragma MARK: Result>> - using Result_std__shared_ptr_Promise_LaunchOptions___ = Result>>; - inline Result_std__shared_ptr_Promise_LaunchOptions___ create_Result_std__shared_ptr_Promise_LaunchOptions___(const std::shared_ptr>& value) noexcept { - return Result>>::withValue(value); - } - inline Result_std__shared_ptr_Promise_LaunchOptions___ create_Result_std__shared_ptr_Promise_LaunchOptions___(const std::exception_ptr& error) noexcept { - return Result>>::withError(error); - } - - // pragma MARK: Result>> - using Result_std__shared_ptr_Promise_bool___ = Result>>; - inline Result_std__shared_ptr_Promise_bool___ create_Result_std__shared_ptr_Promise_bool___(const std::shared_ptr>& value) noexcept { - return Result>>::withValue(value); - } - inline Result_std__shared_ptr_Promise_bool___ create_Result_std__shared_ptr_Promise_bool___(const std::exception_ptr& error) noexcept { - return Result>>::withError(error); - } - - // pragma MARK: Result>> - using Result_std__shared_ptr_Promise_std__string___ = Result>>; - inline Result_std__shared_ptr_Promise_std__string___ create_Result_std__shared_ptr_Promise_std__string___(const std::shared_ptr>& value) noexcept { - return Result>>::withValue(value); - } - inline Result_std__shared_ptr_Promise_std__string___ create_Result_std__shared_ptr_Promise_std__string___(const std::exception_ptr& error) noexcept { - return Result>>::withError(error); - } - - // pragma MARK: Result>> - using Result_std__shared_ptr_Promise_void___ = Result>>; - inline Result_std__shared_ptr_Promise_void___ create_Result_std__shared_ptr_Promise_void___(const std::shared_ptr>& value) noexcept { - return Result>>::withValue(value); - } - inline Result_std__shared_ptr_Promise_void___ create_Result_std__shared_ptr_Promise_void___(const std::exception_ptr& error) noexcept { - return Result>>::withError(error); - } - - // pragma MARK: Result>> - using Result_std__shared_ptr_Promise_double___ = Result>>; - inline Result_std__shared_ptr_Promise_double___ create_Result_std__shared_ptr_Promise_double___(const std::shared_ptr>& value) noexcept { - return Result>>::withValue(value); - } - inline Result_std__shared_ptr_Promise_double___ create_Result_std__shared_ptr_Promise_double___(const std::exception_ptr& error) noexcept { - return Result>>::withError(error); - } - - // pragma MARK: Result>> - using Result_std__shared_ptr_Promise_WebViewPackageInfo___ = Result>>; - inline Result_std__shared_ptr_Promise_WebViewPackageInfo___ create_Result_std__shared_ptr_Promise_WebViewPackageInfo___(const std::shared_ptr>& value) noexcept { - return Result>>::withValue(value); - } - inline Result_std__shared_ptr_Promise_WebViewPackageInfo___ create_Result_std__shared_ptr_Promise_WebViewPackageInfo___(const std::exception_ptr& error) noexcept { - return Result>>::withError(error); - } - - // pragma MARK: Result>> - using Result_std__shared_ptr_Promise_GooglePlayServicesStatus___ = Result>>; - inline Result_std__shared_ptr_Promise_GooglePlayServicesStatus___ create_Result_std__shared_ptr_Promise_GooglePlayServicesStatus___(const std::shared_ptr>& value) noexcept { - return Result>>::withValue(value); - } - inline Result_std__shared_ptr_Promise_GooglePlayServicesStatus___ create_Result_std__shared_ptr_Promise_GooglePlayServicesStatus___(const std::exception_ptr& error) noexcept { - return Result>>::withError(error); - } - -} // namespace margelo::nitro::reactnativedeviceutils::bridge::swift diff --git a/native-modules/react-native-device-utils/nitrogen/generated/ios/ReactNativeDeviceUtils-Swift-Cxx-Umbrella.hpp b/native-modules/react-native-device-utils/nitrogen/generated/ios/ReactNativeDeviceUtils-Swift-Cxx-Umbrella.hpp deleted file mode 100644 index dc1d633..0000000 --- a/native-modules/react-native-device-utils/nitrogen/generated/ios/ReactNativeDeviceUtils-Swift-Cxx-Umbrella.hpp +++ /dev/null @@ -1,63 +0,0 @@ -/// -/// ReactNativeDeviceUtils-Swift-Cxx-Umbrella.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -// Forward declarations of C++ defined types -// Forward declaration of `DualScreenInfoRect` to properly resolve imports. -namespace margelo::nitro::reactnativedeviceutils { struct DualScreenInfoRect; } -// Forward declaration of `GooglePlayServicesStatus` to properly resolve imports. -namespace margelo::nitro::reactnativedeviceutils { struct GooglePlayServicesStatus; } -// Forward declaration of `HybridReactNativeDeviceUtilsSpec` to properly resolve imports. -namespace margelo::nitro::reactnativedeviceutils { class HybridReactNativeDeviceUtilsSpec; } -// Forward declaration of `LaunchOptions` to properly resolve imports. -namespace margelo::nitro::reactnativedeviceutils { struct LaunchOptions; } -// Forward declaration of `UserInterfaceStyle` to properly resolve imports. -namespace margelo::nitro::reactnativedeviceutils { enum class UserInterfaceStyle; } -// Forward declaration of `WebViewPackageInfo` to properly resolve imports. -namespace margelo::nitro::reactnativedeviceutils { struct WebViewPackageInfo; } - -// Include C++ defined types -#include "DualScreenInfoRect.hpp" -#include "GooglePlayServicesStatus.hpp" -#include "HybridReactNativeDeviceUtilsSpec.hpp" -#include "LaunchOptions.hpp" -#include "UserInterfaceStyle.hpp" -#include "WebViewPackageInfo.hpp" -#include -#include -#include -#include -#include -#include -#include -#include - -// C++ helpers for Swift -#include "ReactNativeDeviceUtils-Swift-Cxx-Bridge.hpp" - -// Common C++ types used in Swift -#include -#include -#include -#include - -// Forward declarations of Swift defined types -// Forward declaration of `HybridReactNativeDeviceUtilsSpec_cxx` to properly resolve imports. -namespace ReactNativeDeviceUtils { class HybridReactNativeDeviceUtilsSpec_cxx; } - -// Include Swift defined types -#if __has_include("ReactNativeDeviceUtils-Swift.h") -// This header is generated by Xcode/Swift on every app build. -// If it cannot be found, make sure the Swift module's name (= podspec name) is actually "ReactNativeDeviceUtils". -#include "ReactNativeDeviceUtils-Swift.h" -// Same as above, but used when building with frameworks (`use_frameworks`) -#elif __has_include() -#include -#else -#error ReactNativeDeviceUtils's autogenerated Swift header cannot be found! Make sure the Swift module's name (= podspec name) is actually "ReactNativeDeviceUtils", and try building the app first. -#endif diff --git a/native-modules/react-native-device-utils/nitrogen/generated/ios/ReactNativeDeviceUtilsAutolinking.mm b/native-modules/react-native-device-utils/nitrogen/generated/ios/ReactNativeDeviceUtilsAutolinking.mm deleted file mode 100644 index fb3f7f6..0000000 --- a/native-modules/react-native-device-utils/nitrogen/generated/ios/ReactNativeDeviceUtilsAutolinking.mm +++ /dev/null @@ -1,33 +0,0 @@ -/// -/// ReactNativeDeviceUtilsAutolinking.mm -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#import -#import -#import "ReactNativeDeviceUtils-Swift-Cxx-Umbrella.hpp" -#import - -#include "HybridReactNativeDeviceUtilsSpecSwift.hpp" - -@interface ReactNativeDeviceUtilsAutolinking : NSObject -@end - -@implementation ReactNativeDeviceUtilsAutolinking - -+ (void) load { - using namespace margelo::nitro; - using namespace margelo::nitro::reactnativedeviceutils; - - HybridObjectRegistry::registerHybridObjectConstructor( - "ReactNativeDeviceUtils", - []() -> std::shared_ptr { - std::shared_ptr hybridObject = ReactNativeDeviceUtils::ReactNativeDeviceUtilsAutolinking::createReactNativeDeviceUtils(); - return hybridObject; - } - ); -} - -@end diff --git a/native-modules/react-native-device-utils/nitrogen/generated/ios/ReactNativeDeviceUtilsAutolinking.swift b/native-modules/react-native-device-utils/nitrogen/generated/ios/ReactNativeDeviceUtilsAutolinking.swift deleted file mode 100644 index cd0d429..0000000 --- a/native-modules/react-native-device-utils/nitrogen/generated/ios/ReactNativeDeviceUtilsAutolinking.swift +++ /dev/null @@ -1,25 +0,0 @@ -/// -/// ReactNativeDeviceUtilsAutolinking.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -public final class ReactNativeDeviceUtilsAutolinking { - public typealias bridge = margelo.nitro.reactnativedeviceutils.bridge.swift - - /** - * Creates an instance of a Swift class that implements `HybridReactNativeDeviceUtilsSpec`, - * and wraps it in a Swift class that can directly interop with C++ (`HybridReactNativeDeviceUtilsSpec_cxx`) - * - * This is generated by Nitrogen and will initialize the class specified - * in the `"autolinking"` property of `nitro.json` (in this case, `ReactNativeDeviceUtils`). - */ - public static func createReactNativeDeviceUtils() -> bridge.std__shared_ptr_HybridReactNativeDeviceUtilsSpec_ { - let hybridObject = ReactNativeDeviceUtils() - return { () -> bridge.std__shared_ptr_HybridReactNativeDeviceUtilsSpec_ in - let __cxxWrapped = hybridObject.getCxxWrapper() - return __cxxWrapped.getCxxPart() - }() - } -} diff --git a/native-modules/react-native-device-utils/nitrogen/generated/ios/c++/HybridReactNativeDeviceUtilsSpecSwift.cpp b/native-modules/react-native-device-utils/nitrogen/generated/ios/c++/HybridReactNativeDeviceUtilsSpecSwift.cpp deleted file mode 100644 index 986264e..0000000 --- a/native-modules/react-native-device-utils/nitrogen/generated/ios/c++/HybridReactNativeDeviceUtilsSpecSwift.cpp +++ /dev/null @@ -1,11 +0,0 @@ -/// -/// HybridReactNativeDeviceUtilsSpecSwift.cpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#include "HybridReactNativeDeviceUtilsSpecSwift.hpp" - -namespace margelo::nitro::reactnativedeviceutils { -} // namespace margelo::nitro::reactnativedeviceutils diff --git a/native-modules/react-native-device-utils/nitrogen/generated/ios/c++/HybridReactNativeDeviceUtilsSpecSwift.hpp b/native-modules/react-native-device-utils/nitrogen/generated/ios/c++/HybridReactNativeDeviceUtilsSpecSwift.hpp deleted file mode 100644 index 8aa6e74..0000000 --- a/native-modules/react-native-device-utils/nitrogen/generated/ios/c++/HybridReactNativeDeviceUtilsSpecSwift.hpp +++ /dev/null @@ -1,220 +0,0 @@ -/// -/// HybridReactNativeDeviceUtilsSpecSwift.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#include "HybridReactNativeDeviceUtilsSpec.hpp" - -// Forward declaration of `HybridReactNativeDeviceUtilsSpec_cxx` to properly resolve imports. -namespace ReactNativeDeviceUtils { class HybridReactNativeDeviceUtilsSpec_cxx; } - -// Forward declaration of `DualScreenInfoRect` to properly resolve imports. -namespace margelo::nitro::reactnativedeviceutils { struct DualScreenInfoRect; } -// Forward declaration of `UserInterfaceStyle` to properly resolve imports. -namespace margelo::nitro::reactnativedeviceutils { enum class UserInterfaceStyle; } -// Forward declaration of `LaunchOptions` to properly resolve imports. -namespace margelo::nitro::reactnativedeviceutils { struct LaunchOptions; } -// Forward declaration of `WebViewPackageInfo` to properly resolve imports. -namespace margelo::nitro::reactnativedeviceutils { struct WebViewPackageInfo; } -// Forward declaration of `GooglePlayServicesStatus` to properly resolve imports. -namespace margelo::nitro::reactnativedeviceutils { struct GooglePlayServicesStatus; } - -#include "DualScreenInfoRect.hpp" -#include -#include -#include -#include "UserInterfaceStyle.hpp" -#include "LaunchOptions.hpp" -#include -#include -#include "WebViewPackageInfo.hpp" -#include "GooglePlayServicesStatus.hpp" - -#include "ReactNativeDeviceUtils-Swift-Cxx-Umbrella.hpp" - -namespace margelo::nitro::reactnativedeviceutils { - - /** - * The C++ part of HybridReactNativeDeviceUtilsSpec_cxx.swift. - * - * HybridReactNativeDeviceUtilsSpecSwift (C++) accesses HybridReactNativeDeviceUtilsSpec_cxx (Swift), and might - * contain some additional bridging code for C++ <> Swift interop. - * - * Since this obviously introduces an overhead, I hope at some point in - * the future, HybridReactNativeDeviceUtilsSpec_cxx can directly inherit from the C++ class HybridReactNativeDeviceUtilsSpec - * to simplify the whole structure and memory management. - */ - class HybridReactNativeDeviceUtilsSpecSwift: public virtual HybridReactNativeDeviceUtilsSpec { - public: - // Constructor from a Swift instance - explicit HybridReactNativeDeviceUtilsSpecSwift(const ReactNativeDeviceUtils::HybridReactNativeDeviceUtilsSpec_cxx& swiftPart): - HybridObject(HybridReactNativeDeviceUtilsSpec::TAG), - _swiftPart(swiftPart) { } - - public: - // Get the Swift part - inline ReactNativeDeviceUtils::HybridReactNativeDeviceUtilsSpec_cxx& getSwiftPart() noexcept { - return _swiftPart; - } - - public: - inline size_t getExternalMemorySize() noexcept override { - return _swiftPart.getMemorySize(); - } - void dispose() noexcept override { - _swiftPart.dispose(); - } - std::string toString() override { - return _swiftPart.toString(); - } - - public: - // Properties - - - public: - // Methods - inline void initEventListeners() override { - auto __result = _swiftPart.initEventListeners(); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - } - inline bool isDualScreenDevice() override { - auto __result = _swiftPart.isDualScreenDevice(); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - auto __value = std::move(__result.value()); - return __value; - } - inline bool isSpanning() override { - auto __result = _swiftPart.isSpanning(); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - auto __value = std::move(__result.value()); - return __value; - } - inline std::shared_ptr>> getWindowRects() override { - auto __result = _swiftPart.getWindowRects(); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - auto __value = std::move(__result.value()); - return __value; - } - inline std::shared_ptr> getHingeBounds() override { - auto __result = _swiftPart.getHingeBounds(); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - auto __value = std::move(__result.value()); - return __value; - } - inline void changeBackgroundColor(double r, double g, double b, double a) override { - auto __result = _swiftPart.changeBackgroundColor(std::forward(r), std::forward(g), std::forward(b), std::forward(a)); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - } - inline double addSpanningChangedListener(const std::function& callback) override { - auto __result = _swiftPart.addSpanningChangedListener(callback); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - auto __value = std::move(__result.value()); - return __value; - } - inline void removeSpanningChangedListener(double id) override { - auto __result = _swiftPart.removeSpanningChangedListener(std::forward(id)); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - } - inline void setUserInterfaceStyle(UserInterfaceStyle style) override { - auto __result = _swiftPart.setUserInterfaceStyle(static_cast(style)); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - } - inline std::shared_ptr> getLaunchOptions() override { - auto __result = _swiftPart.getLaunchOptions(); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - auto __value = std::move(__result.value()); - return __value; - } - inline std::shared_ptr> clearLaunchOptions() override { - auto __result = _swiftPart.clearLaunchOptions(); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - auto __value = std::move(__result.value()); - return __value; - } - inline std::shared_ptr> getDeviceToken() override { - auto __result = _swiftPart.getDeviceToken(); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - auto __value = std::move(__result.value()); - return __value; - } - inline std::shared_ptr> saveDeviceToken(const std::string& token) override { - auto __result = _swiftPart.saveDeviceToken(token); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - auto __value = std::move(__result.value()); - return __value; - } - inline std::shared_ptr> registerDeviceToken() override { - auto __result = _swiftPart.registerDeviceToken(); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - auto __value = std::move(__result.value()); - return __value; - } - inline std::shared_ptr> getStartupTime() override { - auto __result = _swiftPart.getStartupTime(); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - auto __value = std::move(__result.value()); - return __value; - } - inline void exitApp() override { - auto __result = _swiftPart.exitApp(); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - } - inline std::shared_ptr> getCurrentWebViewPackageInfo() override { - auto __result = _swiftPart.getCurrentWebViewPackageInfo(); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - auto __value = std::move(__result.value()); - return __value; - } - inline std::shared_ptr> isGooglePlayServicesAvailable() override { - auto __result = _swiftPart.isGooglePlayServicesAvailable(); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - auto __value = std::move(__result.value()); - return __value; - } - - private: - ReactNativeDeviceUtils::HybridReactNativeDeviceUtilsSpec_cxx _swiftPart; - }; - -} // namespace margelo::nitro::reactnativedeviceutils diff --git a/native-modules/react-native-device-utils/nitrogen/generated/ios/swift/DualScreenInfoRect.swift b/native-modules/react-native-device-utils/nitrogen/generated/ios/swift/DualScreenInfoRect.swift deleted file mode 100644 index 5948bfa..0000000 --- a/native-modules/react-native-device-utils/nitrogen/generated/ios/swift/DualScreenInfoRect.swift +++ /dev/null @@ -1,69 +0,0 @@ -/// -/// DualScreenInfoRect.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Represents an instance of `DualScreenInfoRect`, backed by a C++ struct. - */ -public typealias DualScreenInfoRect = margelo.nitro.reactnativedeviceutils.DualScreenInfoRect - -public extension DualScreenInfoRect { - private typealias bridge = margelo.nitro.reactnativedeviceutils.bridge.swift - - /** - * Create a new instance of `DualScreenInfoRect`. - */ - init(x: Double, y: Double, width: Double, height: Double) { - self.init(x, y, width, height) - } - - var x: Double { - @inline(__always) - get { - return self.__x - } - @inline(__always) - set { - self.__x = newValue - } - } - - var y: Double { - @inline(__always) - get { - return self.__y - } - @inline(__always) - set { - self.__y = newValue - } - } - - var width: Double { - @inline(__always) - get { - return self.__width - } - @inline(__always) - set { - self.__width = newValue - } - } - - var height: Double { - @inline(__always) - get { - return self.__height - } - @inline(__always) - set { - self.__height = newValue - } - } -} diff --git a/native-modules/react-native-device-utils/nitrogen/generated/ios/swift/Func_void.swift b/native-modules/react-native-device-utils/nitrogen/generated/ios/swift/Func_void.swift deleted file mode 100644 index ba88454..0000000 --- a/native-modules/react-native-device-utils/nitrogen/generated/ios/swift/Func_void.swift +++ /dev/null @@ -1,47 +0,0 @@ -/// -/// Func_void.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Wraps a Swift `() -> Void` as a class. - * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`. - */ -public final class Func_void { - public typealias bridge = margelo.nitro.reactnativedeviceutils.bridge.swift - - private let closure: () -> Void - - public init(_ closure: @escaping () -> Void) { - self.closure = closure - } - - @inline(__always) - public func call() -> Void { - self.closure() - } - - /** - * Casts this instance to a retained unsafe raw pointer. - * This acquires one additional strong reference on the object! - */ - @inline(__always) - public func toUnsafe() -> UnsafeMutableRawPointer { - return Unmanaged.passRetained(self).toOpaque() - } - - /** - * Casts an unsafe pointer to a `Func_void`. - * The pointer has to be a retained opaque `Unmanaged`. - * This removes one strong reference from the object! - */ - @inline(__always) - public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void { - return Unmanaged.fromOpaque(pointer).takeRetainedValue() - } -} diff --git a/native-modules/react-native-device-utils/nitrogen/generated/ios/swift/Func_void_DualScreenInfoRect.swift b/native-modules/react-native-device-utils/nitrogen/generated/ios/swift/Func_void_DualScreenInfoRect.swift deleted file mode 100644 index 0ab2a03..0000000 --- a/native-modules/react-native-device-utils/nitrogen/generated/ios/swift/Func_void_DualScreenInfoRect.swift +++ /dev/null @@ -1,47 +0,0 @@ -/// -/// Func_void_DualScreenInfoRect.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Wraps a Swift `(_ value: DualScreenInfoRect) -> Void` as a class. - * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`. - */ -public final class Func_void_DualScreenInfoRect { - public typealias bridge = margelo.nitro.reactnativedeviceutils.bridge.swift - - private let closure: (_ value: DualScreenInfoRect) -> Void - - public init(_ closure: @escaping (_ value: DualScreenInfoRect) -> Void) { - self.closure = closure - } - - @inline(__always) - public func call(value: DualScreenInfoRect) -> Void { - self.closure(value) - } - - /** - * Casts this instance to a retained unsafe raw pointer. - * This acquires one additional strong reference on the object! - */ - @inline(__always) - public func toUnsafe() -> UnsafeMutableRawPointer { - return Unmanaged.passRetained(self).toOpaque() - } - - /** - * Casts an unsafe pointer to a `Func_void_DualScreenInfoRect`. - * The pointer has to be a retained opaque `Unmanaged`. - * This removes one strong reference from the object! - */ - @inline(__always) - public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_DualScreenInfoRect { - return Unmanaged.fromOpaque(pointer).takeRetainedValue() - } -} diff --git a/native-modules/react-native-device-utils/nitrogen/generated/ios/swift/Func_void_GooglePlayServicesStatus.swift b/native-modules/react-native-device-utils/nitrogen/generated/ios/swift/Func_void_GooglePlayServicesStatus.swift deleted file mode 100644 index 4d7b5c3..0000000 --- a/native-modules/react-native-device-utils/nitrogen/generated/ios/swift/Func_void_GooglePlayServicesStatus.swift +++ /dev/null @@ -1,47 +0,0 @@ -/// -/// Func_void_GooglePlayServicesStatus.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Wraps a Swift `(_ value: GooglePlayServicesStatus) -> Void` as a class. - * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`. - */ -public final class Func_void_GooglePlayServicesStatus { - public typealias bridge = margelo.nitro.reactnativedeviceutils.bridge.swift - - private let closure: (_ value: GooglePlayServicesStatus) -> Void - - public init(_ closure: @escaping (_ value: GooglePlayServicesStatus) -> Void) { - self.closure = closure - } - - @inline(__always) - public func call(value: GooglePlayServicesStatus) -> Void { - self.closure(value) - } - - /** - * Casts this instance to a retained unsafe raw pointer. - * This acquires one additional strong reference on the object! - */ - @inline(__always) - public func toUnsafe() -> UnsafeMutableRawPointer { - return Unmanaged.passRetained(self).toOpaque() - } - - /** - * Casts an unsafe pointer to a `Func_void_GooglePlayServicesStatus`. - * The pointer has to be a retained opaque `Unmanaged`. - * This removes one strong reference from the object! - */ - @inline(__always) - public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_GooglePlayServicesStatus { - return Unmanaged.fromOpaque(pointer).takeRetainedValue() - } -} diff --git a/native-modules/react-native-device-utils/nitrogen/generated/ios/swift/Func_void_LaunchOptions.swift b/native-modules/react-native-device-utils/nitrogen/generated/ios/swift/Func_void_LaunchOptions.swift deleted file mode 100644 index c701aff..0000000 --- a/native-modules/react-native-device-utils/nitrogen/generated/ios/swift/Func_void_LaunchOptions.swift +++ /dev/null @@ -1,47 +0,0 @@ -/// -/// Func_void_LaunchOptions.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Wraps a Swift `(_ value: LaunchOptions) -> Void` as a class. - * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`. - */ -public final class Func_void_LaunchOptions { - public typealias bridge = margelo.nitro.reactnativedeviceutils.bridge.swift - - private let closure: (_ value: LaunchOptions) -> Void - - public init(_ closure: @escaping (_ value: LaunchOptions) -> Void) { - self.closure = closure - } - - @inline(__always) - public func call(value: LaunchOptions) -> Void { - self.closure(value) - } - - /** - * Casts this instance to a retained unsafe raw pointer. - * This acquires one additional strong reference on the object! - */ - @inline(__always) - public func toUnsafe() -> UnsafeMutableRawPointer { - return Unmanaged.passRetained(self).toOpaque() - } - - /** - * Casts an unsafe pointer to a `Func_void_LaunchOptions`. - * The pointer has to be a retained opaque `Unmanaged`. - * This removes one strong reference from the object! - */ - @inline(__always) - public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_LaunchOptions { - return Unmanaged.fromOpaque(pointer).takeRetainedValue() - } -} diff --git a/native-modules/react-native-device-utils/nitrogen/generated/ios/swift/Func_void_WebViewPackageInfo.swift b/native-modules/react-native-device-utils/nitrogen/generated/ios/swift/Func_void_WebViewPackageInfo.swift deleted file mode 100644 index 2ec0624..0000000 --- a/native-modules/react-native-device-utils/nitrogen/generated/ios/swift/Func_void_WebViewPackageInfo.swift +++ /dev/null @@ -1,47 +0,0 @@ -/// -/// Func_void_WebViewPackageInfo.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Wraps a Swift `(_ value: WebViewPackageInfo) -> Void` as a class. - * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`. - */ -public final class Func_void_WebViewPackageInfo { - public typealias bridge = margelo.nitro.reactnativedeviceutils.bridge.swift - - private let closure: (_ value: WebViewPackageInfo) -> Void - - public init(_ closure: @escaping (_ value: WebViewPackageInfo) -> Void) { - self.closure = closure - } - - @inline(__always) - public func call(value: WebViewPackageInfo) -> Void { - self.closure(value) - } - - /** - * Casts this instance to a retained unsafe raw pointer. - * This acquires one additional strong reference on the object! - */ - @inline(__always) - public func toUnsafe() -> UnsafeMutableRawPointer { - return Unmanaged.passRetained(self).toOpaque() - } - - /** - * Casts an unsafe pointer to a `Func_void_WebViewPackageInfo`. - * The pointer has to be a retained opaque `Unmanaged`. - * This removes one strong reference from the object! - */ - @inline(__always) - public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_WebViewPackageInfo { - return Unmanaged.fromOpaque(pointer).takeRetainedValue() - } -} diff --git a/native-modules/react-native-device-utils/nitrogen/generated/ios/swift/Func_void_bool.swift b/native-modules/react-native-device-utils/nitrogen/generated/ios/swift/Func_void_bool.swift deleted file mode 100644 index c7f7095..0000000 --- a/native-modules/react-native-device-utils/nitrogen/generated/ios/swift/Func_void_bool.swift +++ /dev/null @@ -1,47 +0,0 @@ -/// -/// Func_void_bool.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Wraps a Swift `(_ isSpanning: Bool) -> Void` as a class. - * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`. - */ -public final class Func_void_bool { - public typealias bridge = margelo.nitro.reactnativedeviceutils.bridge.swift - - private let closure: (_ isSpanning: Bool) -> Void - - public init(_ closure: @escaping (_ isSpanning: Bool) -> Void) { - self.closure = closure - } - - @inline(__always) - public func call(isSpanning: Bool) -> Void { - self.closure(isSpanning) - } - - /** - * Casts this instance to a retained unsafe raw pointer. - * This acquires one additional strong reference on the object! - */ - @inline(__always) - public func toUnsafe() -> UnsafeMutableRawPointer { - return Unmanaged.passRetained(self).toOpaque() - } - - /** - * Casts an unsafe pointer to a `Func_void_bool`. - * The pointer has to be a retained opaque `Unmanaged`. - * This removes one strong reference from the object! - */ - @inline(__always) - public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_bool { - return Unmanaged.fromOpaque(pointer).takeRetainedValue() - } -} diff --git a/native-modules/react-native-device-utils/nitrogen/generated/ios/swift/Func_void_double.swift b/native-modules/react-native-device-utils/nitrogen/generated/ios/swift/Func_void_double.swift deleted file mode 100644 index f8827a7..0000000 --- a/native-modules/react-native-device-utils/nitrogen/generated/ios/swift/Func_void_double.swift +++ /dev/null @@ -1,47 +0,0 @@ -/// -/// Func_void_double.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Wraps a Swift `(_ value: Double) -> Void` as a class. - * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`. - */ -public final class Func_void_double { - public typealias bridge = margelo.nitro.reactnativedeviceutils.bridge.swift - - private let closure: (_ value: Double) -> Void - - public init(_ closure: @escaping (_ value: Double) -> Void) { - self.closure = closure - } - - @inline(__always) - public func call(value: Double) -> Void { - self.closure(value) - } - - /** - * Casts this instance to a retained unsafe raw pointer. - * This acquires one additional strong reference on the object! - */ - @inline(__always) - public func toUnsafe() -> UnsafeMutableRawPointer { - return Unmanaged.passRetained(self).toOpaque() - } - - /** - * Casts an unsafe pointer to a `Func_void_double`. - * The pointer has to be a retained opaque `Unmanaged`. - * This removes one strong reference from the object! - */ - @inline(__always) - public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_double { - return Unmanaged.fromOpaque(pointer).takeRetainedValue() - } -} diff --git a/native-modules/react-native-device-utils/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift b/native-modules/react-native-device-utils/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift deleted file mode 100644 index 046ebb4..0000000 --- a/native-modules/react-native-device-utils/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +++ /dev/null @@ -1,47 +0,0 @@ -/// -/// Func_void_std__exception_ptr.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Wraps a Swift `(_ error: Error) -> Void` as a class. - * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`. - */ -public final class Func_void_std__exception_ptr { - public typealias bridge = margelo.nitro.reactnativedeviceutils.bridge.swift - - private let closure: (_ error: Error) -> Void - - public init(_ closure: @escaping (_ error: Error) -> Void) { - self.closure = closure - } - - @inline(__always) - public func call(error: std.exception_ptr) -> Void { - self.closure(RuntimeError.from(cppError: error)) - } - - /** - * Casts this instance to a retained unsafe raw pointer. - * This acquires one additional strong reference on the object! - */ - @inline(__always) - public func toUnsafe() -> UnsafeMutableRawPointer { - return Unmanaged.passRetained(self).toOpaque() - } - - /** - * Casts an unsafe pointer to a `Func_void_std__exception_ptr`. - * The pointer has to be a retained opaque `Unmanaged`. - * This removes one strong reference from the object! - */ - @inline(__always) - public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_std__exception_ptr { - return Unmanaged.fromOpaque(pointer).takeRetainedValue() - } -} diff --git a/native-modules/react-native-device-utils/nitrogen/generated/ios/swift/Func_void_std__string.swift b/native-modules/react-native-device-utils/nitrogen/generated/ios/swift/Func_void_std__string.swift deleted file mode 100644 index c11eb81..0000000 --- a/native-modules/react-native-device-utils/nitrogen/generated/ios/swift/Func_void_std__string.swift +++ /dev/null @@ -1,47 +0,0 @@ -/// -/// Func_void_std__string.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Wraps a Swift `(_ value: String) -> Void` as a class. - * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`. - */ -public final class Func_void_std__string { - public typealias bridge = margelo.nitro.reactnativedeviceutils.bridge.swift - - private let closure: (_ value: String) -> Void - - public init(_ closure: @escaping (_ value: String) -> Void) { - self.closure = closure - } - - @inline(__always) - public func call(value: std.string) -> Void { - self.closure(String(value)) - } - - /** - * Casts this instance to a retained unsafe raw pointer. - * This acquires one additional strong reference on the object! - */ - @inline(__always) - public func toUnsafe() -> UnsafeMutableRawPointer { - return Unmanaged.passRetained(self).toOpaque() - } - - /** - * Casts an unsafe pointer to a `Func_void_std__string`. - * The pointer has to be a retained opaque `Unmanaged`. - * This removes one strong reference from the object! - */ - @inline(__always) - public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_std__string { - return Unmanaged.fromOpaque(pointer).takeRetainedValue() - } -} diff --git a/native-modules/react-native-device-utils/nitrogen/generated/ios/swift/Func_void_std__vector_DualScreenInfoRect_.swift b/native-modules/react-native-device-utils/nitrogen/generated/ios/swift/Func_void_std__vector_DualScreenInfoRect_.swift deleted file mode 100644 index 63c153a..0000000 --- a/native-modules/react-native-device-utils/nitrogen/generated/ios/swift/Func_void_std__vector_DualScreenInfoRect_.swift +++ /dev/null @@ -1,47 +0,0 @@ -/// -/// Func_void_std__vector_DualScreenInfoRect_.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Wraps a Swift `(_ value: [DualScreenInfoRect]) -> Void` as a class. - * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`. - */ -public final class Func_void_std__vector_DualScreenInfoRect_ { - public typealias bridge = margelo.nitro.reactnativedeviceutils.bridge.swift - - private let closure: (_ value: [DualScreenInfoRect]) -> Void - - public init(_ closure: @escaping (_ value: [DualScreenInfoRect]) -> Void) { - self.closure = closure - } - - @inline(__always) - public func call(value: bridge.std__vector_DualScreenInfoRect_) -> Void { - self.closure(value.map({ __item in __item })) - } - - /** - * Casts this instance to a retained unsafe raw pointer. - * This acquires one additional strong reference on the object! - */ - @inline(__always) - public func toUnsafe() -> UnsafeMutableRawPointer { - return Unmanaged.passRetained(self).toOpaque() - } - - /** - * Casts an unsafe pointer to a `Func_void_std__vector_DualScreenInfoRect_`. - * The pointer has to be a retained opaque `Unmanaged`. - * This removes one strong reference from the object! - */ - @inline(__always) - public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_std__vector_DualScreenInfoRect_ { - return Unmanaged.fromOpaque(pointer).takeRetainedValue() - } -} diff --git a/native-modules/react-native-device-utils/nitrogen/generated/ios/swift/GooglePlayServicesStatus.swift b/native-modules/react-native-device-utils/nitrogen/generated/ios/swift/GooglePlayServicesStatus.swift deleted file mode 100644 index f37954c..0000000 --- a/native-modules/react-native-device-utils/nitrogen/generated/ios/swift/GooglePlayServicesStatus.swift +++ /dev/null @@ -1,47 +0,0 @@ -/// -/// GooglePlayServicesStatus.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Represents an instance of `GooglePlayServicesStatus`, backed by a C++ struct. - */ -public typealias GooglePlayServicesStatus = margelo.nitro.reactnativedeviceutils.GooglePlayServicesStatus - -public extension GooglePlayServicesStatus { - private typealias bridge = margelo.nitro.reactnativedeviceutils.bridge.swift - - /** - * Create a new instance of `GooglePlayServicesStatus`. - */ - init(status: Double, isAvailable: Bool) { - self.init(status, isAvailable) - } - - var status: Double { - @inline(__always) - get { - return self.__status - } - @inline(__always) - set { - self.__status = newValue - } - } - - var isAvailable: Bool { - @inline(__always) - get { - return self.__isAvailable - } - @inline(__always) - set { - self.__isAvailable = newValue - } - } -} diff --git a/native-modules/react-native-device-utils/nitrogen/generated/ios/swift/HybridReactNativeDeviceUtilsSpec.swift b/native-modules/react-native-device-utils/nitrogen/generated/ios/swift/HybridReactNativeDeviceUtilsSpec.swift deleted file mode 100644 index 3042d74..0000000 --- a/native-modules/react-native-device-utils/nitrogen/generated/ios/swift/HybridReactNativeDeviceUtilsSpec.swift +++ /dev/null @@ -1,73 +0,0 @@ -/// -/// HybridReactNativeDeviceUtilsSpec.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/// See ``HybridReactNativeDeviceUtilsSpec`` -public protocol HybridReactNativeDeviceUtilsSpec_protocol: HybridObject { - // Properties - - - // Methods - func initEventListeners() throws -> Void - func isDualScreenDevice() throws -> Bool - func isSpanning() throws -> Bool - func getWindowRects() throws -> Promise<[DualScreenInfoRect]> - func getHingeBounds() throws -> Promise - func changeBackgroundColor(r: Double, g: Double, b: Double, a: Double) throws -> Void - func addSpanningChangedListener(callback: @escaping (_ isSpanning: Bool) -> Void) throws -> Double - func removeSpanningChangedListener(id: Double) throws -> Void - func setUserInterfaceStyle(style: UserInterfaceStyle) throws -> Void - func getLaunchOptions() throws -> Promise - func clearLaunchOptions() throws -> Promise - func getDeviceToken() throws -> Promise - func saveDeviceToken(token: String) throws -> Promise - func registerDeviceToken() throws -> Promise - func getStartupTime() throws -> Promise - func exitApp() throws -> Void - func getCurrentWebViewPackageInfo() throws -> Promise - func isGooglePlayServicesAvailable() throws -> Promise -} - -public extension HybridReactNativeDeviceUtilsSpec_protocol { - /// Default implementation of ``HybridObject.toString`` - func toString() -> String { - return "[HybridObject ReactNativeDeviceUtils]" - } -} - -/// See ``HybridReactNativeDeviceUtilsSpec`` -open class HybridReactNativeDeviceUtilsSpec_base { - private weak var cxxWrapper: HybridReactNativeDeviceUtilsSpec_cxx? = nil - public init() { } - public func getCxxWrapper() -> HybridReactNativeDeviceUtilsSpec_cxx { - #if DEBUG - guard self is HybridReactNativeDeviceUtilsSpec else { - fatalError("`self` is not a `HybridReactNativeDeviceUtilsSpec`! Did you accidentally inherit from `HybridReactNativeDeviceUtilsSpec_base` instead of `HybridReactNativeDeviceUtilsSpec`?") - } - #endif - if let cxxWrapper = self.cxxWrapper { - return cxxWrapper - } else { - let cxxWrapper = HybridReactNativeDeviceUtilsSpec_cxx(self as! HybridReactNativeDeviceUtilsSpec) - self.cxxWrapper = cxxWrapper - return cxxWrapper - } - } -} - -/** - * A Swift base-protocol representing the ReactNativeDeviceUtils HybridObject. - * Implement this protocol to create Swift-based instances of ReactNativeDeviceUtils. - * ```swift - * class HybridReactNativeDeviceUtils : HybridReactNativeDeviceUtilsSpec { - * // ... - * } - * ``` - */ -public typealias HybridReactNativeDeviceUtilsSpec = HybridReactNativeDeviceUtilsSpec_protocol & HybridReactNativeDeviceUtilsSpec_base diff --git a/native-modules/react-native-device-utils/nitrogen/generated/ios/swift/HybridReactNativeDeviceUtilsSpec_cxx.swift b/native-modules/react-native-device-utils/nitrogen/generated/ios/swift/HybridReactNativeDeviceUtilsSpec_cxx.swift deleted file mode 100644 index d457f3c..0000000 --- a/native-modules/react-native-device-utils/nitrogen/generated/ios/swift/HybridReactNativeDeviceUtilsSpec_cxx.swift +++ /dev/null @@ -1,411 +0,0 @@ -/// -/// HybridReactNativeDeviceUtilsSpec_cxx.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * A class implementation that bridges HybridReactNativeDeviceUtilsSpec over to C++. - * In C++, we cannot use Swift protocols - so we need to wrap it in a class to make it strongly defined. - * - * Also, some Swift types need to be bridged with special handling: - * - Enums need to be wrapped in Structs, otherwise they cannot be accessed bi-directionally (Swift bug: https://github.com/swiftlang/swift/issues/75330) - * - Other HybridObjects need to be wrapped/unwrapped from the Swift TCxx wrapper - * - Throwing methods need to be wrapped with a Result type, as exceptions cannot be propagated to C++ - */ -open class HybridReactNativeDeviceUtilsSpec_cxx { - /** - * The Swift <> C++ bridge's namespace (`margelo::nitro::reactnativedeviceutils::bridge::swift`) - * from `ReactNativeDeviceUtils-Swift-Cxx-Bridge.hpp`. - * This contains specialized C++ templates, and C++ helper functions that can be accessed from Swift. - */ - public typealias bridge = margelo.nitro.reactnativedeviceutils.bridge.swift - - /** - * Holds an instance of the `HybridReactNativeDeviceUtilsSpec` Swift protocol. - */ - private var __implementation: any HybridReactNativeDeviceUtilsSpec - - /** - * Holds a weak pointer to the C++ class that wraps the Swift class. - */ - private var __cxxPart: bridge.std__weak_ptr_HybridReactNativeDeviceUtilsSpec_ - - /** - * Create a new `HybridReactNativeDeviceUtilsSpec_cxx` that wraps the given `HybridReactNativeDeviceUtilsSpec`. - * All properties and methods bridge to C++ types. - */ - public init(_ implementation: any HybridReactNativeDeviceUtilsSpec) { - self.__implementation = implementation - self.__cxxPart = .init() - /* no base class */ - } - - /** - * Get the actual `HybridReactNativeDeviceUtilsSpec` instance this class wraps. - */ - @inline(__always) - public func getHybridReactNativeDeviceUtilsSpec() -> any HybridReactNativeDeviceUtilsSpec { - return __implementation - } - - /** - * Casts this instance to a retained unsafe raw pointer. - * This acquires one additional strong reference on the object! - */ - public func toUnsafe() -> UnsafeMutableRawPointer { - return Unmanaged.passRetained(self).toOpaque() - } - - /** - * Casts an unsafe pointer to a `HybridReactNativeDeviceUtilsSpec_cxx`. - * The pointer has to be a retained opaque `Unmanaged`. - * This removes one strong reference from the object! - */ - public class func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> HybridReactNativeDeviceUtilsSpec_cxx { - return Unmanaged.fromOpaque(pointer).takeRetainedValue() - } - - /** - * Gets (or creates) the C++ part of this Hybrid Object. - * The C++ part is a `std::shared_ptr`. - */ - public func getCxxPart() -> bridge.std__shared_ptr_HybridReactNativeDeviceUtilsSpec_ { - let cachedCxxPart = self.__cxxPart.lock() - if Bool(fromCxx: cachedCxxPart) { - return cachedCxxPart - } else { - let newCxxPart = bridge.create_std__shared_ptr_HybridReactNativeDeviceUtilsSpec_(self.toUnsafe()) - __cxxPart = bridge.weakify_std__shared_ptr_HybridReactNativeDeviceUtilsSpec_(newCxxPart) - return newCxxPart - } - } - - - - /** - * Get the memory size of the Swift class (plus size of any other allocations) - * so the JS VM can properly track it and garbage-collect the JS object if needed. - */ - @inline(__always) - public var memorySize: Int { - return MemoryHelper.getSizeOf(self.__implementation) + self.__implementation.memorySize - } - - /** - * Call dispose() on the Swift class. - * This _may_ be called manually from JS. - */ - @inline(__always) - public func dispose() { - self.__implementation.dispose() - } - - /** - * Call toString() on the Swift class. - */ - @inline(__always) - public func toString() -> String { - return self.__implementation.toString() - } - - // Properties - - - // Methods - @inline(__always) - public final func initEventListeners() -> bridge.Result_void_ { - do { - try self.__implementation.initEventListeners() - return bridge.create_Result_void_() - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_void_(__exceptionPtr) - } - } - - @inline(__always) - public final func isDualScreenDevice() -> bridge.Result_bool_ { - do { - let __result = try self.__implementation.isDualScreenDevice() - let __resultCpp = __result - return bridge.create_Result_bool_(__resultCpp) - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_bool_(__exceptionPtr) - } - } - - @inline(__always) - public final func isSpanning() -> bridge.Result_bool_ { - do { - let __result = try self.__implementation.isSpanning() - let __resultCpp = __result - return bridge.create_Result_bool_(__resultCpp) - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_bool_(__exceptionPtr) - } - } - - @inline(__always) - public final func getWindowRects() -> bridge.Result_std__shared_ptr_Promise_std__vector_DualScreenInfoRect____ { - do { - let __result = try self.__implementation.getWindowRects() - let __resultCpp = { () -> bridge.std__shared_ptr_Promise_std__vector_DualScreenInfoRect___ in - let __promise = bridge.create_std__shared_ptr_Promise_std__vector_DualScreenInfoRect___() - let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_std__vector_DualScreenInfoRect___(__promise) - __result - .then({ __result in __promiseHolder.resolve({ () -> bridge.std__vector_DualScreenInfoRect_ in - var __vector = bridge.create_std__vector_DualScreenInfoRect_(__result.count) - for __item in __result { - __vector.push_back(__item) - } - return __vector - }()) }) - .catch({ __error in __promiseHolder.reject(__error.toCpp()) }) - return __promise - }() - return bridge.create_Result_std__shared_ptr_Promise_std__vector_DualScreenInfoRect____(__resultCpp) - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_std__shared_ptr_Promise_std__vector_DualScreenInfoRect____(__exceptionPtr) - } - } - - @inline(__always) - public final func getHingeBounds() -> bridge.Result_std__shared_ptr_Promise_DualScreenInfoRect___ { - do { - let __result = try self.__implementation.getHingeBounds() - let __resultCpp = { () -> bridge.std__shared_ptr_Promise_DualScreenInfoRect__ in - let __promise = bridge.create_std__shared_ptr_Promise_DualScreenInfoRect__() - let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_DualScreenInfoRect__(__promise) - __result - .then({ __result in __promiseHolder.resolve(__result) }) - .catch({ __error in __promiseHolder.reject(__error.toCpp()) }) - return __promise - }() - return bridge.create_Result_std__shared_ptr_Promise_DualScreenInfoRect___(__resultCpp) - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_std__shared_ptr_Promise_DualScreenInfoRect___(__exceptionPtr) - } - } - - @inline(__always) - public final func changeBackgroundColor(r: Double, g: Double, b: Double, a: Double) -> bridge.Result_void_ { - do { - try self.__implementation.changeBackgroundColor(r: r, g: g, b: b, a: a) - return bridge.create_Result_void_() - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_void_(__exceptionPtr) - } - } - - @inline(__always) - public final func addSpanningChangedListener(callback: bridge.Func_void_bool) -> bridge.Result_double_ { - do { - let __result = try self.__implementation.addSpanningChangedListener(callback: { () -> (Bool) -> Void in - let __wrappedFunction = bridge.wrap_Func_void_bool(callback) - return { (__isSpanning: Bool) -> Void in - __wrappedFunction.call(__isSpanning) - } - }()) - let __resultCpp = __result - return bridge.create_Result_double_(__resultCpp) - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_double_(__exceptionPtr) - } - } - - @inline(__always) - public final func removeSpanningChangedListener(id: Double) -> bridge.Result_void_ { - do { - try self.__implementation.removeSpanningChangedListener(id: id) - return bridge.create_Result_void_() - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_void_(__exceptionPtr) - } - } - - @inline(__always) - public final func setUserInterfaceStyle(style: Int32) -> bridge.Result_void_ { - do { - try self.__implementation.setUserInterfaceStyle(style: margelo.nitro.reactnativedeviceutils.UserInterfaceStyle(rawValue: style)!) - return bridge.create_Result_void_() - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_void_(__exceptionPtr) - } - } - - @inline(__always) - public final func getLaunchOptions() -> bridge.Result_std__shared_ptr_Promise_LaunchOptions___ { - do { - let __result = try self.__implementation.getLaunchOptions() - let __resultCpp = { () -> bridge.std__shared_ptr_Promise_LaunchOptions__ in - let __promise = bridge.create_std__shared_ptr_Promise_LaunchOptions__() - let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_LaunchOptions__(__promise) - __result - .then({ __result in __promiseHolder.resolve(__result) }) - .catch({ __error in __promiseHolder.reject(__error.toCpp()) }) - return __promise - }() - return bridge.create_Result_std__shared_ptr_Promise_LaunchOptions___(__resultCpp) - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_std__shared_ptr_Promise_LaunchOptions___(__exceptionPtr) - } - } - - @inline(__always) - public final func clearLaunchOptions() -> bridge.Result_std__shared_ptr_Promise_bool___ { - do { - let __result = try self.__implementation.clearLaunchOptions() - let __resultCpp = { () -> bridge.std__shared_ptr_Promise_bool__ in - let __promise = bridge.create_std__shared_ptr_Promise_bool__() - let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_bool__(__promise) - __result - .then({ __result in __promiseHolder.resolve(__result) }) - .catch({ __error in __promiseHolder.reject(__error.toCpp()) }) - return __promise - }() - return bridge.create_Result_std__shared_ptr_Promise_bool___(__resultCpp) - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_std__shared_ptr_Promise_bool___(__exceptionPtr) - } - } - - @inline(__always) - public final func getDeviceToken() -> bridge.Result_std__shared_ptr_Promise_std__string___ { - do { - let __result = try self.__implementation.getDeviceToken() - let __resultCpp = { () -> bridge.std__shared_ptr_Promise_std__string__ in - let __promise = bridge.create_std__shared_ptr_Promise_std__string__() - let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_std__string__(__promise) - __result - .then({ __result in __promiseHolder.resolve(std.string(__result)) }) - .catch({ __error in __promiseHolder.reject(__error.toCpp()) }) - return __promise - }() - return bridge.create_Result_std__shared_ptr_Promise_std__string___(__resultCpp) - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_std__shared_ptr_Promise_std__string___(__exceptionPtr) - } - } - - @inline(__always) - public final func saveDeviceToken(token: std.string) -> bridge.Result_std__shared_ptr_Promise_void___ { - do { - let __result = try self.__implementation.saveDeviceToken(token: String(token)) - let __resultCpp = { () -> bridge.std__shared_ptr_Promise_void__ in - let __promise = bridge.create_std__shared_ptr_Promise_void__() - let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_void__(__promise) - __result - .then({ __result in __promiseHolder.resolve() }) - .catch({ __error in __promiseHolder.reject(__error.toCpp()) }) - return __promise - }() - return bridge.create_Result_std__shared_ptr_Promise_void___(__resultCpp) - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_std__shared_ptr_Promise_void___(__exceptionPtr) - } - } - - @inline(__always) - public final func registerDeviceToken() -> bridge.Result_std__shared_ptr_Promise_bool___ { - do { - let __result = try self.__implementation.registerDeviceToken() - let __resultCpp = { () -> bridge.std__shared_ptr_Promise_bool__ in - let __promise = bridge.create_std__shared_ptr_Promise_bool__() - let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_bool__(__promise) - __result - .then({ __result in __promiseHolder.resolve(__result) }) - .catch({ __error in __promiseHolder.reject(__error.toCpp()) }) - return __promise - }() - return bridge.create_Result_std__shared_ptr_Promise_bool___(__resultCpp) - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_std__shared_ptr_Promise_bool___(__exceptionPtr) - } - } - - @inline(__always) - public final func getStartupTime() -> bridge.Result_std__shared_ptr_Promise_double___ { - do { - let __result = try self.__implementation.getStartupTime() - let __resultCpp = { () -> bridge.std__shared_ptr_Promise_double__ in - let __promise = bridge.create_std__shared_ptr_Promise_double__() - let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_double__(__promise) - __result - .then({ __result in __promiseHolder.resolve(__result) }) - .catch({ __error in __promiseHolder.reject(__error.toCpp()) }) - return __promise - }() - return bridge.create_Result_std__shared_ptr_Promise_double___(__resultCpp) - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_std__shared_ptr_Promise_double___(__exceptionPtr) - } - } - - @inline(__always) - public final func exitApp() -> bridge.Result_void_ { - do { - try self.__implementation.exitApp() - return bridge.create_Result_void_() - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_void_(__exceptionPtr) - } - } - - @inline(__always) - public final func getCurrentWebViewPackageInfo() -> bridge.Result_std__shared_ptr_Promise_WebViewPackageInfo___ { - do { - let __result = try self.__implementation.getCurrentWebViewPackageInfo() - let __resultCpp = { () -> bridge.std__shared_ptr_Promise_WebViewPackageInfo__ in - let __promise = bridge.create_std__shared_ptr_Promise_WebViewPackageInfo__() - let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_WebViewPackageInfo__(__promise) - __result - .then({ __result in __promiseHolder.resolve(__result) }) - .catch({ __error in __promiseHolder.reject(__error.toCpp()) }) - return __promise - }() - return bridge.create_Result_std__shared_ptr_Promise_WebViewPackageInfo___(__resultCpp) - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_std__shared_ptr_Promise_WebViewPackageInfo___(__exceptionPtr) - } - } - - @inline(__always) - public final func isGooglePlayServicesAvailable() -> bridge.Result_std__shared_ptr_Promise_GooglePlayServicesStatus___ { - do { - let __result = try self.__implementation.isGooglePlayServicesAvailable() - let __resultCpp = { () -> bridge.std__shared_ptr_Promise_GooglePlayServicesStatus__ in - let __promise = bridge.create_std__shared_ptr_Promise_GooglePlayServicesStatus__() - let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_GooglePlayServicesStatus__(__promise) - __result - .then({ __result in __promiseHolder.resolve(__result) }) - .catch({ __error in __promiseHolder.reject(__error.toCpp()) }) - return __promise - }() - return bridge.create_Result_std__shared_ptr_Promise_GooglePlayServicesStatus___(__resultCpp) - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_std__shared_ptr_Promise_GooglePlayServicesStatus___(__exceptionPtr) - } - } -} diff --git a/native-modules/react-native-device-utils/nitrogen/generated/ios/swift/LaunchOptions.swift b/native-modules/react-native-device-utils/nitrogen/generated/ios/swift/LaunchOptions.swift deleted file mode 100644 index b1f0f2e..0000000 --- a/native-modules/react-native-device-utils/nitrogen/generated/ios/swift/LaunchOptions.swift +++ /dev/null @@ -1,66 +0,0 @@ -/// -/// LaunchOptions.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Represents an instance of `LaunchOptions`, backed by a C++ struct. - */ -public typealias LaunchOptions = margelo.nitro.reactnativedeviceutils.LaunchOptions - -public extension LaunchOptions { - private typealias bridge = margelo.nitro.reactnativedeviceutils.bridge.swift - - /** - * Create a new instance of `LaunchOptions`. - */ - init(launchType: String, deepLink: String?) { - self.init(std.string(launchType), { () -> bridge.std__optional_std__string_ in - if let __unwrappedValue = deepLink { - return bridge.create_std__optional_std__string_(std.string(__unwrappedValue)) - } else { - return .init() - } - }()) - } - - var launchType: String { - @inline(__always) - get { - return String(self.__launchType) - } - @inline(__always) - set { - self.__launchType = std.string(newValue) - } - } - - var deepLink: String? { - @inline(__always) - get { - return { () -> String? in - if bridge.has_value_std__optional_std__string_(self.__deepLink) { - let __unwrapped = bridge.get_std__optional_std__string_(self.__deepLink) - return String(__unwrapped) - } else { - return nil - } - }() - } - @inline(__always) - set { - self.__deepLink = { () -> bridge.std__optional_std__string_ in - if let __unwrappedValue = newValue { - return bridge.create_std__optional_std__string_(std.string(__unwrappedValue)) - } else { - return .init() - } - }() - } - } -} diff --git a/native-modules/react-native-device-utils/nitrogen/generated/ios/swift/UserInterfaceStyle.swift b/native-modules/react-native-device-utils/nitrogen/generated/ios/swift/UserInterfaceStyle.swift deleted file mode 100644 index af603dc..0000000 --- a/native-modules/react-native-device-utils/nitrogen/generated/ios/swift/UserInterfaceStyle.swift +++ /dev/null @@ -1,44 +0,0 @@ -/// -/// UserInterfaceStyle.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -/** - * Represents the JS union `UserInterfaceStyle`, backed by a C++ enum. - */ -public typealias UserInterfaceStyle = margelo.nitro.reactnativedeviceutils.UserInterfaceStyle - -public extension UserInterfaceStyle { - /** - * Get a UserInterfaceStyle for the given String value, or - * return `nil` if the given value was invalid/unknown. - */ - init?(fromString string: String) { - switch string { - case "light": - self = .light - case "dark": - self = .dark - case "unspecified": - self = .unspecified - default: - return nil - } - } - - /** - * Get the String value this UserInterfaceStyle represents. - */ - var stringValue: String { - switch self { - case .light: - return "light" - case .dark: - return "dark" - case .unspecified: - return "unspecified" - } - } -} diff --git a/native-modules/react-native-device-utils/nitrogen/generated/ios/swift/WebViewPackageInfo.swift b/native-modules/react-native-device-utils/nitrogen/generated/ios/swift/WebViewPackageInfo.swift deleted file mode 100644 index 88dba96..0000000 --- a/native-modules/react-native-device-utils/nitrogen/generated/ios/swift/WebViewPackageInfo.swift +++ /dev/null @@ -1,58 +0,0 @@ -/// -/// WebViewPackageInfo.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Represents an instance of `WebViewPackageInfo`, backed by a C++ struct. - */ -public typealias WebViewPackageInfo = margelo.nitro.reactnativedeviceutils.WebViewPackageInfo - -public extension WebViewPackageInfo { - private typealias bridge = margelo.nitro.reactnativedeviceutils.bridge.swift - - /** - * Create a new instance of `WebViewPackageInfo`. - */ - init(packageName: String, versionName: String, versionCode: Double) { - self.init(std.string(packageName), std.string(versionName), versionCode) - } - - var packageName: String { - @inline(__always) - get { - return String(self.__packageName) - } - @inline(__always) - set { - self.__packageName = std.string(newValue) - } - } - - var versionName: String { - @inline(__always) - get { - return String(self.__versionName) - } - @inline(__always) - set { - self.__versionName = std.string(newValue) - } - } - - var versionCode: Double { - @inline(__always) - get { - return self.__versionCode - } - @inline(__always) - set { - self.__versionCode = newValue - } - } -} diff --git a/native-modules/react-native-device-utils/nitrogen/generated/shared/c++/DualScreenInfoRect.hpp b/native-modules/react-native-device-utils/nitrogen/generated/shared/c++/DualScreenInfoRect.hpp deleted file mode 100644 index 8fbf339..0000000 --- a/native-modules/react-native-device-utils/nitrogen/generated/shared/c++/DualScreenInfoRect.hpp +++ /dev/null @@ -1,87 +0,0 @@ -/// -/// DualScreenInfoRect.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif - - - - - -namespace margelo::nitro::reactnativedeviceutils { - - /** - * A struct which can be represented as a JavaScript object (DualScreenInfoRect). - */ - struct DualScreenInfoRect { - public: - double x SWIFT_PRIVATE; - double y SWIFT_PRIVATE; - double width SWIFT_PRIVATE; - double height SWIFT_PRIVATE; - - public: - DualScreenInfoRect() = default; - explicit DualScreenInfoRect(double x, double y, double width, double height): x(x), y(y), width(width), height(height) {} - }; - -} // namespace margelo::nitro::reactnativedeviceutils - -namespace margelo::nitro { - - // C++ DualScreenInfoRect <> JS DualScreenInfoRect (object) - template <> - struct JSIConverter final { - static inline margelo::nitro::reactnativedeviceutils::DualScreenInfoRect fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { - jsi::Object obj = arg.asObject(runtime); - return margelo::nitro::reactnativedeviceutils::DualScreenInfoRect( - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "x")), - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "y")), - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "width")), - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "height")) - ); - } - static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::reactnativedeviceutils::DualScreenInfoRect& arg) { - jsi::Object obj(runtime); - obj.setProperty(runtime, "x", JSIConverter::toJSI(runtime, arg.x)); - obj.setProperty(runtime, "y", JSIConverter::toJSI(runtime, arg.y)); - obj.setProperty(runtime, "width", JSIConverter::toJSI(runtime, arg.width)); - obj.setProperty(runtime, "height", JSIConverter::toJSI(runtime, arg.height)); - return obj; - } - static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) { - if (!value.isObject()) { - return false; - } - jsi::Object obj = value.getObject(runtime); - if (!nitro::isPlainObject(runtime, obj)) { - return false; - } - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "x"))) return false; - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "y"))) return false; - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "width"))) return false; - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "height"))) return false; - return true; - } - }; - -} // namespace margelo::nitro diff --git a/native-modules/react-native-device-utils/nitrogen/generated/shared/c++/GooglePlayServicesStatus.hpp b/native-modules/react-native-device-utils/nitrogen/generated/shared/c++/GooglePlayServicesStatus.hpp deleted file mode 100644 index 2f82fea..0000000 --- a/native-modules/react-native-device-utils/nitrogen/generated/shared/c++/GooglePlayServicesStatus.hpp +++ /dev/null @@ -1,79 +0,0 @@ -/// -/// GooglePlayServicesStatus.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif - - - - - -namespace margelo::nitro::reactnativedeviceutils { - - /** - * A struct which can be represented as a JavaScript object (GooglePlayServicesStatus). - */ - struct GooglePlayServicesStatus { - public: - double status SWIFT_PRIVATE; - bool isAvailable SWIFT_PRIVATE; - - public: - GooglePlayServicesStatus() = default; - explicit GooglePlayServicesStatus(double status, bool isAvailable): status(status), isAvailable(isAvailable) {} - }; - -} // namespace margelo::nitro::reactnativedeviceutils - -namespace margelo::nitro { - - // C++ GooglePlayServicesStatus <> JS GooglePlayServicesStatus (object) - template <> - struct JSIConverter final { - static inline margelo::nitro::reactnativedeviceutils::GooglePlayServicesStatus fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { - jsi::Object obj = arg.asObject(runtime); - return margelo::nitro::reactnativedeviceutils::GooglePlayServicesStatus( - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "status")), - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "isAvailable")) - ); - } - static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::reactnativedeviceutils::GooglePlayServicesStatus& arg) { - jsi::Object obj(runtime); - obj.setProperty(runtime, "status", JSIConverter::toJSI(runtime, arg.status)); - obj.setProperty(runtime, "isAvailable", JSIConverter::toJSI(runtime, arg.isAvailable)); - return obj; - } - static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) { - if (!value.isObject()) { - return false; - } - jsi::Object obj = value.getObject(runtime); - if (!nitro::isPlainObject(runtime, obj)) { - return false; - } - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "status"))) return false; - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "isAvailable"))) return false; - return true; - } - }; - -} // namespace margelo::nitro diff --git a/native-modules/react-native-device-utils/nitrogen/generated/shared/c++/HybridReactNativeDeviceUtilsSpec.cpp b/native-modules/react-native-device-utils/nitrogen/generated/shared/c++/HybridReactNativeDeviceUtilsSpec.cpp deleted file mode 100644 index 448aabd..0000000 --- a/native-modules/react-native-device-utils/nitrogen/generated/shared/c++/HybridReactNativeDeviceUtilsSpec.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/// -/// HybridReactNativeDeviceUtilsSpec.cpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#include "HybridReactNativeDeviceUtilsSpec.hpp" - -namespace margelo::nitro::reactnativedeviceutils { - - void HybridReactNativeDeviceUtilsSpec::loadHybridMethods() { - // load base methods/properties - HybridObject::loadHybridMethods(); - // load custom methods/properties - registerHybrids(this, [](Prototype& prototype) { - prototype.registerHybridMethod("initEventListeners", &HybridReactNativeDeviceUtilsSpec::initEventListeners); - prototype.registerHybridMethod("isDualScreenDevice", &HybridReactNativeDeviceUtilsSpec::isDualScreenDevice); - prototype.registerHybridMethod("isSpanning", &HybridReactNativeDeviceUtilsSpec::isSpanning); - prototype.registerHybridMethod("getWindowRects", &HybridReactNativeDeviceUtilsSpec::getWindowRects); - prototype.registerHybridMethod("getHingeBounds", &HybridReactNativeDeviceUtilsSpec::getHingeBounds); - prototype.registerHybridMethod("changeBackgroundColor", &HybridReactNativeDeviceUtilsSpec::changeBackgroundColor); - prototype.registerHybridMethod("addSpanningChangedListener", &HybridReactNativeDeviceUtilsSpec::addSpanningChangedListener); - prototype.registerHybridMethod("removeSpanningChangedListener", &HybridReactNativeDeviceUtilsSpec::removeSpanningChangedListener); - prototype.registerHybridMethod("setUserInterfaceStyle", &HybridReactNativeDeviceUtilsSpec::setUserInterfaceStyle); - prototype.registerHybridMethod("getLaunchOptions", &HybridReactNativeDeviceUtilsSpec::getLaunchOptions); - prototype.registerHybridMethod("clearLaunchOptions", &HybridReactNativeDeviceUtilsSpec::clearLaunchOptions); - prototype.registerHybridMethod("getDeviceToken", &HybridReactNativeDeviceUtilsSpec::getDeviceToken); - prototype.registerHybridMethod("saveDeviceToken", &HybridReactNativeDeviceUtilsSpec::saveDeviceToken); - prototype.registerHybridMethod("registerDeviceToken", &HybridReactNativeDeviceUtilsSpec::registerDeviceToken); - prototype.registerHybridMethod("getStartupTime", &HybridReactNativeDeviceUtilsSpec::getStartupTime); - prototype.registerHybridMethod("exitApp", &HybridReactNativeDeviceUtilsSpec::exitApp); - prototype.registerHybridMethod("getCurrentWebViewPackageInfo", &HybridReactNativeDeviceUtilsSpec::getCurrentWebViewPackageInfo); - prototype.registerHybridMethod("isGooglePlayServicesAvailable", &HybridReactNativeDeviceUtilsSpec::isGooglePlayServicesAvailable); - }); - } - -} // namespace margelo::nitro::reactnativedeviceutils diff --git a/native-modules/react-native-device-utils/nitrogen/generated/shared/c++/HybridReactNativeDeviceUtilsSpec.hpp b/native-modules/react-native-device-utils/nitrogen/generated/shared/c++/HybridReactNativeDeviceUtilsSpec.hpp deleted file mode 100644 index f953245..0000000 --- a/native-modules/react-native-device-utils/nitrogen/generated/shared/c++/HybridReactNativeDeviceUtilsSpec.hpp +++ /dev/null @@ -1,96 +0,0 @@ -/// -/// HybridReactNativeDeviceUtilsSpec.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif - -// Forward declaration of `DualScreenInfoRect` to properly resolve imports. -namespace margelo::nitro::reactnativedeviceutils { struct DualScreenInfoRect; } -// Forward declaration of `UserInterfaceStyle` to properly resolve imports. -namespace margelo::nitro::reactnativedeviceutils { enum class UserInterfaceStyle; } -// Forward declaration of `LaunchOptions` to properly resolve imports. -namespace margelo::nitro::reactnativedeviceutils { struct LaunchOptions; } -// Forward declaration of `WebViewPackageInfo` to properly resolve imports. -namespace margelo::nitro::reactnativedeviceutils { struct WebViewPackageInfo; } -// Forward declaration of `GooglePlayServicesStatus` to properly resolve imports. -namespace margelo::nitro::reactnativedeviceutils { struct GooglePlayServicesStatus; } - -#include "DualScreenInfoRect.hpp" -#include -#include -#include -#include "UserInterfaceStyle.hpp" -#include "LaunchOptions.hpp" -#include -#include "WebViewPackageInfo.hpp" -#include "GooglePlayServicesStatus.hpp" - -namespace margelo::nitro::reactnativedeviceutils { - - using namespace margelo::nitro; - - /** - * An abstract base class for `ReactNativeDeviceUtils` - * Inherit this class to create instances of `HybridReactNativeDeviceUtilsSpec` in C++. - * You must explicitly call `HybridObject`'s constructor yourself, because it is virtual. - * @example - * ```cpp - * class HybridReactNativeDeviceUtils: public HybridReactNativeDeviceUtilsSpec { - * public: - * HybridReactNativeDeviceUtils(...): HybridObject(TAG) { ... } - * // ... - * }; - * ``` - */ - class HybridReactNativeDeviceUtilsSpec: public virtual HybridObject { - public: - // Constructor - explicit HybridReactNativeDeviceUtilsSpec(): HybridObject(TAG) { } - - // Destructor - ~HybridReactNativeDeviceUtilsSpec() override = default; - - public: - // Properties - - - public: - // Methods - virtual void initEventListeners() = 0; - virtual bool isDualScreenDevice() = 0; - virtual bool isSpanning() = 0; - virtual std::shared_ptr>> getWindowRects() = 0; - virtual std::shared_ptr> getHingeBounds() = 0; - virtual void changeBackgroundColor(double r, double g, double b, double a) = 0; - virtual double addSpanningChangedListener(const std::function& callback) = 0; - virtual void removeSpanningChangedListener(double id) = 0; - virtual void setUserInterfaceStyle(UserInterfaceStyle style) = 0; - virtual std::shared_ptr> getLaunchOptions() = 0; - virtual std::shared_ptr> clearLaunchOptions() = 0; - virtual std::shared_ptr> getDeviceToken() = 0; - virtual std::shared_ptr> saveDeviceToken(const std::string& token) = 0; - virtual std::shared_ptr> registerDeviceToken() = 0; - virtual std::shared_ptr> getStartupTime() = 0; - virtual void exitApp() = 0; - virtual std::shared_ptr> getCurrentWebViewPackageInfo() = 0; - virtual std::shared_ptr> isGooglePlayServicesAvailable() = 0; - - protected: - // Hybrid Setup - void loadHybridMethods() override; - - protected: - // Tag for logging - static constexpr auto TAG = "ReactNativeDeviceUtils"; - }; - -} // namespace margelo::nitro::reactnativedeviceutils diff --git a/native-modules/react-native-device-utils/nitrogen/generated/shared/c++/LaunchOptions.hpp b/native-modules/react-native-device-utils/nitrogen/generated/shared/c++/LaunchOptions.hpp deleted file mode 100644 index b20708c..0000000 --- a/native-modules/react-native-device-utils/nitrogen/generated/shared/c++/LaunchOptions.hpp +++ /dev/null @@ -1,80 +0,0 @@ -/// -/// LaunchOptions.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif - - - -#include -#include - -namespace margelo::nitro::reactnativedeviceutils { - - /** - * A struct which can be represented as a JavaScript object (LaunchOptions). - */ - struct LaunchOptions { - public: - std::string launchType SWIFT_PRIVATE; - std::optional deepLink SWIFT_PRIVATE; - - public: - LaunchOptions() = default; - explicit LaunchOptions(std::string launchType, std::optional deepLink): launchType(launchType), deepLink(deepLink) {} - }; - -} // namespace margelo::nitro::reactnativedeviceutils - -namespace margelo::nitro { - - // C++ LaunchOptions <> JS LaunchOptions (object) - template <> - struct JSIConverter final { - static inline margelo::nitro::reactnativedeviceutils::LaunchOptions fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { - jsi::Object obj = arg.asObject(runtime); - return margelo::nitro::reactnativedeviceutils::LaunchOptions( - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "launchType")), - JSIConverter>::fromJSI(runtime, obj.getProperty(runtime, "deepLink")) - ); - } - static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::reactnativedeviceutils::LaunchOptions& arg) { - jsi::Object obj(runtime); - obj.setProperty(runtime, "launchType", JSIConverter::toJSI(runtime, arg.launchType)); - obj.setProperty(runtime, "deepLink", JSIConverter>::toJSI(runtime, arg.deepLink)); - return obj; - } - static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) { - if (!value.isObject()) { - return false; - } - jsi::Object obj = value.getObject(runtime); - if (!nitro::isPlainObject(runtime, obj)) { - return false; - } - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "launchType"))) return false; - if (!JSIConverter>::canConvert(runtime, obj.getProperty(runtime, "deepLink"))) return false; - return true; - } - }; - -} // namespace margelo::nitro diff --git a/native-modules/react-native-device-utils/nitrogen/generated/shared/c++/UserInterfaceStyle.hpp b/native-modules/react-native-device-utils/nitrogen/generated/shared/c++/UserInterfaceStyle.hpp deleted file mode 100644 index 0f0c740..0000000 --- a/native-modules/react-native-device-utils/nitrogen/generated/shared/c++/UserInterfaceStyle.hpp +++ /dev/null @@ -1,80 +0,0 @@ -/// -/// UserInterfaceStyle.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif - -namespace margelo::nitro::reactnativedeviceutils { - - /** - * An enum which can be represented as a JavaScript union (UserInterfaceStyle). - */ - enum class UserInterfaceStyle { - LIGHT SWIFT_NAME(light) = 0, - DARK SWIFT_NAME(dark) = 1, - UNSPECIFIED SWIFT_NAME(unspecified) = 2, - } CLOSED_ENUM; - -} // namespace margelo::nitro::reactnativedeviceutils - -namespace margelo::nitro { - - // C++ UserInterfaceStyle <> JS UserInterfaceStyle (union) - template <> - struct JSIConverter final { - static inline margelo::nitro::reactnativedeviceutils::UserInterfaceStyle fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { - std::string unionValue = JSIConverter::fromJSI(runtime, arg); - switch (hashString(unionValue.c_str(), unionValue.size())) { - case hashString("light"): return margelo::nitro::reactnativedeviceutils::UserInterfaceStyle::LIGHT; - case hashString("dark"): return margelo::nitro::reactnativedeviceutils::UserInterfaceStyle::DARK; - case hashString("unspecified"): return margelo::nitro::reactnativedeviceutils::UserInterfaceStyle::UNSPECIFIED; - default: [[unlikely]] - throw std::invalid_argument("Cannot convert \"" + unionValue + "\" to enum UserInterfaceStyle - invalid value!"); - } - } - static inline jsi::Value toJSI(jsi::Runtime& runtime, margelo::nitro::reactnativedeviceutils::UserInterfaceStyle arg) { - switch (arg) { - case margelo::nitro::reactnativedeviceutils::UserInterfaceStyle::LIGHT: return JSIConverter::toJSI(runtime, "light"); - case margelo::nitro::reactnativedeviceutils::UserInterfaceStyle::DARK: return JSIConverter::toJSI(runtime, "dark"); - case margelo::nitro::reactnativedeviceutils::UserInterfaceStyle::UNSPECIFIED: return JSIConverter::toJSI(runtime, "unspecified"); - default: [[unlikely]] - throw std::invalid_argument("Cannot convert UserInterfaceStyle to JS - invalid value: " - + std::to_string(static_cast(arg)) + "!"); - } - } - static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) { - if (!value.isString()) { - return false; - } - std::string unionValue = JSIConverter::fromJSI(runtime, value); - switch (hashString(unionValue.c_str(), unionValue.size())) { - case hashString("light"): - case hashString("dark"): - case hashString("unspecified"): - return true; - default: - return false; - } - } - }; - -} // namespace margelo::nitro diff --git a/native-modules/react-native-device-utils/nitrogen/generated/shared/c++/WebViewPackageInfo.hpp b/native-modules/react-native-device-utils/nitrogen/generated/shared/c++/WebViewPackageInfo.hpp deleted file mode 100644 index 343704e..0000000 --- a/native-modules/react-native-device-utils/nitrogen/generated/shared/c++/WebViewPackageInfo.hpp +++ /dev/null @@ -1,83 +0,0 @@ -/// -/// WebViewPackageInfo.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif - - - -#include - -namespace margelo::nitro::reactnativedeviceutils { - - /** - * A struct which can be represented as a JavaScript object (WebViewPackageInfo). - */ - struct WebViewPackageInfo { - public: - std::string packageName SWIFT_PRIVATE; - std::string versionName SWIFT_PRIVATE; - double versionCode SWIFT_PRIVATE; - - public: - WebViewPackageInfo() = default; - explicit WebViewPackageInfo(std::string packageName, std::string versionName, double versionCode): packageName(packageName), versionName(versionName), versionCode(versionCode) {} - }; - -} // namespace margelo::nitro::reactnativedeviceutils - -namespace margelo::nitro { - - // C++ WebViewPackageInfo <> JS WebViewPackageInfo (object) - template <> - struct JSIConverter final { - static inline margelo::nitro::reactnativedeviceutils::WebViewPackageInfo fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { - jsi::Object obj = arg.asObject(runtime); - return margelo::nitro::reactnativedeviceutils::WebViewPackageInfo( - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "packageName")), - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "versionName")), - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "versionCode")) - ); - } - static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::reactnativedeviceutils::WebViewPackageInfo& arg) { - jsi::Object obj(runtime); - obj.setProperty(runtime, "packageName", JSIConverter::toJSI(runtime, arg.packageName)); - obj.setProperty(runtime, "versionName", JSIConverter::toJSI(runtime, arg.versionName)); - obj.setProperty(runtime, "versionCode", JSIConverter::toJSI(runtime, arg.versionCode)); - return obj; - } - static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) { - if (!value.isObject()) { - return false; - } - jsi::Object obj = value.getObject(runtime); - if (!nitro::isPlainObject(runtime, obj)) { - return false; - } - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "packageName"))) return false; - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "versionName"))) return false; - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "versionCode"))) return false; - return true; - } - }; - -} // namespace margelo::nitro diff --git a/native-modules/react-native-get-random-values/nitrogen/generated/.gitattributes b/native-modules/react-native-get-random-values/nitrogen/generated/.gitattributes deleted file mode 100644 index fb7a0d5..0000000 --- a/native-modules/react-native-get-random-values/nitrogen/generated/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -** linguist-generated=true diff --git a/native-modules/react-native-get-random-values/nitrogen/generated/android/c++/JHybridReactNativeGetRandomValuesSpec.cpp b/native-modules/react-native-get-random-values/nitrogen/generated/android/c++/JHybridReactNativeGetRandomValuesSpec.cpp deleted file mode 100644 index 3c5d40d..0000000 --- a/native-modules/react-native-get-random-values/nitrogen/generated/android/c++/JHybridReactNativeGetRandomValuesSpec.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/// -/// JHybridReactNativeGetRandomValuesSpec.cpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#include "JHybridReactNativeGetRandomValuesSpec.hpp" - - - -#include - -namespace margelo::nitro::reactnativegetrandomvalues { - - jni::local_ref JHybridReactNativeGetRandomValuesSpec::initHybrid(jni::alias_ref jThis) { - return makeCxxInstance(jThis); - } - - void JHybridReactNativeGetRandomValuesSpec::registerNatives() { - registerHybrid({ - makeNativeMethod("initHybrid", JHybridReactNativeGetRandomValuesSpec::initHybrid), - }); - } - - size_t JHybridReactNativeGetRandomValuesSpec::getExternalMemorySize() noexcept { - static const auto method = javaClassStatic()->getMethod("getMemorySize"); - return method(_javaPart); - } - - void JHybridReactNativeGetRandomValuesSpec::dispose() noexcept { - static const auto method = javaClassStatic()->getMethod("dispose"); - method(_javaPart); - } - - std::string JHybridReactNativeGetRandomValuesSpec::toString() { - static const auto method = javaClassStatic()->getMethod("toString"); - auto javaString = method(_javaPart); - return javaString->toStdString(); - } - - // Properties - - - // Methods - std::string JHybridReactNativeGetRandomValuesSpec::getRandomBase64(double byteLength) { - static const auto method = javaClassStatic()->getMethod(double /* byteLength */)>("getRandomBase64"); - auto __result = method(_javaPart, byteLength); - return __result->toStdString(); - } - -} // namespace margelo::nitro::reactnativegetrandomvalues diff --git a/native-modules/react-native-get-random-values/nitrogen/generated/android/c++/JHybridReactNativeGetRandomValuesSpec.hpp b/native-modules/react-native-get-random-values/nitrogen/generated/android/c++/JHybridReactNativeGetRandomValuesSpec.hpp deleted file mode 100644 index 624617d..0000000 --- a/native-modules/react-native-get-random-values/nitrogen/generated/android/c++/JHybridReactNativeGetRandomValuesSpec.hpp +++ /dev/null @@ -1,65 +0,0 @@ -/// -/// HybridReactNativeGetRandomValuesSpec.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#include -#include -#include "HybridReactNativeGetRandomValuesSpec.hpp" - - - - -namespace margelo::nitro::reactnativegetrandomvalues { - - using namespace facebook; - - class JHybridReactNativeGetRandomValuesSpec: public jni::HybridClass, - public virtual HybridReactNativeGetRandomValuesSpec { - public: - static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/reactnativegetrandomvalues/HybridReactNativeGetRandomValuesSpec;"; - static jni::local_ref initHybrid(jni::alias_ref jThis); - static void registerNatives(); - - protected: - // C++ constructor (called from Java via `initHybrid()`) - explicit JHybridReactNativeGetRandomValuesSpec(jni::alias_ref jThis) : - HybridObject(HybridReactNativeGetRandomValuesSpec::TAG), - HybridBase(jThis), - _javaPart(jni::make_global(jThis)) {} - - public: - ~JHybridReactNativeGetRandomValuesSpec() override { - // Hermes GC can destroy JS objects on a non-JNI Thread. - jni::ThreadScope::WithClassLoader([&] { _javaPart.reset(); }); - } - - public: - size_t getExternalMemorySize() noexcept override; - void dispose() noexcept override; - std::string toString() override; - - public: - inline const jni::global_ref& getJavaPart() const noexcept { - return _javaPart; - } - - public: - // Properties - - - public: - // Methods - std::string getRandomBase64(double byteLength) override; - - private: - friend HybridBase; - using HybridBase::HybridBase; - jni::global_ref _javaPart; - }; - -} // namespace margelo::nitro::reactnativegetrandomvalues diff --git a/native-modules/react-native-get-random-values/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativegetrandomvalues/HybridReactNativeGetRandomValuesSpec.kt b/native-modules/react-native-get-random-values/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativegetrandomvalues/HybridReactNativeGetRandomValuesSpec.kt deleted file mode 100644 index fce5ffe..0000000 --- a/native-modules/react-native-get-random-values/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativegetrandomvalues/HybridReactNativeGetRandomValuesSpec.kt +++ /dev/null @@ -1,57 +0,0 @@ -/// -/// HybridReactNativeGetRandomValuesSpec.kt -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -package com.margelo.nitro.reactnativegetrandomvalues - -import androidx.annotation.Keep -import com.facebook.jni.HybridData -import com.facebook.proguard.annotations.DoNotStrip -import com.margelo.nitro.core.HybridObject - -/** - * A Kotlin class representing the ReactNativeGetRandomValues HybridObject. - * Implement this abstract class to create Kotlin-based instances of ReactNativeGetRandomValues. - */ -@DoNotStrip -@Keep -@Suppress( - "KotlinJniMissingFunction", "unused", - "RedundantSuppression", "RedundantUnitReturnType", "SimpleRedundantLet", - "LocalVariableName", "PropertyName", "PrivatePropertyName", "FunctionName" -) -abstract class HybridReactNativeGetRandomValuesSpec: HybridObject() { - @DoNotStrip - private var mHybridData: HybridData = initHybrid() - - init { - super.updateNative(mHybridData) - } - - override fun updateNative(hybridData: HybridData) { - mHybridData = hybridData - super.updateNative(hybridData) - } - - // Default implementation of `HybridObject.toString()` - override fun toString(): String { - return "[HybridObject ReactNativeGetRandomValues]" - } - - // Properties - - - // Methods - @DoNotStrip - @Keep - abstract fun getRandomBase64(byteLength: Double): String - - private external fun initHybrid(): HybridData - - companion object { - protected const val TAG = "HybridReactNativeGetRandomValuesSpec" - } -} diff --git a/native-modules/react-native-get-random-values/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativegetrandomvalues/reactnativegetrandomvaluesOnLoad.kt b/native-modules/react-native-get-random-values/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativegetrandomvalues/reactnativegetrandomvaluesOnLoad.kt deleted file mode 100644 index 8dca77f..0000000 --- a/native-modules/react-native-get-random-values/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativegetrandomvalues/reactnativegetrandomvaluesOnLoad.kt +++ /dev/null @@ -1,35 +0,0 @@ -/// -/// reactnativegetrandomvaluesOnLoad.kt -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -package com.margelo.nitro.reactnativegetrandomvalues - -import android.util.Log - -internal class reactnativegetrandomvaluesOnLoad { - companion object { - private const val TAG = "reactnativegetrandomvaluesOnLoad" - private var didLoad = false - /** - * Initializes the native part of "reactnativegetrandomvalues". - * This method is idempotent and can be called more than once. - */ - @JvmStatic - fun initializeNative() { - if (didLoad) return - try { - Log.i(TAG, "Loading reactnativegetrandomvalues C++ library...") - System.loadLibrary("reactnativegetrandomvalues") - Log.i(TAG, "Successfully loaded reactnativegetrandomvalues C++ library!") - didLoad = true - } catch (e: Error) { - Log.e(TAG, "Failed to load reactnativegetrandomvalues C++ library! Is it properly installed and linked? " + - "Is the name correct? (see `CMakeLists.txt`, at `add_library(...)`)", e) - throw e - } - } - } -} diff --git a/native-modules/react-native-get-random-values/nitrogen/generated/android/reactnativegetrandomvalues+autolinking.cmake b/native-modules/react-native-get-random-values/nitrogen/generated/android/reactnativegetrandomvalues+autolinking.cmake deleted file mode 100644 index 27746f2..0000000 --- a/native-modules/react-native-get-random-values/nitrogen/generated/android/reactnativegetrandomvalues+autolinking.cmake +++ /dev/null @@ -1,81 +0,0 @@ -# -# reactnativegetrandomvalues+autolinking.cmake -# This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -# https://github.com/mrousavy/nitro -# Copyright © 2026 Marc Rousavy @ Margelo -# - -# This is a CMake file that adds all files generated by Nitrogen -# to the current CMake project. -# -# To use it, add this to your CMakeLists.txt: -# ```cmake -# include(${CMAKE_SOURCE_DIR}/../nitrogen/generated/android/reactnativegetrandomvalues+autolinking.cmake) -# ``` - -# Define a flag to check if we are building properly -add_definitions(-DBUILDING_REACTNATIVEGETRANDOMVALUES_WITH_GENERATED_CMAKE_PROJECT) - -# Enable Raw Props parsing in react-native (for Nitro Views) -add_definitions(-DRN_SERIALIZABLE_STATE) - -# Add all headers that were generated by Nitrogen -include_directories( - "../nitrogen/generated/shared/c++" - "../nitrogen/generated/android/c++" - "../nitrogen/generated/android/" -) - -# Add all .cpp sources that were generated by Nitrogen -target_sources( - # CMake project name (Android C++ library name) - reactnativegetrandomvalues PRIVATE - # Autolinking Setup - ../nitrogen/generated/android/reactnativegetrandomvaluesOnLoad.cpp - # Shared Nitrogen C++ sources - ../nitrogen/generated/shared/c++/HybridReactNativeGetRandomValuesSpec.cpp - # Android-specific Nitrogen C++ sources - ../nitrogen/generated/android/c++/JHybridReactNativeGetRandomValuesSpec.cpp -) - -# From node_modules/react-native/ReactAndroid/cmake-utils/folly-flags.cmake -# Used in node_modules/react-native/ReactAndroid/cmake-utils/ReactNative-application.cmake -target_compile_definitions( - reactnativegetrandomvalues PRIVATE - -DFOLLY_NO_CONFIG=1 - -DFOLLY_HAVE_CLOCK_GETTIME=1 - -DFOLLY_USE_LIBCPP=1 - -DFOLLY_CFG_NO_COROUTINES=1 - -DFOLLY_MOBILE=1 - -DFOLLY_HAVE_RECVMMSG=1 - -DFOLLY_HAVE_PTHREAD=1 - # Once we target android-23 above, we can comment - # the following line. NDK uses GNU style stderror_r() after API 23. - -DFOLLY_HAVE_XSI_STRERROR_R=1 -) - -# Add all libraries required by the generated specs -find_package(fbjni REQUIRED) # <-- Used for communication between Java <-> C++ -find_package(ReactAndroid REQUIRED) # <-- Used to set up React Native bindings (e.g. CallInvoker/TurboModule) -find_package(react-native-nitro-modules REQUIRED) # <-- Used to create all HybridObjects and use the Nitro core library - -# Link all libraries together -target_link_libraries( - reactnativegetrandomvalues - fbjni::fbjni # <-- Facebook C++ JNI helpers - ReactAndroid::jsi # <-- RN: JSI - react-native-nitro-modules::NitroModules # <-- NitroModules Core :) -) - -# Link react-native (different prefab between RN 0.75 and RN 0.76) -if(ReactAndroid_VERSION_MINOR GREATER_EQUAL 76) - target_link_libraries( - reactnativegetrandomvalues - ReactAndroid::reactnative # <-- RN: Native Modules umbrella prefab - ) -else() - target_link_libraries( - reactnativegetrandomvalues - ReactAndroid::react_nativemodule_core # <-- RN: TurboModules Core - ) -endif() diff --git a/native-modules/react-native-get-random-values/nitrogen/generated/android/reactnativegetrandomvalues+autolinking.gradle b/native-modules/react-native-get-random-values/nitrogen/generated/android/reactnativegetrandomvalues+autolinking.gradle deleted file mode 100644 index b1caf05..0000000 --- a/native-modules/react-native-get-random-values/nitrogen/generated/android/reactnativegetrandomvalues+autolinking.gradle +++ /dev/null @@ -1,27 +0,0 @@ -/// -/// reactnativegetrandomvalues+autolinking.gradle -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -/// This is a Gradle file that adds all files generated by Nitrogen -/// to the current Gradle project. -/// -/// To use it, add this to your build.gradle: -/// ```gradle -/// apply from: '../nitrogen/generated/android/reactnativegetrandomvalues+autolinking.gradle' -/// ``` - -logger.warn("[NitroModules] 🔥 reactnativegetrandomvalues is boosted by nitro!") - -android { - sourceSets { - main { - java.srcDirs += [ - // Nitrogen files - "${project.projectDir}/../nitrogen/generated/android/kotlin" - ] - } - } -} diff --git a/native-modules/react-native-get-random-values/nitrogen/generated/android/reactnativegetrandomvaluesOnLoad.cpp b/native-modules/react-native-get-random-values/nitrogen/generated/android/reactnativegetrandomvaluesOnLoad.cpp deleted file mode 100644 index 731e594..0000000 --- a/native-modules/react-native-get-random-values/nitrogen/generated/android/reactnativegetrandomvaluesOnLoad.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/// -/// reactnativegetrandomvaluesOnLoad.cpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#ifndef BUILDING_REACTNATIVEGETRANDOMVALUES_WITH_GENERATED_CMAKE_PROJECT -#error reactnativegetrandomvaluesOnLoad.cpp is not being built with the autogenerated CMakeLists.txt project. Is a different CMakeLists.txt building this? -#endif - -#include "reactnativegetrandomvaluesOnLoad.hpp" - -#include -#include -#include - -#include "JHybridReactNativeGetRandomValuesSpec.hpp" -#include - -namespace margelo::nitro::reactnativegetrandomvalues { - -int initialize(JavaVM* vm) { - using namespace margelo::nitro; - using namespace margelo::nitro::reactnativegetrandomvalues; - using namespace facebook; - - return facebook::jni::initialize(vm, [] { - // Register native JNI methods - margelo::nitro::reactnativegetrandomvalues::JHybridReactNativeGetRandomValuesSpec::registerNatives(); - - // Register Nitro Hybrid Objects - HybridObjectRegistry::registerHybridObjectConstructor( - "ReactNativeGetRandomValues", - []() -> std::shared_ptr { - static DefaultConstructableObject object("com/margelo/nitro/reactnativegetrandomvalues/ReactNativeGetRandomValues"); - auto instance = object.create(); - return instance->cthis()->shared(); - } - ); - }); -} - -} // namespace margelo::nitro::reactnativegetrandomvalues diff --git a/native-modules/react-native-get-random-values/nitrogen/generated/android/reactnativegetrandomvaluesOnLoad.hpp b/native-modules/react-native-get-random-values/nitrogen/generated/android/reactnativegetrandomvaluesOnLoad.hpp deleted file mode 100644 index 72a3967..0000000 --- a/native-modules/react-native-get-random-values/nitrogen/generated/android/reactnativegetrandomvaluesOnLoad.hpp +++ /dev/null @@ -1,25 +0,0 @@ -/// -/// reactnativegetrandomvaluesOnLoad.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#include -#include - -namespace margelo::nitro::reactnativegetrandomvalues { - - /** - * Initializes the native (C++) part of reactnativegetrandomvalues, and autolinks all Hybrid Objects. - * Call this in your `JNI_OnLoad` function (probably inside `cpp-adapter.cpp`). - * Example: - * ```cpp (cpp-adapter.cpp) - * JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void*) { - * return margelo::nitro::reactnativegetrandomvalues::initialize(vm); - * } - * ``` - */ - int initialize(JavaVM* vm); - -} // namespace margelo::nitro::reactnativegetrandomvalues diff --git a/native-modules/react-native-get-random-values/nitrogen/generated/ios/ReactNativeGetRandomValues+autolinking.rb b/native-modules/react-native-get-random-values/nitrogen/generated/ios/ReactNativeGetRandomValues+autolinking.rb deleted file mode 100644 index 83a9378..0000000 --- a/native-modules/react-native-get-random-values/nitrogen/generated/ios/ReactNativeGetRandomValues+autolinking.rb +++ /dev/null @@ -1,60 +0,0 @@ -# -# ReactNativeGetRandomValues+autolinking.rb -# This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -# https://github.com/mrousavy/nitro -# Copyright © 2026 Marc Rousavy @ Margelo -# - -# This is a Ruby script that adds all files generated by Nitrogen -# to the given podspec. -# -# To use it, add this to your .podspec: -# ```ruby -# Pod::Spec.new do |spec| -# # ... -# -# # Add all files generated by Nitrogen -# load 'nitrogen/generated/ios/ReactNativeGetRandomValues+autolinking.rb' -# add_nitrogen_files(spec) -# end -# ``` - -def add_nitrogen_files(spec) - Pod::UI.puts "[NitroModules] 🔥 ReactNativeGetRandomValues is boosted by nitro!" - - spec.dependency "NitroModules" - - current_source_files = Array(spec.attributes_hash['source_files']) - spec.source_files = current_source_files + [ - # Generated cross-platform specs - "nitrogen/generated/shared/**/*.{h,hpp,c,cpp,swift}", - # Generated bridges for the cross-platform specs - "nitrogen/generated/ios/**/*.{h,hpp,c,cpp,mm,swift}", - ] - - current_public_header_files = Array(spec.attributes_hash['public_header_files']) - spec.public_header_files = current_public_header_files + [ - # Generated specs - "nitrogen/generated/shared/**/*.{h,hpp}", - # Swift to C++ bridging helpers - "nitrogen/generated/ios/ReactNativeGetRandomValues-Swift-Cxx-Bridge.hpp" - ] - - current_private_header_files = Array(spec.attributes_hash['private_header_files']) - spec.private_header_files = current_private_header_files + [ - # iOS specific specs - "nitrogen/generated/ios/c++/**/*.{h,hpp}", - # Views are framework-specific and should be private - "nitrogen/generated/shared/**/views/**/*" - ] - - current_pod_target_xcconfig = spec.attributes_hash['pod_target_xcconfig'] || {} - spec.pod_target_xcconfig = current_pod_target_xcconfig.merge({ - # Use C++ 20 - "CLANG_CXX_LANGUAGE_STANDARD" => "c++20", - # Enables C++ <-> Swift interop (by default it's only C) - "SWIFT_OBJC_INTEROP_MODE" => "objcxx", - # Enables stricter modular headers - "DEFINES_MODULE" => "YES", - }) -end diff --git a/native-modules/react-native-get-random-values/nitrogen/generated/ios/ReactNativeGetRandomValues-Swift-Cxx-Bridge.cpp b/native-modules/react-native-get-random-values/nitrogen/generated/ios/ReactNativeGetRandomValues-Swift-Cxx-Bridge.cpp deleted file mode 100644 index 2a0a27a..0000000 --- a/native-modules/react-native-get-random-values/nitrogen/generated/ios/ReactNativeGetRandomValues-Swift-Cxx-Bridge.cpp +++ /dev/null @@ -1,33 +0,0 @@ -/// -/// ReactNativeGetRandomValues-Swift-Cxx-Bridge.cpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#include "ReactNativeGetRandomValues-Swift-Cxx-Bridge.hpp" - -// Include C++ implementation defined types -#include "HybridReactNativeGetRandomValuesSpecSwift.hpp" -#include "ReactNativeGetRandomValues-Swift-Cxx-Umbrella.hpp" -#include - -namespace margelo::nitro::reactnativegetrandomvalues::bridge::swift { - - // pragma MARK: std::shared_ptr - std::shared_ptr create_std__shared_ptr_HybridReactNativeGetRandomValuesSpec_(void* NON_NULL swiftUnsafePointer) noexcept { - ReactNativeGetRandomValues::HybridReactNativeGetRandomValuesSpec_cxx swiftPart = ReactNativeGetRandomValues::HybridReactNativeGetRandomValuesSpec_cxx::fromUnsafe(swiftUnsafePointer); - return std::make_shared(swiftPart); - } - void* NON_NULL get_std__shared_ptr_HybridReactNativeGetRandomValuesSpec_(std__shared_ptr_HybridReactNativeGetRandomValuesSpec_ cppType) { - std::shared_ptr swiftWrapper = std::dynamic_pointer_cast(cppType); - #ifdef NITRO_DEBUG - if (swiftWrapper == nullptr) [[unlikely]] { - throw std::runtime_error("Class \"HybridReactNativeGetRandomValuesSpec\" is not implemented in Swift!"); - } - #endif - ReactNativeGetRandomValues::HybridReactNativeGetRandomValuesSpec_cxx& swiftPart = swiftWrapper->getSwiftPart(); - return swiftPart.toUnsafe(); - } - -} // namespace margelo::nitro::reactnativegetrandomvalues::bridge::swift diff --git a/native-modules/react-native-get-random-values/nitrogen/generated/ios/ReactNativeGetRandomValues-Swift-Cxx-Bridge.hpp b/native-modules/react-native-get-random-values/nitrogen/generated/ios/ReactNativeGetRandomValues-Swift-Cxx-Bridge.hpp deleted file mode 100644 index 47175f1..0000000 --- a/native-modules/react-native-get-random-values/nitrogen/generated/ios/ReactNativeGetRandomValues-Swift-Cxx-Bridge.hpp +++ /dev/null @@ -1,52 +0,0 @@ -/// -/// ReactNativeGetRandomValues-Swift-Cxx-Bridge.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -// Forward declarations of C++ defined types -// Forward declaration of `HybridReactNativeGetRandomValuesSpec` to properly resolve imports. -namespace margelo::nitro::reactnativegetrandomvalues { class HybridReactNativeGetRandomValuesSpec; } - -// Forward declarations of Swift defined types -// Forward declaration of `HybridReactNativeGetRandomValuesSpec_cxx` to properly resolve imports. -namespace ReactNativeGetRandomValues { class HybridReactNativeGetRandomValuesSpec_cxx; } - -// Include C++ defined types -#include "HybridReactNativeGetRandomValuesSpec.hpp" -#include -#include -#include -#include - -/** - * Contains specialized versions of C++ templated types so they can be accessed from Swift, - * as well as helper functions to interact with those C++ types from Swift. - */ -namespace margelo::nitro::reactnativegetrandomvalues::bridge::swift { - - // pragma MARK: std::shared_ptr - /** - * Specialized version of `std::shared_ptr`. - */ - using std__shared_ptr_HybridReactNativeGetRandomValuesSpec_ = std::shared_ptr; - std::shared_ptr create_std__shared_ptr_HybridReactNativeGetRandomValuesSpec_(void* NON_NULL swiftUnsafePointer) noexcept; - void* NON_NULL get_std__shared_ptr_HybridReactNativeGetRandomValuesSpec_(std__shared_ptr_HybridReactNativeGetRandomValuesSpec_ cppType); - - // pragma MARK: std::weak_ptr - using std__weak_ptr_HybridReactNativeGetRandomValuesSpec_ = std::weak_ptr; - inline std__weak_ptr_HybridReactNativeGetRandomValuesSpec_ weakify_std__shared_ptr_HybridReactNativeGetRandomValuesSpec_(const std::shared_ptr& strong) noexcept { return strong; } - - // pragma MARK: Result - using Result_std__string_ = Result; - inline Result_std__string_ create_Result_std__string_(const std::string& value) noexcept { - return Result::withValue(value); - } - inline Result_std__string_ create_Result_std__string_(const std::exception_ptr& error) noexcept { - return Result::withError(error); - } - -} // namespace margelo::nitro::reactnativegetrandomvalues::bridge::swift diff --git a/native-modules/react-native-get-random-values/nitrogen/generated/ios/ReactNativeGetRandomValues-Swift-Cxx-Umbrella.hpp b/native-modules/react-native-get-random-values/nitrogen/generated/ios/ReactNativeGetRandomValues-Swift-Cxx-Umbrella.hpp deleted file mode 100644 index d9bbee8..0000000 --- a/native-modules/react-native-get-random-values/nitrogen/generated/ios/ReactNativeGetRandomValues-Swift-Cxx-Umbrella.hpp +++ /dev/null @@ -1,44 +0,0 @@ -/// -/// ReactNativeGetRandomValues-Swift-Cxx-Umbrella.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -// Forward declarations of C++ defined types -// Forward declaration of `HybridReactNativeGetRandomValuesSpec` to properly resolve imports. -namespace margelo::nitro::reactnativegetrandomvalues { class HybridReactNativeGetRandomValuesSpec; } - -// Include C++ defined types -#include "HybridReactNativeGetRandomValuesSpec.hpp" -#include -#include -#include -#include - -// C++ helpers for Swift -#include "ReactNativeGetRandomValues-Swift-Cxx-Bridge.hpp" - -// Common C++ types used in Swift -#include -#include -#include -#include - -// Forward declarations of Swift defined types -// Forward declaration of `HybridReactNativeGetRandomValuesSpec_cxx` to properly resolve imports. -namespace ReactNativeGetRandomValues { class HybridReactNativeGetRandomValuesSpec_cxx; } - -// Include Swift defined types -#if __has_include("ReactNativeGetRandomValues-Swift.h") -// This header is generated by Xcode/Swift on every app build. -// If it cannot be found, make sure the Swift module's name (= podspec name) is actually "ReactNativeGetRandomValues". -#include "ReactNativeGetRandomValues-Swift.h" -// Same as above, but used when building with frameworks (`use_frameworks`) -#elif __has_include() -#include -#else -#error ReactNativeGetRandomValues's autogenerated Swift header cannot be found! Make sure the Swift module's name (= podspec name) is actually "ReactNativeGetRandomValues", and try building the app first. -#endif diff --git a/native-modules/react-native-get-random-values/nitrogen/generated/ios/ReactNativeGetRandomValuesAutolinking.mm b/native-modules/react-native-get-random-values/nitrogen/generated/ios/ReactNativeGetRandomValuesAutolinking.mm deleted file mode 100644 index 003aac7..0000000 --- a/native-modules/react-native-get-random-values/nitrogen/generated/ios/ReactNativeGetRandomValuesAutolinking.mm +++ /dev/null @@ -1,33 +0,0 @@ -/// -/// ReactNativeGetRandomValuesAutolinking.mm -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#import -#import -#import "ReactNativeGetRandomValues-Swift-Cxx-Umbrella.hpp" -#import - -#include "HybridReactNativeGetRandomValuesSpecSwift.hpp" - -@interface ReactNativeGetRandomValuesAutolinking : NSObject -@end - -@implementation ReactNativeGetRandomValuesAutolinking - -+ (void) load { - using namespace margelo::nitro; - using namespace margelo::nitro::reactnativegetrandomvalues; - - HybridObjectRegistry::registerHybridObjectConstructor( - "ReactNativeGetRandomValues", - []() -> std::shared_ptr { - std::shared_ptr hybridObject = ReactNativeGetRandomValues::ReactNativeGetRandomValuesAutolinking::createReactNativeGetRandomValues(); - return hybridObject; - } - ); -} - -@end diff --git a/native-modules/react-native-get-random-values/nitrogen/generated/ios/ReactNativeGetRandomValuesAutolinking.swift b/native-modules/react-native-get-random-values/nitrogen/generated/ios/ReactNativeGetRandomValuesAutolinking.swift deleted file mode 100644 index 6a5b274..0000000 --- a/native-modules/react-native-get-random-values/nitrogen/generated/ios/ReactNativeGetRandomValuesAutolinking.swift +++ /dev/null @@ -1,25 +0,0 @@ -/// -/// ReactNativeGetRandomValuesAutolinking.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -public final class ReactNativeGetRandomValuesAutolinking { - public typealias bridge = margelo.nitro.reactnativegetrandomvalues.bridge.swift - - /** - * Creates an instance of a Swift class that implements `HybridReactNativeGetRandomValuesSpec`, - * and wraps it in a Swift class that can directly interop with C++ (`HybridReactNativeGetRandomValuesSpec_cxx`) - * - * This is generated by Nitrogen and will initialize the class specified - * in the `"autolinking"` property of `nitro.json` (in this case, `ReactNativeGetRandomValues`). - */ - public static func createReactNativeGetRandomValues() -> bridge.std__shared_ptr_HybridReactNativeGetRandomValuesSpec_ { - let hybridObject = ReactNativeGetRandomValues() - return { () -> bridge.std__shared_ptr_HybridReactNativeGetRandomValuesSpec_ in - let __cxxWrapped = hybridObject.getCxxWrapper() - return __cxxWrapped.getCxxPart() - }() - } -} diff --git a/native-modules/react-native-get-random-values/nitrogen/generated/ios/c++/HybridReactNativeGetRandomValuesSpecSwift.cpp b/native-modules/react-native-get-random-values/nitrogen/generated/ios/c++/HybridReactNativeGetRandomValuesSpecSwift.cpp deleted file mode 100644 index 2daee6a..0000000 --- a/native-modules/react-native-get-random-values/nitrogen/generated/ios/c++/HybridReactNativeGetRandomValuesSpecSwift.cpp +++ /dev/null @@ -1,11 +0,0 @@ -/// -/// HybridReactNativeGetRandomValuesSpecSwift.cpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#include "HybridReactNativeGetRandomValuesSpecSwift.hpp" - -namespace margelo::nitro::reactnativegetrandomvalues { -} // namespace margelo::nitro::reactnativegetrandomvalues diff --git a/native-modules/react-native-get-random-values/nitrogen/generated/ios/c++/HybridReactNativeGetRandomValuesSpecSwift.hpp b/native-modules/react-native-get-random-values/nitrogen/generated/ios/c++/HybridReactNativeGetRandomValuesSpecSwift.hpp deleted file mode 100644 index d5454c7..0000000 --- a/native-modules/react-native-get-random-values/nitrogen/generated/ios/c++/HybridReactNativeGetRandomValuesSpecSwift.hpp +++ /dev/null @@ -1,76 +0,0 @@ -/// -/// HybridReactNativeGetRandomValuesSpecSwift.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#include "HybridReactNativeGetRandomValuesSpec.hpp" - -// Forward declaration of `HybridReactNativeGetRandomValuesSpec_cxx` to properly resolve imports. -namespace ReactNativeGetRandomValues { class HybridReactNativeGetRandomValuesSpec_cxx; } - - - -#include - -#include "ReactNativeGetRandomValues-Swift-Cxx-Umbrella.hpp" - -namespace margelo::nitro::reactnativegetrandomvalues { - - /** - * The C++ part of HybridReactNativeGetRandomValuesSpec_cxx.swift. - * - * HybridReactNativeGetRandomValuesSpecSwift (C++) accesses HybridReactNativeGetRandomValuesSpec_cxx (Swift), and might - * contain some additional bridging code for C++ <> Swift interop. - * - * Since this obviously introduces an overhead, I hope at some point in - * the future, HybridReactNativeGetRandomValuesSpec_cxx can directly inherit from the C++ class HybridReactNativeGetRandomValuesSpec - * to simplify the whole structure and memory management. - */ - class HybridReactNativeGetRandomValuesSpecSwift: public virtual HybridReactNativeGetRandomValuesSpec { - public: - // Constructor from a Swift instance - explicit HybridReactNativeGetRandomValuesSpecSwift(const ReactNativeGetRandomValues::HybridReactNativeGetRandomValuesSpec_cxx& swiftPart): - HybridObject(HybridReactNativeGetRandomValuesSpec::TAG), - _swiftPart(swiftPart) { } - - public: - // Get the Swift part - inline ReactNativeGetRandomValues::HybridReactNativeGetRandomValuesSpec_cxx& getSwiftPart() noexcept { - return _swiftPart; - } - - public: - inline size_t getExternalMemorySize() noexcept override { - return _swiftPart.getMemorySize(); - } - void dispose() noexcept override { - _swiftPart.dispose(); - } - std::string toString() override { - return _swiftPart.toString(); - } - - public: - // Properties - - - public: - // Methods - inline std::string getRandomBase64(double byteLength) override { - auto __result = _swiftPart.getRandomBase64(std::forward(byteLength)); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - auto __value = std::move(__result.value()); - return __value; - } - - private: - ReactNativeGetRandomValues::HybridReactNativeGetRandomValuesSpec_cxx _swiftPart; - }; - -} // namespace margelo::nitro::reactnativegetrandomvalues diff --git a/native-modules/react-native-get-random-values/nitrogen/generated/ios/swift/HybridReactNativeGetRandomValuesSpec.swift b/native-modules/react-native-get-random-values/nitrogen/generated/ios/swift/HybridReactNativeGetRandomValuesSpec.swift deleted file mode 100644 index 8bea9e0..0000000 --- a/native-modules/react-native-get-random-values/nitrogen/generated/ios/swift/HybridReactNativeGetRandomValuesSpec.swift +++ /dev/null @@ -1,56 +0,0 @@ -/// -/// HybridReactNativeGetRandomValuesSpec.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/// See ``HybridReactNativeGetRandomValuesSpec`` -public protocol HybridReactNativeGetRandomValuesSpec_protocol: HybridObject { - // Properties - - - // Methods - func getRandomBase64(byteLength: Double) throws -> String -} - -public extension HybridReactNativeGetRandomValuesSpec_protocol { - /// Default implementation of ``HybridObject.toString`` - func toString() -> String { - return "[HybridObject ReactNativeGetRandomValues]" - } -} - -/// See ``HybridReactNativeGetRandomValuesSpec`` -open class HybridReactNativeGetRandomValuesSpec_base { - private weak var cxxWrapper: HybridReactNativeGetRandomValuesSpec_cxx? = nil - public init() { } - public func getCxxWrapper() -> HybridReactNativeGetRandomValuesSpec_cxx { - #if DEBUG - guard self is HybridReactNativeGetRandomValuesSpec else { - fatalError("`self` is not a `HybridReactNativeGetRandomValuesSpec`! Did you accidentally inherit from `HybridReactNativeGetRandomValuesSpec_base` instead of `HybridReactNativeGetRandomValuesSpec`?") - } - #endif - if let cxxWrapper = self.cxxWrapper { - return cxxWrapper - } else { - let cxxWrapper = HybridReactNativeGetRandomValuesSpec_cxx(self as! HybridReactNativeGetRandomValuesSpec) - self.cxxWrapper = cxxWrapper - return cxxWrapper - } - } -} - -/** - * A Swift base-protocol representing the ReactNativeGetRandomValues HybridObject. - * Implement this protocol to create Swift-based instances of ReactNativeGetRandomValues. - * ```swift - * class HybridReactNativeGetRandomValues : HybridReactNativeGetRandomValuesSpec { - * // ... - * } - * ``` - */ -public typealias HybridReactNativeGetRandomValuesSpec = HybridReactNativeGetRandomValuesSpec_protocol & HybridReactNativeGetRandomValuesSpec_base diff --git a/native-modules/react-native-get-random-values/nitrogen/generated/ios/swift/HybridReactNativeGetRandomValuesSpec_cxx.swift b/native-modules/react-native-get-random-values/nitrogen/generated/ios/swift/HybridReactNativeGetRandomValuesSpec_cxx.swift deleted file mode 100644 index 2b63aa0..0000000 --- a/native-modules/react-native-get-random-values/nitrogen/generated/ios/swift/HybridReactNativeGetRandomValuesSpec_cxx.swift +++ /dev/null @@ -1,131 +0,0 @@ -/// -/// HybridReactNativeGetRandomValuesSpec_cxx.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * A class implementation that bridges HybridReactNativeGetRandomValuesSpec over to C++. - * In C++, we cannot use Swift protocols - so we need to wrap it in a class to make it strongly defined. - * - * Also, some Swift types need to be bridged with special handling: - * - Enums need to be wrapped in Structs, otherwise they cannot be accessed bi-directionally (Swift bug: https://github.com/swiftlang/swift/issues/75330) - * - Other HybridObjects need to be wrapped/unwrapped from the Swift TCxx wrapper - * - Throwing methods need to be wrapped with a Result type, as exceptions cannot be propagated to C++ - */ -open class HybridReactNativeGetRandomValuesSpec_cxx { - /** - * The Swift <> C++ bridge's namespace (`margelo::nitro::reactnativegetrandomvalues::bridge::swift`) - * from `ReactNativeGetRandomValues-Swift-Cxx-Bridge.hpp`. - * This contains specialized C++ templates, and C++ helper functions that can be accessed from Swift. - */ - public typealias bridge = margelo.nitro.reactnativegetrandomvalues.bridge.swift - - /** - * Holds an instance of the `HybridReactNativeGetRandomValuesSpec` Swift protocol. - */ - private var __implementation: any HybridReactNativeGetRandomValuesSpec - - /** - * Holds a weak pointer to the C++ class that wraps the Swift class. - */ - private var __cxxPart: bridge.std__weak_ptr_HybridReactNativeGetRandomValuesSpec_ - - /** - * Create a new `HybridReactNativeGetRandomValuesSpec_cxx` that wraps the given `HybridReactNativeGetRandomValuesSpec`. - * All properties and methods bridge to C++ types. - */ - public init(_ implementation: any HybridReactNativeGetRandomValuesSpec) { - self.__implementation = implementation - self.__cxxPart = .init() - /* no base class */ - } - - /** - * Get the actual `HybridReactNativeGetRandomValuesSpec` instance this class wraps. - */ - @inline(__always) - public func getHybridReactNativeGetRandomValuesSpec() -> any HybridReactNativeGetRandomValuesSpec { - return __implementation - } - - /** - * Casts this instance to a retained unsafe raw pointer. - * This acquires one additional strong reference on the object! - */ - public func toUnsafe() -> UnsafeMutableRawPointer { - return Unmanaged.passRetained(self).toOpaque() - } - - /** - * Casts an unsafe pointer to a `HybridReactNativeGetRandomValuesSpec_cxx`. - * The pointer has to be a retained opaque `Unmanaged`. - * This removes one strong reference from the object! - */ - public class func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> HybridReactNativeGetRandomValuesSpec_cxx { - return Unmanaged.fromOpaque(pointer).takeRetainedValue() - } - - /** - * Gets (or creates) the C++ part of this Hybrid Object. - * The C++ part is a `std::shared_ptr`. - */ - public func getCxxPart() -> bridge.std__shared_ptr_HybridReactNativeGetRandomValuesSpec_ { - let cachedCxxPart = self.__cxxPart.lock() - if Bool(fromCxx: cachedCxxPart) { - return cachedCxxPart - } else { - let newCxxPart = bridge.create_std__shared_ptr_HybridReactNativeGetRandomValuesSpec_(self.toUnsafe()) - __cxxPart = bridge.weakify_std__shared_ptr_HybridReactNativeGetRandomValuesSpec_(newCxxPart) - return newCxxPart - } - } - - - - /** - * Get the memory size of the Swift class (plus size of any other allocations) - * so the JS VM can properly track it and garbage-collect the JS object if needed. - */ - @inline(__always) - public var memorySize: Int { - return MemoryHelper.getSizeOf(self.__implementation) + self.__implementation.memorySize - } - - /** - * Call dispose() on the Swift class. - * This _may_ be called manually from JS. - */ - @inline(__always) - public func dispose() { - self.__implementation.dispose() - } - - /** - * Call toString() on the Swift class. - */ - @inline(__always) - public func toString() -> String { - return self.__implementation.toString() - } - - // Properties - - - // Methods - @inline(__always) - public final func getRandomBase64(byteLength: Double) -> bridge.Result_std__string_ { - do { - let __result = try self.__implementation.getRandomBase64(byteLength: byteLength) - let __resultCpp = std.string(__result) - return bridge.create_Result_std__string_(__resultCpp) - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_std__string_(__exceptionPtr) - } - } -} diff --git a/native-modules/react-native-get-random-values/nitrogen/generated/shared/c++/HybridReactNativeGetRandomValuesSpec.cpp b/native-modules/react-native-get-random-values/nitrogen/generated/shared/c++/HybridReactNativeGetRandomValuesSpec.cpp deleted file mode 100644 index ab8ccea..0000000 --- a/native-modules/react-native-get-random-values/nitrogen/generated/shared/c++/HybridReactNativeGetRandomValuesSpec.cpp +++ /dev/null @@ -1,21 +0,0 @@ -/// -/// HybridReactNativeGetRandomValuesSpec.cpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#include "HybridReactNativeGetRandomValuesSpec.hpp" - -namespace margelo::nitro::reactnativegetrandomvalues { - - void HybridReactNativeGetRandomValuesSpec::loadHybridMethods() { - // load base methods/properties - HybridObject::loadHybridMethods(); - // load custom methods/properties - registerHybrids(this, [](Prototype& prototype) { - prototype.registerHybridMethod("getRandomBase64", &HybridReactNativeGetRandomValuesSpec::getRandomBase64); - }); - } - -} // namespace margelo::nitro::reactnativegetrandomvalues diff --git a/native-modules/react-native-get-random-values/nitrogen/generated/shared/c++/HybridReactNativeGetRandomValuesSpec.hpp b/native-modules/react-native-get-random-values/nitrogen/generated/shared/c++/HybridReactNativeGetRandomValuesSpec.hpp deleted file mode 100644 index 6d4ec89..0000000 --- a/native-modules/react-native-get-random-values/nitrogen/generated/shared/c++/HybridReactNativeGetRandomValuesSpec.hpp +++ /dev/null @@ -1,62 +0,0 @@ -/// -/// HybridReactNativeGetRandomValuesSpec.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif - - - -#include - -namespace margelo::nitro::reactnativegetrandomvalues { - - using namespace margelo::nitro; - - /** - * An abstract base class for `ReactNativeGetRandomValues` - * Inherit this class to create instances of `HybridReactNativeGetRandomValuesSpec` in C++. - * You must explicitly call `HybridObject`'s constructor yourself, because it is virtual. - * @example - * ```cpp - * class HybridReactNativeGetRandomValues: public HybridReactNativeGetRandomValuesSpec { - * public: - * HybridReactNativeGetRandomValues(...): HybridObject(TAG) { ... } - * // ... - * }; - * ``` - */ - class HybridReactNativeGetRandomValuesSpec: public virtual HybridObject { - public: - // Constructor - explicit HybridReactNativeGetRandomValuesSpec(): HybridObject(TAG) { } - - // Destructor - ~HybridReactNativeGetRandomValuesSpec() override = default; - - public: - // Properties - - - public: - // Methods - virtual std::string getRandomBase64(double byteLength) = 0; - - protected: - // Hybrid Setup - void loadHybridMethods() override; - - protected: - // Tag for logging - static constexpr auto TAG = "ReactNativeGetRandomValues"; - }; - -} // namespace margelo::nitro::reactnativegetrandomvalues diff --git a/native-modules/react-native-keychain-module/nitrogen/generated/.gitattributes b/native-modules/react-native-keychain-module/nitrogen/generated/.gitattributes deleted file mode 100644 index fb7a0d5..0000000 --- a/native-modules/react-native-keychain-module/nitrogen/generated/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -** linguist-generated=true diff --git a/native-modules/react-native-keychain-module/nitrogen/generated/android/c++/JGetItemParams.hpp b/native-modules/react-native-keychain-module/nitrogen/generated/android/c++/JGetItemParams.hpp deleted file mode 100644 index e97cbeb..0000000 --- a/native-modules/react-native-keychain-module/nitrogen/generated/android/c++/JGetItemParams.hpp +++ /dev/null @@ -1,57 +0,0 @@ -/// -/// JGetItemParams.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#include -#include "GetItemParams.hpp" - -#include - -namespace margelo::nitro::keychainmodule { - - using namespace facebook; - - /** - * The C++ JNI bridge between the C++ struct "GetItemParams" and the the Kotlin data class "GetItemParams". - */ - struct JGetItemParams final: public jni::JavaClass { - public: - static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/keychainmodule/GetItemParams;"; - - public: - /** - * Convert this Java/Kotlin-based struct to the C++ struct GetItemParams by copying all values to C++. - */ - [[maybe_unused]] - [[nodiscard]] - GetItemParams toCpp() const { - static const auto clazz = javaClassStatic(); - static const auto fieldKey = clazz->getField("key"); - jni::local_ref key = this->getFieldValue(fieldKey); - return GetItemParams( - key->toStdString() - ); - } - - public: - /** - * Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java. - */ - [[maybe_unused]] - static jni::local_ref fromCpp(const GetItemParams& value) { - using JSignature = JGetItemParams(jni::alias_ref); - static const auto clazz = javaClassStatic(); - static const auto create = clazz->getStaticMethod("fromCpp"); - return create( - clazz, - jni::make_jstring(value.key) - ); - } - }; - -} // namespace margelo::nitro::keychainmodule diff --git a/native-modules/react-native-keychain-module/nitrogen/generated/android/c++/JGetItemResult.hpp b/native-modules/react-native-keychain-module/nitrogen/generated/android/c++/JGetItemResult.hpp deleted file mode 100644 index 96cc23e..0000000 --- a/native-modules/react-native-keychain-module/nitrogen/generated/android/c++/JGetItemResult.hpp +++ /dev/null @@ -1,61 +0,0 @@ -/// -/// JGetItemResult.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#include -#include "GetItemResult.hpp" - -#include - -namespace margelo::nitro::keychainmodule { - - using namespace facebook; - - /** - * The C++ JNI bridge between the C++ struct "GetItemResult" and the the Kotlin data class "GetItemResult". - */ - struct JGetItemResult final: public jni::JavaClass { - public: - static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/keychainmodule/GetItemResult;"; - - public: - /** - * Convert this Java/Kotlin-based struct to the C++ struct GetItemResult by copying all values to C++. - */ - [[maybe_unused]] - [[nodiscard]] - GetItemResult toCpp() const { - static const auto clazz = javaClassStatic(); - static const auto fieldKey = clazz->getField("key"); - jni::local_ref key = this->getFieldValue(fieldKey); - static const auto fieldValue = clazz->getField("value"); - jni::local_ref value = this->getFieldValue(fieldValue); - return GetItemResult( - key->toStdString(), - value->toStdString() - ); - } - - public: - /** - * Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java. - */ - [[maybe_unused]] - static jni::local_ref fromCpp(const GetItemResult& value) { - using JSignature = JGetItemResult(jni::alias_ref, jni::alias_ref); - static const auto clazz = javaClassStatic(); - static const auto create = clazz->getStaticMethod("fromCpp"); - return create( - clazz, - jni::make_jstring(value.key), - jni::make_jstring(value.value) - ); - } - }; - -} // namespace margelo::nitro::keychainmodule diff --git a/native-modules/react-native-keychain-module/nitrogen/generated/android/c++/JHasItemParams.hpp b/native-modules/react-native-keychain-module/nitrogen/generated/android/c++/JHasItemParams.hpp deleted file mode 100644 index 52c34b8..0000000 --- a/native-modules/react-native-keychain-module/nitrogen/generated/android/c++/JHasItemParams.hpp +++ /dev/null @@ -1,57 +0,0 @@ -/// -/// JHasItemParams.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#include -#include "HasItemParams.hpp" - -#include - -namespace margelo::nitro::keychainmodule { - - using namespace facebook; - - /** - * The C++ JNI bridge between the C++ struct "HasItemParams" and the the Kotlin data class "HasItemParams". - */ - struct JHasItemParams final: public jni::JavaClass { - public: - static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/keychainmodule/HasItemParams;"; - - public: - /** - * Convert this Java/Kotlin-based struct to the C++ struct HasItemParams by copying all values to C++. - */ - [[maybe_unused]] - [[nodiscard]] - HasItemParams toCpp() const { - static const auto clazz = javaClassStatic(); - static const auto fieldKey = clazz->getField("key"); - jni::local_ref key = this->getFieldValue(fieldKey); - return HasItemParams( - key->toStdString() - ); - } - - public: - /** - * Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java. - */ - [[maybe_unused]] - static jni::local_ref fromCpp(const HasItemParams& value) { - using JSignature = JHasItemParams(jni::alias_ref); - static const auto clazz = javaClassStatic(); - static const auto create = clazz->getStaticMethod("fromCpp"); - return create( - clazz, - jni::make_jstring(value.key) - ); - } - }; - -} // namespace margelo::nitro::keychainmodule diff --git a/native-modules/react-native-keychain-module/nitrogen/generated/android/c++/JHybridKeychainModuleSpec.cpp b/native-modules/react-native-keychain-module/nitrogen/generated/android/c++/JHybridKeychainModuleSpec.cpp deleted file mode 100644 index 2d0caae..0000000 --- a/native-modules/react-native-keychain-module/nitrogen/generated/android/c++/JHybridKeychainModuleSpec.cpp +++ /dev/null @@ -1,151 +0,0 @@ -/// -/// JHybridKeychainModuleSpec.cpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#include "JHybridKeychainModuleSpec.hpp" - -// Forward declaration of `GetItemResult` to properly resolve imports. -namespace margelo::nitro::keychainmodule { struct GetItemResult; } -// Forward declaration of `SetItemParams` to properly resolve imports. -namespace margelo::nitro::keychainmodule { struct SetItemParams; } -// Forward declaration of `GetItemParams` to properly resolve imports. -namespace margelo::nitro::keychainmodule { struct GetItemParams; } -// Forward declaration of `RemoveItemParams` to properly resolve imports. -namespace margelo::nitro::keychainmodule { struct RemoveItemParams; } -// Forward declaration of `HasItemParams` to properly resolve imports. -namespace margelo::nitro::keychainmodule { struct HasItemParams; } - -#include -#include -#include -#include "GetItemResult.hpp" -#include -#include "JVariant_NullType_GetItemResult.hpp" -#include -#include "JGetItemResult.hpp" -#include -#include "SetItemParams.hpp" -#include "JSetItemParams.hpp" -#include -#include "GetItemParams.hpp" -#include "JGetItemParams.hpp" -#include "RemoveItemParams.hpp" -#include "JRemoveItemParams.hpp" -#include "HasItemParams.hpp" -#include "JHasItemParams.hpp" - -namespace margelo::nitro::keychainmodule { - - jni::local_ref JHybridKeychainModuleSpec::initHybrid(jni::alias_ref jThis) { - return makeCxxInstance(jThis); - } - - void JHybridKeychainModuleSpec::registerNatives() { - registerHybrid({ - makeNativeMethod("initHybrid", JHybridKeychainModuleSpec::initHybrid), - }); - } - - size_t JHybridKeychainModuleSpec::getExternalMemorySize() noexcept { - static const auto method = javaClassStatic()->getMethod("getMemorySize"); - return method(_javaPart); - } - - void JHybridKeychainModuleSpec::dispose() noexcept { - static const auto method = javaClassStatic()->getMethod("dispose"); - method(_javaPart); - } - - std::string JHybridKeychainModuleSpec::toString() { - static const auto method = javaClassStatic()->getMethod("toString"); - auto javaString = method(_javaPart); - return javaString->toStdString(); - } - - // Properties - - - // Methods - std::shared_ptr> JHybridKeychainModuleSpec::setItem(const SetItemParams& params) { - static const auto method = javaClassStatic()->getMethod(jni::alias_ref /* params */)>("setItem"); - auto __result = method(_javaPart, JSetItemParams::fromCpp(params)); - return [&]() { - auto __promise = Promise::create(); - __result->cthis()->addOnResolvedListener([=](const jni::alias_ref& /* unit */) { - __promise->resolve(); - }); - __result->cthis()->addOnRejectedListener([=](const jni::alias_ref& __throwable) { - jni::JniException __jniError(__throwable); - __promise->reject(std::make_exception_ptr(__jniError)); - }); - return __promise; - }(); - } - std::shared_ptr>> JHybridKeychainModuleSpec::getItem(const GetItemParams& params) { - static const auto method = javaClassStatic()->getMethod(jni::alias_ref /* params */)>("getItem"); - auto __result = method(_javaPart, JGetItemParams::fromCpp(params)); - return [&]() { - auto __promise = Promise>::create(); - __result->cthis()->addOnResolvedListener([=](const jni::alias_ref& __boxedResult) { - auto __result = jni::static_ref_cast(__boxedResult); - __promise->resolve(__result->toCpp()); - }); - __result->cthis()->addOnRejectedListener([=](const jni::alias_ref& __throwable) { - jni::JniException __jniError(__throwable); - __promise->reject(std::make_exception_ptr(__jniError)); - }); - return __promise; - }(); - } - std::shared_ptr> JHybridKeychainModuleSpec::removeItem(const RemoveItemParams& params) { - static const auto method = javaClassStatic()->getMethod(jni::alias_ref /* params */)>("removeItem"); - auto __result = method(_javaPart, JRemoveItemParams::fromCpp(params)); - return [&]() { - auto __promise = Promise::create(); - __result->cthis()->addOnResolvedListener([=](const jni::alias_ref& /* unit */) { - __promise->resolve(); - }); - __result->cthis()->addOnRejectedListener([=](const jni::alias_ref& __throwable) { - jni::JniException __jniError(__throwable); - __promise->reject(std::make_exception_ptr(__jniError)); - }); - return __promise; - }(); - } - std::shared_ptr> JHybridKeychainModuleSpec::hasItem(const HasItemParams& params) { - static const auto method = javaClassStatic()->getMethod(jni::alias_ref /* params */)>("hasItem"); - auto __result = method(_javaPart, JHasItemParams::fromCpp(params)); - return [&]() { - auto __promise = Promise::create(); - __result->cthis()->addOnResolvedListener([=](const jni::alias_ref& __boxedResult) { - auto __result = jni::static_ref_cast(__boxedResult); - __promise->resolve(static_cast(__result->value())); - }); - __result->cthis()->addOnRejectedListener([=](const jni::alias_ref& __throwable) { - jni::JniException __jniError(__throwable); - __promise->reject(std::make_exception_ptr(__jniError)); - }); - return __promise; - }(); - } - std::shared_ptr> JHybridKeychainModuleSpec::isICloudSyncEnabled() { - static const auto method = javaClassStatic()->getMethod()>("isICloudSyncEnabled"); - auto __result = method(_javaPart); - return [&]() { - auto __promise = Promise::create(); - __result->cthis()->addOnResolvedListener([=](const jni::alias_ref& __boxedResult) { - auto __result = jni::static_ref_cast(__boxedResult); - __promise->resolve(static_cast(__result->value())); - }); - __result->cthis()->addOnRejectedListener([=](const jni::alias_ref& __throwable) { - jni::JniException __jniError(__throwable); - __promise->reject(std::make_exception_ptr(__jniError)); - }); - return __promise; - }(); - } - -} // namespace margelo::nitro::keychainmodule diff --git a/native-modules/react-native-keychain-module/nitrogen/generated/android/c++/JHybridKeychainModuleSpec.hpp b/native-modules/react-native-keychain-module/nitrogen/generated/android/c++/JHybridKeychainModuleSpec.hpp deleted file mode 100644 index 0f43172..0000000 --- a/native-modules/react-native-keychain-module/nitrogen/generated/android/c++/JHybridKeychainModuleSpec.hpp +++ /dev/null @@ -1,69 +0,0 @@ -/// -/// HybridKeychainModuleSpec.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#include -#include -#include "HybridKeychainModuleSpec.hpp" - - - - -namespace margelo::nitro::keychainmodule { - - using namespace facebook; - - class JHybridKeychainModuleSpec: public jni::HybridClass, - public virtual HybridKeychainModuleSpec { - public: - static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/keychainmodule/HybridKeychainModuleSpec;"; - static jni::local_ref initHybrid(jni::alias_ref jThis); - static void registerNatives(); - - protected: - // C++ constructor (called from Java via `initHybrid()`) - explicit JHybridKeychainModuleSpec(jni::alias_ref jThis) : - HybridObject(HybridKeychainModuleSpec::TAG), - HybridBase(jThis), - _javaPart(jni::make_global(jThis)) {} - - public: - ~JHybridKeychainModuleSpec() override { - // Hermes GC can destroy JS objects on a non-JNI Thread. - jni::ThreadScope::WithClassLoader([&] { _javaPart.reset(); }); - } - - public: - size_t getExternalMemorySize() noexcept override; - void dispose() noexcept override; - std::string toString() override; - - public: - inline const jni::global_ref& getJavaPart() const noexcept { - return _javaPart; - } - - public: - // Properties - - - public: - // Methods - std::shared_ptr> setItem(const SetItemParams& params) override; - std::shared_ptr>> getItem(const GetItemParams& params) override; - std::shared_ptr> removeItem(const RemoveItemParams& params) override; - std::shared_ptr> hasItem(const HasItemParams& params) override; - std::shared_ptr> isICloudSyncEnabled() override; - - private: - friend HybridBase; - using HybridBase::HybridBase; - jni::global_ref _javaPart; - }; - -} // namespace margelo::nitro::keychainmodule diff --git a/native-modules/react-native-keychain-module/nitrogen/generated/android/c++/JRemoveItemParams.hpp b/native-modules/react-native-keychain-module/nitrogen/generated/android/c++/JRemoveItemParams.hpp deleted file mode 100644 index 000cbca..0000000 --- a/native-modules/react-native-keychain-module/nitrogen/generated/android/c++/JRemoveItemParams.hpp +++ /dev/null @@ -1,57 +0,0 @@ -/// -/// JRemoveItemParams.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#include -#include "RemoveItemParams.hpp" - -#include - -namespace margelo::nitro::keychainmodule { - - using namespace facebook; - - /** - * The C++ JNI bridge between the C++ struct "RemoveItemParams" and the the Kotlin data class "RemoveItemParams". - */ - struct JRemoveItemParams final: public jni::JavaClass { - public: - static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/keychainmodule/RemoveItemParams;"; - - public: - /** - * Convert this Java/Kotlin-based struct to the C++ struct RemoveItemParams by copying all values to C++. - */ - [[maybe_unused]] - [[nodiscard]] - RemoveItemParams toCpp() const { - static const auto clazz = javaClassStatic(); - static const auto fieldKey = clazz->getField("key"); - jni::local_ref key = this->getFieldValue(fieldKey); - return RemoveItemParams( - key->toStdString() - ); - } - - public: - /** - * Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java. - */ - [[maybe_unused]] - static jni::local_ref fromCpp(const RemoveItemParams& value) { - using JSignature = JRemoveItemParams(jni::alias_ref); - static const auto clazz = javaClassStatic(); - static const auto create = clazz->getStaticMethod("fromCpp"); - return create( - clazz, - jni::make_jstring(value.key) - ); - } - }; - -} // namespace margelo::nitro::keychainmodule diff --git a/native-modules/react-native-keychain-module/nitrogen/generated/android/c++/JSetItemParams.hpp b/native-modules/react-native-keychain-module/nitrogen/generated/android/c++/JSetItemParams.hpp deleted file mode 100644 index 7c13529..0000000 --- a/native-modules/react-native-keychain-module/nitrogen/generated/android/c++/JSetItemParams.hpp +++ /dev/null @@ -1,74 +0,0 @@ -/// -/// JSetItemParams.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#include -#include "SetItemParams.hpp" - -#include -#include - -namespace margelo::nitro::keychainmodule { - - using namespace facebook; - - /** - * The C++ JNI bridge between the C++ struct "SetItemParams" and the the Kotlin data class "SetItemParams". - */ - struct JSetItemParams final: public jni::JavaClass { - public: - static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/keychainmodule/SetItemParams;"; - - public: - /** - * Convert this Java/Kotlin-based struct to the C++ struct SetItemParams by copying all values to C++. - */ - [[maybe_unused]] - [[nodiscard]] - SetItemParams toCpp() const { - static const auto clazz = javaClassStatic(); - static const auto fieldKey = clazz->getField("key"); - jni::local_ref key = this->getFieldValue(fieldKey); - static const auto fieldValue = clazz->getField("value"); - jni::local_ref value = this->getFieldValue(fieldValue); - static const auto fieldEnableSync = clazz->getField("enableSync"); - jni::local_ref enableSync = this->getFieldValue(fieldEnableSync); - static const auto fieldLabel = clazz->getField("label"); - jni::local_ref label = this->getFieldValue(fieldLabel); - static const auto fieldDescription = clazz->getField("description"); - jni::local_ref description = this->getFieldValue(fieldDescription); - return SetItemParams( - key->toStdString(), - value->toStdString(), - enableSync != nullptr ? std::make_optional(static_cast(enableSync->value())) : std::nullopt, - label != nullptr ? std::make_optional(label->toStdString()) : std::nullopt, - description != nullptr ? std::make_optional(description->toStdString()) : std::nullopt - ); - } - - public: - /** - * Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java. - */ - [[maybe_unused]] - static jni::local_ref fromCpp(const SetItemParams& value) { - using JSignature = JSetItemParams(jni::alias_ref, jni::alias_ref, jni::alias_ref, jni::alias_ref, jni::alias_ref); - static const auto clazz = javaClassStatic(); - static const auto create = clazz->getStaticMethod("fromCpp"); - return create( - clazz, - jni::make_jstring(value.key), - jni::make_jstring(value.value), - value.enableSync.has_value() ? jni::JBoolean::valueOf(value.enableSync.value()) : nullptr, - value.label.has_value() ? jni::make_jstring(value.label.value()) : nullptr, - value.description.has_value() ? jni::make_jstring(value.description.value()) : nullptr - ); - } - }; - -} // namespace margelo::nitro::keychainmodule diff --git a/native-modules/react-native-keychain-module/nitrogen/generated/android/c++/JVariant_NullType_GetItemResult.cpp b/native-modules/react-native-keychain-module/nitrogen/generated/android/c++/JVariant_NullType_GetItemResult.cpp deleted file mode 100644 index 502849a..0000000 --- a/native-modules/react-native-keychain-module/nitrogen/generated/android/c++/JVariant_NullType_GetItemResult.cpp +++ /dev/null @@ -1,26 +0,0 @@ -/// -/// JVariant_NullType_GetItemResult.cpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#include "JVariant_NullType_GetItemResult.hpp" - -namespace margelo::nitro::keychainmodule { - /** - * Converts JVariant_NullType_GetItemResult to std::variant - */ - std::variant JVariant_NullType_GetItemResult::toCpp() const { - if (isInstanceOf(JVariant_NullType_GetItemResult_impl::First::javaClassStatic())) { - // It's a `nitro::NullType` - auto jniValue = static_cast(this)->getValue(); - return nitro::null; - } else if (isInstanceOf(JVariant_NullType_GetItemResult_impl::Second::javaClassStatic())) { - // It's a `GetItemResult` - auto jniValue = static_cast(this)->getValue(); - return jniValue->toCpp(); - } - throw std::invalid_argument("Variant is unknown Kotlin instance!"); - } -} // namespace margelo::nitro::keychainmodule diff --git a/native-modules/react-native-keychain-module/nitrogen/generated/android/c++/JVariant_NullType_GetItemResult.hpp b/native-modules/react-native-keychain-module/nitrogen/generated/android/c++/JVariant_NullType_GetItemResult.hpp deleted file mode 100644 index 993affb..0000000 --- a/native-modules/react-native-keychain-module/nitrogen/generated/android/c++/JVariant_NullType_GetItemResult.hpp +++ /dev/null @@ -1,72 +0,0 @@ -/// -/// JVariant_NullType_GetItemResult.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#include -#include - -#include -#include "GetItemResult.hpp" -#include -#include -#include "JGetItemResult.hpp" -#include - -namespace margelo::nitro::keychainmodule { - - using namespace facebook; - - /** - * The C++ JNI bridge between the C++ std::variant and the Java class "Variant_NullType_GetItemResult". - */ - class JVariant_NullType_GetItemResult: public jni::JavaClass { - public: - static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/keychainmodule/Variant_NullType_GetItemResult;"; - - static jni::local_ref create_0(jni::alias_ref value) { - static const auto method = javaClassStatic()->getStaticMethod)>("create"); - return method(javaClassStatic(), value); - } - static jni::local_ref create_1(jni::alias_ref value) { - static const auto method = javaClassStatic()->getStaticMethod)>("create"); - return method(javaClassStatic(), value); - } - - static jni::local_ref fromCpp(const std::variant& variant) { - switch (variant.index()) { - case 0: return create_0(JNull::null()); - case 1: return create_1(JGetItemResult::fromCpp(std::get<1>(variant))); - default: throw std::invalid_argument("Variant holds unknown index! (" + std::to_string(variant.index()) + ")"); - } - } - - [[nodiscard]] std::variant toCpp() const; - }; - - namespace JVariant_NullType_GetItemResult_impl { - class First: public jni::JavaClass { - public: - static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/keychainmodule/Variant_NullType_GetItemResult$First;"; - - [[nodiscard]] jni::local_ref getValue() const { - static const auto field = javaClassStatic()->getField("value"); - return getFieldValue(field); - } - }; - - class Second: public jni::JavaClass { - public: - static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/keychainmodule/Variant_NullType_GetItemResult$Second;"; - - [[nodiscard]] jni::local_ref getValue() const { - static const auto field = javaClassStatic()->getField("value"); - return getFieldValue(field); - } - }; - } // namespace JVariant_NullType_GetItemResult_impl -} // namespace margelo::nitro::keychainmodule diff --git a/native-modules/react-native-keychain-module/nitrogen/generated/android/keychainmodule+autolinking.cmake b/native-modules/react-native-keychain-module/nitrogen/generated/android/keychainmodule+autolinking.cmake deleted file mode 100644 index e299843..0000000 --- a/native-modules/react-native-keychain-module/nitrogen/generated/android/keychainmodule+autolinking.cmake +++ /dev/null @@ -1,82 +0,0 @@ -# -# keychainmodule+autolinking.cmake -# This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -# https://github.com/mrousavy/nitro -# Copyright © 2026 Marc Rousavy @ Margelo -# - -# This is a CMake file that adds all files generated by Nitrogen -# to the current CMake project. -# -# To use it, add this to your CMakeLists.txt: -# ```cmake -# include(${CMAKE_SOURCE_DIR}/../nitrogen/generated/android/keychainmodule+autolinking.cmake) -# ``` - -# Define a flag to check if we are building properly -add_definitions(-DBUILDING_KEYCHAINMODULE_WITH_GENERATED_CMAKE_PROJECT) - -# Enable Raw Props parsing in react-native (for Nitro Views) -add_definitions(-DRN_SERIALIZABLE_STATE) - -# Add all headers that were generated by Nitrogen -include_directories( - "../nitrogen/generated/shared/c++" - "../nitrogen/generated/android/c++" - "../nitrogen/generated/android/" -) - -# Add all .cpp sources that were generated by Nitrogen -target_sources( - # CMake project name (Android C++ library name) - keychainmodule PRIVATE - # Autolinking Setup - ../nitrogen/generated/android/keychainmoduleOnLoad.cpp - # Shared Nitrogen C++ sources - ../nitrogen/generated/shared/c++/HybridKeychainModuleSpec.cpp - # Android-specific Nitrogen C++ sources - ../nitrogen/generated/android/c++/JHybridKeychainModuleSpec.cpp - ../nitrogen/generated/android/c++/JVariant_NullType_GetItemResult.cpp -) - -# From node_modules/react-native/ReactAndroid/cmake-utils/folly-flags.cmake -# Used in node_modules/react-native/ReactAndroid/cmake-utils/ReactNative-application.cmake -target_compile_definitions( - keychainmodule PRIVATE - -DFOLLY_NO_CONFIG=1 - -DFOLLY_HAVE_CLOCK_GETTIME=1 - -DFOLLY_USE_LIBCPP=1 - -DFOLLY_CFG_NO_COROUTINES=1 - -DFOLLY_MOBILE=1 - -DFOLLY_HAVE_RECVMMSG=1 - -DFOLLY_HAVE_PTHREAD=1 - # Once we target android-23 above, we can comment - # the following line. NDK uses GNU style stderror_r() after API 23. - -DFOLLY_HAVE_XSI_STRERROR_R=1 -) - -# Add all libraries required by the generated specs -find_package(fbjni REQUIRED) # <-- Used for communication between Java <-> C++ -find_package(ReactAndroid REQUIRED) # <-- Used to set up React Native bindings (e.g. CallInvoker/TurboModule) -find_package(react-native-nitro-modules REQUIRED) # <-- Used to create all HybridObjects and use the Nitro core library - -# Link all libraries together -target_link_libraries( - keychainmodule - fbjni::fbjni # <-- Facebook C++ JNI helpers - ReactAndroid::jsi # <-- RN: JSI - react-native-nitro-modules::NitroModules # <-- NitroModules Core :) -) - -# Link react-native (different prefab between RN 0.75 and RN 0.76) -if(ReactAndroid_VERSION_MINOR GREATER_EQUAL 76) - target_link_libraries( - keychainmodule - ReactAndroid::reactnative # <-- RN: Native Modules umbrella prefab - ) -else() - target_link_libraries( - keychainmodule - ReactAndroid::react_nativemodule_core # <-- RN: TurboModules Core - ) -endif() diff --git a/native-modules/react-native-keychain-module/nitrogen/generated/android/keychainmodule+autolinking.gradle b/native-modules/react-native-keychain-module/nitrogen/generated/android/keychainmodule+autolinking.gradle deleted file mode 100644 index 93806bb..0000000 --- a/native-modules/react-native-keychain-module/nitrogen/generated/android/keychainmodule+autolinking.gradle +++ /dev/null @@ -1,27 +0,0 @@ -/// -/// keychainmodule+autolinking.gradle -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -/// This is a Gradle file that adds all files generated by Nitrogen -/// to the current Gradle project. -/// -/// To use it, add this to your build.gradle: -/// ```gradle -/// apply from: '../nitrogen/generated/android/keychainmodule+autolinking.gradle' -/// ``` - -logger.warn("[NitroModules] 🔥 keychainmodule is boosted by nitro!") - -android { - sourceSets { - main { - java.srcDirs += [ - // Nitrogen files - "${project.projectDir}/../nitrogen/generated/android/kotlin" - ] - } - } -} diff --git a/native-modules/react-native-keychain-module/nitrogen/generated/android/keychainmoduleOnLoad.cpp b/native-modules/react-native-keychain-module/nitrogen/generated/android/keychainmoduleOnLoad.cpp deleted file mode 100644 index f916c92..0000000 --- a/native-modules/react-native-keychain-module/nitrogen/generated/android/keychainmoduleOnLoad.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/// -/// keychainmoduleOnLoad.cpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#ifndef BUILDING_KEYCHAINMODULE_WITH_GENERATED_CMAKE_PROJECT -#error keychainmoduleOnLoad.cpp is not being built with the autogenerated CMakeLists.txt project. Is a different CMakeLists.txt building this? -#endif - -#include "keychainmoduleOnLoad.hpp" - -#include -#include -#include - -#include "JHybridKeychainModuleSpec.hpp" -#include - -namespace margelo::nitro::keychainmodule { - -int initialize(JavaVM* vm) { - using namespace margelo::nitro; - using namespace margelo::nitro::keychainmodule; - using namespace facebook; - - return facebook::jni::initialize(vm, [] { - // Register native JNI methods - margelo::nitro::keychainmodule::JHybridKeychainModuleSpec::registerNatives(); - - // Register Nitro Hybrid Objects - HybridObjectRegistry::registerHybridObjectConstructor( - "KeychainModule", - []() -> std::shared_ptr { - static DefaultConstructableObject object("com/margelo/nitro/keychainmodule/KeychainModule"); - auto instance = object.create(); - return instance->cthis()->shared(); - } - ); - }); -} - -} // namespace margelo::nitro::keychainmodule diff --git a/native-modules/react-native-keychain-module/nitrogen/generated/android/keychainmoduleOnLoad.hpp b/native-modules/react-native-keychain-module/nitrogen/generated/android/keychainmoduleOnLoad.hpp deleted file mode 100644 index 4abd9c4..0000000 --- a/native-modules/react-native-keychain-module/nitrogen/generated/android/keychainmoduleOnLoad.hpp +++ /dev/null @@ -1,25 +0,0 @@ -/// -/// keychainmoduleOnLoad.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#include -#include - -namespace margelo::nitro::keychainmodule { - - /** - * Initializes the native (C++) part of keychainmodule, and autolinks all Hybrid Objects. - * Call this in your `JNI_OnLoad` function (probably inside `cpp-adapter.cpp`). - * Example: - * ```cpp (cpp-adapter.cpp) - * JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void*) { - * return margelo::nitro::keychainmodule::initialize(vm); - * } - * ``` - */ - int initialize(JavaVM* vm); - -} // namespace margelo::nitro::keychainmodule diff --git a/native-modules/react-native-keychain-module/nitrogen/generated/android/kotlin/com/margelo/nitro/keychainmodule/GetItemParams.kt b/native-modules/react-native-keychain-module/nitrogen/generated/android/kotlin/com/margelo/nitro/keychainmodule/GetItemParams.kt deleted file mode 100644 index 417fc4f..0000000 --- a/native-modules/react-native-keychain-module/nitrogen/generated/android/kotlin/com/margelo/nitro/keychainmodule/GetItemParams.kt +++ /dev/null @@ -1,38 +0,0 @@ -/// -/// GetItemParams.kt -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -package com.margelo.nitro.keychainmodule - -import androidx.annotation.Keep -import com.facebook.proguard.annotations.DoNotStrip - - -/** - * Represents the JavaScript object/struct "GetItemParams". - */ -@DoNotStrip -@Keep -data class GetItemParams( - @DoNotStrip - @Keep - val key: String -) { - /* primary constructor */ - - private companion object { - /** - * Constructor called from C++ - */ - @DoNotStrip - @Keep - @Suppress("unused") - @JvmStatic - private fun fromCpp(key: String): GetItemParams { - return GetItemParams(key) - } - } -} diff --git a/native-modules/react-native-keychain-module/nitrogen/generated/android/kotlin/com/margelo/nitro/keychainmodule/GetItemResult.kt b/native-modules/react-native-keychain-module/nitrogen/generated/android/kotlin/com/margelo/nitro/keychainmodule/GetItemResult.kt deleted file mode 100644 index 2655489..0000000 --- a/native-modules/react-native-keychain-module/nitrogen/generated/android/kotlin/com/margelo/nitro/keychainmodule/GetItemResult.kt +++ /dev/null @@ -1,41 +0,0 @@ -/// -/// GetItemResult.kt -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -package com.margelo.nitro.keychainmodule - -import androidx.annotation.Keep -import com.facebook.proguard.annotations.DoNotStrip - - -/** - * Represents the JavaScript object/struct "GetItemResult". - */ -@DoNotStrip -@Keep -data class GetItemResult( - @DoNotStrip - @Keep - val key: String, - @DoNotStrip - @Keep - val value: String -) { - /* primary constructor */ - - private companion object { - /** - * Constructor called from C++ - */ - @DoNotStrip - @Keep - @Suppress("unused") - @JvmStatic - private fun fromCpp(key: String, value: String): GetItemResult { - return GetItemResult(key, value) - } - } -} diff --git a/native-modules/react-native-keychain-module/nitrogen/generated/android/kotlin/com/margelo/nitro/keychainmodule/HasItemParams.kt b/native-modules/react-native-keychain-module/nitrogen/generated/android/kotlin/com/margelo/nitro/keychainmodule/HasItemParams.kt deleted file mode 100644 index c0c2e52..0000000 --- a/native-modules/react-native-keychain-module/nitrogen/generated/android/kotlin/com/margelo/nitro/keychainmodule/HasItemParams.kt +++ /dev/null @@ -1,38 +0,0 @@ -/// -/// HasItemParams.kt -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -package com.margelo.nitro.keychainmodule - -import androidx.annotation.Keep -import com.facebook.proguard.annotations.DoNotStrip - - -/** - * Represents the JavaScript object/struct "HasItemParams". - */ -@DoNotStrip -@Keep -data class HasItemParams( - @DoNotStrip - @Keep - val key: String -) { - /* primary constructor */ - - private companion object { - /** - * Constructor called from C++ - */ - @DoNotStrip - @Keep - @Suppress("unused") - @JvmStatic - private fun fromCpp(key: String): HasItemParams { - return HasItemParams(key) - } - } -} diff --git a/native-modules/react-native-keychain-module/nitrogen/generated/android/kotlin/com/margelo/nitro/keychainmodule/HybridKeychainModuleSpec.kt b/native-modules/react-native-keychain-module/nitrogen/generated/android/kotlin/com/margelo/nitro/keychainmodule/HybridKeychainModuleSpec.kt deleted file mode 100644 index 910ab49..0000000 --- a/native-modules/react-native-keychain-module/nitrogen/generated/android/kotlin/com/margelo/nitro/keychainmodule/HybridKeychainModuleSpec.kt +++ /dev/null @@ -1,75 +0,0 @@ -/// -/// HybridKeychainModuleSpec.kt -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -package com.margelo.nitro.keychainmodule - -import androidx.annotation.Keep -import com.facebook.jni.HybridData -import com.facebook.proguard.annotations.DoNotStrip -import com.margelo.nitro.core.Promise -import com.margelo.nitro.core.NullType -import com.margelo.nitro.core.HybridObject - -/** - * A Kotlin class representing the KeychainModule HybridObject. - * Implement this abstract class to create Kotlin-based instances of KeychainModule. - */ -@DoNotStrip -@Keep -@Suppress( - "KotlinJniMissingFunction", "unused", - "RedundantSuppression", "RedundantUnitReturnType", "SimpleRedundantLet", - "LocalVariableName", "PropertyName", "PrivatePropertyName", "FunctionName" -) -abstract class HybridKeychainModuleSpec: HybridObject() { - @DoNotStrip - private var mHybridData: HybridData = initHybrid() - - init { - super.updateNative(mHybridData) - } - - override fun updateNative(hybridData: HybridData) { - mHybridData = hybridData - super.updateNative(hybridData) - } - - // Default implementation of `HybridObject.toString()` - override fun toString(): String { - return "[HybridObject KeychainModule]" - } - - // Properties - - - // Methods - @DoNotStrip - @Keep - abstract fun setItem(params: SetItemParams): Promise - - @DoNotStrip - @Keep - abstract fun getItem(params: GetItemParams): Promise - - @DoNotStrip - @Keep - abstract fun removeItem(params: RemoveItemParams): Promise - - @DoNotStrip - @Keep - abstract fun hasItem(params: HasItemParams): Promise - - @DoNotStrip - @Keep - abstract fun isICloudSyncEnabled(): Promise - - private external fun initHybrid(): HybridData - - companion object { - protected const val TAG = "HybridKeychainModuleSpec" - } -} diff --git a/native-modules/react-native-keychain-module/nitrogen/generated/android/kotlin/com/margelo/nitro/keychainmodule/RemoveItemParams.kt b/native-modules/react-native-keychain-module/nitrogen/generated/android/kotlin/com/margelo/nitro/keychainmodule/RemoveItemParams.kt deleted file mode 100644 index 6518189..0000000 --- a/native-modules/react-native-keychain-module/nitrogen/generated/android/kotlin/com/margelo/nitro/keychainmodule/RemoveItemParams.kt +++ /dev/null @@ -1,38 +0,0 @@ -/// -/// RemoveItemParams.kt -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -package com.margelo.nitro.keychainmodule - -import androidx.annotation.Keep -import com.facebook.proguard.annotations.DoNotStrip - - -/** - * Represents the JavaScript object/struct "RemoveItemParams". - */ -@DoNotStrip -@Keep -data class RemoveItemParams( - @DoNotStrip - @Keep - val key: String -) { - /* primary constructor */ - - private companion object { - /** - * Constructor called from C++ - */ - @DoNotStrip - @Keep - @Suppress("unused") - @JvmStatic - private fun fromCpp(key: String): RemoveItemParams { - return RemoveItemParams(key) - } - } -} diff --git a/native-modules/react-native-keychain-module/nitrogen/generated/android/kotlin/com/margelo/nitro/keychainmodule/SetItemParams.kt b/native-modules/react-native-keychain-module/nitrogen/generated/android/kotlin/com/margelo/nitro/keychainmodule/SetItemParams.kt deleted file mode 100644 index ef8e029..0000000 --- a/native-modules/react-native-keychain-module/nitrogen/generated/android/kotlin/com/margelo/nitro/keychainmodule/SetItemParams.kt +++ /dev/null @@ -1,50 +0,0 @@ -/// -/// SetItemParams.kt -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -package com.margelo.nitro.keychainmodule - -import androidx.annotation.Keep -import com.facebook.proguard.annotations.DoNotStrip - - -/** - * Represents the JavaScript object/struct "SetItemParams". - */ -@DoNotStrip -@Keep -data class SetItemParams( - @DoNotStrip - @Keep - val key: String, - @DoNotStrip - @Keep - val value: String, - @DoNotStrip - @Keep - val enableSync: Boolean?, - @DoNotStrip - @Keep - val label: String?, - @DoNotStrip - @Keep - val description: String? -) { - /* primary constructor */ - - private companion object { - /** - * Constructor called from C++ - */ - @DoNotStrip - @Keep - @Suppress("unused") - @JvmStatic - private fun fromCpp(key: String, value: String, enableSync: Boolean?, label: String?, description: String?): SetItemParams { - return SetItemParams(key, value, enableSync, label, description) - } - } -} diff --git a/native-modules/react-native-keychain-module/nitrogen/generated/android/kotlin/com/margelo/nitro/keychainmodule/Variant_NullType_GetItemResult.kt b/native-modules/react-native-keychain-module/nitrogen/generated/android/kotlin/com/margelo/nitro/keychainmodule/Variant_NullType_GetItemResult.kt deleted file mode 100644 index 34ba5ed..0000000 --- a/native-modules/react-native-keychain-module/nitrogen/generated/android/kotlin/com/margelo/nitro/keychainmodule/Variant_NullType_GetItemResult.kt +++ /dev/null @@ -1,59 +0,0 @@ -/// -/// Variant_NullType_GetItemResult.kt -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -package com.margelo.nitro.keychainmodule - -import com.facebook.proguard.annotations.DoNotStrip -import com.margelo.nitro.core.NullType - -/** - * Represents the TypeScript variant "NullType | GetItemResult". - */ -@Suppress("ClassName") -@DoNotStrip -sealed class Variant_NullType_GetItemResult { - @DoNotStrip - data class First(@DoNotStrip val value: NullType): Variant_NullType_GetItemResult() - @DoNotStrip - data class Second(@DoNotStrip val value: GetItemResult): Variant_NullType_GetItemResult() - - @Deprecated("getAs() is not type-safe. Use fold/asFirstOrNull/asSecondOrNull instead.", level = DeprecationLevel.ERROR) - inline fun getAs(): T? = when (this) { - is First -> value as? T - is Second -> value as? T - } - - val isFirst: Boolean - get() = this is First - val isSecond: Boolean - get() = this is Second - - fun asFirstOrNull(): NullType? { - val value = (this as? First)?.value ?: return null - return value - } - fun asSecondOrNull(): GetItemResult? { - val value = (this as? Second)?.value ?: return null - return value - } - - inline fun match(first: (NullType) -> R, second: (GetItemResult) -> R): R { - return when (this) { - is First -> first(value) - is Second -> second(value) - } - } - - companion object { - @JvmStatic - @DoNotStrip - fun create(value: NullType): Variant_NullType_GetItemResult = First(value) - @JvmStatic - @DoNotStrip - fun create(value: GetItemResult): Variant_NullType_GetItemResult = Second(value) - } -} diff --git a/native-modules/react-native-keychain-module/nitrogen/generated/android/kotlin/com/margelo/nitro/keychainmodule/keychainmoduleOnLoad.kt b/native-modules/react-native-keychain-module/nitrogen/generated/android/kotlin/com/margelo/nitro/keychainmodule/keychainmoduleOnLoad.kt deleted file mode 100644 index 12c0d5f..0000000 --- a/native-modules/react-native-keychain-module/nitrogen/generated/android/kotlin/com/margelo/nitro/keychainmodule/keychainmoduleOnLoad.kt +++ /dev/null @@ -1,35 +0,0 @@ -/// -/// keychainmoduleOnLoad.kt -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -package com.margelo.nitro.keychainmodule - -import android.util.Log - -internal class keychainmoduleOnLoad { - companion object { - private const val TAG = "keychainmoduleOnLoad" - private var didLoad = false - /** - * Initializes the native part of "keychainmodule". - * This method is idempotent and can be called more than once. - */ - @JvmStatic - fun initializeNative() { - if (didLoad) return - try { - Log.i(TAG, "Loading keychainmodule C++ library...") - System.loadLibrary("keychainmodule") - Log.i(TAG, "Successfully loaded keychainmodule C++ library!") - didLoad = true - } catch (e: Error) { - Log.e(TAG, "Failed to load keychainmodule C++ library! Is it properly installed and linked? " + - "Is the name correct? (see `CMakeLists.txt`, at `add_library(...)`)", e) - throw e - } - } - } -} diff --git a/native-modules/react-native-keychain-module/nitrogen/generated/ios/KeychainModule+autolinking.rb b/native-modules/react-native-keychain-module/nitrogen/generated/ios/KeychainModule+autolinking.rb deleted file mode 100644 index b05b4b3..0000000 --- a/native-modules/react-native-keychain-module/nitrogen/generated/ios/KeychainModule+autolinking.rb +++ /dev/null @@ -1,60 +0,0 @@ -# -# KeychainModule+autolinking.rb -# This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -# https://github.com/mrousavy/nitro -# Copyright © 2026 Marc Rousavy @ Margelo -# - -# This is a Ruby script that adds all files generated by Nitrogen -# to the given podspec. -# -# To use it, add this to your .podspec: -# ```ruby -# Pod::Spec.new do |spec| -# # ... -# -# # Add all files generated by Nitrogen -# load 'nitrogen/generated/ios/KeychainModule+autolinking.rb' -# add_nitrogen_files(spec) -# end -# ``` - -def add_nitrogen_files(spec) - Pod::UI.puts "[NitroModules] 🔥 KeychainModule is boosted by nitro!" - - spec.dependency "NitroModules" - - current_source_files = Array(spec.attributes_hash['source_files']) - spec.source_files = current_source_files + [ - # Generated cross-platform specs - "nitrogen/generated/shared/**/*.{h,hpp,c,cpp,swift}", - # Generated bridges for the cross-platform specs - "nitrogen/generated/ios/**/*.{h,hpp,c,cpp,mm,swift}", - ] - - current_public_header_files = Array(spec.attributes_hash['public_header_files']) - spec.public_header_files = current_public_header_files + [ - # Generated specs - "nitrogen/generated/shared/**/*.{h,hpp}", - # Swift to C++ bridging helpers - "nitrogen/generated/ios/KeychainModule-Swift-Cxx-Bridge.hpp" - ] - - current_private_header_files = Array(spec.attributes_hash['private_header_files']) - spec.private_header_files = current_private_header_files + [ - # iOS specific specs - "nitrogen/generated/ios/c++/**/*.{h,hpp}", - # Views are framework-specific and should be private - "nitrogen/generated/shared/**/views/**/*" - ] - - current_pod_target_xcconfig = spec.attributes_hash['pod_target_xcconfig'] || {} - spec.pod_target_xcconfig = current_pod_target_xcconfig.merge({ - # Use C++ 20 - "CLANG_CXX_LANGUAGE_STANDARD" => "c++20", - # Enables C++ <-> Swift interop (by default it's only C) - "SWIFT_OBJC_INTEROP_MODE" => "objcxx", - # Enables stricter modular headers - "DEFINES_MODULE" => "YES", - }) -end diff --git a/native-modules/react-native-keychain-module/nitrogen/generated/ios/KeychainModule-Swift-Cxx-Bridge.cpp b/native-modules/react-native-keychain-module/nitrogen/generated/ios/KeychainModule-Swift-Cxx-Bridge.cpp deleted file mode 100644 index 397feec..0000000 --- a/native-modules/react-native-keychain-module/nitrogen/generated/ios/KeychainModule-Swift-Cxx-Bridge.cpp +++ /dev/null @@ -1,65 +0,0 @@ -/// -/// KeychainModule-Swift-Cxx-Bridge.cpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#include "KeychainModule-Swift-Cxx-Bridge.hpp" - -// Include C++ implementation defined types -#include "HybridKeychainModuleSpecSwift.hpp" -#include "KeychainModule-Swift-Cxx-Umbrella.hpp" -#include - -namespace margelo::nitro::keychainmodule::bridge::swift { - - // pragma MARK: std::function - Func_void create_Func_void(void* NON_NULL swiftClosureWrapper) noexcept { - auto swiftClosure = KeychainModule::Func_void::fromUnsafe(swiftClosureWrapper); - return [swiftClosure = std::move(swiftClosure)]() mutable -> void { - swiftClosure.call(); - }; - } - - // pragma MARK: std::function - Func_void_std__exception_ptr create_Func_void_std__exception_ptr(void* NON_NULL swiftClosureWrapper) noexcept { - auto swiftClosure = KeychainModule::Func_void_std__exception_ptr::fromUnsafe(swiftClosureWrapper); - return [swiftClosure = std::move(swiftClosure)](const std::exception_ptr& error) mutable -> void { - swiftClosure.call(error); - }; - } - - // pragma MARK: std::function& /* result */)> - Func_void_std__variant_nitro__NullType__GetItemResult_ create_Func_void_std__variant_nitro__NullType__GetItemResult_(void* NON_NULL swiftClosureWrapper) noexcept { - auto swiftClosure = KeychainModule::Func_void_std__variant_nitro__NullType__GetItemResult_::fromUnsafe(swiftClosureWrapper); - return [swiftClosure = std::move(swiftClosure)](const std::variant& result) mutable -> void { - swiftClosure.call(result); - }; - } - - // pragma MARK: std::function - Func_void_bool create_Func_void_bool(void* NON_NULL swiftClosureWrapper) noexcept { - auto swiftClosure = KeychainModule::Func_void_bool::fromUnsafe(swiftClosureWrapper); - return [swiftClosure = std::move(swiftClosure)](bool result) mutable -> void { - swiftClosure.call(result); - }; - } - - // pragma MARK: std::shared_ptr - std::shared_ptr create_std__shared_ptr_HybridKeychainModuleSpec_(void* NON_NULL swiftUnsafePointer) noexcept { - KeychainModule::HybridKeychainModuleSpec_cxx swiftPart = KeychainModule::HybridKeychainModuleSpec_cxx::fromUnsafe(swiftUnsafePointer); - return std::make_shared(swiftPart); - } - void* NON_NULL get_std__shared_ptr_HybridKeychainModuleSpec_(std__shared_ptr_HybridKeychainModuleSpec_ cppType) { - std::shared_ptr swiftWrapper = std::dynamic_pointer_cast(cppType); - #ifdef NITRO_DEBUG - if (swiftWrapper == nullptr) [[unlikely]] { - throw std::runtime_error("Class \"HybridKeychainModuleSpec\" is not implemented in Swift!"); - } - #endif - KeychainModule::HybridKeychainModuleSpec_cxx& swiftPart = swiftWrapper->getSwiftPart(); - return swiftPart.toUnsafe(); - } - -} // namespace margelo::nitro::keychainmodule::bridge::swift diff --git a/native-modules/react-native-keychain-module/nitrogen/generated/ios/KeychainModule-Swift-Cxx-Bridge.hpp b/native-modules/react-native-keychain-module/nitrogen/generated/ios/KeychainModule-Swift-Cxx-Bridge.hpp deleted file mode 100644 index fdc0392..0000000 --- a/native-modules/react-native-keychain-module/nitrogen/generated/ios/KeychainModule-Swift-Cxx-Bridge.hpp +++ /dev/null @@ -1,262 +0,0 @@ -/// -/// KeychainModule-Swift-Cxx-Bridge.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -// Forward declarations of C++ defined types -// Forward declaration of `GetItemResult` to properly resolve imports. -namespace margelo::nitro::keychainmodule { struct GetItemResult; } -// Forward declaration of `HybridKeychainModuleSpec` to properly resolve imports. -namespace margelo::nitro::keychainmodule { class HybridKeychainModuleSpec; } - -// Forward declarations of Swift defined types -// Forward declaration of `HybridKeychainModuleSpec_cxx` to properly resolve imports. -namespace KeychainModule { class HybridKeychainModuleSpec_cxx; } - -// Include C++ defined types -#include "GetItemResult.hpp" -#include "HybridKeychainModuleSpec.hpp" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/** - * Contains specialized versions of C++ templated types so they can be accessed from Swift, - * as well as helper functions to interact with those C++ types from Swift. - */ -namespace margelo::nitro::keychainmodule::bridge::swift { - - // pragma MARK: std::shared_ptr> - /** - * Specialized version of `std::shared_ptr>`. - */ - using std__shared_ptr_Promise_void__ = std::shared_ptr>; - inline std::shared_ptr> create_std__shared_ptr_Promise_void__() noexcept { - return Promise::create(); - } - inline PromiseHolder wrap_std__shared_ptr_Promise_void__(std::shared_ptr> promise) noexcept { - return PromiseHolder(std::move(promise)); - } - - // pragma MARK: std::function - /** - * Specialized version of `std::function`. - */ - using Func_void = std::function; - /** - * Wrapper class for a `std::function`, this can be used from Swift. - */ - class Func_void_Wrapper final { - public: - explicit Func_void_Wrapper(std::function&& func): _function(std::make_unique>(std::move(func))) {} - inline void call() const noexcept { - _function->operator()(); - } - private: - std::unique_ptr> _function; - } SWIFT_NONCOPYABLE; - Func_void create_Func_void(void* NON_NULL swiftClosureWrapper) noexcept; - inline Func_void_Wrapper wrap_Func_void(Func_void value) noexcept { - return Func_void_Wrapper(std::move(value)); - } - - // pragma MARK: std::function - /** - * Specialized version of `std::function`. - */ - using Func_void_std__exception_ptr = std::function; - /** - * Wrapper class for a `std::function`, this can be used from Swift. - */ - class Func_void_std__exception_ptr_Wrapper final { - public: - explicit Func_void_std__exception_ptr_Wrapper(std::function&& func): _function(std::make_unique>(std::move(func))) {} - inline void call(std::exception_ptr error) const noexcept { - _function->operator()(error); - } - private: - std::unique_ptr> _function; - } SWIFT_NONCOPYABLE; - Func_void_std__exception_ptr create_Func_void_std__exception_ptr(void* NON_NULL swiftClosureWrapper) noexcept; - inline Func_void_std__exception_ptr_Wrapper wrap_Func_void_std__exception_ptr(Func_void_std__exception_ptr value) noexcept { - return Func_void_std__exception_ptr_Wrapper(std::move(value)); - } - - // pragma MARK: std::optional - /** - * Specialized version of `std::optional`. - */ - using std__optional_bool_ = std::optional; - inline std::optional create_std__optional_bool_(const bool& value) noexcept { - return std::optional(value); - } - inline bool has_value_std__optional_bool_(const std::optional& optional) noexcept { - return optional.has_value(); - } - inline bool get_std__optional_bool_(const std::optional& optional) noexcept { - return *optional; - } - - // pragma MARK: std::optional - /** - * Specialized version of `std::optional`. - */ - using std__optional_std__string_ = std::optional; - inline std::optional create_std__optional_std__string_(const std::string& value) noexcept { - return std::optional(value); - } - inline bool has_value_std__optional_std__string_(const std::optional& optional) noexcept { - return optional.has_value(); - } - inline std::string get_std__optional_std__string_(const std::optional& optional) noexcept { - return *optional; - } - - // pragma MARK: std::variant - /** - * Wrapper struct for `std::variant`. - * std::variant cannot be used in Swift because of a Swift bug. - * Not even specializing it works. So we create a wrapper struct. - */ - struct std__variant_nitro__NullType__GetItemResult_ { - std::variant variant; - std__variant_nitro__NullType__GetItemResult_(std::variant variant): variant(variant) { } - operator std::variant() const noexcept { - return variant; - } - inline size_t index() const noexcept { - return variant.index(); - } - inline nitro::NullType get_0() const noexcept { - return std::get<0>(variant); - } - inline GetItemResult get_1() const noexcept { - return std::get<1>(variant); - } - }; - inline std__variant_nitro__NullType__GetItemResult_ create_std__variant_nitro__NullType__GetItemResult_(nitro::NullType value) noexcept { - return std__variant_nitro__NullType__GetItemResult_(value); - } - inline std__variant_nitro__NullType__GetItemResult_ create_std__variant_nitro__NullType__GetItemResult_(const GetItemResult& value) noexcept { - return std__variant_nitro__NullType__GetItemResult_(value); - } - - // pragma MARK: std::shared_ptr>> - /** - * Specialized version of `std::shared_ptr>>`. - */ - using std__shared_ptr_Promise_std__variant_nitro__NullType__GetItemResult___ = std::shared_ptr>>; - inline std::shared_ptr>> create_std__shared_ptr_Promise_std__variant_nitro__NullType__GetItemResult___() noexcept { - return Promise>::create(); - } - inline PromiseHolder> wrap_std__shared_ptr_Promise_std__variant_nitro__NullType__GetItemResult___(std::shared_ptr>> promise) noexcept { - return PromiseHolder>(std::move(promise)); - } - - // pragma MARK: std::function& /* result */)> - /** - * Specialized version of `std::function&)>`. - */ - using Func_void_std__variant_nitro__NullType__GetItemResult_ = std::function& /* result */)>; - /** - * Wrapper class for a `std::function& / * result * /)>`, this can be used from Swift. - */ - class Func_void_std__variant_nitro__NullType__GetItemResult__Wrapper final { - public: - explicit Func_void_std__variant_nitro__NullType__GetItemResult__Wrapper(std::function& /* result */)>&& func): _function(std::make_unique& /* result */)>>(std::move(func))) {} - inline void call(std::variant result) const noexcept { - _function->operator()(result); - } - private: - std::unique_ptr& /* result */)>> _function; - } SWIFT_NONCOPYABLE; - Func_void_std__variant_nitro__NullType__GetItemResult_ create_Func_void_std__variant_nitro__NullType__GetItemResult_(void* NON_NULL swiftClosureWrapper) noexcept; - inline Func_void_std__variant_nitro__NullType__GetItemResult__Wrapper wrap_Func_void_std__variant_nitro__NullType__GetItemResult_(Func_void_std__variant_nitro__NullType__GetItemResult_ value) noexcept { - return Func_void_std__variant_nitro__NullType__GetItemResult__Wrapper(std::move(value)); - } - - // pragma MARK: std::shared_ptr> - /** - * Specialized version of `std::shared_ptr>`. - */ - using std__shared_ptr_Promise_bool__ = std::shared_ptr>; - inline std::shared_ptr> create_std__shared_ptr_Promise_bool__() noexcept { - return Promise::create(); - } - inline PromiseHolder wrap_std__shared_ptr_Promise_bool__(std::shared_ptr> promise) noexcept { - return PromiseHolder(std::move(promise)); - } - - // pragma MARK: std::function - /** - * Specialized version of `std::function`. - */ - using Func_void_bool = std::function; - /** - * Wrapper class for a `std::function`, this can be used from Swift. - */ - class Func_void_bool_Wrapper final { - public: - explicit Func_void_bool_Wrapper(std::function&& func): _function(std::make_unique>(std::move(func))) {} - inline void call(bool result) const noexcept { - _function->operator()(result); - } - private: - std::unique_ptr> _function; - } SWIFT_NONCOPYABLE; - Func_void_bool create_Func_void_bool(void* NON_NULL swiftClosureWrapper) noexcept; - inline Func_void_bool_Wrapper wrap_Func_void_bool(Func_void_bool value) noexcept { - return Func_void_bool_Wrapper(std::move(value)); - } - - // pragma MARK: std::shared_ptr - /** - * Specialized version of `std::shared_ptr`. - */ - using std__shared_ptr_HybridKeychainModuleSpec_ = std::shared_ptr; - std::shared_ptr create_std__shared_ptr_HybridKeychainModuleSpec_(void* NON_NULL swiftUnsafePointer) noexcept; - void* NON_NULL get_std__shared_ptr_HybridKeychainModuleSpec_(std__shared_ptr_HybridKeychainModuleSpec_ cppType); - - // pragma MARK: std::weak_ptr - using std__weak_ptr_HybridKeychainModuleSpec_ = std::weak_ptr; - inline std__weak_ptr_HybridKeychainModuleSpec_ weakify_std__shared_ptr_HybridKeychainModuleSpec_(const std::shared_ptr& strong) noexcept { return strong; } - - // pragma MARK: Result>> - using Result_std__shared_ptr_Promise_void___ = Result>>; - inline Result_std__shared_ptr_Promise_void___ create_Result_std__shared_ptr_Promise_void___(const std::shared_ptr>& value) noexcept { - return Result>>::withValue(value); - } - inline Result_std__shared_ptr_Promise_void___ create_Result_std__shared_ptr_Promise_void___(const std::exception_ptr& error) noexcept { - return Result>>::withError(error); - } - - // pragma MARK: Result>>> - using Result_std__shared_ptr_Promise_std__variant_nitro__NullType__GetItemResult____ = Result>>>; - inline Result_std__shared_ptr_Promise_std__variant_nitro__NullType__GetItemResult____ create_Result_std__shared_ptr_Promise_std__variant_nitro__NullType__GetItemResult____(const std::shared_ptr>>& value) noexcept { - return Result>>>::withValue(value); - } - inline Result_std__shared_ptr_Promise_std__variant_nitro__NullType__GetItemResult____ create_Result_std__shared_ptr_Promise_std__variant_nitro__NullType__GetItemResult____(const std::exception_ptr& error) noexcept { - return Result>>>::withError(error); - } - - // pragma MARK: Result>> - using Result_std__shared_ptr_Promise_bool___ = Result>>; - inline Result_std__shared_ptr_Promise_bool___ create_Result_std__shared_ptr_Promise_bool___(const std::shared_ptr>& value) noexcept { - return Result>>::withValue(value); - } - inline Result_std__shared_ptr_Promise_bool___ create_Result_std__shared_ptr_Promise_bool___(const std::exception_ptr& error) noexcept { - return Result>>::withError(error); - } - -} // namespace margelo::nitro::keychainmodule::bridge::swift diff --git a/native-modules/react-native-keychain-module/nitrogen/generated/ios/KeychainModule-Swift-Cxx-Umbrella.hpp b/native-modules/react-native-keychain-module/nitrogen/generated/ios/KeychainModule-Swift-Cxx-Umbrella.hpp deleted file mode 100644 index 6bb0df5..0000000 --- a/native-modules/react-native-keychain-module/nitrogen/generated/ios/KeychainModule-Swift-Cxx-Umbrella.hpp +++ /dev/null @@ -1,63 +0,0 @@ -/// -/// KeychainModule-Swift-Cxx-Umbrella.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -// Forward declarations of C++ defined types -// Forward declaration of `GetItemParams` to properly resolve imports. -namespace margelo::nitro::keychainmodule { struct GetItemParams; } -// Forward declaration of `GetItemResult` to properly resolve imports. -namespace margelo::nitro::keychainmodule { struct GetItemResult; } -// Forward declaration of `HasItemParams` to properly resolve imports. -namespace margelo::nitro::keychainmodule { struct HasItemParams; } -// Forward declaration of `HybridKeychainModuleSpec` to properly resolve imports. -namespace margelo::nitro::keychainmodule { class HybridKeychainModuleSpec; } -// Forward declaration of `RemoveItemParams` to properly resolve imports. -namespace margelo::nitro::keychainmodule { struct RemoveItemParams; } -// Forward declaration of `SetItemParams` to properly resolve imports. -namespace margelo::nitro::keychainmodule { struct SetItemParams; } - -// Include C++ defined types -#include "GetItemParams.hpp" -#include "GetItemResult.hpp" -#include "HasItemParams.hpp" -#include "HybridKeychainModuleSpec.hpp" -#include "RemoveItemParams.hpp" -#include "SetItemParams.hpp" -#include -#include -#include -#include -#include -#include -#include -#include - -// C++ helpers for Swift -#include "KeychainModule-Swift-Cxx-Bridge.hpp" - -// Common C++ types used in Swift -#include -#include -#include -#include - -// Forward declarations of Swift defined types -// Forward declaration of `HybridKeychainModuleSpec_cxx` to properly resolve imports. -namespace KeychainModule { class HybridKeychainModuleSpec_cxx; } - -// Include Swift defined types -#if __has_include("KeychainModule-Swift.h") -// This header is generated by Xcode/Swift on every app build. -// If it cannot be found, make sure the Swift module's name (= podspec name) is actually "KeychainModule". -#include "KeychainModule-Swift.h" -// Same as above, but used when building with frameworks (`use_frameworks`) -#elif __has_include() -#include -#else -#error KeychainModule's autogenerated Swift header cannot be found! Make sure the Swift module's name (= podspec name) is actually "KeychainModule", and try building the app first. -#endif diff --git a/native-modules/react-native-keychain-module/nitrogen/generated/ios/KeychainModuleAutolinking.mm b/native-modules/react-native-keychain-module/nitrogen/generated/ios/KeychainModuleAutolinking.mm deleted file mode 100644 index b0c7171..0000000 --- a/native-modules/react-native-keychain-module/nitrogen/generated/ios/KeychainModuleAutolinking.mm +++ /dev/null @@ -1,33 +0,0 @@ -/// -/// KeychainModuleAutolinking.mm -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#import -#import -#import "KeychainModule-Swift-Cxx-Umbrella.hpp" -#import - -#include "HybridKeychainModuleSpecSwift.hpp" - -@interface KeychainModuleAutolinking : NSObject -@end - -@implementation KeychainModuleAutolinking - -+ (void) load { - using namespace margelo::nitro; - using namespace margelo::nitro::keychainmodule; - - HybridObjectRegistry::registerHybridObjectConstructor( - "KeychainModule", - []() -> std::shared_ptr { - std::shared_ptr hybridObject = KeychainModule::KeychainModuleAutolinking::createKeychainModule(); - return hybridObject; - } - ); -} - -@end diff --git a/native-modules/react-native-keychain-module/nitrogen/generated/ios/KeychainModuleAutolinking.swift b/native-modules/react-native-keychain-module/nitrogen/generated/ios/KeychainModuleAutolinking.swift deleted file mode 100644 index 62dad0d..0000000 --- a/native-modules/react-native-keychain-module/nitrogen/generated/ios/KeychainModuleAutolinking.swift +++ /dev/null @@ -1,25 +0,0 @@ -/// -/// KeychainModuleAutolinking.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -public final class KeychainModuleAutolinking { - public typealias bridge = margelo.nitro.keychainmodule.bridge.swift - - /** - * Creates an instance of a Swift class that implements `HybridKeychainModuleSpec`, - * and wraps it in a Swift class that can directly interop with C++ (`HybridKeychainModuleSpec_cxx`) - * - * This is generated by Nitrogen and will initialize the class specified - * in the `"autolinking"` property of `nitro.json` (in this case, `KeychainModule`). - */ - public static func createKeychainModule() -> bridge.std__shared_ptr_HybridKeychainModuleSpec_ { - let hybridObject = KeychainModule() - return { () -> bridge.std__shared_ptr_HybridKeychainModuleSpec_ in - let __cxxWrapped = hybridObject.getCxxWrapper() - return __cxxWrapped.getCxxPart() - }() - } -} diff --git a/native-modules/react-native-keychain-module/nitrogen/generated/ios/c++/HybridKeychainModuleSpecSwift.cpp b/native-modules/react-native-keychain-module/nitrogen/generated/ios/c++/HybridKeychainModuleSpecSwift.cpp deleted file mode 100644 index 548a9f8..0000000 --- a/native-modules/react-native-keychain-module/nitrogen/generated/ios/c++/HybridKeychainModuleSpecSwift.cpp +++ /dev/null @@ -1,11 +0,0 @@ -/// -/// HybridKeychainModuleSpecSwift.cpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#include "HybridKeychainModuleSpecSwift.hpp" - -namespace margelo::nitro::keychainmodule { -} // namespace margelo::nitro::keychainmodule diff --git a/native-modules/react-native-keychain-module/nitrogen/generated/ios/c++/HybridKeychainModuleSpecSwift.hpp b/native-modules/react-native-keychain-module/nitrogen/generated/ios/c++/HybridKeychainModuleSpecSwift.hpp deleted file mode 100644 index 1e3204c..0000000 --- a/native-modules/react-native-keychain-module/nitrogen/generated/ios/c++/HybridKeychainModuleSpecSwift.hpp +++ /dev/null @@ -1,126 +0,0 @@ -/// -/// HybridKeychainModuleSpecSwift.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#include "HybridKeychainModuleSpec.hpp" - -// Forward declaration of `HybridKeychainModuleSpec_cxx` to properly resolve imports. -namespace KeychainModule { class HybridKeychainModuleSpec_cxx; } - -// Forward declaration of `SetItemParams` to properly resolve imports. -namespace margelo::nitro::keychainmodule { struct SetItemParams; } -// Forward declaration of `GetItemResult` to properly resolve imports. -namespace margelo::nitro::keychainmodule { struct GetItemResult; } -// Forward declaration of `GetItemParams` to properly resolve imports. -namespace margelo::nitro::keychainmodule { struct GetItemParams; } -// Forward declaration of `RemoveItemParams` to properly resolve imports. -namespace margelo::nitro::keychainmodule { struct RemoveItemParams; } -// Forward declaration of `HasItemParams` to properly resolve imports. -namespace margelo::nitro::keychainmodule { struct HasItemParams; } - -#include -#include "SetItemParams.hpp" -#include -#include -#include -#include "GetItemResult.hpp" -#include -#include "GetItemParams.hpp" -#include "RemoveItemParams.hpp" -#include "HasItemParams.hpp" - -#include "KeychainModule-Swift-Cxx-Umbrella.hpp" - -namespace margelo::nitro::keychainmodule { - - /** - * The C++ part of HybridKeychainModuleSpec_cxx.swift. - * - * HybridKeychainModuleSpecSwift (C++) accesses HybridKeychainModuleSpec_cxx (Swift), and might - * contain some additional bridging code for C++ <> Swift interop. - * - * Since this obviously introduces an overhead, I hope at some point in - * the future, HybridKeychainModuleSpec_cxx can directly inherit from the C++ class HybridKeychainModuleSpec - * to simplify the whole structure and memory management. - */ - class HybridKeychainModuleSpecSwift: public virtual HybridKeychainModuleSpec { - public: - // Constructor from a Swift instance - explicit HybridKeychainModuleSpecSwift(const KeychainModule::HybridKeychainModuleSpec_cxx& swiftPart): - HybridObject(HybridKeychainModuleSpec::TAG), - _swiftPart(swiftPart) { } - - public: - // Get the Swift part - inline KeychainModule::HybridKeychainModuleSpec_cxx& getSwiftPart() noexcept { - return _swiftPart; - } - - public: - inline size_t getExternalMemorySize() noexcept override { - return _swiftPart.getMemorySize(); - } - void dispose() noexcept override { - _swiftPart.dispose(); - } - std::string toString() override { - return _swiftPart.toString(); - } - - public: - // Properties - - - public: - // Methods - inline std::shared_ptr> setItem(const SetItemParams& params) override { - auto __result = _swiftPart.setItem(std::forward(params)); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - auto __value = std::move(__result.value()); - return __value; - } - inline std::shared_ptr>> getItem(const GetItemParams& params) override { - auto __result = _swiftPart.getItem(std::forward(params)); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - auto __value = std::move(__result.value()); - return __value; - } - inline std::shared_ptr> removeItem(const RemoveItemParams& params) override { - auto __result = _swiftPart.removeItem(std::forward(params)); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - auto __value = std::move(__result.value()); - return __value; - } - inline std::shared_ptr> hasItem(const HasItemParams& params) override { - auto __result = _swiftPart.hasItem(std::forward(params)); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - auto __value = std::move(__result.value()); - return __value; - } - inline std::shared_ptr> isICloudSyncEnabled() override { - auto __result = _swiftPart.isICloudSyncEnabled(); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - auto __value = std::move(__result.value()); - return __value; - } - - private: - KeychainModule::HybridKeychainModuleSpec_cxx _swiftPart; - }; - -} // namespace margelo::nitro::keychainmodule diff --git a/native-modules/react-native-keychain-module/nitrogen/generated/ios/swift/Func_void.swift b/native-modules/react-native-keychain-module/nitrogen/generated/ios/swift/Func_void.swift deleted file mode 100644 index b44317f..0000000 --- a/native-modules/react-native-keychain-module/nitrogen/generated/ios/swift/Func_void.swift +++ /dev/null @@ -1,47 +0,0 @@ -/// -/// Func_void.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Wraps a Swift `() -> Void` as a class. - * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`. - */ -public final class Func_void { - public typealias bridge = margelo.nitro.keychainmodule.bridge.swift - - private let closure: () -> Void - - public init(_ closure: @escaping () -> Void) { - self.closure = closure - } - - @inline(__always) - public func call() -> Void { - self.closure() - } - - /** - * Casts this instance to a retained unsafe raw pointer. - * This acquires one additional strong reference on the object! - */ - @inline(__always) - public func toUnsafe() -> UnsafeMutableRawPointer { - return Unmanaged.passRetained(self).toOpaque() - } - - /** - * Casts an unsafe pointer to a `Func_void`. - * The pointer has to be a retained opaque `Unmanaged`. - * This removes one strong reference from the object! - */ - @inline(__always) - public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void { - return Unmanaged.fromOpaque(pointer).takeRetainedValue() - } -} diff --git a/native-modules/react-native-keychain-module/nitrogen/generated/ios/swift/Func_void_bool.swift b/native-modules/react-native-keychain-module/nitrogen/generated/ios/swift/Func_void_bool.swift deleted file mode 100644 index 9d33962..0000000 --- a/native-modules/react-native-keychain-module/nitrogen/generated/ios/swift/Func_void_bool.swift +++ /dev/null @@ -1,47 +0,0 @@ -/// -/// Func_void_bool.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Wraps a Swift `(_ value: Bool) -> Void` as a class. - * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`. - */ -public final class Func_void_bool { - public typealias bridge = margelo.nitro.keychainmodule.bridge.swift - - private let closure: (_ value: Bool) -> Void - - public init(_ closure: @escaping (_ value: Bool) -> Void) { - self.closure = closure - } - - @inline(__always) - public func call(value: Bool) -> Void { - self.closure(value) - } - - /** - * Casts this instance to a retained unsafe raw pointer. - * This acquires one additional strong reference on the object! - */ - @inline(__always) - public func toUnsafe() -> UnsafeMutableRawPointer { - return Unmanaged.passRetained(self).toOpaque() - } - - /** - * Casts an unsafe pointer to a `Func_void_bool`. - * The pointer has to be a retained opaque `Unmanaged`. - * This removes one strong reference from the object! - */ - @inline(__always) - public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_bool { - return Unmanaged.fromOpaque(pointer).takeRetainedValue() - } -} diff --git a/native-modules/react-native-keychain-module/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift b/native-modules/react-native-keychain-module/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift deleted file mode 100644 index d7322ae..0000000 --- a/native-modules/react-native-keychain-module/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +++ /dev/null @@ -1,47 +0,0 @@ -/// -/// Func_void_std__exception_ptr.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Wraps a Swift `(_ error: Error) -> Void` as a class. - * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`. - */ -public final class Func_void_std__exception_ptr { - public typealias bridge = margelo.nitro.keychainmodule.bridge.swift - - private let closure: (_ error: Error) -> Void - - public init(_ closure: @escaping (_ error: Error) -> Void) { - self.closure = closure - } - - @inline(__always) - public func call(error: std.exception_ptr) -> Void { - self.closure(RuntimeError.from(cppError: error)) - } - - /** - * Casts this instance to a retained unsafe raw pointer. - * This acquires one additional strong reference on the object! - */ - @inline(__always) - public func toUnsafe() -> UnsafeMutableRawPointer { - return Unmanaged.passRetained(self).toOpaque() - } - - /** - * Casts an unsafe pointer to a `Func_void_std__exception_ptr`. - * The pointer has to be a retained opaque `Unmanaged`. - * This removes one strong reference from the object! - */ - @inline(__always) - public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_std__exception_ptr { - return Unmanaged.fromOpaque(pointer).takeRetainedValue() - } -} diff --git a/native-modules/react-native-keychain-module/nitrogen/generated/ios/swift/Func_void_std__variant_nitro__NullType__GetItemResult_.swift b/native-modules/react-native-keychain-module/nitrogen/generated/ios/swift/Func_void_std__variant_nitro__NullType__GetItemResult_.swift deleted file mode 100644 index 15bcd5f..0000000 --- a/native-modules/react-native-keychain-module/nitrogen/generated/ios/swift/Func_void_std__variant_nitro__NullType__GetItemResult_.swift +++ /dev/null @@ -1,59 +0,0 @@ -/// -/// Func_void_std__variant_nitro__NullType__GetItemResult_.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Wraps a Swift `(_ value: Variant_NullType_GetItemResult) -> Void` as a class. - * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`. - */ -public final class Func_void_std__variant_nitro__NullType__GetItemResult_ { - public typealias bridge = margelo.nitro.keychainmodule.bridge.swift - - private let closure: (_ value: Variant_NullType_GetItemResult) -> Void - - public init(_ closure: @escaping (_ value: Variant_NullType_GetItemResult) -> Void) { - self.closure = closure - } - - @inline(__always) - public func call(value: bridge.std__variant_nitro__NullType__GetItemResult_) -> Void { - self.closure({ () -> Variant_NullType_GetItemResult in - let __variant = value - switch __variant.index() { - case 0: - let __actual = __variant.get_0() - return .first(NullType.null) - case 1: - let __actual = __variant.get_1() - return .second(__actual) - default: - fatalError("Variant can never have index \(__variant.index())!") - } - }()) - } - - /** - * Casts this instance to a retained unsafe raw pointer. - * This acquires one additional strong reference on the object! - */ - @inline(__always) - public func toUnsafe() -> UnsafeMutableRawPointer { - return Unmanaged.passRetained(self).toOpaque() - } - - /** - * Casts an unsafe pointer to a `Func_void_std__variant_nitro__NullType__GetItemResult_`. - * The pointer has to be a retained opaque `Unmanaged`. - * This removes one strong reference from the object! - */ - @inline(__always) - public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_std__variant_nitro__NullType__GetItemResult_ { - return Unmanaged.fromOpaque(pointer).takeRetainedValue() - } -} diff --git a/native-modules/react-native-keychain-module/nitrogen/generated/ios/swift/GetItemParams.swift b/native-modules/react-native-keychain-module/nitrogen/generated/ios/swift/GetItemParams.swift deleted file mode 100644 index 0b486fb..0000000 --- a/native-modules/react-native-keychain-module/nitrogen/generated/ios/swift/GetItemParams.swift +++ /dev/null @@ -1,36 +0,0 @@ -/// -/// GetItemParams.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Represents an instance of `GetItemParams`, backed by a C++ struct. - */ -public typealias GetItemParams = margelo.nitro.keychainmodule.GetItemParams - -public extension GetItemParams { - private typealias bridge = margelo.nitro.keychainmodule.bridge.swift - - /** - * Create a new instance of `GetItemParams`. - */ - init(key: String) { - self.init(std.string(key)) - } - - var key: String { - @inline(__always) - get { - return String(self.__key) - } - @inline(__always) - set { - self.__key = std.string(newValue) - } - } -} diff --git a/native-modules/react-native-keychain-module/nitrogen/generated/ios/swift/GetItemResult.swift b/native-modules/react-native-keychain-module/nitrogen/generated/ios/swift/GetItemResult.swift deleted file mode 100644 index ba432fe..0000000 --- a/native-modules/react-native-keychain-module/nitrogen/generated/ios/swift/GetItemResult.swift +++ /dev/null @@ -1,47 +0,0 @@ -/// -/// GetItemResult.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Represents an instance of `GetItemResult`, backed by a C++ struct. - */ -public typealias GetItemResult = margelo.nitro.keychainmodule.GetItemResult - -public extension GetItemResult { - private typealias bridge = margelo.nitro.keychainmodule.bridge.swift - - /** - * Create a new instance of `GetItemResult`. - */ - init(key: String, value: String) { - self.init(std.string(key), std.string(value)) - } - - var key: String { - @inline(__always) - get { - return String(self.__key) - } - @inline(__always) - set { - self.__key = std.string(newValue) - } - } - - var value: String { - @inline(__always) - get { - return String(self.__value) - } - @inline(__always) - set { - self.__value = std.string(newValue) - } - } -} diff --git a/native-modules/react-native-keychain-module/nitrogen/generated/ios/swift/HasItemParams.swift b/native-modules/react-native-keychain-module/nitrogen/generated/ios/swift/HasItemParams.swift deleted file mode 100644 index 72f32de..0000000 --- a/native-modules/react-native-keychain-module/nitrogen/generated/ios/swift/HasItemParams.swift +++ /dev/null @@ -1,36 +0,0 @@ -/// -/// HasItemParams.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Represents an instance of `HasItemParams`, backed by a C++ struct. - */ -public typealias HasItemParams = margelo.nitro.keychainmodule.HasItemParams - -public extension HasItemParams { - private typealias bridge = margelo.nitro.keychainmodule.bridge.swift - - /** - * Create a new instance of `HasItemParams`. - */ - init(key: String) { - self.init(std.string(key)) - } - - var key: String { - @inline(__always) - get { - return String(self.__key) - } - @inline(__always) - set { - self.__key = std.string(newValue) - } - } -} diff --git a/native-modules/react-native-keychain-module/nitrogen/generated/ios/swift/HybridKeychainModuleSpec.swift b/native-modules/react-native-keychain-module/nitrogen/generated/ios/swift/HybridKeychainModuleSpec.swift deleted file mode 100644 index b90c42f..0000000 --- a/native-modules/react-native-keychain-module/nitrogen/generated/ios/swift/HybridKeychainModuleSpec.swift +++ /dev/null @@ -1,60 +0,0 @@ -/// -/// HybridKeychainModuleSpec.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/// See ``HybridKeychainModuleSpec`` -public protocol HybridKeychainModuleSpec_protocol: HybridObject { - // Properties - - - // Methods - func setItem(params: SetItemParams) throws -> Promise - func getItem(params: GetItemParams) throws -> Promise - func removeItem(params: RemoveItemParams) throws -> Promise - func hasItem(params: HasItemParams) throws -> Promise - func isICloudSyncEnabled() throws -> Promise -} - -public extension HybridKeychainModuleSpec_protocol { - /// Default implementation of ``HybridObject.toString`` - func toString() -> String { - return "[HybridObject KeychainModule]" - } -} - -/// See ``HybridKeychainModuleSpec`` -open class HybridKeychainModuleSpec_base { - private weak var cxxWrapper: HybridKeychainModuleSpec_cxx? = nil - public init() { } - public func getCxxWrapper() -> HybridKeychainModuleSpec_cxx { - #if DEBUG - guard self is HybridKeychainModuleSpec else { - fatalError("`self` is not a `HybridKeychainModuleSpec`! Did you accidentally inherit from `HybridKeychainModuleSpec_base` instead of `HybridKeychainModuleSpec`?") - } - #endif - if let cxxWrapper = self.cxxWrapper { - return cxxWrapper - } else { - let cxxWrapper = HybridKeychainModuleSpec_cxx(self as! HybridKeychainModuleSpec) - self.cxxWrapper = cxxWrapper - return cxxWrapper - } - } -} - -/** - * A Swift base-protocol representing the KeychainModule HybridObject. - * Implement this protocol to create Swift-based instances of KeychainModule. - * ```swift - * class HybridKeychainModule : HybridKeychainModuleSpec { - * // ... - * } - * ``` - */ -public typealias HybridKeychainModuleSpec = HybridKeychainModuleSpec_protocol & HybridKeychainModuleSpec_base diff --git a/native-modules/react-native-keychain-module/nitrogen/generated/ios/swift/HybridKeychainModuleSpec_cxx.swift b/native-modules/react-native-keychain-module/nitrogen/generated/ios/swift/HybridKeychainModuleSpec_cxx.swift deleted file mode 100644 index 50dc41e..0000000 --- a/native-modules/react-native-keychain-module/nitrogen/generated/ios/swift/HybridKeychainModuleSpec_cxx.swift +++ /dev/null @@ -1,221 +0,0 @@ -/// -/// HybridKeychainModuleSpec_cxx.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * A class implementation that bridges HybridKeychainModuleSpec over to C++. - * In C++, we cannot use Swift protocols - so we need to wrap it in a class to make it strongly defined. - * - * Also, some Swift types need to be bridged with special handling: - * - Enums need to be wrapped in Structs, otherwise they cannot be accessed bi-directionally (Swift bug: https://github.com/swiftlang/swift/issues/75330) - * - Other HybridObjects need to be wrapped/unwrapped from the Swift TCxx wrapper - * - Throwing methods need to be wrapped with a Result type, as exceptions cannot be propagated to C++ - */ -open class HybridKeychainModuleSpec_cxx { - /** - * The Swift <> C++ bridge's namespace (`margelo::nitro::keychainmodule::bridge::swift`) - * from `KeychainModule-Swift-Cxx-Bridge.hpp`. - * This contains specialized C++ templates, and C++ helper functions that can be accessed from Swift. - */ - public typealias bridge = margelo.nitro.keychainmodule.bridge.swift - - /** - * Holds an instance of the `HybridKeychainModuleSpec` Swift protocol. - */ - private var __implementation: any HybridKeychainModuleSpec - - /** - * Holds a weak pointer to the C++ class that wraps the Swift class. - */ - private var __cxxPart: bridge.std__weak_ptr_HybridKeychainModuleSpec_ - - /** - * Create a new `HybridKeychainModuleSpec_cxx` that wraps the given `HybridKeychainModuleSpec`. - * All properties and methods bridge to C++ types. - */ - public init(_ implementation: any HybridKeychainModuleSpec) { - self.__implementation = implementation - self.__cxxPart = .init() - /* no base class */ - } - - /** - * Get the actual `HybridKeychainModuleSpec` instance this class wraps. - */ - @inline(__always) - public func getHybridKeychainModuleSpec() -> any HybridKeychainModuleSpec { - return __implementation - } - - /** - * Casts this instance to a retained unsafe raw pointer. - * This acquires one additional strong reference on the object! - */ - public func toUnsafe() -> UnsafeMutableRawPointer { - return Unmanaged.passRetained(self).toOpaque() - } - - /** - * Casts an unsafe pointer to a `HybridKeychainModuleSpec_cxx`. - * The pointer has to be a retained opaque `Unmanaged`. - * This removes one strong reference from the object! - */ - public class func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> HybridKeychainModuleSpec_cxx { - return Unmanaged.fromOpaque(pointer).takeRetainedValue() - } - - /** - * Gets (or creates) the C++ part of this Hybrid Object. - * The C++ part is a `std::shared_ptr`. - */ - public func getCxxPart() -> bridge.std__shared_ptr_HybridKeychainModuleSpec_ { - let cachedCxxPart = self.__cxxPart.lock() - if Bool(fromCxx: cachedCxxPart) { - return cachedCxxPart - } else { - let newCxxPart = bridge.create_std__shared_ptr_HybridKeychainModuleSpec_(self.toUnsafe()) - __cxxPart = bridge.weakify_std__shared_ptr_HybridKeychainModuleSpec_(newCxxPart) - return newCxxPart - } - } - - - - /** - * Get the memory size of the Swift class (plus size of any other allocations) - * so the JS VM can properly track it and garbage-collect the JS object if needed. - */ - @inline(__always) - public var memorySize: Int { - return MemoryHelper.getSizeOf(self.__implementation) + self.__implementation.memorySize - } - - /** - * Call dispose() on the Swift class. - * This _may_ be called manually from JS. - */ - @inline(__always) - public func dispose() { - self.__implementation.dispose() - } - - /** - * Call toString() on the Swift class. - */ - @inline(__always) - public func toString() -> String { - return self.__implementation.toString() - } - - // Properties - - - // Methods - @inline(__always) - public final func setItem(params: SetItemParams) -> bridge.Result_std__shared_ptr_Promise_void___ { - do { - let __result = try self.__implementation.setItem(params: params) - let __resultCpp = { () -> bridge.std__shared_ptr_Promise_void__ in - let __promise = bridge.create_std__shared_ptr_Promise_void__() - let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_void__(__promise) - __result - .then({ __result in __promiseHolder.resolve() }) - .catch({ __error in __promiseHolder.reject(__error.toCpp()) }) - return __promise - }() - return bridge.create_Result_std__shared_ptr_Promise_void___(__resultCpp) - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_std__shared_ptr_Promise_void___(__exceptionPtr) - } - } - - @inline(__always) - public final func getItem(params: GetItemParams) -> bridge.Result_std__shared_ptr_Promise_std__variant_nitro__NullType__GetItemResult____ { - do { - let __result = try self.__implementation.getItem(params: params) - let __resultCpp = { () -> bridge.std__shared_ptr_Promise_std__variant_nitro__NullType__GetItemResult___ in - let __promise = bridge.create_std__shared_ptr_Promise_std__variant_nitro__NullType__GetItemResult___() - let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_std__variant_nitro__NullType__GetItemResult___(__promise) - __result - .then({ __result in __promiseHolder.resolve({ () -> bridge.std__variant_nitro__NullType__GetItemResult_ in - switch __result { - case .first(let __value): - return bridge.create_std__variant_nitro__NullType__GetItemResult_(margelo.nitro.NullType.null) - case .second(let __value): - return bridge.create_std__variant_nitro__NullType__GetItemResult_(__value) - } - }().variant) }) - .catch({ __error in __promiseHolder.reject(__error.toCpp()) }) - return __promise - }() - return bridge.create_Result_std__shared_ptr_Promise_std__variant_nitro__NullType__GetItemResult____(__resultCpp) - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_std__shared_ptr_Promise_std__variant_nitro__NullType__GetItemResult____(__exceptionPtr) - } - } - - @inline(__always) - public final func removeItem(params: RemoveItemParams) -> bridge.Result_std__shared_ptr_Promise_void___ { - do { - let __result = try self.__implementation.removeItem(params: params) - let __resultCpp = { () -> bridge.std__shared_ptr_Promise_void__ in - let __promise = bridge.create_std__shared_ptr_Promise_void__() - let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_void__(__promise) - __result - .then({ __result in __promiseHolder.resolve() }) - .catch({ __error in __promiseHolder.reject(__error.toCpp()) }) - return __promise - }() - return bridge.create_Result_std__shared_ptr_Promise_void___(__resultCpp) - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_std__shared_ptr_Promise_void___(__exceptionPtr) - } - } - - @inline(__always) - public final func hasItem(params: HasItemParams) -> bridge.Result_std__shared_ptr_Promise_bool___ { - do { - let __result = try self.__implementation.hasItem(params: params) - let __resultCpp = { () -> bridge.std__shared_ptr_Promise_bool__ in - let __promise = bridge.create_std__shared_ptr_Promise_bool__() - let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_bool__(__promise) - __result - .then({ __result in __promiseHolder.resolve(__result) }) - .catch({ __error in __promiseHolder.reject(__error.toCpp()) }) - return __promise - }() - return bridge.create_Result_std__shared_ptr_Promise_bool___(__resultCpp) - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_std__shared_ptr_Promise_bool___(__exceptionPtr) - } - } - - @inline(__always) - public final func isICloudSyncEnabled() -> bridge.Result_std__shared_ptr_Promise_bool___ { - do { - let __result = try self.__implementation.isICloudSyncEnabled() - let __resultCpp = { () -> bridge.std__shared_ptr_Promise_bool__ in - let __promise = bridge.create_std__shared_ptr_Promise_bool__() - let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_bool__(__promise) - __result - .then({ __result in __promiseHolder.resolve(__result) }) - .catch({ __error in __promiseHolder.reject(__error.toCpp()) }) - return __promise - }() - return bridge.create_Result_std__shared_ptr_Promise_bool___(__resultCpp) - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_std__shared_ptr_Promise_bool___(__exceptionPtr) - } - } -} diff --git a/native-modules/react-native-keychain-module/nitrogen/generated/ios/swift/RemoveItemParams.swift b/native-modules/react-native-keychain-module/nitrogen/generated/ios/swift/RemoveItemParams.swift deleted file mode 100644 index 9314da6..0000000 --- a/native-modules/react-native-keychain-module/nitrogen/generated/ios/swift/RemoveItemParams.swift +++ /dev/null @@ -1,36 +0,0 @@ -/// -/// RemoveItemParams.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Represents an instance of `RemoveItemParams`, backed by a C++ struct. - */ -public typealias RemoveItemParams = margelo.nitro.keychainmodule.RemoveItemParams - -public extension RemoveItemParams { - private typealias bridge = margelo.nitro.keychainmodule.bridge.swift - - /** - * Create a new instance of `RemoveItemParams`. - */ - init(key: String) { - self.init(std.string(key)) - } - - var key: String { - @inline(__always) - get { - return String(self.__key) - } - @inline(__always) - set { - self.__key = std.string(newValue) - } - } -} diff --git a/native-modules/react-native-keychain-module/nitrogen/generated/ios/swift/SetItemParams.swift b/native-modules/react-native-keychain-module/nitrogen/generated/ios/swift/SetItemParams.swift deleted file mode 100644 index 5f5eafc..0000000 --- a/native-modules/react-native-keychain-module/nitrogen/generated/ios/swift/SetItemParams.swift +++ /dev/null @@ -1,137 +0,0 @@ -/// -/// SetItemParams.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Represents an instance of `SetItemParams`, backed by a C++ struct. - */ -public typealias SetItemParams = margelo.nitro.keychainmodule.SetItemParams - -public extension SetItemParams { - private typealias bridge = margelo.nitro.keychainmodule.bridge.swift - - /** - * Create a new instance of `SetItemParams`. - */ - init(key: String, value: String, enableSync: Bool?, label: String?, description: String?) { - self.init(std.string(key), std.string(value), { () -> bridge.std__optional_bool_ in - if let __unwrappedValue = enableSync { - return bridge.create_std__optional_bool_(__unwrappedValue) - } else { - return .init() - } - }(), { () -> bridge.std__optional_std__string_ in - if let __unwrappedValue = label { - return bridge.create_std__optional_std__string_(std.string(__unwrappedValue)) - } else { - return .init() - } - }(), { () -> bridge.std__optional_std__string_ in - if let __unwrappedValue = description { - return bridge.create_std__optional_std__string_(std.string(__unwrappedValue)) - } else { - return .init() - } - }()) - } - - var key: String { - @inline(__always) - get { - return String(self.__key) - } - @inline(__always) - set { - self.__key = std.string(newValue) - } - } - - var value: String { - @inline(__always) - get { - return String(self.__value) - } - @inline(__always) - set { - self.__value = std.string(newValue) - } - } - - var enableSync: Bool? { - @inline(__always) - get { - return { () -> Bool? in - if bridge.has_value_std__optional_bool_(self.__enableSync) { - let __unwrapped = bridge.get_std__optional_bool_(self.__enableSync) - return __unwrapped - } else { - return nil - } - }() - } - @inline(__always) - set { - self.__enableSync = { () -> bridge.std__optional_bool_ in - if let __unwrappedValue = newValue { - return bridge.create_std__optional_bool_(__unwrappedValue) - } else { - return .init() - } - }() - } - } - - var label: String? { - @inline(__always) - get { - return { () -> String? in - if bridge.has_value_std__optional_std__string_(self.__label) { - let __unwrapped = bridge.get_std__optional_std__string_(self.__label) - return String(__unwrapped) - } else { - return nil - } - }() - } - @inline(__always) - set { - self.__label = { () -> bridge.std__optional_std__string_ in - if let __unwrappedValue = newValue { - return bridge.create_std__optional_std__string_(std.string(__unwrappedValue)) - } else { - return .init() - } - }() - } - } - - var description: String? { - @inline(__always) - get { - return { () -> String? in - if bridge.has_value_std__optional_std__string_(self.__description) { - let __unwrapped = bridge.get_std__optional_std__string_(self.__description) - return String(__unwrapped) - } else { - return nil - } - }() - } - @inline(__always) - set { - self.__description = { () -> bridge.std__optional_std__string_ in - if let __unwrappedValue = newValue { - return bridge.create_std__optional_std__string_(std.string(__unwrappedValue)) - } else { - return .init() - } - }() - } - } -} diff --git a/native-modules/react-native-keychain-module/nitrogen/generated/ios/swift/Variant_NullType_GetItemResult.swift b/native-modules/react-native-keychain-module/nitrogen/generated/ios/swift/Variant_NullType_GetItemResult.swift deleted file mode 100644 index cd55757..0000000 --- a/native-modules/react-native-keychain-module/nitrogen/generated/ios/swift/Variant_NullType_GetItemResult.swift +++ /dev/null @@ -1,18 +0,0 @@ -/// -/// Variant_NullType_GetItemResult.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import NitroModules - -/** - * An Swift enum with associated values representing a Variant/Union type. - * JS type: `null | struct` - */ -@frozen -public indirect enum Variant_NullType_GetItemResult { - case first(NullType) - case second(GetItemResult) -} diff --git a/native-modules/react-native-keychain-module/nitrogen/generated/shared/c++/GetItemParams.hpp b/native-modules/react-native-keychain-module/nitrogen/generated/shared/c++/GetItemParams.hpp deleted file mode 100644 index 958f575..0000000 --- a/native-modules/react-native-keychain-module/nitrogen/generated/shared/c++/GetItemParams.hpp +++ /dev/null @@ -1,75 +0,0 @@ -/// -/// GetItemParams.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif - - - -#include - -namespace margelo::nitro::keychainmodule { - - /** - * A struct which can be represented as a JavaScript object (GetItemParams). - */ - struct GetItemParams { - public: - std::string key SWIFT_PRIVATE; - - public: - GetItemParams() = default; - explicit GetItemParams(std::string key): key(key) {} - }; - -} // namespace margelo::nitro::keychainmodule - -namespace margelo::nitro { - - // C++ GetItemParams <> JS GetItemParams (object) - template <> - struct JSIConverter final { - static inline margelo::nitro::keychainmodule::GetItemParams fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { - jsi::Object obj = arg.asObject(runtime); - return margelo::nitro::keychainmodule::GetItemParams( - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "key")) - ); - } - static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::keychainmodule::GetItemParams& arg) { - jsi::Object obj(runtime); - obj.setProperty(runtime, "key", JSIConverter::toJSI(runtime, arg.key)); - return obj; - } - static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) { - if (!value.isObject()) { - return false; - } - jsi::Object obj = value.getObject(runtime); - if (!nitro::isPlainObject(runtime, obj)) { - return false; - } - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "key"))) return false; - return true; - } - }; - -} // namespace margelo::nitro diff --git a/native-modules/react-native-keychain-module/nitrogen/generated/shared/c++/GetItemResult.hpp b/native-modules/react-native-keychain-module/nitrogen/generated/shared/c++/GetItemResult.hpp deleted file mode 100644 index fabfe6b..0000000 --- a/native-modules/react-native-keychain-module/nitrogen/generated/shared/c++/GetItemResult.hpp +++ /dev/null @@ -1,79 +0,0 @@ -/// -/// GetItemResult.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif - - - -#include - -namespace margelo::nitro::keychainmodule { - - /** - * A struct which can be represented as a JavaScript object (GetItemResult). - */ - struct GetItemResult { - public: - std::string key SWIFT_PRIVATE; - std::string value SWIFT_PRIVATE; - - public: - GetItemResult() = default; - explicit GetItemResult(std::string key, std::string value): key(key), value(value) {} - }; - -} // namespace margelo::nitro::keychainmodule - -namespace margelo::nitro { - - // C++ GetItemResult <> JS GetItemResult (object) - template <> - struct JSIConverter final { - static inline margelo::nitro::keychainmodule::GetItemResult fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { - jsi::Object obj = arg.asObject(runtime); - return margelo::nitro::keychainmodule::GetItemResult( - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "key")), - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "value")) - ); - } - static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::keychainmodule::GetItemResult& arg) { - jsi::Object obj(runtime); - obj.setProperty(runtime, "key", JSIConverter::toJSI(runtime, arg.key)); - obj.setProperty(runtime, "value", JSIConverter::toJSI(runtime, arg.value)); - return obj; - } - static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) { - if (!value.isObject()) { - return false; - } - jsi::Object obj = value.getObject(runtime); - if (!nitro::isPlainObject(runtime, obj)) { - return false; - } - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "key"))) return false; - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "value"))) return false; - return true; - } - }; - -} // namespace margelo::nitro diff --git a/native-modules/react-native-keychain-module/nitrogen/generated/shared/c++/HasItemParams.hpp b/native-modules/react-native-keychain-module/nitrogen/generated/shared/c++/HasItemParams.hpp deleted file mode 100644 index 4a499a3..0000000 --- a/native-modules/react-native-keychain-module/nitrogen/generated/shared/c++/HasItemParams.hpp +++ /dev/null @@ -1,75 +0,0 @@ -/// -/// HasItemParams.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif - - - -#include - -namespace margelo::nitro::keychainmodule { - - /** - * A struct which can be represented as a JavaScript object (HasItemParams). - */ - struct HasItemParams { - public: - std::string key SWIFT_PRIVATE; - - public: - HasItemParams() = default; - explicit HasItemParams(std::string key): key(key) {} - }; - -} // namespace margelo::nitro::keychainmodule - -namespace margelo::nitro { - - // C++ HasItemParams <> JS HasItemParams (object) - template <> - struct JSIConverter final { - static inline margelo::nitro::keychainmodule::HasItemParams fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { - jsi::Object obj = arg.asObject(runtime); - return margelo::nitro::keychainmodule::HasItemParams( - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "key")) - ); - } - static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::keychainmodule::HasItemParams& arg) { - jsi::Object obj(runtime); - obj.setProperty(runtime, "key", JSIConverter::toJSI(runtime, arg.key)); - return obj; - } - static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) { - if (!value.isObject()) { - return false; - } - jsi::Object obj = value.getObject(runtime); - if (!nitro::isPlainObject(runtime, obj)) { - return false; - } - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "key"))) return false; - return true; - } - }; - -} // namespace margelo::nitro diff --git a/native-modules/react-native-keychain-module/nitrogen/generated/shared/c++/HybridKeychainModuleSpec.cpp b/native-modules/react-native-keychain-module/nitrogen/generated/shared/c++/HybridKeychainModuleSpec.cpp deleted file mode 100644 index d07c663..0000000 --- a/native-modules/react-native-keychain-module/nitrogen/generated/shared/c++/HybridKeychainModuleSpec.cpp +++ /dev/null @@ -1,25 +0,0 @@ -/// -/// HybridKeychainModuleSpec.cpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#include "HybridKeychainModuleSpec.hpp" - -namespace margelo::nitro::keychainmodule { - - void HybridKeychainModuleSpec::loadHybridMethods() { - // load base methods/properties - HybridObject::loadHybridMethods(); - // load custom methods/properties - registerHybrids(this, [](Prototype& prototype) { - prototype.registerHybridMethod("setItem", &HybridKeychainModuleSpec::setItem); - prototype.registerHybridMethod("getItem", &HybridKeychainModuleSpec::getItem); - prototype.registerHybridMethod("removeItem", &HybridKeychainModuleSpec::removeItem); - prototype.registerHybridMethod("hasItem", &HybridKeychainModuleSpec::hasItem); - prototype.registerHybridMethod("isICloudSyncEnabled", &HybridKeychainModuleSpec::isICloudSyncEnabled); - }); - } - -} // namespace margelo::nitro::keychainmodule diff --git a/native-modules/react-native-keychain-module/nitrogen/generated/shared/c++/HybridKeychainModuleSpec.hpp b/native-modules/react-native-keychain-module/nitrogen/generated/shared/c++/HybridKeychainModuleSpec.hpp deleted file mode 100644 index 3752301..0000000 --- a/native-modules/react-native-keychain-module/nitrogen/generated/shared/c++/HybridKeychainModuleSpec.hpp +++ /dev/null @@ -1,82 +0,0 @@ -/// -/// HybridKeychainModuleSpec.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif - -// Forward declaration of `SetItemParams` to properly resolve imports. -namespace margelo::nitro::keychainmodule { struct SetItemParams; } -// Forward declaration of `GetItemResult` to properly resolve imports. -namespace margelo::nitro::keychainmodule { struct GetItemResult; } -// Forward declaration of `GetItemParams` to properly resolve imports. -namespace margelo::nitro::keychainmodule { struct GetItemParams; } -// Forward declaration of `RemoveItemParams` to properly resolve imports. -namespace margelo::nitro::keychainmodule { struct RemoveItemParams; } -// Forward declaration of `HasItemParams` to properly resolve imports. -namespace margelo::nitro::keychainmodule { struct HasItemParams; } - -#include -#include "SetItemParams.hpp" -#include -#include "GetItemResult.hpp" -#include -#include "GetItemParams.hpp" -#include "RemoveItemParams.hpp" -#include "HasItemParams.hpp" - -namespace margelo::nitro::keychainmodule { - - using namespace margelo::nitro; - - /** - * An abstract base class for `KeychainModule` - * Inherit this class to create instances of `HybridKeychainModuleSpec` in C++. - * You must explicitly call `HybridObject`'s constructor yourself, because it is virtual. - * @example - * ```cpp - * class HybridKeychainModule: public HybridKeychainModuleSpec { - * public: - * HybridKeychainModule(...): HybridObject(TAG) { ... } - * // ... - * }; - * ``` - */ - class HybridKeychainModuleSpec: public virtual HybridObject { - public: - // Constructor - explicit HybridKeychainModuleSpec(): HybridObject(TAG) { } - - // Destructor - ~HybridKeychainModuleSpec() override = default; - - public: - // Properties - - - public: - // Methods - virtual std::shared_ptr> setItem(const SetItemParams& params) = 0; - virtual std::shared_ptr>> getItem(const GetItemParams& params) = 0; - virtual std::shared_ptr> removeItem(const RemoveItemParams& params) = 0; - virtual std::shared_ptr> hasItem(const HasItemParams& params) = 0; - virtual std::shared_ptr> isICloudSyncEnabled() = 0; - - protected: - // Hybrid Setup - void loadHybridMethods() override; - - protected: - // Tag for logging - static constexpr auto TAG = "KeychainModule"; - }; - -} // namespace margelo::nitro::keychainmodule diff --git a/native-modules/react-native-keychain-module/nitrogen/generated/shared/c++/RemoveItemParams.hpp b/native-modules/react-native-keychain-module/nitrogen/generated/shared/c++/RemoveItemParams.hpp deleted file mode 100644 index be5fb4b..0000000 --- a/native-modules/react-native-keychain-module/nitrogen/generated/shared/c++/RemoveItemParams.hpp +++ /dev/null @@ -1,75 +0,0 @@ -/// -/// RemoveItemParams.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif - - - -#include - -namespace margelo::nitro::keychainmodule { - - /** - * A struct which can be represented as a JavaScript object (RemoveItemParams). - */ - struct RemoveItemParams { - public: - std::string key SWIFT_PRIVATE; - - public: - RemoveItemParams() = default; - explicit RemoveItemParams(std::string key): key(key) {} - }; - -} // namespace margelo::nitro::keychainmodule - -namespace margelo::nitro { - - // C++ RemoveItemParams <> JS RemoveItemParams (object) - template <> - struct JSIConverter final { - static inline margelo::nitro::keychainmodule::RemoveItemParams fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { - jsi::Object obj = arg.asObject(runtime); - return margelo::nitro::keychainmodule::RemoveItemParams( - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "key")) - ); - } - static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::keychainmodule::RemoveItemParams& arg) { - jsi::Object obj(runtime); - obj.setProperty(runtime, "key", JSIConverter::toJSI(runtime, arg.key)); - return obj; - } - static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) { - if (!value.isObject()) { - return false; - } - jsi::Object obj = value.getObject(runtime); - if (!nitro::isPlainObject(runtime, obj)) { - return false; - } - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "key"))) return false; - return true; - } - }; - -} // namespace margelo::nitro diff --git a/native-modules/react-native-keychain-module/nitrogen/generated/shared/c++/SetItemParams.hpp b/native-modules/react-native-keychain-module/nitrogen/generated/shared/c++/SetItemParams.hpp deleted file mode 100644 index dec2cec..0000000 --- a/native-modules/react-native-keychain-module/nitrogen/generated/shared/c++/SetItemParams.hpp +++ /dev/null @@ -1,92 +0,0 @@ -/// -/// SetItemParams.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif - - - -#include -#include - -namespace margelo::nitro::keychainmodule { - - /** - * A struct which can be represented as a JavaScript object (SetItemParams). - */ - struct SetItemParams { - public: - std::string key SWIFT_PRIVATE; - std::string value SWIFT_PRIVATE; - std::optional enableSync SWIFT_PRIVATE; - std::optional label SWIFT_PRIVATE; - std::optional description SWIFT_PRIVATE; - - public: - SetItemParams() = default; - explicit SetItemParams(std::string key, std::string value, std::optional enableSync, std::optional label, std::optional description): key(key), value(value), enableSync(enableSync), label(label), description(description) {} - }; - -} // namespace margelo::nitro::keychainmodule - -namespace margelo::nitro { - - // C++ SetItemParams <> JS SetItemParams (object) - template <> - struct JSIConverter final { - static inline margelo::nitro::keychainmodule::SetItemParams fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { - jsi::Object obj = arg.asObject(runtime); - return margelo::nitro::keychainmodule::SetItemParams( - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "key")), - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "value")), - JSIConverter>::fromJSI(runtime, obj.getProperty(runtime, "enableSync")), - JSIConverter>::fromJSI(runtime, obj.getProperty(runtime, "label")), - JSIConverter>::fromJSI(runtime, obj.getProperty(runtime, "description")) - ); - } - static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::keychainmodule::SetItemParams& arg) { - jsi::Object obj(runtime); - obj.setProperty(runtime, "key", JSIConverter::toJSI(runtime, arg.key)); - obj.setProperty(runtime, "value", JSIConverter::toJSI(runtime, arg.value)); - obj.setProperty(runtime, "enableSync", JSIConverter>::toJSI(runtime, arg.enableSync)); - obj.setProperty(runtime, "label", JSIConverter>::toJSI(runtime, arg.label)); - obj.setProperty(runtime, "description", JSIConverter>::toJSI(runtime, arg.description)); - return obj; - } - static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) { - if (!value.isObject()) { - return false; - } - jsi::Object obj = value.getObject(runtime); - if (!nitro::isPlainObject(runtime, obj)) { - return false; - } - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "key"))) return false; - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "value"))) return false; - if (!JSIConverter>::canConvert(runtime, obj.getProperty(runtime, "enableSync"))) return false; - if (!JSIConverter>::canConvert(runtime, obj.getProperty(runtime, "label"))) return false; - if (!JSIConverter>::canConvert(runtime, obj.getProperty(runtime, "description"))) return false; - return true; - } - }; - -} // namespace margelo::nitro diff --git a/native-modules/react-native-perf-memory/nitrogen/generated/.gitattributes b/native-modules/react-native-perf-memory/nitrogen/generated/.gitattributes deleted file mode 100644 index fb7a0d5..0000000 --- a/native-modules/react-native-perf-memory/nitrogen/generated/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -** linguist-generated=true diff --git a/native-modules/react-native-perf-memory/nitrogen/generated/android/c++/JHybridReactNativePerfMemorySpec.cpp b/native-modules/react-native-perf-memory/nitrogen/generated/android/c++/JHybridReactNativePerfMemorySpec.cpp deleted file mode 100644 index 58893c0..0000000 --- a/native-modules/react-native-perf-memory/nitrogen/generated/android/c++/JHybridReactNativePerfMemorySpec.cpp +++ /dev/null @@ -1,67 +0,0 @@ -/// -/// JHybridReactNativePerfMemorySpec.cpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#include "JHybridReactNativePerfMemorySpec.hpp" - -// Forward declaration of `MemoryUsage` to properly resolve imports. -namespace margelo::nitro::reactnativeperfmemory { struct MemoryUsage; } - -#include "MemoryUsage.hpp" -#include -#include -#include "JMemoryUsage.hpp" - -namespace margelo::nitro::reactnativeperfmemory { - - jni::local_ref JHybridReactNativePerfMemorySpec::initHybrid(jni::alias_ref jThis) { - return makeCxxInstance(jThis); - } - - void JHybridReactNativePerfMemorySpec::registerNatives() { - registerHybrid({ - makeNativeMethod("initHybrid", JHybridReactNativePerfMemorySpec::initHybrid), - }); - } - - size_t JHybridReactNativePerfMemorySpec::getExternalMemorySize() noexcept { - static const auto method = javaClassStatic()->getMethod("getMemorySize"); - return method(_javaPart); - } - - void JHybridReactNativePerfMemorySpec::dispose() noexcept { - static const auto method = javaClassStatic()->getMethod("dispose"); - method(_javaPart); - } - - std::string JHybridReactNativePerfMemorySpec::toString() { - static const auto method = javaClassStatic()->getMethod("toString"); - auto javaString = method(_javaPart); - return javaString->toStdString(); - } - - // Properties - - - // Methods - std::shared_ptr> JHybridReactNativePerfMemorySpec::getMemoryUsage() { - static const auto method = javaClassStatic()->getMethod()>("getMemoryUsage"); - auto __result = method(_javaPart); - return [&]() { - auto __promise = Promise::create(); - __result->cthis()->addOnResolvedListener([=](const jni::alias_ref& __boxedResult) { - auto __result = jni::static_ref_cast(__boxedResult); - __promise->resolve(__result->toCpp()); - }); - __result->cthis()->addOnRejectedListener([=](const jni::alias_ref& __throwable) { - jni::JniException __jniError(__throwable); - __promise->reject(std::make_exception_ptr(__jniError)); - }); - return __promise; - }(); - } - -} // namespace margelo::nitro::reactnativeperfmemory diff --git a/native-modules/react-native-perf-memory/nitrogen/generated/android/c++/JHybridReactNativePerfMemorySpec.hpp b/native-modules/react-native-perf-memory/nitrogen/generated/android/c++/JHybridReactNativePerfMemorySpec.hpp deleted file mode 100644 index 468c0b3..0000000 --- a/native-modules/react-native-perf-memory/nitrogen/generated/android/c++/JHybridReactNativePerfMemorySpec.hpp +++ /dev/null @@ -1,65 +0,0 @@ -/// -/// HybridReactNativePerfMemorySpec.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#include -#include -#include "HybridReactNativePerfMemorySpec.hpp" - - - - -namespace margelo::nitro::reactnativeperfmemory { - - using namespace facebook; - - class JHybridReactNativePerfMemorySpec: public jni::HybridClass, - public virtual HybridReactNativePerfMemorySpec { - public: - static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/reactnativeperfmemory/HybridReactNativePerfMemorySpec;"; - static jni::local_ref initHybrid(jni::alias_ref jThis); - static void registerNatives(); - - protected: - // C++ constructor (called from Java via `initHybrid()`) - explicit JHybridReactNativePerfMemorySpec(jni::alias_ref jThis) : - HybridObject(HybridReactNativePerfMemorySpec::TAG), - HybridBase(jThis), - _javaPart(jni::make_global(jThis)) {} - - public: - ~JHybridReactNativePerfMemorySpec() override { - // Hermes GC can destroy JS objects on a non-JNI Thread. - jni::ThreadScope::WithClassLoader([&] { _javaPart.reset(); }); - } - - public: - size_t getExternalMemorySize() noexcept override; - void dispose() noexcept override; - std::string toString() override; - - public: - inline const jni::global_ref& getJavaPart() const noexcept { - return _javaPart; - } - - public: - // Properties - - - public: - // Methods - std::shared_ptr> getMemoryUsage() override; - - private: - friend HybridBase; - using HybridBase::HybridBase; - jni::global_ref _javaPart; - }; - -} // namespace margelo::nitro::reactnativeperfmemory diff --git a/native-modules/react-native-perf-memory/nitrogen/generated/android/c++/JMemoryUsage.hpp b/native-modules/react-native-perf-memory/nitrogen/generated/android/c++/JMemoryUsage.hpp deleted file mode 100644 index 337e67f..0000000 --- a/native-modules/react-native-perf-memory/nitrogen/generated/android/c++/JMemoryUsage.hpp +++ /dev/null @@ -1,57 +0,0 @@ -/// -/// JMemoryUsage.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#include -#include "MemoryUsage.hpp" - - - -namespace margelo::nitro::reactnativeperfmemory { - - using namespace facebook; - - /** - * The C++ JNI bridge between the C++ struct "MemoryUsage" and the the Kotlin data class "MemoryUsage". - */ - struct JMemoryUsage final: public jni::JavaClass { - public: - static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/reactnativeperfmemory/MemoryUsage;"; - - public: - /** - * Convert this Java/Kotlin-based struct to the C++ struct MemoryUsage by copying all values to C++. - */ - [[maybe_unused]] - [[nodiscard]] - MemoryUsage toCpp() const { - static const auto clazz = javaClassStatic(); - static const auto fieldRss = clazz->getField("rss"); - double rss = this->getFieldValue(fieldRss); - return MemoryUsage( - rss - ); - } - - public: - /** - * Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java. - */ - [[maybe_unused]] - static jni::local_ref fromCpp(const MemoryUsage& value) { - using JSignature = JMemoryUsage(double); - static const auto clazz = javaClassStatic(); - static const auto create = clazz->getStaticMethod("fromCpp"); - return create( - clazz, - value.rss - ); - } - }; - -} // namespace margelo::nitro::reactnativeperfmemory diff --git a/native-modules/react-native-perf-memory/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativeperfmemory/HybridReactNativePerfMemorySpec.kt b/native-modules/react-native-perf-memory/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativeperfmemory/HybridReactNativePerfMemorySpec.kt deleted file mode 100644 index 1b217e1..0000000 --- a/native-modules/react-native-perf-memory/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativeperfmemory/HybridReactNativePerfMemorySpec.kt +++ /dev/null @@ -1,58 +0,0 @@ -/// -/// HybridReactNativePerfMemorySpec.kt -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -package com.margelo.nitro.reactnativeperfmemory - -import androidx.annotation.Keep -import com.facebook.jni.HybridData -import com.facebook.proguard.annotations.DoNotStrip -import com.margelo.nitro.core.Promise -import com.margelo.nitro.core.HybridObject - -/** - * A Kotlin class representing the ReactNativePerfMemory HybridObject. - * Implement this abstract class to create Kotlin-based instances of ReactNativePerfMemory. - */ -@DoNotStrip -@Keep -@Suppress( - "KotlinJniMissingFunction", "unused", - "RedundantSuppression", "RedundantUnitReturnType", "SimpleRedundantLet", - "LocalVariableName", "PropertyName", "PrivatePropertyName", "FunctionName" -) -abstract class HybridReactNativePerfMemorySpec: HybridObject() { - @DoNotStrip - private var mHybridData: HybridData = initHybrid() - - init { - super.updateNative(mHybridData) - } - - override fun updateNative(hybridData: HybridData) { - mHybridData = hybridData - super.updateNative(hybridData) - } - - // Default implementation of `HybridObject.toString()` - override fun toString(): String { - return "[HybridObject ReactNativePerfMemory]" - } - - // Properties - - - // Methods - @DoNotStrip - @Keep - abstract fun getMemoryUsage(): Promise - - private external fun initHybrid(): HybridData - - companion object { - protected const val TAG = "HybridReactNativePerfMemorySpec" - } -} diff --git a/native-modules/react-native-perf-memory/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativeperfmemory/MemoryUsage.kt b/native-modules/react-native-perf-memory/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativeperfmemory/MemoryUsage.kt deleted file mode 100644 index 43d7f0c..0000000 --- a/native-modules/react-native-perf-memory/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativeperfmemory/MemoryUsage.kt +++ /dev/null @@ -1,38 +0,0 @@ -/// -/// MemoryUsage.kt -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -package com.margelo.nitro.reactnativeperfmemory - -import androidx.annotation.Keep -import com.facebook.proguard.annotations.DoNotStrip - - -/** - * Represents the JavaScript object/struct "MemoryUsage". - */ -@DoNotStrip -@Keep -data class MemoryUsage( - @DoNotStrip - @Keep - val rss: Double -) { - /* primary constructor */ - - private companion object { - /** - * Constructor called from C++ - */ - @DoNotStrip - @Keep - @Suppress("unused") - @JvmStatic - private fun fromCpp(rss: Double): MemoryUsage { - return MemoryUsage(rss) - } - } -} diff --git a/native-modules/react-native-perf-memory/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativeperfmemory/reactnativeperfmemoryOnLoad.kt b/native-modules/react-native-perf-memory/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativeperfmemory/reactnativeperfmemoryOnLoad.kt deleted file mode 100644 index 920d7a9..0000000 --- a/native-modules/react-native-perf-memory/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativeperfmemory/reactnativeperfmemoryOnLoad.kt +++ /dev/null @@ -1,35 +0,0 @@ -/// -/// reactnativeperfmemoryOnLoad.kt -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -package com.margelo.nitro.reactnativeperfmemory - -import android.util.Log - -internal class reactnativeperfmemoryOnLoad { - companion object { - private const val TAG = "reactnativeperfmemoryOnLoad" - private var didLoad = false - /** - * Initializes the native part of "reactnativeperfmemory". - * This method is idempotent and can be called more than once. - */ - @JvmStatic - fun initializeNative() { - if (didLoad) return - try { - Log.i(TAG, "Loading reactnativeperfmemory C++ library...") - System.loadLibrary("reactnativeperfmemory") - Log.i(TAG, "Successfully loaded reactnativeperfmemory C++ library!") - didLoad = true - } catch (e: Error) { - Log.e(TAG, "Failed to load reactnativeperfmemory C++ library! Is it properly installed and linked? " + - "Is the name correct? (see `CMakeLists.txt`, at `add_library(...)`)", e) - throw e - } - } - } -} diff --git a/native-modules/react-native-perf-memory/nitrogen/generated/android/reactnativeperfmemory+autolinking.cmake b/native-modules/react-native-perf-memory/nitrogen/generated/android/reactnativeperfmemory+autolinking.cmake deleted file mode 100644 index 928abdf..0000000 --- a/native-modules/react-native-perf-memory/nitrogen/generated/android/reactnativeperfmemory+autolinking.cmake +++ /dev/null @@ -1,81 +0,0 @@ -# -# reactnativeperfmemory+autolinking.cmake -# This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -# https://github.com/mrousavy/nitro -# Copyright © 2026 Marc Rousavy @ Margelo -# - -# This is a CMake file that adds all files generated by Nitrogen -# to the current CMake project. -# -# To use it, add this to your CMakeLists.txt: -# ```cmake -# include(${CMAKE_SOURCE_DIR}/../nitrogen/generated/android/reactnativeperfmemory+autolinking.cmake) -# ``` - -# Define a flag to check if we are building properly -add_definitions(-DBUILDING_REACTNATIVEPERFMEMORY_WITH_GENERATED_CMAKE_PROJECT) - -# Enable Raw Props parsing in react-native (for Nitro Views) -add_definitions(-DRN_SERIALIZABLE_STATE) - -# Add all headers that were generated by Nitrogen -include_directories( - "../nitrogen/generated/shared/c++" - "../nitrogen/generated/android/c++" - "../nitrogen/generated/android/" -) - -# Add all .cpp sources that were generated by Nitrogen -target_sources( - # CMake project name (Android C++ library name) - reactnativeperfmemory PRIVATE - # Autolinking Setup - ../nitrogen/generated/android/reactnativeperfmemoryOnLoad.cpp - # Shared Nitrogen C++ sources - ../nitrogen/generated/shared/c++/HybridReactNativePerfMemorySpec.cpp - # Android-specific Nitrogen C++ sources - ../nitrogen/generated/android/c++/JHybridReactNativePerfMemorySpec.cpp -) - -# From node_modules/react-native/ReactAndroid/cmake-utils/folly-flags.cmake -# Used in node_modules/react-native/ReactAndroid/cmake-utils/ReactNative-application.cmake -target_compile_definitions( - reactnativeperfmemory PRIVATE - -DFOLLY_NO_CONFIG=1 - -DFOLLY_HAVE_CLOCK_GETTIME=1 - -DFOLLY_USE_LIBCPP=1 - -DFOLLY_CFG_NO_COROUTINES=1 - -DFOLLY_MOBILE=1 - -DFOLLY_HAVE_RECVMMSG=1 - -DFOLLY_HAVE_PTHREAD=1 - # Once we target android-23 above, we can comment - # the following line. NDK uses GNU style stderror_r() after API 23. - -DFOLLY_HAVE_XSI_STRERROR_R=1 -) - -# Add all libraries required by the generated specs -find_package(fbjni REQUIRED) # <-- Used for communication between Java <-> C++ -find_package(ReactAndroid REQUIRED) # <-- Used to set up React Native bindings (e.g. CallInvoker/TurboModule) -find_package(react-native-nitro-modules REQUIRED) # <-- Used to create all HybridObjects and use the Nitro core library - -# Link all libraries together -target_link_libraries( - reactnativeperfmemory - fbjni::fbjni # <-- Facebook C++ JNI helpers - ReactAndroid::jsi # <-- RN: JSI - react-native-nitro-modules::NitroModules # <-- NitroModules Core :) -) - -# Link react-native (different prefab between RN 0.75 and RN 0.76) -if(ReactAndroid_VERSION_MINOR GREATER_EQUAL 76) - target_link_libraries( - reactnativeperfmemory - ReactAndroid::reactnative # <-- RN: Native Modules umbrella prefab - ) -else() - target_link_libraries( - reactnativeperfmemory - ReactAndroid::react_nativemodule_core # <-- RN: TurboModules Core - ) -endif() diff --git a/native-modules/react-native-perf-memory/nitrogen/generated/android/reactnativeperfmemory+autolinking.gradle b/native-modules/react-native-perf-memory/nitrogen/generated/android/reactnativeperfmemory+autolinking.gradle deleted file mode 100644 index ee61666..0000000 --- a/native-modules/react-native-perf-memory/nitrogen/generated/android/reactnativeperfmemory+autolinking.gradle +++ /dev/null @@ -1,27 +0,0 @@ -/// -/// reactnativeperfmemory+autolinking.gradle -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -/// This is a Gradle file that adds all files generated by Nitrogen -/// to the current Gradle project. -/// -/// To use it, add this to your build.gradle: -/// ```gradle -/// apply from: '../nitrogen/generated/android/reactnativeperfmemory+autolinking.gradle' -/// ``` - -logger.warn("[NitroModules] 🔥 reactnativeperfmemory is boosted by nitro!") - -android { - sourceSets { - main { - java.srcDirs += [ - // Nitrogen files - "${project.projectDir}/../nitrogen/generated/android/kotlin" - ] - } - } -} diff --git a/native-modules/react-native-perf-memory/nitrogen/generated/android/reactnativeperfmemoryOnLoad.cpp b/native-modules/react-native-perf-memory/nitrogen/generated/android/reactnativeperfmemoryOnLoad.cpp deleted file mode 100644 index c70cf9f..0000000 --- a/native-modules/react-native-perf-memory/nitrogen/generated/android/reactnativeperfmemoryOnLoad.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/// -/// reactnativeperfmemoryOnLoad.cpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#ifndef BUILDING_REACTNATIVEPERFMEMORY_WITH_GENERATED_CMAKE_PROJECT -#error reactnativeperfmemoryOnLoad.cpp is not being built with the autogenerated CMakeLists.txt project. Is a different CMakeLists.txt building this? -#endif - -#include "reactnativeperfmemoryOnLoad.hpp" - -#include -#include -#include - -#include "JHybridReactNativePerfMemorySpec.hpp" -#include - -namespace margelo::nitro::reactnativeperfmemory { - -int initialize(JavaVM* vm) { - using namespace margelo::nitro; - using namespace margelo::nitro::reactnativeperfmemory; - using namespace facebook; - - return facebook::jni::initialize(vm, [] { - // Register native JNI methods - margelo::nitro::reactnativeperfmemory::JHybridReactNativePerfMemorySpec::registerNatives(); - - // Register Nitro Hybrid Objects - HybridObjectRegistry::registerHybridObjectConstructor( - "ReactNativePerfMemory", - []() -> std::shared_ptr { - static DefaultConstructableObject object("com/margelo/nitro/reactnativeperfmemory/ReactNativePerfMemory"); - auto instance = object.create(); - return instance->cthis()->shared(); - } - ); - }); -} - -} // namespace margelo::nitro::reactnativeperfmemory diff --git a/native-modules/react-native-perf-memory/nitrogen/generated/android/reactnativeperfmemoryOnLoad.hpp b/native-modules/react-native-perf-memory/nitrogen/generated/android/reactnativeperfmemoryOnLoad.hpp deleted file mode 100644 index 0d0b550..0000000 --- a/native-modules/react-native-perf-memory/nitrogen/generated/android/reactnativeperfmemoryOnLoad.hpp +++ /dev/null @@ -1,25 +0,0 @@ -/// -/// reactnativeperfmemoryOnLoad.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#include -#include - -namespace margelo::nitro::reactnativeperfmemory { - - /** - * Initializes the native (C++) part of reactnativeperfmemory, and autolinks all Hybrid Objects. - * Call this in your `JNI_OnLoad` function (probably inside `cpp-adapter.cpp`). - * Example: - * ```cpp (cpp-adapter.cpp) - * JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void*) { - * return margelo::nitro::reactnativeperfmemory::initialize(vm); - * } - * ``` - */ - int initialize(JavaVM* vm); - -} // namespace margelo::nitro::reactnativeperfmemory diff --git a/native-modules/react-native-perf-memory/nitrogen/generated/ios/ReactNativePerfMemory+autolinking.rb b/native-modules/react-native-perf-memory/nitrogen/generated/ios/ReactNativePerfMemory+autolinking.rb deleted file mode 100644 index b7242b1..0000000 --- a/native-modules/react-native-perf-memory/nitrogen/generated/ios/ReactNativePerfMemory+autolinking.rb +++ /dev/null @@ -1,60 +0,0 @@ -# -# ReactNativePerfMemory+autolinking.rb -# This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -# https://github.com/mrousavy/nitro -# Copyright © 2026 Marc Rousavy @ Margelo -# - -# This is a Ruby script that adds all files generated by Nitrogen -# to the given podspec. -# -# To use it, add this to your .podspec: -# ```ruby -# Pod::Spec.new do |spec| -# # ... -# -# # Add all files generated by Nitrogen -# load 'nitrogen/generated/ios/ReactNativePerfMemory+autolinking.rb' -# add_nitrogen_files(spec) -# end -# ``` - -def add_nitrogen_files(spec) - Pod::UI.puts "[NitroModules] 🔥 ReactNativePerfMemory is boosted by nitro!" - - spec.dependency "NitroModules" - - current_source_files = Array(spec.attributes_hash['source_files']) - spec.source_files = current_source_files + [ - # Generated cross-platform specs - "nitrogen/generated/shared/**/*.{h,hpp,c,cpp,swift}", - # Generated bridges for the cross-platform specs - "nitrogen/generated/ios/**/*.{h,hpp,c,cpp,mm,swift}", - ] - - current_public_header_files = Array(spec.attributes_hash['public_header_files']) - spec.public_header_files = current_public_header_files + [ - # Generated specs - "nitrogen/generated/shared/**/*.{h,hpp}", - # Swift to C++ bridging helpers - "nitrogen/generated/ios/ReactNativePerfMemory-Swift-Cxx-Bridge.hpp" - ] - - current_private_header_files = Array(spec.attributes_hash['private_header_files']) - spec.private_header_files = current_private_header_files + [ - # iOS specific specs - "nitrogen/generated/ios/c++/**/*.{h,hpp}", - # Views are framework-specific and should be private - "nitrogen/generated/shared/**/views/**/*" - ] - - current_pod_target_xcconfig = spec.attributes_hash['pod_target_xcconfig'] || {} - spec.pod_target_xcconfig = current_pod_target_xcconfig.merge({ - # Use C++ 20 - "CLANG_CXX_LANGUAGE_STANDARD" => "c++20", - # Enables C++ <-> Swift interop (by default it's only C) - "SWIFT_OBJC_INTEROP_MODE" => "objcxx", - # Enables stricter modular headers - "DEFINES_MODULE" => "YES", - }) -end diff --git a/native-modules/react-native-perf-memory/nitrogen/generated/ios/ReactNativePerfMemory-Swift-Cxx-Bridge.cpp b/native-modules/react-native-perf-memory/nitrogen/generated/ios/ReactNativePerfMemory-Swift-Cxx-Bridge.cpp deleted file mode 100644 index c97f44f..0000000 --- a/native-modules/react-native-perf-memory/nitrogen/generated/ios/ReactNativePerfMemory-Swift-Cxx-Bridge.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/// -/// ReactNativePerfMemory-Swift-Cxx-Bridge.cpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#include "ReactNativePerfMemory-Swift-Cxx-Bridge.hpp" - -// Include C++ implementation defined types -#include "HybridReactNativePerfMemorySpecSwift.hpp" -#include "ReactNativePerfMemory-Swift-Cxx-Umbrella.hpp" -#include - -namespace margelo::nitro::reactnativeperfmemory::bridge::swift { - - // pragma MARK: std::function - Func_void_MemoryUsage create_Func_void_MemoryUsage(void* NON_NULL swiftClosureWrapper) noexcept { - auto swiftClosure = ReactNativePerfMemory::Func_void_MemoryUsage::fromUnsafe(swiftClosureWrapper); - return [swiftClosure = std::move(swiftClosure)](const MemoryUsage& result) mutable -> void { - swiftClosure.call(result); - }; - } - - // pragma MARK: std::function - Func_void_std__exception_ptr create_Func_void_std__exception_ptr(void* NON_NULL swiftClosureWrapper) noexcept { - auto swiftClosure = ReactNativePerfMemory::Func_void_std__exception_ptr::fromUnsafe(swiftClosureWrapper); - return [swiftClosure = std::move(swiftClosure)](const std::exception_ptr& error) mutable -> void { - swiftClosure.call(error); - }; - } - - // pragma MARK: std::shared_ptr - std::shared_ptr create_std__shared_ptr_HybridReactNativePerfMemorySpec_(void* NON_NULL swiftUnsafePointer) noexcept { - ReactNativePerfMemory::HybridReactNativePerfMemorySpec_cxx swiftPart = ReactNativePerfMemory::HybridReactNativePerfMemorySpec_cxx::fromUnsafe(swiftUnsafePointer); - return std::make_shared(swiftPart); - } - void* NON_NULL get_std__shared_ptr_HybridReactNativePerfMemorySpec_(std__shared_ptr_HybridReactNativePerfMemorySpec_ cppType) { - std::shared_ptr swiftWrapper = std::dynamic_pointer_cast(cppType); - #ifdef NITRO_DEBUG - if (swiftWrapper == nullptr) [[unlikely]] { - throw std::runtime_error("Class \"HybridReactNativePerfMemorySpec\" is not implemented in Swift!"); - } - #endif - ReactNativePerfMemory::HybridReactNativePerfMemorySpec_cxx& swiftPart = swiftWrapper->getSwiftPart(); - return swiftPart.toUnsafe(); - } - -} // namespace margelo::nitro::reactnativeperfmemory::bridge::swift diff --git a/native-modules/react-native-perf-memory/nitrogen/generated/ios/ReactNativePerfMemory-Swift-Cxx-Bridge.hpp b/native-modules/react-native-perf-memory/nitrogen/generated/ios/ReactNativePerfMemory-Swift-Cxx-Bridge.hpp deleted file mode 100644 index 42101e7..0000000 --- a/native-modules/react-native-perf-memory/nitrogen/generated/ios/ReactNativePerfMemory-Swift-Cxx-Bridge.hpp +++ /dev/null @@ -1,113 +0,0 @@ -/// -/// ReactNativePerfMemory-Swift-Cxx-Bridge.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -// Forward declarations of C++ defined types -// Forward declaration of `HybridReactNativePerfMemorySpec` to properly resolve imports. -namespace margelo::nitro::reactnativeperfmemory { class HybridReactNativePerfMemorySpec; } -// Forward declaration of `MemoryUsage` to properly resolve imports. -namespace margelo::nitro::reactnativeperfmemory { struct MemoryUsage; } - -// Forward declarations of Swift defined types -// Forward declaration of `HybridReactNativePerfMemorySpec_cxx` to properly resolve imports. -namespace ReactNativePerfMemory { class HybridReactNativePerfMemorySpec_cxx; } - -// Include C++ defined types -#include "HybridReactNativePerfMemorySpec.hpp" -#include "MemoryUsage.hpp" -#include -#include -#include -#include -#include -#include - -/** - * Contains specialized versions of C++ templated types so they can be accessed from Swift, - * as well as helper functions to interact with those C++ types from Swift. - */ -namespace margelo::nitro::reactnativeperfmemory::bridge::swift { - - // pragma MARK: std::shared_ptr> - /** - * Specialized version of `std::shared_ptr>`. - */ - using std__shared_ptr_Promise_MemoryUsage__ = std::shared_ptr>; - inline std::shared_ptr> create_std__shared_ptr_Promise_MemoryUsage__() noexcept { - return Promise::create(); - } - inline PromiseHolder wrap_std__shared_ptr_Promise_MemoryUsage__(std::shared_ptr> promise) noexcept { - return PromiseHolder(std::move(promise)); - } - - // pragma MARK: std::function - /** - * Specialized version of `std::function`. - */ - using Func_void_MemoryUsage = std::function; - /** - * Wrapper class for a `std::function`, this can be used from Swift. - */ - class Func_void_MemoryUsage_Wrapper final { - public: - explicit Func_void_MemoryUsage_Wrapper(std::function&& func): _function(std::make_unique>(std::move(func))) {} - inline void call(MemoryUsage result) const noexcept { - _function->operator()(result); - } - private: - std::unique_ptr> _function; - } SWIFT_NONCOPYABLE; - Func_void_MemoryUsage create_Func_void_MemoryUsage(void* NON_NULL swiftClosureWrapper) noexcept; - inline Func_void_MemoryUsage_Wrapper wrap_Func_void_MemoryUsage(Func_void_MemoryUsage value) noexcept { - return Func_void_MemoryUsage_Wrapper(std::move(value)); - } - - // pragma MARK: std::function - /** - * Specialized version of `std::function`. - */ - using Func_void_std__exception_ptr = std::function; - /** - * Wrapper class for a `std::function`, this can be used from Swift. - */ - class Func_void_std__exception_ptr_Wrapper final { - public: - explicit Func_void_std__exception_ptr_Wrapper(std::function&& func): _function(std::make_unique>(std::move(func))) {} - inline void call(std::exception_ptr error) const noexcept { - _function->operator()(error); - } - private: - std::unique_ptr> _function; - } SWIFT_NONCOPYABLE; - Func_void_std__exception_ptr create_Func_void_std__exception_ptr(void* NON_NULL swiftClosureWrapper) noexcept; - inline Func_void_std__exception_ptr_Wrapper wrap_Func_void_std__exception_ptr(Func_void_std__exception_ptr value) noexcept { - return Func_void_std__exception_ptr_Wrapper(std::move(value)); - } - - // pragma MARK: std::shared_ptr - /** - * Specialized version of `std::shared_ptr`. - */ - using std__shared_ptr_HybridReactNativePerfMemorySpec_ = std::shared_ptr; - std::shared_ptr create_std__shared_ptr_HybridReactNativePerfMemorySpec_(void* NON_NULL swiftUnsafePointer) noexcept; - void* NON_NULL get_std__shared_ptr_HybridReactNativePerfMemorySpec_(std__shared_ptr_HybridReactNativePerfMemorySpec_ cppType); - - // pragma MARK: std::weak_ptr - using std__weak_ptr_HybridReactNativePerfMemorySpec_ = std::weak_ptr; - inline std__weak_ptr_HybridReactNativePerfMemorySpec_ weakify_std__shared_ptr_HybridReactNativePerfMemorySpec_(const std::shared_ptr& strong) noexcept { return strong; } - - // pragma MARK: Result>> - using Result_std__shared_ptr_Promise_MemoryUsage___ = Result>>; - inline Result_std__shared_ptr_Promise_MemoryUsage___ create_Result_std__shared_ptr_Promise_MemoryUsage___(const std::shared_ptr>& value) noexcept { - return Result>>::withValue(value); - } - inline Result_std__shared_ptr_Promise_MemoryUsage___ create_Result_std__shared_ptr_Promise_MemoryUsage___(const std::exception_ptr& error) noexcept { - return Result>>::withError(error); - } - -} // namespace margelo::nitro::reactnativeperfmemory::bridge::swift diff --git a/native-modules/react-native-perf-memory/nitrogen/generated/ios/ReactNativePerfMemory-Swift-Cxx-Umbrella.hpp b/native-modules/react-native-perf-memory/nitrogen/generated/ios/ReactNativePerfMemory-Swift-Cxx-Umbrella.hpp deleted file mode 100644 index 376ed64..0000000 --- a/native-modules/react-native-perf-memory/nitrogen/generated/ios/ReactNativePerfMemory-Swift-Cxx-Umbrella.hpp +++ /dev/null @@ -1,47 +0,0 @@ -/// -/// ReactNativePerfMemory-Swift-Cxx-Umbrella.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -// Forward declarations of C++ defined types -// Forward declaration of `HybridReactNativePerfMemorySpec` to properly resolve imports. -namespace margelo::nitro::reactnativeperfmemory { class HybridReactNativePerfMemorySpec; } -// Forward declaration of `MemoryUsage` to properly resolve imports. -namespace margelo::nitro::reactnativeperfmemory { struct MemoryUsage; } - -// Include C++ defined types -#include "HybridReactNativePerfMemorySpec.hpp" -#include "MemoryUsage.hpp" -#include -#include -#include -#include - -// C++ helpers for Swift -#include "ReactNativePerfMemory-Swift-Cxx-Bridge.hpp" - -// Common C++ types used in Swift -#include -#include -#include -#include - -// Forward declarations of Swift defined types -// Forward declaration of `HybridReactNativePerfMemorySpec_cxx` to properly resolve imports. -namespace ReactNativePerfMemory { class HybridReactNativePerfMemorySpec_cxx; } - -// Include Swift defined types -#if __has_include("ReactNativePerfMemory-Swift.h") -// This header is generated by Xcode/Swift on every app build. -// If it cannot be found, make sure the Swift module's name (= podspec name) is actually "ReactNativePerfMemory". -#include "ReactNativePerfMemory-Swift.h" -// Same as above, but used when building with frameworks (`use_frameworks`) -#elif __has_include() -#include -#else -#error ReactNativePerfMemory's autogenerated Swift header cannot be found! Make sure the Swift module's name (= podspec name) is actually "ReactNativePerfMemory", and try building the app first. -#endif diff --git a/native-modules/react-native-perf-memory/nitrogen/generated/ios/ReactNativePerfMemoryAutolinking.mm b/native-modules/react-native-perf-memory/nitrogen/generated/ios/ReactNativePerfMemoryAutolinking.mm deleted file mode 100644 index 80b2e1e..0000000 --- a/native-modules/react-native-perf-memory/nitrogen/generated/ios/ReactNativePerfMemoryAutolinking.mm +++ /dev/null @@ -1,33 +0,0 @@ -/// -/// ReactNativePerfMemoryAutolinking.mm -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#import -#import -#import "ReactNativePerfMemory-Swift-Cxx-Umbrella.hpp" -#import - -#include "HybridReactNativePerfMemorySpecSwift.hpp" - -@interface ReactNativePerfMemoryAutolinking : NSObject -@end - -@implementation ReactNativePerfMemoryAutolinking - -+ (void) load { - using namespace margelo::nitro; - using namespace margelo::nitro::reactnativeperfmemory; - - HybridObjectRegistry::registerHybridObjectConstructor( - "ReactNativePerfMemory", - []() -> std::shared_ptr { - std::shared_ptr hybridObject = ReactNativePerfMemory::ReactNativePerfMemoryAutolinking::createReactNativePerfMemory(); - return hybridObject; - } - ); -} - -@end diff --git a/native-modules/react-native-perf-memory/nitrogen/generated/ios/ReactNativePerfMemoryAutolinking.swift b/native-modules/react-native-perf-memory/nitrogen/generated/ios/ReactNativePerfMemoryAutolinking.swift deleted file mode 100644 index 6d6d235..0000000 --- a/native-modules/react-native-perf-memory/nitrogen/generated/ios/ReactNativePerfMemoryAutolinking.swift +++ /dev/null @@ -1,25 +0,0 @@ -/// -/// ReactNativePerfMemoryAutolinking.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -public final class ReactNativePerfMemoryAutolinking { - public typealias bridge = margelo.nitro.reactnativeperfmemory.bridge.swift - - /** - * Creates an instance of a Swift class that implements `HybridReactNativePerfMemorySpec`, - * and wraps it in a Swift class that can directly interop with C++ (`HybridReactNativePerfMemorySpec_cxx`) - * - * This is generated by Nitrogen and will initialize the class specified - * in the `"autolinking"` property of `nitro.json` (in this case, `ReactNativePerfMemory`). - */ - public static func createReactNativePerfMemory() -> bridge.std__shared_ptr_HybridReactNativePerfMemorySpec_ { - let hybridObject = ReactNativePerfMemory() - return { () -> bridge.std__shared_ptr_HybridReactNativePerfMemorySpec_ in - let __cxxWrapped = hybridObject.getCxxWrapper() - return __cxxWrapped.getCxxPart() - }() - } -} diff --git a/native-modules/react-native-perf-memory/nitrogen/generated/ios/c++/HybridReactNativePerfMemorySpecSwift.cpp b/native-modules/react-native-perf-memory/nitrogen/generated/ios/c++/HybridReactNativePerfMemorySpecSwift.cpp deleted file mode 100644 index 3bc3d2c..0000000 --- a/native-modules/react-native-perf-memory/nitrogen/generated/ios/c++/HybridReactNativePerfMemorySpecSwift.cpp +++ /dev/null @@ -1,11 +0,0 @@ -/// -/// HybridReactNativePerfMemorySpecSwift.cpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#include "HybridReactNativePerfMemorySpecSwift.hpp" - -namespace margelo::nitro::reactnativeperfmemory { -} // namespace margelo::nitro::reactnativeperfmemory diff --git a/native-modules/react-native-perf-memory/nitrogen/generated/ios/c++/HybridReactNativePerfMemorySpecSwift.hpp b/native-modules/react-native-perf-memory/nitrogen/generated/ios/c++/HybridReactNativePerfMemorySpecSwift.hpp deleted file mode 100644 index f286fde..0000000 --- a/native-modules/react-native-perf-memory/nitrogen/generated/ios/c++/HybridReactNativePerfMemorySpecSwift.hpp +++ /dev/null @@ -1,78 +0,0 @@ -/// -/// HybridReactNativePerfMemorySpecSwift.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#include "HybridReactNativePerfMemorySpec.hpp" - -// Forward declaration of `HybridReactNativePerfMemorySpec_cxx` to properly resolve imports. -namespace ReactNativePerfMemory { class HybridReactNativePerfMemorySpec_cxx; } - -// Forward declaration of `MemoryUsage` to properly resolve imports. -namespace margelo::nitro::reactnativeperfmemory { struct MemoryUsage; } - -#include "MemoryUsage.hpp" -#include - -#include "ReactNativePerfMemory-Swift-Cxx-Umbrella.hpp" - -namespace margelo::nitro::reactnativeperfmemory { - - /** - * The C++ part of HybridReactNativePerfMemorySpec_cxx.swift. - * - * HybridReactNativePerfMemorySpecSwift (C++) accesses HybridReactNativePerfMemorySpec_cxx (Swift), and might - * contain some additional bridging code for C++ <> Swift interop. - * - * Since this obviously introduces an overhead, I hope at some point in - * the future, HybridReactNativePerfMemorySpec_cxx can directly inherit from the C++ class HybridReactNativePerfMemorySpec - * to simplify the whole structure and memory management. - */ - class HybridReactNativePerfMemorySpecSwift: public virtual HybridReactNativePerfMemorySpec { - public: - // Constructor from a Swift instance - explicit HybridReactNativePerfMemorySpecSwift(const ReactNativePerfMemory::HybridReactNativePerfMemorySpec_cxx& swiftPart): - HybridObject(HybridReactNativePerfMemorySpec::TAG), - _swiftPart(swiftPart) { } - - public: - // Get the Swift part - inline ReactNativePerfMemory::HybridReactNativePerfMemorySpec_cxx& getSwiftPart() noexcept { - return _swiftPart; - } - - public: - inline size_t getExternalMemorySize() noexcept override { - return _swiftPart.getMemorySize(); - } - void dispose() noexcept override { - _swiftPart.dispose(); - } - std::string toString() override { - return _swiftPart.toString(); - } - - public: - // Properties - - - public: - // Methods - inline std::shared_ptr> getMemoryUsage() override { - auto __result = _swiftPart.getMemoryUsage(); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - auto __value = std::move(__result.value()); - return __value; - } - - private: - ReactNativePerfMemory::HybridReactNativePerfMemorySpec_cxx _swiftPart; - }; - -} // namespace margelo::nitro::reactnativeperfmemory diff --git a/native-modules/react-native-perf-memory/nitrogen/generated/ios/swift/Func_void_MemoryUsage.swift b/native-modules/react-native-perf-memory/nitrogen/generated/ios/swift/Func_void_MemoryUsage.swift deleted file mode 100644 index afa3a55..0000000 --- a/native-modules/react-native-perf-memory/nitrogen/generated/ios/swift/Func_void_MemoryUsage.swift +++ /dev/null @@ -1,47 +0,0 @@ -/// -/// Func_void_MemoryUsage.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Wraps a Swift `(_ value: MemoryUsage) -> Void` as a class. - * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`. - */ -public final class Func_void_MemoryUsage { - public typealias bridge = margelo.nitro.reactnativeperfmemory.bridge.swift - - private let closure: (_ value: MemoryUsage) -> Void - - public init(_ closure: @escaping (_ value: MemoryUsage) -> Void) { - self.closure = closure - } - - @inline(__always) - public func call(value: MemoryUsage) -> Void { - self.closure(value) - } - - /** - * Casts this instance to a retained unsafe raw pointer. - * This acquires one additional strong reference on the object! - */ - @inline(__always) - public func toUnsafe() -> UnsafeMutableRawPointer { - return Unmanaged.passRetained(self).toOpaque() - } - - /** - * Casts an unsafe pointer to a `Func_void_MemoryUsage`. - * The pointer has to be a retained opaque `Unmanaged`. - * This removes one strong reference from the object! - */ - @inline(__always) - public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_MemoryUsage { - return Unmanaged.fromOpaque(pointer).takeRetainedValue() - } -} diff --git a/native-modules/react-native-perf-memory/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift b/native-modules/react-native-perf-memory/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift deleted file mode 100644 index 581add4..0000000 --- a/native-modules/react-native-perf-memory/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +++ /dev/null @@ -1,47 +0,0 @@ -/// -/// Func_void_std__exception_ptr.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Wraps a Swift `(_ error: Error) -> Void` as a class. - * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`. - */ -public final class Func_void_std__exception_ptr { - public typealias bridge = margelo.nitro.reactnativeperfmemory.bridge.swift - - private let closure: (_ error: Error) -> Void - - public init(_ closure: @escaping (_ error: Error) -> Void) { - self.closure = closure - } - - @inline(__always) - public func call(error: std.exception_ptr) -> Void { - self.closure(RuntimeError.from(cppError: error)) - } - - /** - * Casts this instance to a retained unsafe raw pointer. - * This acquires one additional strong reference on the object! - */ - @inline(__always) - public func toUnsafe() -> UnsafeMutableRawPointer { - return Unmanaged.passRetained(self).toOpaque() - } - - /** - * Casts an unsafe pointer to a `Func_void_std__exception_ptr`. - * The pointer has to be a retained opaque `Unmanaged`. - * This removes one strong reference from the object! - */ - @inline(__always) - public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_std__exception_ptr { - return Unmanaged.fromOpaque(pointer).takeRetainedValue() - } -} diff --git a/native-modules/react-native-perf-memory/nitrogen/generated/ios/swift/HybridReactNativePerfMemorySpec.swift b/native-modules/react-native-perf-memory/nitrogen/generated/ios/swift/HybridReactNativePerfMemorySpec.swift deleted file mode 100644 index fd37955..0000000 --- a/native-modules/react-native-perf-memory/nitrogen/generated/ios/swift/HybridReactNativePerfMemorySpec.swift +++ /dev/null @@ -1,56 +0,0 @@ -/// -/// HybridReactNativePerfMemorySpec.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/// See ``HybridReactNativePerfMemorySpec`` -public protocol HybridReactNativePerfMemorySpec_protocol: HybridObject { - // Properties - - - // Methods - func getMemoryUsage() throws -> Promise -} - -public extension HybridReactNativePerfMemorySpec_protocol { - /// Default implementation of ``HybridObject.toString`` - func toString() -> String { - return "[HybridObject ReactNativePerfMemory]" - } -} - -/// See ``HybridReactNativePerfMemorySpec`` -open class HybridReactNativePerfMemorySpec_base { - private weak var cxxWrapper: HybridReactNativePerfMemorySpec_cxx? = nil - public init() { } - public func getCxxWrapper() -> HybridReactNativePerfMemorySpec_cxx { - #if DEBUG - guard self is HybridReactNativePerfMemorySpec else { - fatalError("`self` is not a `HybridReactNativePerfMemorySpec`! Did you accidentally inherit from `HybridReactNativePerfMemorySpec_base` instead of `HybridReactNativePerfMemorySpec`?") - } - #endif - if let cxxWrapper = self.cxxWrapper { - return cxxWrapper - } else { - let cxxWrapper = HybridReactNativePerfMemorySpec_cxx(self as! HybridReactNativePerfMemorySpec) - self.cxxWrapper = cxxWrapper - return cxxWrapper - } - } -} - -/** - * A Swift base-protocol representing the ReactNativePerfMemory HybridObject. - * Implement this protocol to create Swift-based instances of ReactNativePerfMemory. - * ```swift - * class HybridReactNativePerfMemory : HybridReactNativePerfMemorySpec { - * // ... - * } - * ``` - */ -public typealias HybridReactNativePerfMemorySpec = HybridReactNativePerfMemorySpec_protocol & HybridReactNativePerfMemorySpec_base diff --git a/native-modules/react-native-perf-memory/nitrogen/generated/ios/swift/HybridReactNativePerfMemorySpec_cxx.swift b/native-modules/react-native-perf-memory/nitrogen/generated/ios/swift/HybridReactNativePerfMemorySpec_cxx.swift deleted file mode 100644 index 31053f5..0000000 --- a/native-modules/react-native-perf-memory/nitrogen/generated/ios/swift/HybridReactNativePerfMemorySpec_cxx.swift +++ /dev/null @@ -1,138 +0,0 @@ -/// -/// HybridReactNativePerfMemorySpec_cxx.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * A class implementation that bridges HybridReactNativePerfMemorySpec over to C++. - * In C++, we cannot use Swift protocols - so we need to wrap it in a class to make it strongly defined. - * - * Also, some Swift types need to be bridged with special handling: - * - Enums need to be wrapped in Structs, otherwise they cannot be accessed bi-directionally (Swift bug: https://github.com/swiftlang/swift/issues/75330) - * - Other HybridObjects need to be wrapped/unwrapped from the Swift TCxx wrapper - * - Throwing methods need to be wrapped with a Result type, as exceptions cannot be propagated to C++ - */ -open class HybridReactNativePerfMemorySpec_cxx { - /** - * The Swift <> C++ bridge's namespace (`margelo::nitro::reactnativeperfmemory::bridge::swift`) - * from `ReactNativePerfMemory-Swift-Cxx-Bridge.hpp`. - * This contains specialized C++ templates, and C++ helper functions that can be accessed from Swift. - */ - public typealias bridge = margelo.nitro.reactnativeperfmemory.bridge.swift - - /** - * Holds an instance of the `HybridReactNativePerfMemorySpec` Swift protocol. - */ - private var __implementation: any HybridReactNativePerfMemorySpec - - /** - * Holds a weak pointer to the C++ class that wraps the Swift class. - */ - private var __cxxPart: bridge.std__weak_ptr_HybridReactNativePerfMemorySpec_ - - /** - * Create a new `HybridReactNativePerfMemorySpec_cxx` that wraps the given `HybridReactNativePerfMemorySpec`. - * All properties and methods bridge to C++ types. - */ - public init(_ implementation: any HybridReactNativePerfMemorySpec) { - self.__implementation = implementation - self.__cxxPart = .init() - /* no base class */ - } - - /** - * Get the actual `HybridReactNativePerfMemorySpec` instance this class wraps. - */ - @inline(__always) - public func getHybridReactNativePerfMemorySpec() -> any HybridReactNativePerfMemorySpec { - return __implementation - } - - /** - * Casts this instance to a retained unsafe raw pointer. - * This acquires one additional strong reference on the object! - */ - public func toUnsafe() -> UnsafeMutableRawPointer { - return Unmanaged.passRetained(self).toOpaque() - } - - /** - * Casts an unsafe pointer to a `HybridReactNativePerfMemorySpec_cxx`. - * The pointer has to be a retained opaque `Unmanaged`. - * This removes one strong reference from the object! - */ - public class func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> HybridReactNativePerfMemorySpec_cxx { - return Unmanaged.fromOpaque(pointer).takeRetainedValue() - } - - /** - * Gets (or creates) the C++ part of this Hybrid Object. - * The C++ part is a `std::shared_ptr`. - */ - public func getCxxPart() -> bridge.std__shared_ptr_HybridReactNativePerfMemorySpec_ { - let cachedCxxPart = self.__cxxPart.lock() - if Bool(fromCxx: cachedCxxPart) { - return cachedCxxPart - } else { - let newCxxPart = bridge.create_std__shared_ptr_HybridReactNativePerfMemorySpec_(self.toUnsafe()) - __cxxPart = bridge.weakify_std__shared_ptr_HybridReactNativePerfMemorySpec_(newCxxPart) - return newCxxPart - } - } - - - - /** - * Get the memory size of the Swift class (plus size of any other allocations) - * so the JS VM can properly track it and garbage-collect the JS object if needed. - */ - @inline(__always) - public var memorySize: Int { - return MemoryHelper.getSizeOf(self.__implementation) + self.__implementation.memorySize - } - - /** - * Call dispose() on the Swift class. - * This _may_ be called manually from JS. - */ - @inline(__always) - public func dispose() { - self.__implementation.dispose() - } - - /** - * Call toString() on the Swift class. - */ - @inline(__always) - public func toString() -> String { - return self.__implementation.toString() - } - - // Properties - - - // Methods - @inline(__always) - public final func getMemoryUsage() -> bridge.Result_std__shared_ptr_Promise_MemoryUsage___ { - do { - let __result = try self.__implementation.getMemoryUsage() - let __resultCpp = { () -> bridge.std__shared_ptr_Promise_MemoryUsage__ in - let __promise = bridge.create_std__shared_ptr_Promise_MemoryUsage__() - let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_MemoryUsage__(__promise) - __result - .then({ __result in __promiseHolder.resolve(__result) }) - .catch({ __error in __promiseHolder.reject(__error.toCpp()) }) - return __promise - }() - return bridge.create_Result_std__shared_ptr_Promise_MemoryUsage___(__resultCpp) - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_std__shared_ptr_Promise_MemoryUsage___(__exceptionPtr) - } - } -} diff --git a/native-modules/react-native-perf-memory/nitrogen/generated/ios/swift/MemoryUsage.swift b/native-modules/react-native-perf-memory/nitrogen/generated/ios/swift/MemoryUsage.swift deleted file mode 100644 index 3578618..0000000 --- a/native-modules/react-native-perf-memory/nitrogen/generated/ios/swift/MemoryUsage.swift +++ /dev/null @@ -1,36 +0,0 @@ -/// -/// MemoryUsage.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Represents an instance of `MemoryUsage`, backed by a C++ struct. - */ -public typealias MemoryUsage = margelo.nitro.reactnativeperfmemory.MemoryUsage - -public extension MemoryUsage { - private typealias bridge = margelo.nitro.reactnativeperfmemory.bridge.swift - - /** - * Create a new instance of `MemoryUsage`. - */ - init(rss: Double) { - self.init(rss) - } - - var rss: Double { - @inline(__always) - get { - return self.__rss - } - @inline(__always) - set { - self.__rss = newValue - } - } -} diff --git a/native-modules/react-native-perf-memory/nitrogen/generated/shared/c++/HybridReactNativePerfMemorySpec.cpp b/native-modules/react-native-perf-memory/nitrogen/generated/shared/c++/HybridReactNativePerfMemorySpec.cpp deleted file mode 100644 index 73b513c..0000000 --- a/native-modules/react-native-perf-memory/nitrogen/generated/shared/c++/HybridReactNativePerfMemorySpec.cpp +++ /dev/null @@ -1,21 +0,0 @@ -/// -/// HybridReactNativePerfMemorySpec.cpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#include "HybridReactNativePerfMemorySpec.hpp" - -namespace margelo::nitro::reactnativeperfmemory { - - void HybridReactNativePerfMemorySpec::loadHybridMethods() { - // load base methods/properties - HybridObject::loadHybridMethods(); - // load custom methods/properties - registerHybrids(this, [](Prototype& prototype) { - prototype.registerHybridMethod("getMemoryUsage", &HybridReactNativePerfMemorySpec::getMemoryUsage); - }); - } - -} // namespace margelo::nitro::reactnativeperfmemory diff --git a/native-modules/react-native-perf-memory/nitrogen/generated/shared/c++/HybridReactNativePerfMemorySpec.hpp b/native-modules/react-native-perf-memory/nitrogen/generated/shared/c++/HybridReactNativePerfMemorySpec.hpp deleted file mode 100644 index beec063..0000000 --- a/native-modules/react-native-perf-memory/nitrogen/generated/shared/c++/HybridReactNativePerfMemorySpec.hpp +++ /dev/null @@ -1,64 +0,0 @@ -/// -/// HybridReactNativePerfMemorySpec.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif - -// Forward declaration of `MemoryUsage` to properly resolve imports. -namespace margelo::nitro::reactnativeperfmemory { struct MemoryUsage; } - -#include "MemoryUsage.hpp" -#include - -namespace margelo::nitro::reactnativeperfmemory { - - using namespace margelo::nitro; - - /** - * An abstract base class for `ReactNativePerfMemory` - * Inherit this class to create instances of `HybridReactNativePerfMemorySpec` in C++. - * You must explicitly call `HybridObject`'s constructor yourself, because it is virtual. - * @example - * ```cpp - * class HybridReactNativePerfMemory: public HybridReactNativePerfMemorySpec { - * public: - * HybridReactNativePerfMemory(...): HybridObject(TAG) { ... } - * // ... - * }; - * ``` - */ - class HybridReactNativePerfMemorySpec: public virtual HybridObject { - public: - // Constructor - explicit HybridReactNativePerfMemorySpec(): HybridObject(TAG) { } - - // Destructor - ~HybridReactNativePerfMemorySpec() override = default; - - public: - // Properties - - - public: - // Methods - virtual std::shared_ptr> getMemoryUsage() = 0; - - protected: - // Hybrid Setup - void loadHybridMethods() override; - - protected: - // Tag for logging - static constexpr auto TAG = "ReactNativePerfMemory"; - }; - -} // namespace margelo::nitro::reactnativeperfmemory diff --git a/native-modules/react-native-perf-memory/nitrogen/generated/shared/c++/MemoryUsage.hpp b/native-modules/react-native-perf-memory/nitrogen/generated/shared/c++/MemoryUsage.hpp deleted file mode 100644 index 2050ad7..0000000 --- a/native-modules/react-native-perf-memory/nitrogen/generated/shared/c++/MemoryUsage.hpp +++ /dev/null @@ -1,75 +0,0 @@ -/// -/// MemoryUsage.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif - - - - - -namespace margelo::nitro::reactnativeperfmemory { - - /** - * A struct which can be represented as a JavaScript object (MemoryUsage). - */ - struct MemoryUsage { - public: - double rss SWIFT_PRIVATE; - - public: - MemoryUsage() = default; - explicit MemoryUsage(double rss): rss(rss) {} - }; - -} // namespace margelo::nitro::reactnativeperfmemory - -namespace margelo::nitro { - - // C++ MemoryUsage <> JS MemoryUsage (object) - template <> - struct JSIConverter final { - static inline margelo::nitro::reactnativeperfmemory::MemoryUsage fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { - jsi::Object obj = arg.asObject(runtime); - return margelo::nitro::reactnativeperfmemory::MemoryUsage( - JSIConverter::fromJSI(runtime, obj.getProperty(runtime, "rss")) - ); - } - static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::reactnativeperfmemory::MemoryUsage& arg) { - jsi::Object obj(runtime); - obj.setProperty(runtime, "rss", JSIConverter::toJSI(runtime, arg.rss)); - return obj; - } - static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) { - if (!value.isObject()) { - return false; - } - jsi::Object obj = value.getObject(runtime); - if (!nitro::isPlainObject(runtime, obj)) { - return false; - } - if (!JSIConverter::canConvert(runtime, obj.getProperty(runtime, "rss"))) return false; - return true; - } - }; - -} // namespace margelo::nitro diff --git a/native-modules/react-native-splash-screen/nitrogen/generated/.gitattributes b/native-modules/react-native-splash-screen/nitrogen/generated/.gitattributes deleted file mode 100644 index fb7a0d5..0000000 --- a/native-modules/react-native-splash-screen/nitrogen/generated/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -** linguist-generated=true diff --git a/native-modules/react-native-splash-screen/nitrogen/generated/android/c++/JHybridReactNativeSplashScreenSpec.cpp b/native-modules/react-native-splash-screen/nitrogen/generated/android/c++/JHybridReactNativeSplashScreenSpec.cpp deleted file mode 100644 index 7fb5779..0000000 --- a/native-modules/react-native-splash-screen/nitrogen/generated/android/c++/JHybridReactNativeSplashScreenSpec.cpp +++ /dev/null @@ -1,80 +0,0 @@ -/// -/// JHybridReactNativeSplashScreenSpec.cpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#include "JHybridReactNativeSplashScreenSpec.hpp" - - - -#include -#include - -namespace margelo::nitro::reactnativesplashscreen { - - jni::local_ref JHybridReactNativeSplashScreenSpec::initHybrid(jni::alias_ref jThis) { - return makeCxxInstance(jThis); - } - - void JHybridReactNativeSplashScreenSpec::registerNatives() { - registerHybrid({ - makeNativeMethod("initHybrid", JHybridReactNativeSplashScreenSpec::initHybrid), - }); - } - - size_t JHybridReactNativeSplashScreenSpec::getExternalMemorySize() noexcept { - static const auto method = javaClassStatic()->getMethod("getMemorySize"); - return method(_javaPart); - } - - void JHybridReactNativeSplashScreenSpec::dispose() noexcept { - static const auto method = javaClassStatic()->getMethod("dispose"); - method(_javaPart); - } - - std::string JHybridReactNativeSplashScreenSpec::toString() { - static const auto method = javaClassStatic()->getMethod("toString"); - auto javaString = method(_javaPart); - return javaString->toStdString(); - } - - // Properties - - - // Methods - std::shared_ptr> JHybridReactNativeSplashScreenSpec::preventAutoHideAsync() { - static const auto method = javaClassStatic()->getMethod()>("preventAutoHideAsync"); - auto __result = method(_javaPart); - return [&]() { - auto __promise = Promise::create(); - __result->cthis()->addOnResolvedListener([=](const jni::alias_ref& __boxedResult) { - auto __result = jni::static_ref_cast(__boxedResult); - __promise->resolve(static_cast(__result->value())); - }); - __result->cthis()->addOnRejectedListener([=](const jni::alias_ref& __throwable) { - jni::JniException __jniError(__throwable); - __promise->reject(std::make_exception_ptr(__jniError)); - }); - return __promise; - }(); - } - std::shared_ptr> JHybridReactNativeSplashScreenSpec::hideAsync() { - static const auto method = javaClassStatic()->getMethod()>("hideAsync"); - auto __result = method(_javaPart); - return [&]() { - auto __promise = Promise::create(); - __result->cthis()->addOnResolvedListener([=](const jni::alias_ref& __boxedResult) { - auto __result = jni::static_ref_cast(__boxedResult); - __promise->resolve(static_cast(__result->value())); - }); - __result->cthis()->addOnRejectedListener([=](const jni::alias_ref& __throwable) { - jni::JniException __jniError(__throwable); - __promise->reject(std::make_exception_ptr(__jniError)); - }); - return __promise; - }(); - } - -} // namespace margelo::nitro::reactnativesplashscreen diff --git a/native-modules/react-native-splash-screen/nitrogen/generated/android/c++/JHybridReactNativeSplashScreenSpec.hpp b/native-modules/react-native-splash-screen/nitrogen/generated/android/c++/JHybridReactNativeSplashScreenSpec.hpp deleted file mode 100644 index 39681ae..0000000 --- a/native-modules/react-native-splash-screen/nitrogen/generated/android/c++/JHybridReactNativeSplashScreenSpec.hpp +++ /dev/null @@ -1,66 +0,0 @@ -/// -/// HybridReactNativeSplashScreenSpec.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#include -#include -#include "HybridReactNativeSplashScreenSpec.hpp" - - - - -namespace margelo::nitro::reactnativesplashscreen { - - using namespace facebook; - - class JHybridReactNativeSplashScreenSpec: public jni::HybridClass, - public virtual HybridReactNativeSplashScreenSpec { - public: - static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/reactnativesplashscreen/HybridReactNativeSplashScreenSpec;"; - static jni::local_ref initHybrid(jni::alias_ref jThis); - static void registerNatives(); - - protected: - // C++ constructor (called from Java via `initHybrid()`) - explicit JHybridReactNativeSplashScreenSpec(jni::alias_ref jThis) : - HybridObject(HybridReactNativeSplashScreenSpec::TAG), - HybridBase(jThis), - _javaPart(jni::make_global(jThis)) {} - - public: - ~JHybridReactNativeSplashScreenSpec() override { - // Hermes GC can destroy JS objects on a non-JNI Thread. - jni::ThreadScope::WithClassLoader([&] { _javaPart.reset(); }); - } - - public: - size_t getExternalMemorySize() noexcept override; - void dispose() noexcept override; - std::string toString() override; - - public: - inline const jni::global_ref& getJavaPart() const noexcept { - return _javaPart; - } - - public: - // Properties - - - public: - // Methods - std::shared_ptr> preventAutoHideAsync() override; - std::shared_ptr> hideAsync() override; - - private: - friend HybridBase; - using HybridBase::HybridBase; - jni::global_ref _javaPart; - }; - -} // namespace margelo::nitro::reactnativesplashscreen diff --git a/native-modules/react-native-splash-screen/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativesplashscreen/HybridReactNativeSplashScreenSpec.kt b/native-modules/react-native-splash-screen/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativesplashscreen/HybridReactNativeSplashScreenSpec.kt deleted file mode 100644 index 5989b86..0000000 --- a/native-modules/react-native-splash-screen/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativesplashscreen/HybridReactNativeSplashScreenSpec.kt +++ /dev/null @@ -1,62 +0,0 @@ -/// -/// HybridReactNativeSplashScreenSpec.kt -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -package com.margelo.nitro.reactnativesplashscreen - -import androidx.annotation.Keep -import com.facebook.jni.HybridData -import com.facebook.proguard.annotations.DoNotStrip -import com.margelo.nitro.core.Promise -import com.margelo.nitro.core.HybridObject - -/** - * A Kotlin class representing the ReactNativeSplashScreen HybridObject. - * Implement this abstract class to create Kotlin-based instances of ReactNativeSplashScreen. - */ -@DoNotStrip -@Keep -@Suppress( - "KotlinJniMissingFunction", "unused", - "RedundantSuppression", "RedundantUnitReturnType", "SimpleRedundantLet", - "LocalVariableName", "PropertyName", "PrivatePropertyName", "FunctionName" -) -abstract class HybridReactNativeSplashScreenSpec: HybridObject() { - @DoNotStrip - private var mHybridData: HybridData = initHybrid() - - init { - super.updateNative(mHybridData) - } - - override fun updateNative(hybridData: HybridData) { - mHybridData = hybridData - super.updateNative(hybridData) - } - - // Default implementation of `HybridObject.toString()` - override fun toString(): String { - return "[HybridObject ReactNativeSplashScreen]" - } - - // Properties - - - // Methods - @DoNotStrip - @Keep - abstract fun preventAutoHideAsync(): Promise - - @DoNotStrip - @Keep - abstract fun hideAsync(): Promise - - private external fun initHybrid(): HybridData - - companion object { - protected const val TAG = "HybridReactNativeSplashScreenSpec" - } -} diff --git a/native-modules/react-native-splash-screen/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativesplashscreen/reactnativesplashscreenOnLoad.kt b/native-modules/react-native-splash-screen/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativesplashscreen/reactnativesplashscreenOnLoad.kt deleted file mode 100644 index ce8acc6..0000000 --- a/native-modules/react-native-splash-screen/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativesplashscreen/reactnativesplashscreenOnLoad.kt +++ /dev/null @@ -1,35 +0,0 @@ -/// -/// reactnativesplashscreenOnLoad.kt -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -package com.margelo.nitro.reactnativesplashscreen - -import android.util.Log - -internal class reactnativesplashscreenOnLoad { - companion object { - private const val TAG = "reactnativesplashscreenOnLoad" - private var didLoad = false - /** - * Initializes the native part of "reactnativesplashscreen". - * This method is idempotent and can be called more than once. - */ - @JvmStatic - fun initializeNative() { - if (didLoad) return - try { - Log.i(TAG, "Loading reactnativesplashscreen C++ library...") - System.loadLibrary("reactnativesplashscreen") - Log.i(TAG, "Successfully loaded reactnativesplashscreen C++ library!") - didLoad = true - } catch (e: Error) { - Log.e(TAG, "Failed to load reactnativesplashscreen C++ library! Is it properly installed and linked? " + - "Is the name correct? (see `CMakeLists.txt`, at `add_library(...)`)", e) - throw e - } - } - } -} diff --git a/native-modules/react-native-splash-screen/nitrogen/generated/android/reactnativesplashscreen+autolinking.cmake b/native-modules/react-native-splash-screen/nitrogen/generated/android/reactnativesplashscreen+autolinking.cmake deleted file mode 100644 index 75ebe24..0000000 --- a/native-modules/react-native-splash-screen/nitrogen/generated/android/reactnativesplashscreen+autolinking.cmake +++ /dev/null @@ -1,81 +0,0 @@ -# -# reactnativesplashscreen+autolinking.cmake -# This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -# https://github.com/mrousavy/nitro -# Copyright © 2026 Marc Rousavy @ Margelo -# - -# This is a CMake file that adds all files generated by Nitrogen -# to the current CMake project. -# -# To use it, add this to your CMakeLists.txt: -# ```cmake -# include(${CMAKE_SOURCE_DIR}/../nitrogen/generated/android/reactnativesplashscreen+autolinking.cmake) -# ``` - -# Define a flag to check if we are building properly -add_definitions(-DBUILDING_REACTNATIVESPLASHSCREEN_WITH_GENERATED_CMAKE_PROJECT) - -# Enable Raw Props parsing in react-native (for Nitro Views) -add_definitions(-DRN_SERIALIZABLE_STATE) - -# Add all headers that were generated by Nitrogen -include_directories( - "../nitrogen/generated/shared/c++" - "../nitrogen/generated/android/c++" - "../nitrogen/generated/android/" -) - -# Add all .cpp sources that were generated by Nitrogen -target_sources( - # CMake project name (Android C++ library name) - reactnativesplashscreen PRIVATE - # Autolinking Setup - ../nitrogen/generated/android/reactnativesplashscreenOnLoad.cpp - # Shared Nitrogen C++ sources - ../nitrogen/generated/shared/c++/HybridReactNativeSplashScreenSpec.cpp - # Android-specific Nitrogen C++ sources - ../nitrogen/generated/android/c++/JHybridReactNativeSplashScreenSpec.cpp -) - -# From node_modules/react-native/ReactAndroid/cmake-utils/folly-flags.cmake -# Used in node_modules/react-native/ReactAndroid/cmake-utils/ReactNative-application.cmake -target_compile_definitions( - reactnativesplashscreen PRIVATE - -DFOLLY_NO_CONFIG=1 - -DFOLLY_HAVE_CLOCK_GETTIME=1 - -DFOLLY_USE_LIBCPP=1 - -DFOLLY_CFG_NO_COROUTINES=1 - -DFOLLY_MOBILE=1 - -DFOLLY_HAVE_RECVMMSG=1 - -DFOLLY_HAVE_PTHREAD=1 - # Once we target android-23 above, we can comment - # the following line. NDK uses GNU style stderror_r() after API 23. - -DFOLLY_HAVE_XSI_STRERROR_R=1 -) - -# Add all libraries required by the generated specs -find_package(fbjni REQUIRED) # <-- Used for communication between Java <-> C++ -find_package(ReactAndroid REQUIRED) # <-- Used to set up React Native bindings (e.g. CallInvoker/TurboModule) -find_package(react-native-nitro-modules REQUIRED) # <-- Used to create all HybridObjects and use the Nitro core library - -# Link all libraries together -target_link_libraries( - reactnativesplashscreen - fbjni::fbjni # <-- Facebook C++ JNI helpers - ReactAndroid::jsi # <-- RN: JSI - react-native-nitro-modules::NitroModules # <-- NitroModules Core :) -) - -# Link react-native (different prefab between RN 0.75 and RN 0.76) -if(ReactAndroid_VERSION_MINOR GREATER_EQUAL 76) - target_link_libraries( - reactnativesplashscreen - ReactAndroid::reactnative # <-- RN: Native Modules umbrella prefab - ) -else() - target_link_libraries( - reactnativesplashscreen - ReactAndroid::react_nativemodule_core # <-- RN: TurboModules Core - ) -endif() diff --git a/native-modules/react-native-splash-screen/nitrogen/generated/android/reactnativesplashscreen+autolinking.gradle b/native-modules/react-native-splash-screen/nitrogen/generated/android/reactnativesplashscreen+autolinking.gradle deleted file mode 100644 index c00b86c..0000000 --- a/native-modules/react-native-splash-screen/nitrogen/generated/android/reactnativesplashscreen+autolinking.gradle +++ /dev/null @@ -1,27 +0,0 @@ -/// -/// reactnativesplashscreen+autolinking.gradle -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -/// This is a Gradle file that adds all files generated by Nitrogen -/// to the current Gradle project. -/// -/// To use it, add this to your build.gradle: -/// ```gradle -/// apply from: '../nitrogen/generated/android/reactnativesplashscreen+autolinking.gradle' -/// ``` - -logger.warn("[NitroModules] 🔥 reactnativesplashscreen is boosted by nitro!") - -android { - sourceSets { - main { - java.srcDirs += [ - // Nitrogen files - "${project.projectDir}/../nitrogen/generated/android/kotlin" - ] - } - } -} diff --git a/native-modules/react-native-splash-screen/nitrogen/generated/android/reactnativesplashscreenOnLoad.cpp b/native-modules/react-native-splash-screen/nitrogen/generated/android/reactnativesplashscreenOnLoad.cpp deleted file mode 100644 index 18b1823..0000000 --- a/native-modules/react-native-splash-screen/nitrogen/generated/android/reactnativesplashscreenOnLoad.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/// -/// reactnativesplashscreenOnLoad.cpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#ifndef BUILDING_REACTNATIVESPLASHSCREEN_WITH_GENERATED_CMAKE_PROJECT -#error reactnativesplashscreenOnLoad.cpp is not being built with the autogenerated CMakeLists.txt project. Is a different CMakeLists.txt building this? -#endif - -#include "reactnativesplashscreenOnLoad.hpp" - -#include -#include -#include - -#include "JHybridReactNativeSplashScreenSpec.hpp" -#include - -namespace margelo::nitro::reactnativesplashscreen { - -int initialize(JavaVM* vm) { - using namespace margelo::nitro; - using namespace margelo::nitro::reactnativesplashscreen; - using namespace facebook; - - return facebook::jni::initialize(vm, [] { - // Register native JNI methods - margelo::nitro::reactnativesplashscreen::JHybridReactNativeSplashScreenSpec::registerNatives(); - - // Register Nitro Hybrid Objects - HybridObjectRegistry::registerHybridObjectConstructor( - "ReactNativeSplashScreen", - []() -> std::shared_ptr { - static DefaultConstructableObject object("com/margelo/nitro/reactnativesplashscreen/ReactNativeSplashScreen"); - auto instance = object.create(); - return instance->cthis()->shared(); - } - ); - }); -} - -} // namespace margelo::nitro::reactnativesplashscreen diff --git a/native-modules/react-native-splash-screen/nitrogen/generated/android/reactnativesplashscreenOnLoad.hpp b/native-modules/react-native-splash-screen/nitrogen/generated/android/reactnativesplashscreenOnLoad.hpp deleted file mode 100644 index ba6d1cc..0000000 --- a/native-modules/react-native-splash-screen/nitrogen/generated/android/reactnativesplashscreenOnLoad.hpp +++ /dev/null @@ -1,25 +0,0 @@ -/// -/// reactnativesplashscreenOnLoad.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#include -#include - -namespace margelo::nitro::reactnativesplashscreen { - - /** - * Initializes the native (C++) part of reactnativesplashscreen, and autolinks all Hybrid Objects. - * Call this in your `JNI_OnLoad` function (probably inside `cpp-adapter.cpp`). - * Example: - * ```cpp (cpp-adapter.cpp) - * JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void*) { - * return margelo::nitro::reactnativesplashscreen::initialize(vm); - * } - * ``` - */ - int initialize(JavaVM* vm); - -} // namespace margelo::nitro::reactnativesplashscreen diff --git a/native-modules/react-native-splash-screen/nitrogen/generated/ios/ReactNativeSplashScreen+autolinking.rb b/native-modules/react-native-splash-screen/nitrogen/generated/ios/ReactNativeSplashScreen+autolinking.rb deleted file mode 100644 index 5ddaef8..0000000 --- a/native-modules/react-native-splash-screen/nitrogen/generated/ios/ReactNativeSplashScreen+autolinking.rb +++ /dev/null @@ -1,60 +0,0 @@ -# -# ReactNativeSplashScreen+autolinking.rb -# This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -# https://github.com/mrousavy/nitro -# Copyright © 2026 Marc Rousavy @ Margelo -# - -# This is a Ruby script that adds all files generated by Nitrogen -# to the given podspec. -# -# To use it, add this to your .podspec: -# ```ruby -# Pod::Spec.new do |spec| -# # ... -# -# # Add all files generated by Nitrogen -# load 'nitrogen/generated/ios/ReactNativeSplashScreen+autolinking.rb' -# add_nitrogen_files(spec) -# end -# ``` - -def add_nitrogen_files(spec) - Pod::UI.puts "[NitroModules] 🔥 ReactNativeSplashScreen is boosted by nitro!" - - spec.dependency "NitroModules" - - current_source_files = Array(spec.attributes_hash['source_files']) - spec.source_files = current_source_files + [ - # Generated cross-platform specs - "nitrogen/generated/shared/**/*.{h,hpp,c,cpp,swift}", - # Generated bridges for the cross-platform specs - "nitrogen/generated/ios/**/*.{h,hpp,c,cpp,mm,swift}", - ] - - current_public_header_files = Array(spec.attributes_hash['public_header_files']) - spec.public_header_files = current_public_header_files + [ - # Generated specs - "nitrogen/generated/shared/**/*.{h,hpp}", - # Swift to C++ bridging helpers - "nitrogen/generated/ios/ReactNativeSplashScreen-Swift-Cxx-Bridge.hpp" - ] - - current_private_header_files = Array(spec.attributes_hash['private_header_files']) - spec.private_header_files = current_private_header_files + [ - # iOS specific specs - "nitrogen/generated/ios/c++/**/*.{h,hpp}", - # Views are framework-specific and should be private - "nitrogen/generated/shared/**/views/**/*" - ] - - current_pod_target_xcconfig = spec.attributes_hash['pod_target_xcconfig'] || {} - spec.pod_target_xcconfig = current_pod_target_xcconfig.merge({ - # Use C++ 20 - "CLANG_CXX_LANGUAGE_STANDARD" => "c++20", - # Enables C++ <-> Swift interop (by default it's only C) - "SWIFT_OBJC_INTEROP_MODE" => "objcxx", - # Enables stricter modular headers - "DEFINES_MODULE" => "YES", - }) -end diff --git a/native-modules/react-native-splash-screen/nitrogen/generated/ios/ReactNativeSplashScreen-Swift-Cxx-Bridge.cpp b/native-modules/react-native-splash-screen/nitrogen/generated/ios/ReactNativeSplashScreen-Swift-Cxx-Bridge.cpp deleted file mode 100644 index c97c357..0000000 --- a/native-modules/react-native-splash-screen/nitrogen/generated/ios/ReactNativeSplashScreen-Swift-Cxx-Bridge.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/// -/// ReactNativeSplashScreen-Swift-Cxx-Bridge.cpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#include "ReactNativeSplashScreen-Swift-Cxx-Bridge.hpp" - -// Include C++ implementation defined types -#include "HybridReactNativeSplashScreenSpecSwift.hpp" -#include "ReactNativeSplashScreen-Swift-Cxx-Umbrella.hpp" -#include - -namespace margelo::nitro::reactnativesplashscreen::bridge::swift { - - // pragma MARK: std::function - Func_void_bool create_Func_void_bool(void* NON_NULL swiftClosureWrapper) noexcept { - auto swiftClosure = ReactNativeSplashScreen::Func_void_bool::fromUnsafe(swiftClosureWrapper); - return [swiftClosure = std::move(swiftClosure)](bool result) mutable -> void { - swiftClosure.call(result); - }; - } - - // pragma MARK: std::function - Func_void_std__exception_ptr create_Func_void_std__exception_ptr(void* NON_NULL swiftClosureWrapper) noexcept { - auto swiftClosure = ReactNativeSplashScreen::Func_void_std__exception_ptr::fromUnsafe(swiftClosureWrapper); - return [swiftClosure = std::move(swiftClosure)](const std::exception_ptr& error) mutable -> void { - swiftClosure.call(error); - }; - } - - // pragma MARK: std::shared_ptr - std::shared_ptr create_std__shared_ptr_HybridReactNativeSplashScreenSpec_(void* NON_NULL swiftUnsafePointer) noexcept { - ReactNativeSplashScreen::HybridReactNativeSplashScreenSpec_cxx swiftPart = ReactNativeSplashScreen::HybridReactNativeSplashScreenSpec_cxx::fromUnsafe(swiftUnsafePointer); - return std::make_shared(swiftPart); - } - void* NON_NULL get_std__shared_ptr_HybridReactNativeSplashScreenSpec_(std__shared_ptr_HybridReactNativeSplashScreenSpec_ cppType) { - std::shared_ptr swiftWrapper = std::dynamic_pointer_cast(cppType); - #ifdef NITRO_DEBUG - if (swiftWrapper == nullptr) [[unlikely]] { - throw std::runtime_error("Class \"HybridReactNativeSplashScreenSpec\" is not implemented in Swift!"); - } - #endif - ReactNativeSplashScreen::HybridReactNativeSplashScreenSpec_cxx& swiftPart = swiftWrapper->getSwiftPart(); - return swiftPart.toUnsafe(); - } - -} // namespace margelo::nitro::reactnativesplashscreen::bridge::swift diff --git a/native-modules/react-native-splash-screen/nitrogen/generated/ios/ReactNativeSplashScreen-Swift-Cxx-Bridge.hpp b/native-modules/react-native-splash-screen/nitrogen/generated/ios/ReactNativeSplashScreen-Swift-Cxx-Bridge.hpp deleted file mode 100644 index cd03e8d..0000000 --- a/native-modules/react-native-splash-screen/nitrogen/generated/ios/ReactNativeSplashScreen-Swift-Cxx-Bridge.hpp +++ /dev/null @@ -1,110 +0,0 @@ -/// -/// ReactNativeSplashScreen-Swift-Cxx-Bridge.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -// Forward declarations of C++ defined types -// Forward declaration of `HybridReactNativeSplashScreenSpec` to properly resolve imports. -namespace margelo::nitro::reactnativesplashscreen { class HybridReactNativeSplashScreenSpec; } - -// Forward declarations of Swift defined types -// Forward declaration of `HybridReactNativeSplashScreenSpec_cxx` to properly resolve imports. -namespace ReactNativeSplashScreen { class HybridReactNativeSplashScreenSpec_cxx; } - -// Include C++ defined types -#include "HybridReactNativeSplashScreenSpec.hpp" -#include -#include -#include -#include -#include -#include - -/** - * Contains specialized versions of C++ templated types so they can be accessed from Swift, - * as well as helper functions to interact with those C++ types from Swift. - */ -namespace margelo::nitro::reactnativesplashscreen::bridge::swift { - - // pragma MARK: std::shared_ptr> - /** - * Specialized version of `std::shared_ptr>`. - */ - using std__shared_ptr_Promise_bool__ = std::shared_ptr>; - inline std::shared_ptr> create_std__shared_ptr_Promise_bool__() noexcept { - return Promise::create(); - } - inline PromiseHolder wrap_std__shared_ptr_Promise_bool__(std::shared_ptr> promise) noexcept { - return PromiseHolder(std::move(promise)); - } - - // pragma MARK: std::function - /** - * Specialized version of `std::function`. - */ - using Func_void_bool = std::function; - /** - * Wrapper class for a `std::function`, this can be used from Swift. - */ - class Func_void_bool_Wrapper final { - public: - explicit Func_void_bool_Wrapper(std::function&& func): _function(std::make_unique>(std::move(func))) {} - inline void call(bool result) const noexcept { - _function->operator()(result); - } - private: - std::unique_ptr> _function; - } SWIFT_NONCOPYABLE; - Func_void_bool create_Func_void_bool(void* NON_NULL swiftClosureWrapper) noexcept; - inline Func_void_bool_Wrapper wrap_Func_void_bool(Func_void_bool value) noexcept { - return Func_void_bool_Wrapper(std::move(value)); - } - - // pragma MARK: std::function - /** - * Specialized version of `std::function`. - */ - using Func_void_std__exception_ptr = std::function; - /** - * Wrapper class for a `std::function`, this can be used from Swift. - */ - class Func_void_std__exception_ptr_Wrapper final { - public: - explicit Func_void_std__exception_ptr_Wrapper(std::function&& func): _function(std::make_unique>(std::move(func))) {} - inline void call(std::exception_ptr error) const noexcept { - _function->operator()(error); - } - private: - std::unique_ptr> _function; - } SWIFT_NONCOPYABLE; - Func_void_std__exception_ptr create_Func_void_std__exception_ptr(void* NON_NULL swiftClosureWrapper) noexcept; - inline Func_void_std__exception_ptr_Wrapper wrap_Func_void_std__exception_ptr(Func_void_std__exception_ptr value) noexcept { - return Func_void_std__exception_ptr_Wrapper(std::move(value)); - } - - // pragma MARK: std::shared_ptr - /** - * Specialized version of `std::shared_ptr`. - */ - using std__shared_ptr_HybridReactNativeSplashScreenSpec_ = std::shared_ptr; - std::shared_ptr create_std__shared_ptr_HybridReactNativeSplashScreenSpec_(void* NON_NULL swiftUnsafePointer) noexcept; - void* NON_NULL get_std__shared_ptr_HybridReactNativeSplashScreenSpec_(std__shared_ptr_HybridReactNativeSplashScreenSpec_ cppType); - - // pragma MARK: std::weak_ptr - using std__weak_ptr_HybridReactNativeSplashScreenSpec_ = std::weak_ptr; - inline std__weak_ptr_HybridReactNativeSplashScreenSpec_ weakify_std__shared_ptr_HybridReactNativeSplashScreenSpec_(const std::shared_ptr& strong) noexcept { return strong; } - - // pragma MARK: Result>> - using Result_std__shared_ptr_Promise_bool___ = Result>>; - inline Result_std__shared_ptr_Promise_bool___ create_Result_std__shared_ptr_Promise_bool___(const std::shared_ptr>& value) noexcept { - return Result>>::withValue(value); - } - inline Result_std__shared_ptr_Promise_bool___ create_Result_std__shared_ptr_Promise_bool___(const std::exception_ptr& error) noexcept { - return Result>>::withError(error); - } - -} // namespace margelo::nitro::reactnativesplashscreen::bridge::swift diff --git a/native-modules/react-native-splash-screen/nitrogen/generated/ios/ReactNativeSplashScreen-Swift-Cxx-Umbrella.hpp b/native-modules/react-native-splash-screen/nitrogen/generated/ios/ReactNativeSplashScreen-Swift-Cxx-Umbrella.hpp deleted file mode 100644 index 25bd834..0000000 --- a/native-modules/react-native-splash-screen/nitrogen/generated/ios/ReactNativeSplashScreen-Swift-Cxx-Umbrella.hpp +++ /dev/null @@ -1,44 +0,0 @@ -/// -/// ReactNativeSplashScreen-Swift-Cxx-Umbrella.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -// Forward declarations of C++ defined types -// Forward declaration of `HybridReactNativeSplashScreenSpec` to properly resolve imports. -namespace margelo::nitro::reactnativesplashscreen { class HybridReactNativeSplashScreenSpec; } - -// Include C++ defined types -#include "HybridReactNativeSplashScreenSpec.hpp" -#include -#include -#include -#include - -// C++ helpers for Swift -#include "ReactNativeSplashScreen-Swift-Cxx-Bridge.hpp" - -// Common C++ types used in Swift -#include -#include -#include -#include - -// Forward declarations of Swift defined types -// Forward declaration of `HybridReactNativeSplashScreenSpec_cxx` to properly resolve imports. -namespace ReactNativeSplashScreen { class HybridReactNativeSplashScreenSpec_cxx; } - -// Include Swift defined types -#if __has_include("ReactNativeSplashScreen-Swift.h") -// This header is generated by Xcode/Swift on every app build. -// If it cannot be found, make sure the Swift module's name (= podspec name) is actually "ReactNativeSplashScreen". -#include "ReactNativeSplashScreen-Swift.h" -// Same as above, but used when building with frameworks (`use_frameworks`) -#elif __has_include() -#include -#else -#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. -#endif diff --git a/native-modules/react-native-splash-screen/nitrogen/generated/ios/ReactNativeSplashScreenAutolinking.mm b/native-modules/react-native-splash-screen/nitrogen/generated/ios/ReactNativeSplashScreenAutolinking.mm deleted file mode 100644 index ead966b..0000000 --- a/native-modules/react-native-splash-screen/nitrogen/generated/ios/ReactNativeSplashScreenAutolinking.mm +++ /dev/null @@ -1,33 +0,0 @@ -/// -/// ReactNativeSplashScreenAutolinking.mm -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#import -#import -#import "ReactNativeSplashScreen-Swift-Cxx-Umbrella.hpp" -#import - -#include "HybridReactNativeSplashScreenSpecSwift.hpp" - -@interface ReactNativeSplashScreenAutolinking : NSObject -@end - -@implementation ReactNativeSplashScreenAutolinking - -+ (void) load { - using namespace margelo::nitro; - using namespace margelo::nitro::reactnativesplashscreen; - - HybridObjectRegistry::registerHybridObjectConstructor( - "ReactNativeSplashScreen", - []() -> std::shared_ptr { - std::shared_ptr hybridObject = ReactNativeSplashScreen::ReactNativeSplashScreenAutolinking::createReactNativeSplashScreen(); - return hybridObject; - } - ); -} - -@end diff --git a/native-modules/react-native-splash-screen/nitrogen/generated/ios/ReactNativeSplashScreenAutolinking.swift b/native-modules/react-native-splash-screen/nitrogen/generated/ios/ReactNativeSplashScreenAutolinking.swift deleted file mode 100644 index 76218c7..0000000 --- a/native-modules/react-native-splash-screen/nitrogen/generated/ios/ReactNativeSplashScreenAutolinking.swift +++ /dev/null @@ -1,25 +0,0 @@ -/// -/// ReactNativeSplashScreenAutolinking.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -public final class ReactNativeSplashScreenAutolinking { - public typealias bridge = margelo.nitro.reactnativesplashscreen.bridge.swift - - /** - * Creates an instance of a Swift class that implements `HybridReactNativeSplashScreenSpec`, - * and wraps it in a Swift class that can directly interop with C++ (`HybridReactNativeSplashScreenSpec_cxx`) - * - * This is generated by Nitrogen and will initialize the class specified - * in the `"autolinking"` property of `nitro.json` (in this case, `ReactNativeSplashScreen`). - */ - public static func createReactNativeSplashScreen() -> bridge.std__shared_ptr_HybridReactNativeSplashScreenSpec_ { - let hybridObject = ReactNativeSplashScreen() - return { () -> bridge.std__shared_ptr_HybridReactNativeSplashScreenSpec_ in - let __cxxWrapped = hybridObject.getCxxWrapper() - return __cxxWrapped.getCxxPart() - }() - } -} diff --git a/native-modules/react-native-splash-screen/nitrogen/generated/ios/c++/HybridReactNativeSplashScreenSpecSwift.cpp b/native-modules/react-native-splash-screen/nitrogen/generated/ios/c++/HybridReactNativeSplashScreenSpecSwift.cpp deleted file mode 100644 index 37001d0..0000000 --- a/native-modules/react-native-splash-screen/nitrogen/generated/ios/c++/HybridReactNativeSplashScreenSpecSwift.cpp +++ /dev/null @@ -1,11 +0,0 @@ -/// -/// HybridReactNativeSplashScreenSpecSwift.cpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#include "HybridReactNativeSplashScreenSpecSwift.hpp" - -namespace margelo::nitro::reactnativesplashscreen { -} // namespace margelo::nitro::reactnativesplashscreen diff --git a/native-modules/react-native-splash-screen/nitrogen/generated/ios/c++/HybridReactNativeSplashScreenSpecSwift.hpp b/native-modules/react-native-splash-screen/nitrogen/generated/ios/c++/HybridReactNativeSplashScreenSpecSwift.hpp deleted file mode 100644 index fb37067..0000000 --- a/native-modules/react-native-splash-screen/nitrogen/generated/ios/c++/HybridReactNativeSplashScreenSpecSwift.hpp +++ /dev/null @@ -1,84 +0,0 @@ -/// -/// HybridReactNativeSplashScreenSpecSwift.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#include "HybridReactNativeSplashScreenSpec.hpp" - -// Forward declaration of `HybridReactNativeSplashScreenSpec_cxx` to properly resolve imports. -namespace ReactNativeSplashScreen { class HybridReactNativeSplashScreenSpec_cxx; } - - - -#include - -#include "ReactNativeSplashScreen-Swift-Cxx-Umbrella.hpp" - -namespace margelo::nitro::reactnativesplashscreen { - - /** - * The C++ part of HybridReactNativeSplashScreenSpec_cxx.swift. - * - * HybridReactNativeSplashScreenSpecSwift (C++) accesses HybridReactNativeSplashScreenSpec_cxx (Swift), and might - * contain some additional bridging code for C++ <> Swift interop. - * - * Since this obviously introduces an overhead, I hope at some point in - * the future, HybridReactNativeSplashScreenSpec_cxx can directly inherit from the C++ class HybridReactNativeSplashScreenSpec - * to simplify the whole structure and memory management. - */ - class HybridReactNativeSplashScreenSpecSwift: public virtual HybridReactNativeSplashScreenSpec { - public: - // Constructor from a Swift instance - explicit HybridReactNativeSplashScreenSpecSwift(const ReactNativeSplashScreen::HybridReactNativeSplashScreenSpec_cxx& swiftPart): - HybridObject(HybridReactNativeSplashScreenSpec::TAG), - _swiftPart(swiftPart) { } - - public: - // Get the Swift part - inline ReactNativeSplashScreen::HybridReactNativeSplashScreenSpec_cxx& getSwiftPart() noexcept { - return _swiftPart; - } - - public: - inline size_t getExternalMemorySize() noexcept override { - return _swiftPart.getMemorySize(); - } - void dispose() noexcept override { - _swiftPart.dispose(); - } - std::string toString() override { - return _swiftPart.toString(); - } - - public: - // Properties - - - public: - // Methods - inline std::shared_ptr> preventAutoHideAsync() override { - auto __result = _swiftPart.preventAutoHideAsync(); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - auto __value = std::move(__result.value()); - return __value; - } - inline std::shared_ptr> hideAsync() override { - auto __result = _swiftPart.hideAsync(); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - auto __value = std::move(__result.value()); - return __value; - } - - private: - ReactNativeSplashScreen::HybridReactNativeSplashScreenSpec_cxx _swiftPart; - }; - -} // namespace margelo::nitro::reactnativesplashscreen diff --git a/native-modules/react-native-splash-screen/nitrogen/generated/ios/swift/Func_void_bool.swift b/native-modules/react-native-splash-screen/nitrogen/generated/ios/swift/Func_void_bool.swift deleted file mode 100644 index cda4403..0000000 --- a/native-modules/react-native-splash-screen/nitrogen/generated/ios/swift/Func_void_bool.swift +++ /dev/null @@ -1,47 +0,0 @@ -/// -/// Func_void_bool.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Wraps a Swift `(_ value: Bool) -> Void` as a class. - * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`. - */ -public final class Func_void_bool { - public typealias bridge = margelo.nitro.reactnativesplashscreen.bridge.swift - - private let closure: (_ value: Bool) -> Void - - public init(_ closure: @escaping (_ value: Bool) -> Void) { - self.closure = closure - } - - @inline(__always) - public func call(value: Bool) -> Void { - self.closure(value) - } - - /** - * Casts this instance to a retained unsafe raw pointer. - * This acquires one additional strong reference on the object! - */ - @inline(__always) - public func toUnsafe() -> UnsafeMutableRawPointer { - return Unmanaged.passRetained(self).toOpaque() - } - - /** - * Casts an unsafe pointer to a `Func_void_bool`. - * The pointer has to be a retained opaque `Unmanaged`. - * This removes one strong reference from the object! - */ - @inline(__always) - public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_bool { - return Unmanaged.fromOpaque(pointer).takeRetainedValue() - } -} diff --git a/native-modules/react-native-splash-screen/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift b/native-modules/react-native-splash-screen/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift deleted file mode 100644 index 654f128..0000000 --- a/native-modules/react-native-splash-screen/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +++ /dev/null @@ -1,47 +0,0 @@ -/// -/// Func_void_std__exception_ptr.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Wraps a Swift `(_ error: Error) -> Void` as a class. - * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`. - */ -public final class Func_void_std__exception_ptr { - public typealias bridge = margelo.nitro.reactnativesplashscreen.bridge.swift - - private let closure: (_ error: Error) -> Void - - public init(_ closure: @escaping (_ error: Error) -> Void) { - self.closure = closure - } - - @inline(__always) - public func call(error: std.exception_ptr) -> Void { - self.closure(RuntimeError.from(cppError: error)) - } - - /** - * Casts this instance to a retained unsafe raw pointer. - * This acquires one additional strong reference on the object! - */ - @inline(__always) - public func toUnsafe() -> UnsafeMutableRawPointer { - return Unmanaged.passRetained(self).toOpaque() - } - - /** - * Casts an unsafe pointer to a `Func_void_std__exception_ptr`. - * The pointer has to be a retained opaque `Unmanaged`. - * This removes one strong reference from the object! - */ - @inline(__always) - public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_std__exception_ptr { - return Unmanaged.fromOpaque(pointer).takeRetainedValue() - } -} diff --git a/native-modules/react-native-splash-screen/nitrogen/generated/ios/swift/HybridReactNativeSplashScreenSpec.swift b/native-modules/react-native-splash-screen/nitrogen/generated/ios/swift/HybridReactNativeSplashScreenSpec.swift deleted file mode 100644 index d419f1e..0000000 --- a/native-modules/react-native-splash-screen/nitrogen/generated/ios/swift/HybridReactNativeSplashScreenSpec.swift +++ /dev/null @@ -1,57 +0,0 @@ -/// -/// HybridReactNativeSplashScreenSpec.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/// See ``HybridReactNativeSplashScreenSpec`` -public protocol HybridReactNativeSplashScreenSpec_protocol: HybridObject { - // Properties - - - // Methods - func preventAutoHideAsync() throws -> Promise - func hideAsync() throws -> Promise -} - -public extension HybridReactNativeSplashScreenSpec_protocol { - /// Default implementation of ``HybridObject.toString`` - func toString() -> String { - return "[HybridObject ReactNativeSplashScreen]" - } -} - -/// See ``HybridReactNativeSplashScreenSpec`` -open class HybridReactNativeSplashScreenSpec_base { - private weak var cxxWrapper: HybridReactNativeSplashScreenSpec_cxx? = nil - public init() { } - public func getCxxWrapper() -> HybridReactNativeSplashScreenSpec_cxx { - #if DEBUG - guard self is HybridReactNativeSplashScreenSpec else { - fatalError("`self` is not a `HybridReactNativeSplashScreenSpec`! Did you accidentally inherit from `HybridReactNativeSplashScreenSpec_base` instead of `HybridReactNativeSplashScreenSpec`?") - } - #endif - if let cxxWrapper = self.cxxWrapper { - return cxxWrapper - } else { - let cxxWrapper = HybridReactNativeSplashScreenSpec_cxx(self as! HybridReactNativeSplashScreenSpec) - self.cxxWrapper = cxxWrapper - return cxxWrapper - } - } -} - -/** - * A Swift base-protocol representing the ReactNativeSplashScreen HybridObject. - * Implement this protocol to create Swift-based instances of ReactNativeSplashScreen. - * ```swift - * class HybridReactNativeSplashScreen : HybridReactNativeSplashScreenSpec { - * // ... - * } - * ``` - */ -public typealias HybridReactNativeSplashScreenSpec = HybridReactNativeSplashScreenSpec_protocol & HybridReactNativeSplashScreenSpec_base diff --git a/native-modules/react-native-splash-screen/nitrogen/generated/ios/swift/HybridReactNativeSplashScreenSpec_cxx.swift b/native-modules/react-native-splash-screen/nitrogen/generated/ios/swift/HybridReactNativeSplashScreenSpec_cxx.swift deleted file mode 100644 index 948bca8..0000000 --- a/native-modules/react-native-splash-screen/nitrogen/generated/ios/swift/HybridReactNativeSplashScreenSpec_cxx.swift +++ /dev/null @@ -1,157 +0,0 @@ -/// -/// HybridReactNativeSplashScreenSpec_cxx.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * A class implementation that bridges HybridReactNativeSplashScreenSpec over to C++. - * In C++, we cannot use Swift protocols - so we need to wrap it in a class to make it strongly defined. - * - * Also, some Swift types need to be bridged with special handling: - * - Enums need to be wrapped in Structs, otherwise they cannot be accessed bi-directionally (Swift bug: https://github.com/swiftlang/swift/issues/75330) - * - Other HybridObjects need to be wrapped/unwrapped from the Swift TCxx wrapper - * - Throwing methods need to be wrapped with a Result type, as exceptions cannot be propagated to C++ - */ -open class HybridReactNativeSplashScreenSpec_cxx { - /** - * The Swift <> C++ bridge's namespace (`margelo::nitro::reactnativesplashscreen::bridge::swift`) - * from `ReactNativeSplashScreen-Swift-Cxx-Bridge.hpp`. - * This contains specialized C++ templates, and C++ helper functions that can be accessed from Swift. - */ - public typealias bridge = margelo.nitro.reactnativesplashscreen.bridge.swift - - /** - * Holds an instance of the `HybridReactNativeSplashScreenSpec` Swift protocol. - */ - private var __implementation: any HybridReactNativeSplashScreenSpec - - /** - * Holds a weak pointer to the C++ class that wraps the Swift class. - */ - private var __cxxPart: bridge.std__weak_ptr_HybridReactNativeSplashScreenSpec_ - - /** - * Create a new `HybridReactNativeSplashScreenSpec_cxx` that wraps the given `HybridReactNativeSplashScreenSpec`. - * All properties and methods bridge to C++ types. - */ - public init(_ implementation: any HybridReactNativeSplashScreenSpec) { - self.__implementation = implementation - self.__cxxPart = .init() - /* no base class */ - } - - /** - * Get the actual `HybridReactNativeSplashScreenSpec` instance this class wraps. - */ - @inline(__always) - public func getHybridReactNativeSplashScreenSpec() -> any HybridReactNativeSplashScreenSpec { - return __implementation - } - - /** - * Casts this instance to a retained unsafe raw pointer. - * This acquires one additional strong reference on the object! - */ - public func toUnsafe() -> UnsafeMutableRawPointer { - return Unmanaged.passRetained(self).toOpaque() - } - - /** - * Casts an unsafe pointer to a `HybridReactNativeSplashScreenSpec_cxx`. - * The pointer has to be a retained opaque `Unmanaged`. - * This removes one strong reference from the object! - */ - public class func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> HybridReactNativeSplashScreenSpec_cxx { - return Unmanaged.fromOpaque(pointer).takeRetainedValue() - } - - /** - * Gets (or creates) the C++ part of this Hybrid Object. - * The C++ part is a `std::shared_ptr`. - */ - public func getCxxPart() -> bridge.std__shared_ptr_HybridReactNativeSplashScreenSpec_ { - let cachedCxxPart = self.__cxxPart.lock() - if Bool(fromCxx: cachedCxxPart) { - return cachedCxxPart - } else { - let newCxxPart = bridge.create_std__shared_ptr_HybridReactNativeSplashScreenSpec_(self.toUnsafe()) - __cxxPart = bridge.weakify_std__shared_ptr_HybridReactNativeSplashScreenSpec_(newCxxPart) - return newCxxPart - } - } - - - - /** - * Get the memory size of the Swift class (plus size of any other allocations) - * so the JS VM can properly track it and garbage-collect the JS object if needed. - */ - @inline(__always) - public var memorySize: Int { - return MemoryHelper.getSizeOf(self.__implementation) + self.__implementation.memorySize - } - - /** - * Call dispose() on the Swift class. - * This _may_ be called manually from JS. - */ - @inline(__always) - public func dispose() { - self.__implementation.dispose() - } - - /** - * Call toString() on the Swift class. - */ - @inline(__always) - public func toString() -> String { - return self.__implementation.toString() - } - - // Properties - - - // Methods - @inline(__always) - public final func preventAutoHideAsync() -> bridge.Result_std__shared_ptr_Promise_bool___ { - do { - let __result = try self.__implementation.preventAutoHideAsync() - let __resultCpp = { () -> bridge.std__shared_ptr_Promise_bool__ in - let __promise = bridge.create_std__shared_ptr_Promise_bool__() - let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_bool__(__promise) - __result - .then({ __result in __promiseHolder.resolve(__result) }) - .catch({ __error in __promiseHolder.reject(__error.toCpp()) }) - return __promise - }() - return bridge.create_Result_std__shared_ptr_Promise_bool___(__resultCpp) - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_std__shared_ptr_Promise_bool___(__exceptionPtr) - } - } - - @inline(__always) - public final func hideAsync() -> bridge.Result_std__shared_ptr_Promise_bool___ { - do { - let __result = try self.__implementation.hideAsync() - let __resultCpp = { () -> bridge.std__shared_ptr_Promise_bool__ in - let __promise = bridge.create_std__shared_ptr_Promise_bool__() - let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_bool__(__promise) - __result - .then({ __result in __promiseHolder.resolve(__result) }) - .catch({ __error in __promiseHolder.reject(__error.toCpp()) }) - return __promise - }() - return bridge.create_Result_std__shared_ptr_Promise_bool___(__resultCpp) - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_std__shared_ptr_Promise_bool___(__exceptionPtr) - } - } -} diff --git a/native-modules/react-native-splash-screen/nitrogen/generated/shared/c++/HybridReactNativeSplashScreenSpec.cpp b/native-modules/react-native-splash-screen/nitrogen/generated/shared/c++/HybridReactNativeSplashScreenSpec.cpp deleted file mode 100644 index fdbc063..0000000 --- a/native-modules/react-native-splash-screen/nitrogen/generated/shared/c++/HybridReactNativeSplashScreenSpec.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/// -/// HybridReactNativeSplashScreenSpec.cpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#include "HybridReactNativeSplashScreenSpec.hpp" - -namespace margelo::nitro::reactnativesplashscreen { - - void HybridReactNativeSplashScreenSpec::loadHybridMethods() { - // load base methods/properties - HybridObject::loadHybridMethods(); - // load custom methods/properties - registerHybrids(this, [](Prototype& prototype) { - prototype.registerHybridMethod("preventAutoHideAsync", &HybridReactNativeSplashScreenSpec::preventAutoHideAsync); - prototype.registerHybridMethod("hideAsync", &HybridReactNativeSplashScreenSpec::hideAsync); - }); - } - -} // namespace margelo::nitro::reactnativesplashscreen diff --git a/native-modules/react-native-splash-screen/nitrogen/generated/shared/c++/HybridReactNativeSplashScreenSpec.hpp b/native-modules/react-native-splash-screen/nitrogen/generated/shared/c++/HybridReactNativeSplashScreenSpec.hpp deleted file mode 100644 index 6e69f88..0000000 --- a/native-modules/react-native-splash-screen/nitrogen/generated/shared/c++/HybridReactNativeSplashScreenSpec.hpp +++ /dev/null @@ -1,63 +0,0 @@ -/// -/// HybridReactNativeSplashScreenSpec.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif - - - -#include - -namespace margelo::nitro::reactnativesplashscreen { - - using namespace margelo::nitro; - - /** - * An abstract base class for `ReactNativeSplashScreen` - * Inherit this class to create instances of `HybridReactNativeSplashScreenSpec` in C++. - * You must explicitly call `HybridObject`'s constructor yourself, because it is virtual. - * @example - * ```cpp - * class HybridReactNativeSplashScreen: public HybridReactNativeSplashScreenSpec { - * public: - * HybridReactNativeSplashScreen(...): HybridObject(TAG) { ... } - * // ... - * }; - * ``` - */ - class HybridReactNativeSplashScreenSpec: public virtual HybridObject { - public: - // Constructor - explicit HybridReactNativeSplashScreenSpec(): HybridObject(TAG) { } - - // Destructor - ~HybridReactNativeSplashScreenSpec() override = default; - - public: - // Properties - - - public: - // Methods - virtual std::shared_ptr> preventAutoHideAsync() = 0; - virtual std::shared_ptr> hideAsync() = 0; - - protected: - // Hybrid Setup - void loadHybridMethods() override; - - protected: - // Tag for logging - static constexpr auto TAG = "ReactNativeSplashScreen"; - }; - -} // namespace margelo::nitro::reactnativesplashscreen diff --git a/native-views/react-native-auto-size-input/nitrogen/generated/.gitattributes b/native-views/react-native-auto-size-input/nitrogen/generated/.gitattributes deleted file mode 100644 index fb7a0d5..0000000 --- a/native-views/react-native-auto-size-input/nitrogen/generated/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -** linguist-generated=true diff --git a/native-views/react-native-auto-size-input/nitrogen/generated/android/autosizeinput+autolinking.cmake b/native-views/react-native-auto-size-input/nitrogen/generated/android/autosizeinput+autolinking.cmake deleted file mode 100644 index bf1964c..0000000 --- a/native-views/react-native-auto-size-input/nitrogen/generated/android/autosizeinput+autolinking.cmake +++ /dev/null @@ -1,83 +0,0 @@ -# -# autosizeinput+autolinking.cmake -# This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -# https://github.com/mrousavy/nitro -# Copyright © 2026 Marc Rousavy @ Margelo -# - -# This is a CMake file that adds all files generated by Nitrogen -# to the current CMake project. -# -# To use it, add this to your CMakeLists.txt: -# ```cmake -# include(${CMAKE_SOURCE_DIR}/../nitrogen/generated/android/autosizeinput+autolinking.cmake) -# ``` - -# Define a flag to check if we are building properly -add_definitions(-DBUILDING_AUTOSIZEINPUT_WITH_GENERATED_CMAKE_PROJECT) - -# Enable Raw Props parsing in react-native (for Nitro Views) -add_definitions(-DRN_SERIALIZABLE_STATE) - -# Add all headers that were generated by Nitrogen -include_directories( - "../nitrogen/generated/shared/c++" - "../nitrogen/generated/android/c++" - "../nitrogen/generated/android/" -) - -# Add all .cpp sources that were generated by Nitrogen -target_sources( - # CMake project name (Android C++ library name) - autosizeinput PRIVATE - # Autolinking Setup - ../nitrogen/generated/android/autosizeinputOnLoad.cpp - # Shared Nitrogen C++ sources - ../nitrogen/generated/shared/c++/HybridAutoSizeInputSpec.cpp - ../nitrogen/generated/shared/c++/views/HybridAutoSizeInputComponent.cpp - # Android-specific Nitrogen C++ sources - ../nitrogen/generated/android/c++/JHybridAutoSizeInputSpec.cpp - ../nitrogen/generated/android/c++/views/JHybridAutoSizeInputStateUpdater.cpp -) - -# From node_modules/react-native/ReactAndroid/cmake-utils/folly-flags.cmake -# Used in node_modules/react-native/ReactAndroid/cmake-utils/ReactNative-application.cmake -target_compile_definitions( - autosizeinput PRIVATE - -DFOLLY_NO_CONFIG=1 - -DFOLLY_HAVE_CLOCK_GETTIME=1 - -DFOLLY_USE_LIBCPP=1 - -DFOLLY_CFG_NO_COROUTINES=1 - -DFOLLY_MOBILE=1 - -DFOLLY_HAVE_RECVMMSG=1 - -DFOLLY_HAVE_PTHREAD=1 - # Once we target android-23 above, we can comment - # the following line. NDK uses GNU style stderror_r() after API 23. - -DFOLLY_HAVE_XSI_STRERROR_R=1 -) - -# Add all libraries required by the generated specs -find_package(fbjni REQUIRED) # <-- Used for communication between Java <-> C++ -find_package(ReactAndroid REQUIRED) # <-- Used to set up React Native bindings (e.g. CallInvoker/TurboModule) -find_package(react-native-nitro-modules REQUIRED) # <-- Used to create all HybridObjects and use the Nitro core library - -# Link all libraries together -target_link_libraries( - autosizeinput - fbjni::fbjni # <-- Facebook C++ JNI helpers - ReactAndroid::jsi # <-- RN: JSI - react-native-nitro-modules::NitroModules # <-- NitroModules Core :) -) - -# Link react-native (different prefab between RN 0.75 and RN 0.76) -if(ReactAndroid_VERSION_MINOR GREATER_EQUAL 76) - target_link_libraries( - autosizeinput - ReactAndroid::reactnative # <-- RN: Native Modules umbrella prefab - ) -else() - target_link_libraries( - autosizeinput - ReactAndroid::react_nativemodule_core # <-- RN: TurboModules Core - ) -endif() diff --git a/native-views/react-native-auto-size-input/nitrogen/generated/android/autosizeinput+autolinking.gradle b/native-views/react-native-auto-size-input/nitrogen/generated/android/autosizeinput+autolinking.gradle deleted file mode 100644 index 4a23143..0000000 --- a/native-views/react-native-auto-size-input/nitrogen/generated/android/autosizeinput+autolinking.gradle +++ /dev/null @@ -1,27 +0,0 @@ -/// -/// autosizeinput+autolinking.gradle -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -/// This is a Gradle file that adds all files generated by Nitrogen -/// to the current Gradle project. -/// -/// To use it, add this to your build.gradle: -/// ```gradle -/// apply from: '../nitrogen/generated/android/autosizeinput+autolinking.gradle' -/// ``` - -logger.warn("[NitroModules] 🔥 autosizeinput is boosted by nitro!") - -android { - sourceSets { - main { - java.srcDirs += [ - // Nitrogen files - "${project.projectDir}/../nitrogen/generated/android/kotlin" - ] - } - } -} diff --git a/native-views/react-native-auto-size-input/nitrogen/generated/android/autosizeinputOnLoad.cpp b/native-views/react-native-auto-size-input/nitrogen/generated/android/autosizeinputOnLoad.cpp deleted file mode 100644 index ef9ac62..0000000 --- a/native-views/react-native-auto-size-input/nitrogen/generated/android/autosizeinputOnLoad.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/// -/// autosizeinputOnLoad.cpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#ifndef BUILDING_AUTOSIZEINPUT_WITH_GENERATED_CMAKE_PROJECT -#error autosizeinputOnLoad.cpp is not being built with the autogenerated CMakeLists.txt project. Is a different CMakeLists.txt building this? -#endif - -#include "autosizeinputOnLoad.hpp" - -#include -#include -#include - -#include "JHybridAutoSizeInputSpec.hpp" -#include "JFunc_void_std__string.hpp" -#include "JFunc_void.hpp" -#include "views/JHybridAutoSizeInputStateUpdater.hpp" -#include - -namespace margelo::nitro::autosizeinput { - -int initialize(JavaVM* vm) { - using namespace margelo::nitro; - using namespace margelo::nitro::autosizeinput; - using namespace facebook; - - return facebook::jni::initialize(vm, [] { - // Register native JNI methods - margelo::nitro::autosizeinput::JHybridAutoSizeInputSpec::registerNatives(); - margelo::nitro::autosizeinput::JFunc_void_std__string_cxx::registerNatives(); - margelo::nitro::autosizeinput::JFunc_void_cxx::registerNatives(); - margelo::nitro::autosizeinput::views::JHybridAutoSizeInputStateUpdater::registerNatives(); - - // Register Nitro Hybrid Objects - HybridObjectRegistry::registerHybridObjectConstructor( - "AutoSizeInput", - []() -> std::shared_ptr { - static DefaultConstructableObject object("com/margelo/nitro/autosizeinput/HybridAutoSizeInput"); - auto instance = object.create(); - return instance->cthis()->shared(); - } - ); - }); -} - -} // namespace margelo::nitro::autosizeinput diff --git a/native-views/react-native-auto-size-input/nitrogen/generated/android/autosizeinputOnLoad.hpp b/native-views/react-native-auto-size-input/nitrogen/generated/android/autosizeinputOnLoad.hpp deleted file mode 100644 index a4714db..0000000 --- a/native-views/react-native-auto-size-input/nitrogen/generated/android/autosizeinputOnLoad.hpp +++ /dev/null @@ -1,25 +0,0 @@ -/// -/// autosizeinputOnLoad.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#include -#include - -namespace margelo::nitro::autosizeinput { - - /** - * Initializes the native (C++) part of autosizeinput, and autolinks all Hybrid Objects. - * Call this in your `JNI_OnLoad` function (probably inside `cpp-adapter.cpp`). - * Example: - * ```cpp (cpp-adapter.cpp) - * JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void*) { - * return margelo::nitro::autosizeinput::initialize(vm); - * } - * ``` - */ - int initialize(JavaVM* vm); - -} // namespace margelo::nitro::autosizeinput diff --git a/native-views/react-native-auto-size-input/nitrogen/generated/android/c++/JFunc_void.hpp b/native-views/react-native-auto-size-input/nitrogen/generated/android/c++/JFunc_void.hpp deleted file mode 100644 index b9f45c3..0000000 --- a/native-views/react-native-auto-size-input/nitrogen/generated/android/c++/JFunc_void.hpp +++ /dev/null @@ -1,75 +0,0 @@ -/// -/// JFunc_void.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#include -#include - -#include -#include - -namespace margelo::nitro::autosizeinput { - - using namespace facebook; - - /** - * Represents the Java/Kotlin callback `() -> Unit`. - * This can be passed around between C++ and Java/Kotlin. - */ - struct JFunc_void: public jni::JavaClass { - public: - static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/autosizeinput/Func_void;"; - - public: - /** - * Invokes the function this `JFunc_void` instance holds through JNI. - */ - void invoke() const { - static const auto method = javaClassStatic()->getMethod("invoke"); - method(self()); - } - }; - - /** - * An implementation of Func_void that is backed by a C++ implementation (using `std::function<...>`) - */ - class JFunc_void_cxx final: public jni::HybridClass { - public: - static jni::local_ref fromCpp(const std::function& func) { - return JFunc_void_cxx::newObjectCxxArgs(func); - } - - public: - /** - * Invokes the C++ `std::function<...>` this `JFunc_void_cxx` instance holds. - */ - void invoke_cxx() { - _func(); - } - - public: - [[nodiscard]] - inline const std::function& getFunction() const { - return _func; - } - - public: - static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/autosizeinput/Func_void_cxx;"; - static void registerNatives() { - registerHybrid({makeNativeMethod("invoke_cxx", JFunc_void_cxx::invoke_cxx)}); - } - - private: - explicit JFunc_void_cxx(const std::function& func): _func(func) { } - - private: - friend HybridBase; - std::function _func; - }; - -} // namespace margelo::nitro::autosizeinput diff --git a/native-views/react-native-auto-size-input/nitrogen/generated/android/c++/JFunc_void_std__string.hpp b/native-views/react-native-auto-size-input/nitrogen/generated/android/c++/JFunc_void_std__string.hpp deleted file mode 100644 index 03004cc..0000000 --- a/native-views/react-native-auto-size-input/nitrogen/generated/android/c++/JFunc_void_std__string.hpp +++ /dev/null @@ -1,76 +0,0 @@ -/// -/// JFunc_void_std__string.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#include -#include - -#include -#include -#include - -namespace margelo::nitro::autosizeinput { - - using namespace facebook; - - /** - * Represents the Java/Kotlin callback `(text: String) -> Unit`. - * This can be passed around between C++ and Java/Kotlin. - */ - struct JFunc_void_std__string: public jni::JavaClass { - public: - static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/autosizeinput/Func_void_std__string;"; - - public: - /** - * Invokes the function this `JFunc_void_std__string` instance holds through JNI. - */ - void invoke(const std::string& text) const { - static const auto method = javaClassStatic()->getMethod /* text */)>("invoke"); - method(self(), jni::make_jstring(text)); - } - }; - - /** - * An implementation of Func_void_std__string that is backed by a C++ implementation (using `std::function<...>`) - */ - class JFunc_void_std__string_cxx final: public jni::HybridClass { - public: - static jni::local_ref fromCpp(const std::function& func) { - return JFunc_void_std__string_cxx::newObjectCxxArgs(func); - } - - public: - /** - * Invokes the C++ `std::function<...>` this `JFunc_void_std__string_cxx` instance holds. - */ - void invoke_cxx(jni::alias_ref text) { - _func(text->toStdString()); - } - - public: - [[nodiscard]] - inline const std::function& getFunction() const { - return _func; - } - - public: - static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/autosizeinput/Func_void_std__string_cxx;"; - static void registerNatives() { - registerHybrid({makeNativeMethod("invoke_cxx", JFunc_void_std__string_cxx::invoke_cxx)}); - } - - private: - explicit JFunc_void_std__string_cxx(const std::function& func): _func(func) { } - - private: - friend HybridBase; - std::function _func; - }; - -} // namespace margelo::nitro::autosizeinput diff --git a/native-views/react-native-auto-size-input/nitrogen/generated/android/c++/JHybridAutoSizeInputSpec.cpp b/native-views/react-native-auto-size-input/nitrogen/generated/android/c++/JHybridAutoSizeInputSpec.cpp deleted file mode 100644 index b22b6d9..0000000 --- a/native-views/react-native-auto-size-input/nitrogen/generated/android/c++/JHybridAutoSizeInputSpec.cpp +++ /dev/null @@ -1,353 +0,0 @@ -/// -/// JHybridAutoSizeInputSpec.cpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#include "JHybridAutoSizeInputSpec.hpp" - - - -#include -#include -#include -#include "JFunc_void_std__string.hpp" -#include -#include "JFunc_void.hpp" - -namespace margelo::nitro::autosizeinput { - - jni::local_ref JHybridAutoSizeInputSpec::initHybrid(jni::alias_ref jThis) { - return makeCxxInstance(jThis); - } - - void JHybridAutoSizeInputSpec::registerNatives() { - registerHybrid({ - makeNativeMethod("initHybrid", JHybridAutoSizeInputSpec::initHybrid), - }); - } - - size_t JHybridAutoSizeInputSpec::getExternalMemorySize() noexcept { - static const auto method = javaClassStatic()->getMethod("getMemorySize"); - return method(_javaPart); - } - - void JHybridAutoSizeInputSpec::dispose() noexcept { - static const auto method = javaClassStatic()->getMethod("dispose"); - method(_javaPart); - } - - std::string JHybridAutoSizeInputSpec::toString() { - static const auto method = javaClassStatic()->getMethod("toString"); - auto javaString = method(_javaPart); - return javaString->toStdString(); - } - - // Properties - std::optional JHybridAutoSizeInputSpec::getText() { - static const auto method = javaClassStatic()->getMethod()>("getText"); - auto __result = method(_javaPart); - return __result != nullptr ? std::make_optional(__result->toStdString()) : std::nullopt; - } - void JHybridAutoSizeInputSpec::setText(const std::optional& text) { - static const auto method = javaClassStatic()->getMethod /* text */)>("setText"); - method(_javaPart, text.has_value() ? jni::make_jstring(text.value()) : nullptr); - } - std::optional JHybridAutoSizeInputSpec::getPrefix() { - static const auto method = javaClassStatic()->getMethod()>("getPrefix"); - auto __result = method(_javaPart); - return __result != nullptr ? std::make_optional(__result->toStdString()) : std::nullopt; - } - void JHybridAutoSizeInputSpec::setPrefix(const std::optional& prefix) { - static const auto method = javaClassStatic()->getMethod /* prefix */)>("setPrefix"); - method(_javaPart, prefix.has_value() ? jni::make_jstring(prefix.value()) : nullptr); - } - std::optional JHybridAutoSizeInputSpec::getSuffix() { - static const auto method = javaClassStatic()->getMethod()>("getSuffix"); - auto __result = method(_javaPart); - return __result != nullptr ? std::make_optional(__result->toStdString()) : std::nullopt; - } - void JHybridAutoSizeInputSpec::setSuffix(const std::optional& suffix) { - static const auto method = javaClassStatic()->getMethod /* suffix */)>("setSuffix"); - method(_javaPart, suffix.has_value() ? jni::make_jstring(suffix.value()) : nullptr); - } - std::optional JHybridAutoSizeInputSpec::getPlaceholder() { - static const auto method = javaClassStatic()->getMethod()>("getPlaceholder"); - auto __result = method(_javaPart); - return __result != nullptr ? std::make_optional(__result->toStdString()) : std::nullopt; - } - void JHybridAutoSizeInputSpec::setPlaceholder(const std::optional& placeholder) { - static const auto method = javaClassStatic()->getMethod /* placeholder */)>("setPlaceholder"); - method(_javaPart, placeholder.has_value() ? jni::make_jstring(placeholder.value()) : nullptr); - } - std::optional JHybridAutoSizeInputSpec::getFontSize() { - static const auto method = javaClassStatic()->getMethod()>("getFontSize"); - auto __result = method(_javaPart); - return __result != nullptr ? std::make_optional(__result->value()) : std::nullopt; - } - void JHybridAutoSizeInputSpec::setFontSize(std::optional fontSize) { - static const auto method = javaClassStatic()->getMethod /* fontSize */)>("setFontSize"); - method(_javaPart, fontSize.has_value() ? jni::JDouble::valueOf(fontSize.value()) : nullptr); - } - std::optional JHybridAutoSizeInputSpec::getMinFontSize() { - static const auto method = javaClassStatic()->getMethod()>("getMinFontSize"); - auto __result = method(_javaPart); - return __result != nullptr ? std::make_optional(__result->value()) : std::nullopt; - } - void JHybridAutoSizeInputSpec::setMinFontSize(std::optional minFontSize) { - static const auto method = javaClassStatic()->getMethod /* minFontSize */)>("setMinFontSize"); - method(_javaPart, minFontSize.has_value() ? jni::JDouble::valueOf(minFontSize.value()) : nullptr); - } - std::optional JHybridAutoSizeInputSpec::getMultiline() { - static const auto method = javaClassStatic()->getMethod()>("getMultiline"); - auto __result = method(_javaPart); - return __result != nullptr ? std::make_optional(static_cast(__result->value())) : std::nullopt; - } - void JHybridAutoSizeInputSpec::setMultiline(std::optional multiline) { - static const auto method = javaClassStatic()->getMethod /* multiline */)>("setMultiline"); - method(_javaPart, multiline.has_value() ? jni::JBoolean::valueOf(multiline.value()) : nullptr); - } - std::optional JHybridAutoSizeInputSpec::getMaxNumberOfLines() { - static const auto method = javaClassStatic()->getMethod()>("getMaxNumberOfLines"); - auto __result = method(_javaPart); - return __result != nullptr ? std::make_optional(__result->value()) : std::nullopt; - } - void JHybridAutoSizeInputSpec::setMaxNumberOfLines(std::optional maxNumberOfLines) { - static const auto method = javaClassStatic()->getMethod /* maxNumberOfLines */)>("setMaxNumberOfLines"); - method(_javaPart, maxNumberOfLines.has_value() ? jni::JDouble::valueOf(maxNumberOfLines.value()) : nullptr); - } - std::optional JHybridAutoSizeInputSpec::getTextColor() { - static const auto method = javaClassStatic()->getMethod()>("getTextColor"); - auto __result = method(_javaPart); - return __result != nullptr ? std::make_optional(__result->toStdString()) : std::nullopt; - } - void JHybridAutoSizeInputSpec::setTextColor(const std::optional& textColor) { - static const auto method = javaClassStatic()->getMethod /* textColor */)>("setTextColor"); - method(_javaPart, textColor.has_value() ? jni::make_jstring(textColor.value()) : nullptr); - } - std::optional JHybridAutoSizeInputSpec::getPrefixColor() { - static const auto method = javaClassStatic()->getMethod()>("getPrefixColor"); - auto __result = method(_javaPart); - return __result != nullptr ? std::make_optional(__result->toStdString()) : std::nullopt; - } - void JHybridAutoSizeInputSpec::setPrefixColor(const std::optional& prefixColor) { - static const auto method = javaClassStatic()->getMethod /* prefixColor */)>("setPrefixColor"); - method(_javaPart, prefixColor.has_value() ? jni::make_jstring(prefixColor.value()) : nullptr); - } - std::optional JHybridAutoSizeInputSpec::getSuffixColor() { - static const auto method = javaClassStatic()->getMethod()>("getSuffixColor"); - auto __result = method(_javaPart); - return __result != nullptr ? std::make_optional(__result->toStdString()) : std::nullopt; - } - void JHybridAutoSizeInputSpec::setSuffixColor(const std::optional& suffixColor) { - static const auto method = javaClassStatic()->getMethod /* suffixColor */)>("setSuffixColor"); - method(_javaPart, suffixColor.has_value() ? jni::make_jstring(suffixColor.value()) : nullptr); - } - std::optional JHybridAutoSizeInputSpec::getPlaceholderColor() { - static const auto method = javaClassStatic()->getMethod()>("getPlaceholderColor"); - auto __result = method(_javaPart); - return __result != nullptr ? std::make_optional(__result->toStdString()) : std::nullopt; - } - void JHybridAutoSizeInputSpec::setPlaceholderColor(const std::optional& placeholderColor) { - static const auto method = javaClassStatic()->getMethod /* placeholderColor */)>("setPlaceholderColor"); - method(_javaPart, placeholderColor.has_value() ? jni::make_jstring(placeholderColor.value()) : nullptr); - } - std::optional JHybridAutoSizeInputSpec::getTextAlign() { - static const auto method = javaClassStatic()->getMethod()>("getTextAlign"); - auto __result = method(_javaPart); - return __result != nullptr ? std::make_optional(__result->toStdString()) : std::nullopt; - } - void JHybridAutoSizeInputSpec::setTextAlign(const std::optional& textAlign) { - static const auto method = javaClassStatic()->getMethod /* textAlign */)>("setTextAlign"); - method(_javaPart, textAlign.has_value() ? jni::make_jstring(textAlign.value()) : nullptr); - } - std::optional JHybridAutoSizeInputSpec::getFontFamily() { - static const auto method = javaClassStatic()->getMethod()>("getFontFamily"); - auto __result = method(_javaPart); - return __result != nullptr ? std::make_optional(__result->toStdString()) : std::nullopt; - } - void JHybridAutoSizeInputSpec::setFontFamily(const std::optional& fontFamily) { - static const auto method = javaClassStatic()->getMethod /* fontFamily */)>("setFontFamily"); - method(_javaPart, fontFamily.has_value() ? jni::make_jstring(fontFamily.value()) : nullptr); - } - std::optional JHybridAutoSizeInputSpec::getFontWeight() { - static const auto method = javaClassStatic()->getMethod()>("getFontWeight"); - auto __result = method(_javaPart); - return __result != nullptr ? std::make_optional(__result->toStdString()) : std::nullopt; - } - void JHybridAutoSizeInputSpec::setFontWeight(const std::optional& fontWeight) { - static const auto method = javaClassStatic()->getMethod /* fontWeight */)>("setFontWeight"); - method(_javaPart, fontWeight.has_value() ? jni::make_jstring(fontWeight.value()) : nullptr); - } - std::optional JHybridAutoSizeInputSpec::getEditable() { - static const auto method = javaClassStatic()->getMethod()>("getEditable"); - auto __result = method(_javaPart); - return __result != nullptr ? std::make_optional(static_cast(__result->value())) : std::nullopt; - } - void JHybridAutoSizeInputSpec::setEditable(std::optional editable) { - static const auto method = javaClassStatic()->getMethod /* editable */)>("setEditable"); - method(_javaPart, editable.has_value() ? jni::JBoolean::valueOf(editable.value()) : nullptr); - } - std::optional JHybridAutoSizeInputSpec::getKeyboardType() { - static const auto method = javaClassStatic()->getMethod()>("getKeyboardType"); - auto __result = method(_javaPart); - return __result != nullptr ? std::make_optional(__result->toStdString()) : std::nullopt; - } - void JHybridAutoSizeInputSpec::setKeyboardType(const std::optional& keyboardType) { - static const auto method = javaClassStatic()->getMethod /* keyboardType */)>("setKeyboardType"); - method(_javaPart, keyboardType.has_value() ? jni::make_jstring(keyboardType.value()) : nullptr); - } - std::optional JHybridAutoSizeInputSpec::getReturnKeyType() { - static const auto method = javaClassStatic()->getMethod()>("getReturnKeyType"); - auto __result = method(_javaPart); - return __result != nullptr ? std::make_optional(__result->toStdString()) : std::nullopt; - } - void JHybridAutoSizeInputSpec::setReturnKeyType(const std::optional& returnKeyType) { - static const auto method = javaClassStatic()->getMethod /* returnKeyType */)>("setReturnKeyType"); - method(_javaPart, returnKeyType.has_value() ? jni::make_jstring(returnKeyType.value()) : nullptr); - } - std::optional JHybridAutoSizeInputSpec::getAutoCorrect() { - static const auto method = javaClassStatic()->getMethod()>("getAutoCorrect"); - auto __result = method(_javaPart); - return __result != nullptr ? std::make_optional(static_cast(__result->value())) : std::nullopt; - } - void JHybridAutoSizeInputSpec::setAutoCorrect(std::optional autoCorrect) { - static const auto method = javaClassStatic()->getMethod /* autoCorrect */)>("setAutoCorrect"); - method(_javaPart, autoCorrect.has_value() ? jni::JBoolean::valueOf(autoCorrect.value()) : nullptr); - } - std::optional JHybridAutoSizeInputSpec::getAutoCapitalize() { - static const auto method = javaClassStatic()->getMethod()>("getAutoCapitalize"); - auto __result = method(_javaPart); - return __result != nullptr ? std::make_optional(__result->toStdString()) : std::nullopt; - } - void JHybridAutoSizeInputSpec::setAutoCapitalize(const std::optional& autoCapitalize) { - static const auto method = javaClassStatic()->getMethod /* autoCapitalize */)>("setAutoCapitalize"); - method(_javaPart, autoCapitalize.has_value() ? jni::make_jstring(autoCapitalize.value()) : nullptr); - } - std::optional JHybridAutoSizeInputSpec::getSelectionColor() { - static const auto method = javaClassStatic()->getMethod()>("getSelectionColor"); - auto __result = method(_javaPart); - return __result != nullptr ? std::make_optional(__result->toStdString()) : std::nullopt; - } - void JHybridAutoSizeInputSpec::setSelectionColor(const std::optional& selectionColor) { - static const auto method = javaClassStatic()->getMethod /* selectionColor */)>("setSelectionColor"); - method(_javaPart, selectionColor.has_value() ? jni::make_jstring(selectionColor.value()) : nullptr); - } - std::optional JHybridAutoSizeInputSpec::getPrefixMarginRight() { - static const auto method = javaClassStatic()->getMethod()>("getPrefixMarginRight"); - auto __result = method(_javaPart); - return __result != nullptr ? std::make_optional(__result->value()) : std::nullopt; - } - void JHybridAutoSizeInputSpec::setPrefixMarginRight(std::optional prefixMarginRight) { - static const auto method = javaClassStatic()->getMethod /* prefixMarginRight */)>("setPrefixMarginRight"); - method(_javaPart, prefixMarginRight.has_value() ? jni::JDouble::valueOf(prefixMarginRight.value()) : nullptr); - } - std::optional JHybridAutoSizeInputSpec::getSuffixMarginLeft() { - static const auto method = javaClassStatic()->getMethod()>("getSuffixMarginLeft"); - auto __result = method(_javaPart); - return __result != nullptr ? std::make_optional(__result->value()) : std::nullopt; - } - void JHybridAutoSizeInputSpec::setSuffixMarginLeft(std::optional suffixMarginLeft) { - static const auto method = javaClassStatic()->getMethod /* suffixMarginLeft */)>("setSuffixMarginLeft"); - method(_javaPart, suffixMarginLeft.has_value() ? jni::JDouble::valueOf(suffixMarginLeft.value()) : nullptr); - } - std::optional JHybridAutoSizeInputSpec::getShowBorder() { - static const auto method = javaClassStatic()->getMethod()>("getShowBorder"); - auto __result = method(_javaPart); - return __result != nullptr ? std::make_optional(static_cast(__result->value())) : std::nullopt; - } - void JHybridAutoSizeInputSpec::setShowBorder(std::optional showBorder) { - static const auto method = javaClassStatic()->getMethod /* showBorder */)>("setShowBorder"); - method(_javaPart, showBorder.has_value() ? jni::JBoolean::valueOf(showBorder.value()) : nullptr); - } - std::optional JHybridAutoSizeInputSpec::getInputBackgroundColor() { - static const auto method = javaClassStatic()->getMethod()>("getInputBackgroundColor"); - auto __result = method(_javaPart); - return __result != nullptr ? std::make_optional(__result->toStdString()) : std::nullopt; - } - void JHybridAutoSizeInputSpec::setInputBackgroundColor(const std::optional& inputBackgroundColor) { - static const auto method = javaClassStatic()->getMethod /* inputBackgroundColor */)>("setInputBackgroundColor"); - method(_javaPart, inputBackgroundColor.has_value() ? jni::make_jstring(inputBackgroundColor.value()) : nullptr); - } - std::optional JHybridAutoSizeInputSpec::getContentAutoWidth() { - static const auto method = javaClassStatic()->getMethod()>("getContentAutoWidth"); - auto __result = method(_javaPart); - return __result != nullptr ? std::make_optional(static_cast(__result->value())) : std::nullopt; - } - void JHybridAutoSizeInputSpec::setContentAutoWidth(std::optional contentAutoWidth) { - static const auto method = javaClassStatic()->getMethod /* contentAutoWidth */)>("setContentAutoWidth"); - method(_javaPart, contentAutoWidth.has_value() ? jni::JBoolean::valueOf(contentAutoWidth.value()) : nullptr); - } - std::optional JHybridAutoSizeInputSpec::getContentCentered() { - static const auto method = javaClassStatic()->getMethod()>("getContentCentered"); - auto __result = method(_javaPart); - return __result != nullptr ? std::make_optional(static_cast(__result->value())) : std::nullopt; - } - void JHybridAutoSizeInputSpec::setContentCentered(std::optional contentCentered) { - static const auto method = javaClassStatic()->getMethod /* contentCentered */)>("setContentCentered"); - method(_javaPart, contentCentered.has_value() ? jni::JBoolean::valueOf(contentCentered.value()) : nullptr); - } - std::optional> JHybridAutoSizeInputSpec::getOnChangeText() { - static const auto method = javaClassStatic()->getMethod()>("getOnChangeText_cxx"); - auto __result = method(_javaPart); - return __result != nullptr ? std::make_optional([&]() -> std::function { - if (__result->isInstanceOf(JFunc_void_std__string_cxx::javaClassStatic())) [[likely]] { - auto downcast = jni::static_ref_cast(__result); - return downcast->cthis()->getFunction(); - } else { - auto __resultRef = jni::make_global(__result); - return JNICallable(std::move(__resultRef)); - } - }()) : std::nullopt; - } - void JHybridAutoSizeInputSpec::setOnChangeText(const std::optional>& onChangeText) { - static const auto method = javaClassStatic()->getMethod /* onChangeText */)>("setOnChangeText_cxx"); - method(_javaPart, onChangeText.has_value() ? JFunc_void_std__string_cxx::fromCpp(onChangeText.value()) : nullptr); - } - std::optional> JHybridAutoSizeInputSpec::getOnFocus() { - static const auto method = javaClassStatic()->getMethod()>("getOnFocus_cxx"); - auto __result = method(_javaPart); - return __result != nullptr ? std::make_optional([&]() -> std::function { - if (__result->isInstanceOf(JFunc_void_cxx::javaClassStatic())) [[likely]] { - auto downcast = jni::static_ref_cast(__result); - return downcast->cthis()->getFunction(); - } else { - auto __resultRef = jni::make_global(__result); - return JNICallable(std::move(__resultRef)); - } - }()) : std::nullopt; - } - void JHybridAutoSizeInputSpec::setOnFocus(const std::optional>& onFocus) { - static const auto method = javaClassStatic()->getMethod /* onFocus */)>("setOnFocus_cxx"); - method(_javaPart, onFocus.has_value() ? JFunc_void_cxx::fromCpp(onFocus.value()) : nullptr); - } - std::optional> JHybridAutoSizeInputSpec::getOnBlur() { - static const auto method = javaClassStatic()->getMethod()>("getOnBlur_cxx"); - auto __result = method(_javaPart); - return __result != nullptr ? std::make_optional([&]() -> std::function { - if (__result->isInstanceOf(JFunc_void_cxx::javaClassStatic())) [[likely]] { - auto downcast = jni::static_ref_cast(__result); - return downcast->cthis()->getFunction(); - } else { - auto __resultRef = jni::make_global(__result); - return JNICallable(std::move(__resultRef)); - } - }()) : std::nullopt; - } - void JHybridAutoSizeInputSpec::setOnBlur(const std::optional>& onBlur) { - static const auto method = javaClassStatic()->getMethod /* onBlur */)>("setOnBlur_cxx"); - method(_javaPart, onBlur.has_value() ? JFunc_void_cxx::fromCpp(onBlur.value()) : nullptr); - } - - // Methods - void JHybridAutoSizeInputSpec::focus() { - static const auto method = javaClassStatic()->getMethod("focus"); - method(_javaPart); - } - void JHybridAutoSizeInputSpec::blur() { - static const auto method = javaClassStatic()->getMethod("blur"); - method(_javaPart); - } - -} // namespace margelo::nitro::autosizeinput diff --git a/native-views/react-native-auto-size-input/nitrogen/generated/android/c++/JHybridAutoSizeInputSpec.hpp b/native-views/react-native-auto-size-input/nitrogen/generated/android/c++/JHybridAutoSizeInputSpec.hpp deleted file mode 100644 index 867c2a4..0000000 --- a/native-views/react-native-auto-size-input/nitrogen/generated/android/c++/JHybridAutoSizeInputSpec.hpp +++ /dev/null @@ -1,125 +0,0 @@ -/// -/// HybridAutoSizeInputSpec.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#include -#include -#include "HybridAutoSizeInputSpec.hpp" - - - - -namespace margelo::nitro::autosizeinput { - - using namespace facebook; - - class JHybridAutoSizeInputSpec: public jni::HybridClass, - public virtual HybridAutoSizeInputSpec { - public: - static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/autosizeinput/HybridAutoSizeInputSpec;"; - static jni::local_ref initHybrid(jni::alias_ref jThis); - static void registerNatives(); - - protected: - // C++ constructor (called from Java via `initHybrid()`) - explicit JHybridAutoSizeInputSpec(jni::alias_ref jThis) : - HybridObject(HybridAutoSizeInputSpec::TAG), - HybridBase(jThis), - _javaPart(jni::make_global(jThis)) {} - - public: - ~JHybridAutoSizeInputSpec() override { - // Hermes GC can destroy JS objects on a non-JNI Thread. - jni::ThreadScope::WithClassLoader([&] { _javaPart.reset(); }); - } - - public: - size_t getExternalMemorySize() noexcept override; - void dispose() noexcept override; - std::string toString() override; - - public: - inline const jni::global_ref& getJavaPart() const noexcept { - return _javaPart; - } - - public: - // Properties - std::optional getText() override; - void setText(const std::optional& text) override; - std::optional getPrefix() override; - void setPrefix(const std::optional& prefix) override; - std::optional getSuffix() override; - void setSuffix(const std::optional& suffix) override; - std::optional getPlaceholder() override; - void setPlaceholder(const std::optional& placeholder) override; - std::optional getFontSize() override; - void setFontSize(std::optional fontSize) override; - std::optional getMinFontSize() override; - void setMinFontSize(std::optional minFontSize) override; - std::optional getMultiline() override; - void setMultiline(std::optional multiline) override; - std::optional getMaxNumberOfLines() override; - void setMaxNumberOfLines(std::optional maxNumberOfLines) override; - std::optional getTextColor() override; - void setTextColor(const std::optional& textColor) override; - std::optional getPrefixColor() override; - void setPrefixColor(const std::optional& prefixColor) override; - std::optional getSuffixColor() override; - void setSuffixColor(const std::optional& suffixColor) override; - std::optional getPlaceholderColor() override; - void setPlaceholderColor(const std::optional& placeholderColor) override; - std::optional getTextAlign() override; - void setTextAlign(const std::optional& textAlign) override; - std::optional getFontFamily() override; - void setFontFamily(const std::optional& fontFamily) override; - std::optional getFontWeight() override; - void setFontWeight(const std::optional& fontWeight) override; - std::optional getEditable() override; - void setEditable(std::optional editable) override; - std::optional getKeyboardType() override; - void setKeyboardType(const std::optional& keyboardType) override; - std::optional getReturnKeyType() override; - void setReturnKeyType(const std::optional& returnKeyType) override; - std::optional getAutoCorrect() override; - void setAutoCorrect(std::optional autoCorrect) override; - std::optional getAutoCapitalize() override; - void setAutoCapitalize(const std::optional& autoCapitalize) override; - std::optional getSelectionColor() override; - void setSelectionColor(const std::optional& selectionColor) override; - std::optional getPrefixMarginRight() override; - void setPrefixMarginRight(std::optional prefixMarginRight) override; - std::optional getSuffixMarginLeft() override; - void setSuffixMarginLeft(std::optional suffixMarginLeft) override; - std::optional getShowBorder() override; - void setShowBorder(std::optional showBorder) override; - std::optional getInputBackgroundColor() override; - void setInputBackgroundColor(const std::optional& inputBackgroundColor) override; - std::optional getContentAutoWidth() override; - void setContentAutoWidth(std::optional contentAutoWidth) override; - std::optional getContentCentered() override; - void setContentCentered(std::optional contentCentered) override; - std::optional> getOnChangeText() override; - void setOnChangeText(const std::optional>& onChangeText) override; - std::optional> getOnFocus() override; - void setOnFocus(const std::optional>& onFocus) override; - std::optional> getOnBlur() override; - void setOnBlur(const std::optional>& onBlur) override; - - public: - // Methods - void focus() override; - void blur() override; - - private: - friend HybridBase; - using HybridBase::HybridBase; - jni::global_ref _javaPart; - }; - -} // namespace margelo::nitro::autosizeinput diff --git a/native-views/react-native-auto-size-input/nitrogen/generated/android/c++/views/JHybridAutoSizeInputStateUpdater.cpp b/native-views/react-native-auto-size-input/nitrogen/generated/android/c++/views/JHybridAutoSizeInputStateUpdater.cpp deleted file mode 100644 index 79fca5c..0000000 --- a/native-views/react-native-auto-size-input/nitrogen/generated/android/c++/views/JHybridAutoSizeInputStateUpdater.cpp +++ /dev/null @@ -1,172 +0,0 @@ -/// -/// JHybridAutoSizeInputStateUpdater.cpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#include "JHybridAutoSizeInputStateUpdater.hpp" -#include "views/HybridAutoSizeInputComponent.hpp" -#include - -namespace margelo::nitro::autosizeinput::views { - -using namespace facebook; -using ConcreteStateData = react::ConcreteState; - -void JHybridAutoSizeInputStateUpdater::updateViewProps(jni::alias_ref /* class */, - jni::alias_ref javaView, - jni::alias_ref stateWrapperInterface) { - JHybridAutoSizeInputSpec* view = javaView->cthis(); - - // Get concrete StateWrapperImpl from passed StateWrapper interface object - jobject rawStateWrapper = stateWrapperInterface.get(); - if (!stateWrapperInterface->isInstanceOf(react::StateWrapperImpl::javaClassStatic())) { - throw std::runtime_error("StateWrapper is not a StateWrapperImpl"); - } - auto stateWrapper = jni::alias_ref{ - static_cast(rawStateWrapper)}; - - std::shared_ptr state = stateWrapper->cthis()->getState(); - auto concreteState = std::dynamic_pointer_cast(state); - const HybridAutoSizeInputState& data = concreteState->getData(); - const std::optional& maybeProps = data.getProps(); - if (!maybeProps.has_value()) { - // Props aren't set yet! - throw std::runtime_error("HybridAutoSizeInputState's data doesn't contain any props!"); - } - const HybridAutoSizeInputProps& props = maybeProps.value(); - if (props.text.isDirty) { - view->setText(props.text.value); - // TODO: Set isDirty = false - } - if (props.prefix.isDirty) { - view->setPrefix(props.prefix.value); - // TODO: Set isDirty = false - } - if (props.suffix.isDirty) { - view->setSuffix(props.suffix.value); - // TODO: Set isDirty = false - } - if (props.placeholder.isDirty) { - view->setPlaceholder(props.placeholder.value); - // TODO: Set isDirty = false - } - if (props.fontSize.isDirty) { - view->setFontSize(props.fontSize.value); - // TODO: Set isDirty = false - } - if (props.minFontSize.isDirty) { - view->setMinFontSize(props.minFontSize.value); - // TODO: Set isDirty = false - } - if (props.multiline.isDirty) { - view->setMultiline(props.multiline.value); - // TODO: Set isDirty = false - } - if (props.maxNumberOfLines.isDirty) { - view->setMaxNumberOfLines(props.maxNumberOfLines.value); - // TODO: Set isDirty = false - } - if (props.textColor.isDirty) { - view->setTextColor(props.textColor.value); - // TODO: Set isDirty = false - } - if (props.prefixColor.isDirty) { - view->setPrefixColor(props.prefixColor.value); - // TODO: Set isDirty = false - } - if (props.suffixColor.isDirty) { - view->setSuffixColor(props.suffixColor.value); - // TODO: Set isDirty = false - } - if (props.placeholderColor.isDirty) { - view->setPlaceholderColor(props.placeholderColor.value); - // TODO: Set isDirty = false - } - if (props.textAlign.isDirty) { - view->setTextAlign(props.textAlign.value); - // TODO: Set isDirty = false - } - if (props.fontFamily.isDirty) { - view->setFontFamily(props.fontFamily.value); - // TODO: Set isDirty = false - } - if (props.fontWeight.isDirty) { - view->setFontWeight(props.fontWeight.value); - // TODO: Set isDirty = false - } - if (props.editable.isDirty) { - view->setEditable(props.editable.value); - // TODO: Set isDirty = false - } - if (props.keyboardType.isDirty) { - view->setKeyboardType(props.keyboardType.value); - // TODO: Set isDirty = false - } - if (props.returnKeyType.isDirty) { - view->setReturnKeyType(props.returnKeyType.value); - // TODO: Set isDirty = false - } - if (props.autoCorrect.isDirty) { - view->setAutoCorrect(props.autoCorrect.value); - // TODO: Set isDirty = false - } - if (props.autoCapitalize.isDirty) { - view->setAutoCapitalize(props.autoCapitalize.value); - // TODO: Set isDirty = false - } - if (props.selectionColor.isDirty) { - view->setSelectionColor(props.selectionColor.value); - // TODO: Set isDirty = false - } - if (props.prefixMarginRight.isDirty) { - view->setPrefixMarginRight(props.prefixMarginRight.value); - // TODO: Set isDirty = false - } - if (props.suffixMarginLeft.isDirty) { - view->setSuffixMarginLeft(props.suffixMarginLeft.value); - // TODO: Set isDirty = false - } - if (props.showBorder.isDirty) { - view->setShowBorder(props.showBorder.value); - // TODO: Set isDirty = false - } - if (props.inputBackgroundColor.isDirty) { - view->setInputBackgroundColor(props.inputBackgroundColor.value); - // TODO: Set isDirty = false - } - if (props.contentAutoWidth.isDirty) { - view->setContentAutoWidth(props.contentAutoWidth.value); - // TODO: Set isDirty = false - } - if (props.contentCentered.isDirty) { - view->setContentCentered(props.contentCentered.value); - // TODO: Set isDirty = false - } - if (props.onChangeText.isDirty) { - view->setOnChangeText(props.onChangeText.value); - // TODO: Set isDirty = false - } - if (props.onFocus.isDirty) { - view->setOnFocus(props.onFocus.value); - // TODO: Set isDirty = false - } - if (props.onBlur.isDirty) { - view->setOnBlur(props.onBlur.value); - // TODO: Set isDirty = false - } - - // Update hybridRef if it changed - if (props.hybridRef.isDirty) { - // hybridRef changed - call it with new this - const auto& maybeFunc = props.hybridRef.value; - if (maybeFunc.has_value()) { - std::shared_ptr shared = javaView->cthis()->shared_cast(); - maybeFunc.value()(shared); - } - // TODO: Set isDirty = false - } -} - -} // namespace margelo::nitro::autosizeinput::views diff --git a/native-views/react-native-auto-size-input/nitrogen/generated/android/c++/views/JHybridAutoSizeInputStateUpdater.hpp b/native-views/react-native-auto-size-input/nitrogen/generated/android/c++/views/JHybridAutoSizeInputStateUpdater.hpp deleted file mode 100644 index d93e017..0000000 --- a/native-views/react-native-auto-size-input/nitrogen/generated/android/c++/views/JHybridAutoSizeInputStateUpdater.hpp +++ /dev/null @@ -1,49 +0,0 @@ -/// -/// JHybridAutoSizeInputStateUpdater.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#ifndef RN_SERIALIZABLE_STATE -#error autosizeinput was compiled without the 'RN_SERIALIZABLE_STATE' flag. This flag is required for Nitro Views - set it in your CMakeLists! -#endif - -#include -#include -#include -#include -#include -#include -#include "JHybridAutoSizeInputSpec.hpp" -#include "views/HybridAutoSizeInputComponent.hpp" - -namespace margelo::nitro::autosizeinput::views { - -using namespace facebook; - -class JHybridAutoSizeInputStateUpdater: public jni::JavaClass { -public: - static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/autosizeinput/views/HybridAutoSizeInputStateUpdater;"; - -public: - static void updateViewProps(jni::alias_ref /* class */, - jni::alias_ref view, - jni::alias_ref stateWrapperInterface); - -public: - static void registerNatives() { - // Register JNI calls - javaClassStatic()->registerNatives({ - makeNativeMethod("updateViewProps", JHybridAutoSizeInputStateUpdater::updateViewProps), - }); - // Register React Native view component descriptor - auto provider = react::concreteComponentDescriptorProvider(); - auto providerRegistry = react::CoreComponentsRegistry::sharedProviderRegistry(); - providerRegistry->add(provider); - } -}; - -} // namespace margelo::nitro::autosizeinput::views diff --git a/native-views/react-native-auto-size-input/nitrogen/generated/android/kotlin/com/margelo/nitro/autosizeinput/Func_void.kt b/native-views/react-native-auto-size-input/nitrogen/generated/android/kotlin/com/margelo/nitro/autosizeinput/Func_void.kt deleted file mode 100644 index 0282895..0000000 --- a/native-views/react-native-auto-size-input/nitrogen/generated/android/kotlin/com/margelo/nitro/autosizeinput/Func_void.kt +++ /dev/null @@ -1,80 +0,0 @@ -/// -/// Func_void.kt -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -package com.margelo.nitro.autosizeinput - -import androidx.annotation.Keep -import com.facebook.jni.HybridData -import com.facebook.proguard.annotations.DoNotStrip -import dalvik.annotation.optimization.FastNative - - -/** - * Represents the JavaScript callback `() => void`. - * This can be either implemented in C++ (in which case it might be a callback coming from JS), - * or in Kotlin/Java (in which case it is a native callback). - */ -@DoNotStrip -@Keep -@Suppress("ClassName", "RedundantUnitReturnType") -fun interface Func_void: () -> Unit { - /** - * Call the given JS callback. - * @throws Throwable if the JS function itself throws an error, or if the JS function/runtime has already been deleted. - */ - @DoNotStrip - @Keep - override fun invoke(): Unit -} - -/** - * Represents the JavaScript callback `() => void`. - * This is implemented in C++, via a `std::function<...>`. - * The callback might be coming from JS. - */ -@DoNotStrip -@Keep -@Suppress( - "KotlinJniMissingFunction", "unused", - "RedundantSuppression", "RedundantUnitReturnType", "FunctionName", - "ConvertSecondaryConstructorToPrimary", "ClassName", "LocalVariableName", -) -class Func_void_cxx: Func_void { - @DoNotStrip - @Keep - private val mHybridData: HybridData - - @DoNotStrip - @Keep - private constructor(hybridData: HybridData) { - mHybridData = hybridData - } - - @DoNotStrip - @Keep - override fun invoke(): Unit - = invoke_cxx() - - @FastNative - private external fun invoke_cxx(): Unit -} - -/** - * Represents the JavaScript callback `() => void`. - * This is implemented in Java/Kotlin, via a `() -> Unit`. - * The callback is always coming from native. - */ -@DoNotStrip -@Keep -@Suppress("ClassName", "RedundantUnitReturnType", "unused") -class Func_void_java(private val function: () -> Unit): Func_void { - @DoNotStrip - @Keep - override fun invoke(): Unit { - return this.function() - } -} diff --git a/native-views/react-native-auto-size-input/nitrogen/generated/android/kotlin/com/margelo/nitro/autosizeinput/Func_void_std__string.kt b/native-views/react-native-auto-size-input/nitrogen/generated/android/kotlin/com/margelo/nitro/autosizeinput/Func_void_std__string.kt deleted file mode 100644 index 9162507..0000000 --- a/native-views/react-native-auto-size-input/nitrogen/generated/android/kotlin/com/margelo/nitro/autosizeinput/Func_void_std__string.kt +++ /dev/null @@ -1,80 +0,0 @@ -/// -/// Func_void_std__string.kt -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -package com.margelo.nitro.autosizeinput - -import androidx.annotation.Keep -import com.facebook.jni.HybridData -import com.facebook.proguard.annotations.DoNotStrip -import dalvik.annotation.optimization.FastNative - - -/** - * Represents the JavaScript callback `(text: string) => void`. - * This can be either implemented in C++ (in which case it might be a callback coming from JS), - * or in Kotlin/Java (in which case it is a native callback). - */ -@DoNotStrip -@Keep -@Suppress("ClassName", "RedundantUnitReturnType") -fun interface Func_void_std__string: (String) -> Unit { - /** - * Call the given JS callback. - * @throws Throwable if the JS function itself throws an error, or if the JS function/runtime has already been deleted. - */ - @DoNotStrip - @Keep - override fun invoke(text: String): Unit -} - -/** - * Represents the JavaScript callback `(text: string) => void`. - * This is implemented in C++, via a `std::function<...>`. - * The callback might be coming from JS. - */ -@DoNotStrip -@Keep -@Suppress( - "KotlinJniMissingFunction", "unused", - "RedundantSuppression", "RedundantUnitReturnType", "FunctionName", - "ConvertSecondaryConstructorToPrimary", "ClassName", "LocalVariableName", -) -class Func_void_std__string_cxx: Func_void_std__string { - @DoNotStrip - @Keep - private val mHybridData: HybridData - - @DoNotStrip - @Keep - private constructor(hybridData: HybridData) { - mHybridData = hybridData - } - - @DoNotStrip - @Keep - override fun invoke(text: String): Unit - = invoke_cxx(text) - - @FastNative - private external fun invoke_cxx(text: String): Unit -} - -/** - * Represents the JavaScript callback `(text: string) => void`. - * This is implemented in Java/Kotlin, via a `(String) -> Unit`. - * The callback is always coming from native. - */ -@DoNotStrip -@Keep -@Suppress("ClassName", "RedundantUnitReturnType", "unused") -class Func_void_std__string_java(private val function: (String) -> Unit): Func_void_std__string { - @DoNotStrip - @Keep - override fun invoke(text: String): Unit { - return this.function(text) - } -} diff --git a/native-views/react-native-auto-size-input/nitrogen/generated/android/kotlin/com/margelo/nitro/autosizeinput/HybridAutoSizeInputSpec.kt b/native-views/react-native-auto-size-input/nitrogen/generated/android/kotlin/com/margelo/nitro/autosizeinput/HybridAutoSizeInputSpec.kt deleted file mode 100644 index 43fd795..0000000 --- a/native-views/react-native-auto-size-input/nitrogen/generated/android/kotlin/com/margelo/nitro/autosizeinput/HybridAutoSizeInputSpec.kt +++ /dev/null @@ -1,263 +0,0 @@ -/// -/// HybridAutoSizeInputSpec.kt -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -package com.margelo.nitro.autosizeinput - -import androidx.annotation.Keep -import com.facebook.jni.HybridData -import com.facebook.proguard.annotations.DoNotStrip -import com.margelo.nitro.views.HybridView - -/** - * A Kotlin class representing the AutoSizeInput HybridObject. - * Implement this abstract class to create Kotlin-based instances of AutoSizeInput. - */ -@DoNotStrip -@Keep -@Suppress( - "KotlinJniMissingFunction", "unused", - "RedundantSuppression", "RedundantUnitReturnType", "SimpleRedundantLet", - "LocalVariableName", "PropertyName", "PrivatePropertyName", "FunctionName" -) -abstract class HybridAutoSizeInputSpec: HybridView() { - @DoNotStrip - private var mHybridData: HybridData = initHybrid() - - init { - super.updateNative(mHybridData) - } - - override fun updateNative(hybridData: HybridData) { - mHybridData = hybridData - super.updateNative(hybridData) - } - - // Default implementation of `HybridObject.toString()` - override fun toString(): String { - return "[HybridObject AutoSizeInput]" - } - - // Properties - @get:DoNotStrip - @get:Keep - @set:DoNotStrip - @set:Keep - abstract var text: String? - - @get:DoNotStrip - @get:Keep - @set:DoNotStrip - @set:Keep - abstract var prefix: String? - - @get:DoNotStrip - @get:Keep - @set:DoNotStrip - @set:Keep - abstract var suffix: String? - - @get:DoNotStrip - @get:Keep - @set:DoNotStrip - @set:Keep - abstract var placeholder: String? - - @get:DoNotStrip - @get:Keep - @set:DoNotStrip - @set:Keep - abstract var fontSize: Double? - - @get:DoNotStrip - @get:Keep - @set:DoNotStrip - @set:Keep - abstract var minFontSize: Double? - - @get:DoNotStrip - @get:Keep - @set:DoNotStrip - @set:Keep - abstract var multiline: Boolean? - - @get:DoNotStrip - @get:Keep - @set:DoNotStrip - @set:Keep - abstract var maxNumberOfLines: Double? - - @get:DoNotStrip - @get:Keep - @set:DoNotStrip - @set:Keep - abstract var textColor: String? - - @get:DoNotStrip - @get:Keep - @set:DoNotStrip - @set:Keep - abstract var prefixColor: String? - - @get:DoNotStrip - @get:Keep - @set:DoNotStrip - @set:Keep - abstract var suffixColor: String? - - @get:DoNotStrip - @get:Keep - @set:DoNotStrip - @set:Keep - abstract var placeholderColor: String? - - @get:DoNotStrip - @get:Keep - @set:DoNotStrip - @set:Keep - abstract var textAlign: String? - - @get:DoNotStrip - @get:Keep - @set:DoNotStrip - @set:Keep - abstract var fontFamily: String? - - @get:DoNotStrip - @get:Keep - @set:DoNotStrip - @set:Keep - abstract var fontWeight: String? - - @get:DoNotStrip - @get:Keep - @set:DoNotStrip - @set:Keep - abstract var editable: Boolean? - - @get:DoNotStrip - @get:Keep - @set:DoNotStrip - @set:Keep - abstract var keyboardType: String? - - @get:DoNotStrip - @get:Keep - @set:DoNotStrip - @set:Keep - abstract var returnKeyType: String? - - @get:DoNotStrip - @get:Keep - @set:DoNotStrip - @set:Keep - abstract var autoCorrect: Boolean? - - @get:DoNotStrip - @get:Keep - @set:DoNotStrip - @set:Keep - abstract var autoCapitalize: String? - - @get:DoNotStrip - @get:Keep - @set:DoNotStrip - @set:Keep - abstract var selectionColor: String? - - @get:DoNotStrip - @get:Keep - @set:DoNotStrip - @set:Keep - abstract var prefixMarginRight: Double? - - @get:DoNotStrip - @get:Keep - @set:DoNotStrip - @set:Keep - abstract var suffixMarginLeft: Double? - - @get:DoNotStrip - @get:Keep - @set:DoNotStrip - @set:Keep - abstract var showBorder: Boolean? - - @get:DoNotStrip - @get:Keep - @set:DoNotStrip - @set:Keep - abstract var inputBackgroundColor: String? - - @get:DoNotStrip - @get:Keep - @set:DoNotStrip - @set:Keep - abstract var contentAutoWidth: Boolean? - - @get:DoNotStrip - @get:Keep - @set:DoNotStrip - @set:Keep - abstract var contentCentered: Boolean? - - abstract var onChangeText: ((text: String) -> Unit)? - - private var onChangeText_cxx: Func_void_std__string? - @Keep - @DoNotStrip - get() { - return onChangeText?.let { Func_void_std__string_java(it) } - } - @Keep - @DoNotStrip - set(value) { - onChangeText = value?.let { it } - } - - abstract var onFocus: (() -> Unit)? - - private var onFocus_cxx: Func_void? - @Keep - @DoNotStrip - get() { - return onFocus?.let { Func_void_java(it) } - } - @Keep - @DoNotStrip - set(value) { - onFocus = value?.let { it } - } - - abstract var onBlur: (() -> Unit)? - - private var onBlur_cxx: Func_void? - @Keep - @DoNotStrip - get() { - return onBlur?.let { Func_void_java(it) } - } - @Keep - @DoNotStrip - set(value) { - onBlur = value?.let { it } - } - - // Methods - @DoNotStrip - @Keep - abstract fun focus(): Unit - - @DoNotStrip - @Keep - abstract fun blur(): Unit - - private external fun initHybrid(): HybridData - - companion object { - protected const val TAG = "HybridAutoSizeInputSpec" - } -} diff --git a/native-views/react-native-auto-size-input/nitrogen/generated/android/kotlin/com/margelo/nitro/autosizeinput/autosizeinputOnLoad.kt b/native-views/react-native-auto-size-input/nitrogen/generated/android/kotlin/com/margelo/nitro/autosizeinput/autosizeinputOnLoad.kt deleted file mode 100644 index 87ee5cf..0000000 --- a/native-views/react-native-auto-size-input/nitrogen/generated/android/kotlin/com/margelo/nitro/autosizeinput/autosizeinputOnLoad.kt +++ /dev/null @@ -1,35 +0,0 @@ -/// -/// autosizeinputOnLoad.kt -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -package com.margelo.nitro.autosizeinput - -import android.util.Log - -internal class autosizeinputOnLoad { - companion object { - private const val TAG = "autosizeinputOnLoad" - private var didLoad = false - /** - * Initializes the native part of "autosizeinput". - * This method is idempotent and can be called more than once. - */ - @JvmStatic - fun initializeNative() { - if (didLoad) return - try { - Log.i(TAG, "Loading autosizeinput C++ library...") - System.loadLibrary("autosizeinput") - Log.i(TAG, "Successfully loaded autosizeinput C++ library!") - didLoad = true - } catch (e: Error) { - Log.e(TAG, "Failed to load autosizeinput C++ library! Is it properly installed and linked? " + - "Is the name correct? (see `CMakeLists.txt`, at `add_library(...)`)", e) - throw e - } - } - } -} diff --git a/native-views/react-native-auto-size-input/nitrogen/generated/android/kotlin/com/margelo/nitro/autosizeinput/views/HybridAutoSizeInputManager.kt b/native-views/react-native-auto-size-input/nitrogen/generated/android/kotlin/com/margelo/nitro/autosizeinput/views/HybridAutoSizeInputManager.kt deleted file mode 100644 index 1965392..0000000 --- a/native-views/react-native-auto-size-input/nitrogen/generated/android/kotlin/com/margelo/nitro/autosizeinput/views/HybridAutoSizeInputManager.kt +++ /dev/null @@ -1,50 +0,0 @@ -/// -/// HybridAutoSizeInputManager.kt -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -package com.margelo.nitro.autosizeinput.views - -import android.view.View -import com.facebook.react.uimanager.ReactStylesDiffMap -import com.facebook.react.uimanager.SimpleViewManager -import com.facebook.react.uimanager.StateWrapper -import com.facebook.react.uimanager.ThemedReactContext -import com.margelo.nitro.autosizeinput.* - -/** - * Represents the React Native `ViewManager` for the "AutoSizeInput" Nitro HybridView. - */ -open class HybridAutoSizeInputManager: SimpleViewManager() { - private val views = hashMapOf() - - override fun getName(): String { - return "AutoSizeInput" - } - - override fun createViewInstance(reactContext: ThemedReactContext): View { - val hybridView = HybridAutoSizeInput(reactContext) - val view = hybridView.view - views[view] = hybridView - return view - } - - override fun onDropViewInstance(view: View) { - super.onDropViewInstance(view) - views.remove(view) - } - - override fun updateState(view: View, props: ReactStylesDiffMap, stateWrapper: StateWrapper): Any? { - val hybridView = views[view] ?: throw Error("Couldn't find view $view in local views table!") - - // 1. Update each prop individually - hybridView.beforeUpdate() - HybridAutoSizeInputStateUpdater.updateViewProps(hybridView, stateWrapper) - hybridView.afterUpdate() - - // 2. Continue in base View props - return super.updateState(view, props, stateWrapper) - } -} diff --git a/native-views/react-native-auto-size-input/nitrogen/generated/android/kotlin/com/margelo/nitro/autosizeinput/views/HybridAutoSizeInputStateUpdater.kt b/native-views/react-native-auto-size-input/nitrogen/generated/android/kotlin/com/margelo/nitro/autosizeinput/views/HybridAutoSizeInputStateUpdater.kt deleted file mode 100644 index c4a85ac..0000000 --- a/native-views/react-native-auto-size-input/nitrogen/generated/android/kotlin/com/margelo/nitro/autosizeinput/views/HybridAutoSizeInputStateUpdater.kt +++ /dev/null @@ -1,23 +0,0 @@ -/// -/// HybridAutoSizeInputStateUpdater.kt -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -package com.margelo.nitro.autosizeinput.views - -import com.facebook.react.uimanager.StateWrapper -import com.margelo.nitro.autosizeinput.* - -internal class HybridAutoSizeInputStateUpdater { - companion object { - /** - * Updates the props for [view] through C++. - * The [state] prop is expected to contain [view]'s props as wrapped Fabric state. - */ - @Suppress("KotlinJniMissingFunction") - @JvmStatic - external fun updateViewProps(view: HybridAutoSizeInputSpec, state: StateWrapper) - } -} diff --git a/native-views/react-native-auto-size-input/nitrogen/generated/ios/AutoSizeInput+autolinking.rb b/native-views/react-native-auto-size-input/nitrogen/generated/ios/AutoSizeInput+autolinking.rb deleted file mode 100644 index 7bfdbe4..0000000 --- a/native-views/react-native-auto-size-input/nitrogen/generated/ios/AutoSizeInput+autolinking.rb +++ /dev/null @@ -1,60 +0,0 @@ -# -# AutoSizeInput+autolinking.rb -# This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -# https://github.com/mrousavy/nitro -# Copyright © 2026 Marc Rousavy @ Margelo -# - -# This is a Ruby script that adds all files generated by Nitrogen -# to the given podspec. -# -# To use it, add this to your .podspec: -# ```ruby -# Pod::Spec.new do |spec| -# # ... -# -# # Add all files generated by Nitrogen -# load 'nitrogen/generated/ios/AutoSizeInput+autolinking.rb' -# add_nitrogen_files(spec) -# end -# ``` - -def add_nitrogen_files(spec) - Pod::UI.puts "[NitroModules] 🔥 AutoSizeInput is boosted by nitro!" - - spec.dependency "NitroModules" - - current_source_files = Array(spec.attributes_hash['source_files']) - spec.source_files = current_source_files + [ - # Generated cross-platform specs - "nitrogen/generated/shared/**/*.{h,hpp,c,cpp,swift}", - # Generated bridges for the cross-platform specs - "nitrogen/generated/ios/**/*.{h,hpp,c,cpp,mm,swift}", - ] - - current_public_header_files = Array(spec.attributes_hash['public_header_files']) - spec.public_header_files = current_public_header_files + [ - # Generated specs - "nitrogen/generated/shared/**/*.{h,hpp}", - # Swift to C++ bridging helpers - "nitrogen/generated/ios/AutoSizeInput-Swift-Cxx-Bridge.hpp" - ] - - current_private_header_files = Array(spec.attributes_hash['private_header_files']) - spec.private_header_files = current_private_header_files + [ - # iOS specific specs - "nitrogen/generated/ios/c++/**/*.{h,hpp}", - # Views are framework-specific and should be private - "nitrogen/generated/shared/**/views/**/*" - ] - - current_pod_target_xcconfig = spec.attributes_hash['pod_target_xcconfig'] || {} - spec.pod_target_xcconfig = current_pod_target_xcconfig.merge({ - # Use C++ 20 - "CLANG_CXX_LANGUAGE_STANDARD" => "c++20", - # Enables C++ <-> Swift interop (by default it's only C) - "SWIFT_OBJC_INTEROP_MODE" => "objcxx", - # Enables stricter modular headers - "DEFINES_MODULE" => "YES", - }) -end diff --git a/native-views/react-native-auto-size-input/nitrogen/generated/ios/AutoSizeInput-Swift-Cxx-Bridge.cpp b/native-views/react-native-auto-size-input/nitrogen/generated/ios/AutoSizeInput-Swift-Cxx-Bridge.cpp deleted file mode 100644 index cea6787..0000000 --- a/native-views/react-native-auto-size-input/nitrogen/generated/ios/AutoSizeInput-Swift-Cxx-Bridge.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/// -/// AutoSizeInput-Swift-Cxx-Bridge.cpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#include "AutoSizeInput-Swift-Cxx-Bridge.hpp" - -// Include C++ implementation defined types -#include "AutoSizeInput-Swift-Cxx-Umbrella.hpp" -#include "HybridAutoSizeInputSpecSwift.hpp" -#include - -namespace margelo::nitro::autosizeinput::bridge::swift { - - // pragma MARK: std::function - Func_void_std__string create_Func_void_std__string(void* NON_NULL swiftClosureWrapper) noexcept { - auto swiftClosure = AutoSizeInput::Func_void_std__string::fromUnsafe(swiftClosureWrapper); - return [swiftClosure = std::move(swiftClosure)](const std::string& text) mutable -> void { - swiftClosure.call(text); - }; - } - - // pragma MARK: std::function - Func_void create_Func_void(void* NON_NULL swiftClosureWrapper) noexcept { - auto swiftClosure = AutoSizeInput::Func_void::fromUnsafe(swiftClosureWrapper); - return [swiftClosure = std::move(swiftClosure)]() mutable -> void { - swiftClosure.call(); - }; - } - - // pragma MARK: std::shared_ptr - std::shared_ptr create_std__shared_ptr_HybridAutoSizeInputSpec_(void* NON_NULL swiftUnsafePointer) noexcept { - AutoSizeInput::HybridAutoSizeInputSpec_cxx swiftPart = AutoSizeInput::HybridAutoSizeInputSpec_cxx::fromUnsafe(swiftUnsafePointer); - return std::make_shared(swiftPart); - } - void* NON_NULL get_std__shared_ptr_HybridAutoSizeInputSpec_(std__shared_ptr_HybridAutoSizeInputSpec_ cppType) { - std::shared_ptr swiftWrapper = std::dynamic_pointer_cast(cppType); - #ifdef NITRO_DEBUG - if (swiftWrapper == nullptr) [[unlikely]] { - throw std::runtime_error("Class \"HybridAutoSizeInputSpec\" is not implemented in Swift!"); - } - #endif - AutoSizeInput::HybridAutoSizeInputSpec_cxx& swiftPart = swiftWrapper->getSwiftPart(); - return swiftPart.toUnsafe(); - } - -} // namespace margelo::nitro::autosizeinput::bridge::swift diff --git a/native-views/react-native-auto-size-input/nitrogen/generated/ios/AutoSizeInput-Swift-Cxx-Bridge.hpp b/native-views/react-native-auto-size-input/nitrogen/generated/ios/AutoSizeInput-Swift-Cxx-Bridge.hpp deleted file mode 100644 index bd4953e..0000000 --- a/native-views/react-native-auto-size-input/nitrogen/generated/ios/AutoSizeInput-Swift-Cxx-Bridge.hpp +++ /dev/null @@ -1,173 +0,0 @@ -/// -/// AutoSizeInput-Swift-Cxx-Bridge.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -// Forward declarations of C++ defined types -// Forward declaration of `HybridAutoSizeInputSpec` to properly resolve imports. -namespace margelo::nitro::autosizeinput { class HybridAutoSizeInputSpec; } - -// Forward declarations of Swift defined types -// Forward declaration of `HybridAutoSizeInputSpec_cxx` to properly resolve imports. -namespace AutoSizeInput { class HybridAutoSizeInputSpec_cxx; } - -// Include C++ defined types -#include "HybridAutoSizeInputSpec.hpp" -#include -#include -#include -#include -#include -#include - -/** - * Contains specialized versions of C++ templated types so they can be accessed from Swift, - * as well as helper functions to interact with those C++ types from Swift. - */ -namespace margelo::nitro::autosizeinput::bridge::swift { - - // pragma MARK: std::optional - /** - * Specialized version of `std::optional`. - */ - using std__optional_std__string_ = std::optional; - inline std::optional create_std__optional_std__string_(const std::string& value) noexcept { - return std::optional(value); - } - inline bool has_value_std__optional_std__string_(const std::optional& optional) noexcept { - return optional.has_value(); - } - inline std::string get_std__optional_std__string_(const std::optional& optional) noexcept { - return *optional; - } - - // pragma MARK: std::optional - /** - * Specialized version of `std::optional`. - */ - using std__optional_double_ = std::optional; - inline std::optional create_std__optional_double_(const double& value) noexcept { - return std::optional(value); - } - inline bool has_value_std__optional_double_(const std::optional& optional) noexcept { - return optional.has_value(); - } - inline double get_std__optional_double_(const std::optional& optional) noexcept { - return *optional; - } - - // pragma MARK: std::optional - /** - * Specialized version of `std::optional`. - */ - using std__optional_bool_ = std::optional; - inline std::optional create_std__optional_bool_(const bool& value) noexcept { - return std::optional(value); - } - inline bool has_value_std__optional_bool_(const std::optional& optional) noexcept { - return optional.has_value(); - } - inline bool get_std__optional_bool_(const std::optional& optional) noexcept { - return *optional; - } - - // pragma MARK: std::function - /** - * Specialized version of `std::function`. - */ - using Func_void_std__string = std::function; - /** - * Wrapper class for a `std::function`, this can be used from Swift. - */ - class Func_void_std__string_Wrapper final { - public: - explicit Func_void_std__string_Wrapper(std::function&& func): _function(std::make_unique>(std::move(func))) {} - inline void call(std::string text) const noexcept { - _function->operator()(text); - } - private: - std::unique_ptr> _function; - } SWIFT_NONCOPYABLE; - Func_void_std__string create_Func_void_std__string(void* NON_NULL swiftClosureWrapper) noexcept; - inline Func_void_std__string_Wrapper wrap_Func_void_std__string(Func_void_std__string value) noexcept { - return Func_void_std__string_Wrapper(std::move(value)); - } - - // pragma MARK: std::optional> - /** - * Specialized version of `std::optional>`. - */ - using std__optional_std__function_void_const_std__string_____text______ = std::optional>; - inline std::optional> create_std__optional_std__function_void_const_std__string_____text______(const std::function& value) noexcept { - return std::optional>(value); - } - inline bool has_value_std__optional_std__function_void_const_std__string_____text______(const std::optional>& optional) noexcept { - return optional.has_value(); - } - inline std::function get_std__optional_std__function_void_const_std__string_____text______(const std::optional>& optional) noexcept { - return *optional; - } - - // pragma MARK: std::function - /** - * Specialized version of `std::function`. - */ - using Func_void = std::function; - /** - * Wrapper class for a `std::function`, this can be used from Swift. - */ - class Func_void_Wrapper final { - public: - explicit Func_void_Wrapper(std::function&& func): _function(std::make_unique>(std::move(func))) {} - inline void call() const noexcept { - _function->operator()(); - } - private: - std::unique_ptr> _function; - } SWIFT_NONCOPYABLE; - Func_void create_Func_void(void* NON_NULL swiftClosureWrapper) noexcept; - inline Func_void_Wrapper wrap_Func_void(Func_void value) noexcept { - return Func_void_Wrapper(std::move(value)); - } - - // pragma MARK: std::optional> - /** - * Specialized version of `std::optional>`. - */ - using std__optional_std__function_void____ = std::optional>; - inline std::optional> create_std__optional_std__function_void____(const std::function& value) noexcept { - return std::optional>(value); - } - inline bool has_value_std__optional_std__function_void____(const std::optional>& optional) noexcept { - return optional.has_value(); - } - inline std::function get_std__optional_std__function_void____(const std::optional>& optional) noexcept { - return *optional; - } - - // pragma MARK: std::shared_ptr - /** - * Specialized version of `std::shared_ptr`. - */ - using std__shared_ptr_HybridAutoSizeInputSpec_ = std::shared_ptr; - std::shared_ptr create_std__shared_ptr_HybridAutoSizeInputSpec_(void* NON_NULL swiftUnsafePointer) noexcept; - void* NON_NULL get_std__shared_ptr_HybridAutoSizeInputSpec_(std__shared_ptr_HybridAutoSizeInputSpec_ cppType); - - // pragma MARK: std::weak_ptr - using std__weak_ptr_HybridAutoSizeInputSpec_ = std::weak_ptr; - inline std__weak_ptr_HybridAutoSizeInputSpec_ weakify_std__shared_ptr_HybridAutoSizeInputSpec_(const std::shared_ptr& strong) noexcept { return strong; } - - // pragma MARK: Result - using Result_void_ = Result; - inline Result_void_ create_Result_void_() noexcept { - return Result::withValue(); - } - inline Result_void_ create_Result_void_(const std::exception_ptr& error) noexcept { - return Result::withError(error); - } - -} // namespace margelo::nitro::autosizeinput::bridge::swift diff --git a/native-views/react-native-auto-size-input/nitrogen/generated/ios/AutoSizeInput-Swift-Cxx-Umbrella.hpp b/native-views/react-native-auto-size-input/nitrogen/generated/ios/AutoSizeInput-Swift-Cxx-Umbrella.hpp deleted file mode 100644 index ff0197e..0000000 --- a/native-views/react-native-auto-size-input/nitrogen/generated/ios/AutoSizeInput-Swift-Cxx-Umbrella.hpp +++ /dev/null @@ -1,46 +0,0 @@ -/// -/// AutoSizeInput-Swift-Cxx-Umbrella.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -// Forward declarations of C++ defined types -// Forward declaration of `HybridAutoSizeInputSpec` to properly resolve imports. -namespace margelo::nitro::autosizeinput { class HybridAutoSizeInputSpec; } - -// Include C++ defined types -#include "HybridAutoSizeInputSpec.hpp" -#include -#include -#include -#include -#include -#include - -// C++ helpers for Swift -#include "AutoSizeInput-Swift-Cxx-Bridge.hpp" - -// Common C++ types used in Swift -#include -#include -#include -#include - -// Forward declarations of Swift defined types -// Forward declaration of `HybridAutoSizeInputSpec_cxx` to properly resolve imports. -namespace AutoSizeInput { class HybridAutoSizeInputSpec_cxx; } - -// Include Swift defined types -#if __has_include("AutoSizeInput-Swift.h") -// This header is generated by Xcode/Swift on every app build. -// If it cannot be found, make sure the Swift module's name (= podspec name) is actually "AutoSizeInput". -#include "AutoSizeInput-Swift.h" -// Same as above, but used when building with frameworks (`use_frameworks`) -#elif __has_include() -#include -#else -#error AutoSizeInput's autogenerated Swift header cannot be found! Make sure the Swift module's name (= podspec name) is actually "AutoSizeInput", and try building the app first. -#endif diff --git a/native-views/react-native-auto-size-input/nitrogen/generated/ios/AutoSizeInputAutolinking.mm b/native-views/react-native-auto-size-input/nitrogen/generated/ios/AutoSizeInputAutolinking.mm deleted file mode 100644 index 0aacd9b..0000000 --- a/native-views/react-native-auto-size-input/nitrogen/generated/ios/AutoSizeInputAutolinking.mm +++ /dev/null @@ -1,33 +0,0 @@ -/// -/// AutoSizeInputAutolinking.mm -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#import -#import -#import "AutoSizeInput-Swift-Cxx-Umbrella.hpp" -#import - -#include "HybridAutoSizeInputSpecSwift.hpp" - -@interface AutoSizeInputAutolinking : NSObject -@end - -@implementation AutoSizeInputAutolinking - -+ (void) load { - using namespace margelo::nitro; - using namespace margelo::nitro::autosizeinput; - - HybridObjectRegistry::registerHybridObjectConstructor( - "AutoSizeInput", - []() -> std::shared_ptr { - std::shared_ptr hybridObject = AutoSizeInput::AutoSizeInputAutolinking::createAutoSizeInput(); - return hybridObject; - } - ); -} - -@end diff --git a/native-views/react-native-auto-size-input/nitrogen/generated/ios/AutoSizeInputAutolinking.swift b/native-views/react-native-auto-size-input/nitrogen/generated/ios/AutoSizeInputAutolinking.swift deleted file mode 100644 index ff6bcff..0000000 --- a/native-views/react-native-auto-size-input/nitrogen/generated/ios/AutoSizeInputAutolinking.swift +++ /dev/null @@ -1,25 +0,0 @@ -/// -/// AutoSizeInputAutolinking.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -public final class AutoSizeInputAutolinking { - public typealias bridge = margelo.nitro.autosizeinput.bridge.swift - - /** - * Creates an instance of a Swift class that implements `HybridAutoSizeInputSpec`, - * and wraps it in a Swift class that can directly interop with C++ (`HybridAutoSizeInputSpec_cxx`) - * - * This is generated by Nitrogen and will initialize the class specified - * in the `"autolinking"` property of `nitro.json` (in this case, `HybridAutoSizeInput`). - */ - public static func createAutoSizeInput() -> bridge.std__shared_ptr_HybridAutoSizeInputSpec_ { - let hybridObject = HybridAutoSizeInput() - return { () -> bridge.std__shared_ptr_HybridAutoSizeInputSpec_ in - let __cxxWrapped = hybridObject.getCxxWrapper() - return __cxxWrapped.getCxxPart() - }() - } -} diff --git a/native-views/react-native-auto-size-input/nitrogen/generated/ios/c++/HybridAutoSizeInputSpecSwift.cpp b/native-views/react-native-auto-size-input/nitrogen/generated/ios/c++/HybridAutoSizeInputSpecSwift.cpp deleted file mode 100644 index ac5d173..0000000 --- a/native-views/react-native-auto-size-input/nitrogen/generated/ios/c++/HybridAutoSizeInputSpecSwift.cpp +++ /dev/null @@ -1,11 +0,0 @@ -/// -/// HybridAutoSizeInputSpecSwift.cpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#include "HybridAutoSizeInputSpecSwift.hpp" - -namespace margelo::nitro::autosizeinput { -} // namespace margelo::nitro::autosizeinput diff --git a/native-views/react-native-auto-size-input/nitrogen/generated/ios/c++/HybridAutoSizeInputSpecSwift.hpp b/native-views/react-native-auto-size-input/nitrogen/generated/ios/c++/HybridAutoSizeInputSpecSwift.hpp deleted file mode 100644 index 11cd396..0000000 --- a/native-views/react-native-auto-size-input/nitrogen/generated/ios/c++/HybridAutoSizeInputSpecSwift.hpp +++ /dev/null @@ -1,291 +0,0 @@ -/// -/// HybridAutoSizeInputSpecSwift.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#include "HybridAutoSizeInputSpec.hpp" - -// Forward declaration of `HybridAutoSizeInputSpec_cxx` to properly resolve imports. -namespace AutoSizeInput { class HybridAutoSizeInputSpec_cxx; } - - - -#include -#include -#include - -#include "AutoSizeInput-Swift-Cxx-Umbrella.hpp" - -namespace margelo::nitro::autosizeinput { - - /** - * The C++ part of HybridAutoSizeInputSpec_cxx.swift. - * - * HybridAutoSizeInputSpecSwift (C++) accesses HybridAutoSizeInputSpec_cxx (Swift), and might - * contain some additional bridging code for C++ <> Swift interop. - * - * Since this obviously introduces an overhead, I hope at some point in - * the future, HybridAutoSizeInputSpec_cxx can directly inherit from the C++ class HybridAutoSizeInputSpec - * to simplify the whole structure and memory management. - */ - class HybridAutoSizeInputSpecSwift: public virtual HybridAutoSizeInputSpec { - public: - // Constructor from a Swift instance - explicit HybridAutoSizeInputSpecSwift(const AutoSizeInput::HybridAutoSizeInputSpec_cxx& swiftPart): - HybridObject(HybridAutoSizeInputSpec::TAG), - _swiftPart(swiftPart) { } - - public: - // Get the Swift part - inline AutoSizeInput::HybridAutoSizeInputSpec_cxx& getSwiftPart() noexcept { - return _swiftPart; - } - - public: - inline size_t getExternalMemorySize() noexcept override { - return _swiftPart.getMemorySize(); - } - void dispose() noexcept override { - _swiftPart.dispose(); - } - std::string toString() override { - return _swiftPart.toString(); - } - - public: - // Properties - inline std::optional getText() noexcept override { - auto __result = _swiftPart.getText(); - return __result; - } - inline void setText(const std::optional& text) noexcept override { - _swiftPart.setText(text); - } - inline std::optional getPrefix() noexcept override { - auto __result = _swiftPart.getPrefix(); - return __result; - } - inline void setPrefix(const std::optional& prefix) noexcept override { - _swiftPart.setPrefix(prefix); - } - inline std::optional getSuffix() noexcept override { - auto __result = _swiftPart.getSuffix(); - return __result; - } - inline void setSuffix(const std::optional& suffix) noexcept override { - _swiftPart.setSuffix(suffix); - } - inline std::optional getPlaceholder() noexcept override { - auto __result = _swiftPart.getPlaceholder(); - return __result; - } - inline void setPlaceholder(const std::optional& placeholder) noexcept override { - _swiftPart.setPlaceholder(placeholder); - } - inline std::optional getFontSize() noexcept override { - auto __result = _swiftPart.getFontSize(); - return __result; - } - inline void setFontSize(std::optional fontSize) noexcept override { - _swiftPart.setFontSize(fontSize); - } - inline std::optional getMinFontSize() noexcept override { - auto __result = _swiftPart.getMinFontSize(); - return __result; - } - inline void setMinFontSize(std::optional minFontSize) noexcept override { - _swiftPart.setMinFontSize(minFontSize); - } - inline std::optional getMultiline() noexcept override { - auto __result = _swiftPart.getMultiline(); - return __result; - } - inline void setMultiline(std::optional multiline) noexcept override { - _swiftPart.setMultiline(multiline); - } - inline std::optional getMaxNumberOfLines() noexcept override { - auto __result = _swiftPart.getMaxNumberOfLines(); - return __result; - } - inline void setMaxNumberOfLines(std::optional maxNumberOfLines) noexcept override { - _swiftPart.setMaxNumberOfLines(maxNumberOfLines); - } - inline std::optional getTextColor() noexcept override { - auto __result = _swiftPart.getTextColor(); - return __result; - } - inline void setTextColor(const std::optional& textColor) noexcept override { - _swiftPart.setTextColor(textColor); - } - inline std::optional getPrefixColor() noexcept override { - auto __result = _swiftPart.getPrefixColor(); - return __result; - } - inline void setPrefixColor(const std::optional& prefixColor) noexcept override { - _swiftPart.setPrefixColor(prefixColor); - } - inline std::optional getSuffixColor() noexcept override { - auto __result = _swiftPart.getSuffixColor(); - return __result; - } - inline void setSuffixColor(const std::optional& suffixColor) noexcept override { - _swiftPart.setSuffixColor(suffixColor); - } - inline std::optional getPlaceholderColor() noexcept override { - auto __result = _swiftPart.getPlaceholderColor(); - return __result; - } - inline void setPlaceholderColor(const std::optional& placeholderColor) noexcept override { - _swiftPart.setPlaceholderColor(placeholderColor); - } - inline std::optional getTextAlign() noexcept override { - auto __result = _swiftPart.getTextAlign(); - return __result; - } - inline void setTextAlign(const std::optional& textAlign) noexcept override { - _swiftPart.setTextAlign(textAlign); - } - inline std::optional getFontFamily() noexcept override { - auto __result = _swiftPart.getFontFamily(); - return __result; - } - inline void setFontFamily(const std::optional& fontFamily) noexcept override { - _swiftPart.setFontFamily(fontFamily); - } - inline std::optional getFontWeight() noexcept override { - auto __result = _swiftPart.getFontWeight(); - return __result; - } - inline void setFontWeight(const std::optional& fontWeight) noexcept override { - _swiftPart.setFontWeight(fontWeight); - } - inline std::optional getEditable() noexcept override { - auto __result = _swiftPart.getEditable(); - return __result; - } - inline void setEditable(std::optional editable) noexcept override { - _swiftPart.setEditable(editable); - } - inline std::optional getKeyboardType() noexcept override { - auto __result = _swiftPart.getKeyboardType(); - return __result; - } - inline void setKeyboardType(const std::optional& keyboardType) noexcept override { - _swiftPart.setKeyboardType(keyboardType); - } - inline std::optional getReturnKeyType() noexcept override { - auto __result = _swiftPart.getReturnKeyType(); - return __result; - } - inline void setReturnKeyType(const std::optional& returnKeyType) noexcept override { - _swiftPart.setReturnKeyType(returnKeyType); - } - inline std::optional getAutoCorrect() noexcept override { - auto __result = _swiftPart.getAutoCorrect(); - return __result; - } - inline void setAutoCorrect(std::optional autoCorrect) noexcept override { - _swiftPart.setAutoCorrect(autoCorrect); - } - inline std::optional getAutoCapitalize() noexcept override { - auto __result = _swiftPart.getAutoCapitalize(); - return __result; - } - inline void setAutoCapitalize(const std::optional& autoCapitalize) noexcept override { - _swiftPart.setAutoCapitalize(autoCapitalize); - } - inline std::optional getSelectionColor() noexcept override { - auto __result = _swiftPart.getSelectionColor(); - return __result; - } - inline void setSelectionColor(const std::optional& selectionColor) noexcept override { - _swiftPart.setSelectionColor(selectionColor); - } - inline std::optional getPrefixMarginRight() noexcept override { - auto __result = _swiftPart.getPrefixMarginRight(); - return __result; - } - inline void setPrefixMarginRight(std::optional prefixMarginRight) noexcept override { - _swiftPart.setPrefixMarginRight(prefixMarginRight); - } - inline std::optional getSuffixMarginLeft() noexcept override { - auto __result = _swiftPart.getSuffixMarginLeft(); - return __result; - } - inline void setSuffixMarginLeft(std::optional suffixMarginLeft) noexcept override { - _swiftPart.setSuffixMarginLeft(suffixMarginLeft); - } - inline std::optional getShowBorder() noexcept override { - auto __result = _swiftPart.getShowBorder(); - return __result; - } - inline void setShowBorder(std::optional showBorder) noexcept override { - _swiftPart.setShowBorder(showBorder); - } - inline std::optional getInputBackgroundColor() noexcept override { - auto __result = _swiftPart.getInputBackgroundColor(); - return __result; - } - inline void setInputBackgroundColor(const std::optional& inputBackgroundColor) noexcept override { - _swiftPart.setInputBackgroundColor(inputBackgroundColor); - } - inline std::optional getContentAutoWidth() noexcept override { - auto __result = _swiftPart.getContentAutoWidth(); - return __result; - } - inline void setContentAutoWidth(std::optional contentAutoWidth) noexcept override { - _swiftPart.setContentAutoWidth(contentAutoWidth); - } - inline std::optional getContentCentered() noexcept override { - auto __result = _swiftPart.getContentCentered(); - return __result; - } - inline void setContentCentered(std::optional contentCentered) noexcept override { - _swiftPart.setContentCentered(contentCentered); - } - inline std::optional> getOnChangeText() noexcept override { - auto __result = _swiftPart.getOnChangeText(); - return __result; - } - inline void setOnChangeText(const std::optional>& onChangeText) noexcept override { - _swiftPart.setOnChangeText(onChangeText); - } - inline std::optional> getOnFocus() noexcept override { - auto __result = _swiftPart.getOnFocus(); - return __result; - } - inline void setOnFocus(const std::optional>& onFocus) noexcept override { - _swiftPart.setOnFocus(onFocus); - } - inline std::optional> getOnBlur() noexcept override { - auto __result = _swiftPart.getOnBlur(); - return __result; - } - inline void setOnBlur(const std::optional>& onBlur) noexcept override { - _swiftPart.setOnBlur(onBlur); - } - - public: - // Methods - inline void focus() override { - auto __result = _swiftPart.focus(); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - } - inline void blur() override { - auto __result = _swiftPart.blur(); - if (__result.hasError()) [[unlikely]] { - std::rethrow_exception(__result.error()); - } - } - - private: - AutoSizeInput::HybridAutoSizeInputSpec_cxx _swiftPart; - }; - -} // namespace margelo::nitro::autosizeinput diff --git a/native-views/react-native-auto-size-input/nitrogen/generated/ios/c++/views/HybridAutoSizeInputComponent.mm b/native-views/react-native-auto-size-input/nitrogen/generated/ios/c++/views/HybridAutoSizeInputComponent.mm deleted file mode 100644 index f4d6bd6..0000000 --- a/native-views/react-native-auto-size-input/nitrogen/generated/ios/c++/views/HybridAutoSizeInputComponent.mm +++ /dev/null @@ -1,241 +0,0 @@ -/// -/// HybridAutoSizeInputComponent.mm -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#import "HybridAutoSizeInputComponent.hpp" -#import -#import -#import -#import -#import -#import -#import - -#import "HybridAutoSizeInputSpecSwift.hpp" -#import "AutoSizeInput-Swift-Cxx-Umbrella.hpp" - -using namespace facebook; -using namespace margelo::nitro::autosizeinput; -using namespace margelo::nitro::autosizeinput::views; - -/** - * Represents the React Native View holder for the Nitro "AutoSizeInput" HybridView. - */ -@interface HybridAutoSizeInputComponent: RCTViewComponentView -@end - -@implementation HybridAutoSizeInputComponent { - std::shared_ptr _hybridView; -} - -+ (void) load { - [super load]; - [RCTComponentViewFactory.currentComponentViewFactory registerComponentViewClass:[HybridAutoSizeInputComponent class]]; -} - -+ (react::ComponentDescriptorProvider) componentDescriptorProvider { - return react::concreteComponentDescriptorProvider(); -} - -- (instancetype) init { - if (self = [super init]) { - std::shared_ptr hybridView = AutoSizeInput::AutoSizeInputAutolinking::createAutoSizeInput(); - _hybridView = std::dynamic_pointer_cast(hybridView); - [self updateView]; - } - return self; -} - -- (void) updateView { - // 1. Get Swift part - AutoSizeInput::HybridAutoSizeInputSpec_cxx& swiftPart = _hybridView->getSwiftPart(); - - // 2. Get UIView* - void* viewUnsafe = swiftPart.getView(); - UIView* view = (__bridge_transfer UIView*) viewUnsafe; - - // 3. Update RCTViewComponentView's [contentView] - [self setContentView:view]; -} - -- (void) updateProps:(const std::shared_ptr&)props - oldProps:(const std::shared_ptr&)oldProps { - // 1. Downcast props - const auto& newViewPropsConst = *std::static_pointer_cast(props); - auto& newViewProps = const_cast(newViewPropsConst); - AutoSizeInput::HybridAutoSizeInputSpec_cxx& swiftPart = _hybridView->getSwiftPart(); - - // 2. Update each prop individually - swiftPart.beforeUpdate(); - - // text: optional - if (newViewProps.text.isDirty) { - swiftPart.setText(newViewProps.text.value); - newViewProps.text.isDirty = false; - } - // prefix: optional - if (newViewProps.prefix.isDirty) { - swiftPart.setPrefix(newViewProps.prefix.value); - newViewProps.prefix.isDirty = false; - } - // suffix: optional - if (newViewProps.suffix.isDirty) { - swiftPart.setSuffix(newViewProps.suffix.value); - newViewProps.suffix.isDirty = false; - } - // placeholder: optional - if (newViewProps.placeholder.isDirty) { - swiftPart.setPlaceholder(newViewProps.placeholder.value); - newViewProps.placeholder.isDirty = false; - } - // fontSize: optional - if (newViewProps.fontSize.isDirty) { - swiftPart.setFontSize(newViewProps.fontSize.value); - newViewProps.fontSize.isDirty = false; - } - // minFontSize: optional - if (newViewProps.minFontSize.isDirty) { - swiftPart.setMinFontSize(newViewProps.minFontSize.value); - newViewProps.minFontSize.isDirty = false; - } - // multiline: optional - if (newViewProps.multiline.isDirty) { - swiftPart.setMultiline(newViewProps.multiline.value); - newViewProps.multiline.isDirty = false; - } - // maxNumberOfLines: optional - if (newViewProps.maxNumberOfLines.isDirty) { - swiftPart.setMaxNumberOfLines(newViewProps.maxNumberOfLines.value); - newViewProps.maxNumberOfLines.isDirty = false; - } - // textColor: optional - if (newViewProps.textColor.isDirty) { - swiftPart.setTextColor(newViewProps.textColor.value); - newViewProps.textColor.isDirty = false; - } - // prefixColor: optional - if (newViewProps.prefixColor.isDirty) { - swiftPart.setPrefixColor(newViewProps.prefixColor.value); - newViewProps.prefixColor.isDirty = false; - } - // suffixColor: optional - if (newViewProps.suffixColor.isDirty) { - swiftPart.setSuffixColor(newViewProps.suffixColor.value); - newViewProps.suffixColor.isDirty = false; - } - // placeholderColor: optional - if (newViewProps.placeholderColor.isDirty) { - swiftPart.setPlaceholderColor(newViewProps.placeholderColor.value); - newViewProps.placeholderColor.isDirty = false; - } - // textAlign: optional - if (newViewProps.textAlign.isDirty) { - swiftPart.setTextAlign(newViewProps.textAlign.value); - newViewProps.textAlign.isDirty = false; - } - // fontFamily: optional - if (newViewProps.fontFamily.isDirty) { - swiftPart.setFontFamily(newViewProps.fontFamily.value); - newViewProps.fontFamily.isDirty = false; - } - // fontWeight: optional - if (newViewProps.fontWeight.isDirty) { - swiftPart.setFontWeight(newViewProps.fontWeight.value); - newViewProps.fontWeight.isDirty = false; - } - // editable: optional - if (newViewProps.editable.isDirty) { - swiftPart.setEditable(newViewProps.editable.value); - newViewProps.editable.isDirty = false; - } - // keyboardType: optional - if (newViewProps.keyboardType.isDirty) { - swiftPart.setKeyboardType(newViewProps.keyboardType.value); - newViewProps.keyboardType.isDirty = false; - } - // returnKeyType: optional - if (newViewProps.returnKeyType.isDirty) { - swiftPart.setReturnKeyType(newViewProps.returnKeyType.value); - newViewProps.returnKeyType.isDirty = false; - } - // autoCorrect: optional - if (newViewProps.autoCorrect.isDirty) { - swiftPart.setAutoCorrect(newViewProps.autoCorrect.value); - newViewProps.autoCorrect.isDirty = false; - } - // autoCapitalize: optional - if (newViewProps.autoCapitalize.isDirty) { - swiftPart.setAutoCapitalize(newViewProps.autoCapitalize.value); - newViewProps.autoCapitalize.isDirty = false; - } - // selectionColor: optional - if (newViewProps.selectionColor.isDirty) { - swiftPart.setSelectionColor(newViewProps.selectionColor.value); - newViewProps.selectionColor.isDirty = false; - } - // prefixMarginRight: optional - if (newViewProps.prefixMarginRight.isDirty) { - swiftPart.setPrefixMarginRight(newViewProps.prefixMarginRight.value); - newViewProps.prefixMarginRight.isDirty = false; - } - // suffixMarginLeft: optional - if (newViewProps.suffixMarginLeft.isDirty) { - swiftPart.setSuffixMarginLeft(newViewProps.suffixMarginLeft.value); - newViewProps.suffixMarginLeft.isDirty = false; - } - // showBorder: optional - if (newViewProps.showBorder.isDirty) { - swiftPart.setShowBorder(newViewProps.showBorder.value); - newViewProps.showBorder.isDirty = false; - } - // inputBackgroundColor: optional - if (newViewProps.inputBackgroundColor.isDirty) { - swiftPart.setInputBackgroundColor(newViewProps.inputBackgroundColor.value); - newViewProps.inputBackgroundColor.isDirty = false; - } - // contentAutoWidth: optional - if (newViewProps.contentAutoWidth.isDirty) { - swiftPart.setContentAutoWidth(newViewProps.contentAutoWidth.value); - newViewProps.contentAutoWidth.isDirty = false; - } - // contentCentered: optional - if (newViewProps.contentCentered.isDirty) { - swiftPart.setContentCentered(newViewProps.contentCentered.value); - newViewProps.contentCentered.isDirty = false; - } - // onChangeText: optional - if (newViewProps.onChangeText.isDirty) { - swiftPart.setOnChangeText(newViewProps.onChangeText.value); - newViewProps.onChangeText.isDirty = false; - } - // onFocus: optional - if (newViewProps.onFocus.isDirty) { - swiftPart.setOnFocus(newViewProps.onFocus.value); - newViewProps.onFocus.isDirty = false; - } - // onBlur: optional - if (newViewProps.onBlur.isDirty) { - swiftPart.setOnBlur(newViewProps.onBlur.value); - newViewProps.onBlur.isDirty = false; - } - - swiftPart.afterUpdate(); - - // 3. Update hybridRef if it changed - if (newViewProps.hybridRef.isDirty) { - // hybridRef changed - call it with new this - const auto& maybeFunc = newViewProps.hybridRef.value; - if (maybeFunc.has_value()) { - maybeFunc.value()(_hybridView); - } - newViewProps.hybridRef.isDirty = false; - } - - // 4. Continue in base class - [super updateProps:props oldProps:oldProps]; -} - -@end diff --git a/native-views/react-native-auto-size-input/nitrogen/generated/ios/swift/Func_void.swift b/native-views/react-native-auto-size-input/nitrogen/generated/ios/swift/Func_void.swift deleted file mode 100644 index cdaf0d6..0000000 --- a/native-views/react-native-auto-size-input/nitrogen/generated/ios/swift/Func_void.swift +++ /dev/null @@ -1,47 +0,0 @@ -/// -/// Func_void.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Wraps a Swift `() -> Void` as a class. - * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`. - */ -public final class Func_void { - public typealias bridge = margelo.nitro.autosizeinput.bridge.swift - - private let closure: () -> Void - - public init(_ closure: @escaping () -> Void) { - self.closure = closure - } - - @inline(__always) - public func call() -> Void { - self.closure() - } - - /** - * Casts this instance to a retained unsafe raw pointer. - * This acquires one additional strong reference on the object! - */ - @inline(__always) - public func toUnsafe() -> UnsafeMutableRawPointer { - return Unmanaged.passRetained(self).toOpaque() - } - - /** - * Casts an unsafe pointer to a `Func_void`. - * The pointer has to be a retained opaque `Unmanaged`. - * This removes one strong reference from the object! - */ - @inline(__always) - public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void { - return Unmanaged.fromOpaque(pointer).takeRetainedValue() - } -} diff --git a/native-views/react-native-auto-size-input/nitrogen/generated/ios/swift/Func_void_std__string.swift b/native-views/react-native-auto-size-input/nitrogen/generated/ios/swift/Func_void_std__string.swift deleted file mode 100644 index db78b9e..0000000 --- a/native-views/react-native-auto-size-input/nitrogen/generated/ios/swift/Func_void_std__string.swift +++ /dev/null @@ -1,47 +0,0 @@ -/// -/// Func_void_std__string.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * Wraps a Swift `(_ text: String) -> Void` as a class. - * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`. - */ -public final class Func_void_std__string { - public typealias bridge = margelo.nitro.autosizeinput.bridge.swift - - private let closure: (_ text: String) -> Void - - public init(_ closure: @escaping (_ text: String) -> Void) { - self.closure = closure - } - - @inline(__always) - public func call(text: std.string) -> Void { - self.closure(String(text)) - } - - /** - * Casts this instance to a retained unsafe raw pointer. - * This acquires one additional strong reference on the object! - */ - @inline(__always) - public func toUnsafe() -> UnsafeMutableRawPointer { - return Unmanaged.passRetained(self).toOpaque() - } - - /** - * Casts an unsafe pointer to a `Func_void_std__string`. - * The pointer has to be a retained opaque `Unmanaged`. - * This removes one strong reference from the object! - */ - @inline(__always) - public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_std__string { - return Unmanaged.fromOpaque(pointer).takeRetainedValue() - } -} diff --git a/native-views/react-native-auto-size-input/nitrogen/generated/ios/swift/HybridAutoSizeInputSpec.swift b/native-views/react-native-auto-size-input/nitrogen/generated/ios/swift/HybridAutoSizeInputSpec.swift deleted file mode 100644 index 43e1b8d..0000000 --- a/native-views/react-native-auto-size-input/nitrogen/generated/ios/swift/HybridAutoSizeInputSpec.swift +++ /dev/null @@ -1,86 +0,0 @@ -/// -/// HybridAutoSizeInputSpec.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/// See ``HybridAutoSizeInputSpec`` -public protocol HybridAutoSizeInputSpec_protocol: HybridObject, HybridView { - // Properties - var text: String? { get set } - var prefix: String? { get set } - var suffix: String? { get set } - var placeholder: String? { get set } - var fontSize: Double? { get set } - var minFontSize: Double? { get set } - var multiline: Bool? { get set } - var maxNumberOfLines: Double? { get set } - var textColor: String? { get set } - var prefixColor: String? { get set } - var suffixColor: String? { get set } - var placeholderColor: String? { get set } - var textAlign: String? { get set } - var fontFamily: String? { get set } - var fontWeight: String? { get set } - var editable: Bool? { get set } - var keyboardType: String? { get set } - var returnKeyType: String? { get set } - var autoCorrect: Bool? { get set } - var autoCapitalize: String? { get set } - var selectionColor: String? { get set } - var prefixMarginRight: Double? { get set } - var suffixMarginLeft: Double? { get set } - var showBorder: Bool? { get set } - var inputBackgroundColor: String? { get set } - var contentAutoWidth: Bool? { get set } - var contentCentered: Bool? { get set } - var onChangeText: ((_ text: String) -> Void)? { get set } - var onFocus: (() -> Void)? { get set } - var onBlur: (() -> Void)? { get set } - - // Methods - func focus() throws -> Void - func blur() throws -> Void -} - -public extension HybridAutoSizeInputSpec_protocol { - /// Default implementation of ``HybridObject.toString`` - func toString() -> String { - return "[HybridObject AutoSizeInput]" - } -} - -/// See ``HybridAutoSizeInputSpec`` -open class HybridAutoSizeInputSpec_base { - private weak var cxxWrapper: HybridAutoSizeInputSpec_cxx? = nil - public init() { } - public func getCxxWrapper() -> HybridAutoSizeInputSpec_cxx { - #if DEBUG - guard self is HybridAutoSizeInputSpec else { - fatalError("`self` is not a `HybridAutoSizeInputSpec`! Did you accidentally inherit from `HybridAutoSizeInputSpec_base` instead of `HybridAutoSizeInputSpec`?") - } - #endif - if let cxxWrapper = self.cxxWrapper { - return cxxWrapper - } else { - let cxxWrapper = HybridAutoSizeInputSpec_cxx(self as! HybridAutoSizeInputSpec) - self.cxxWrapper = cxxWrapper - return cxxWrapper - } - } -} - -/** - * A Swift base-protocol representing the AutoSizeInput HybridObject. - * Implement this protocol to create Swift-based instances of AutoSizeInput. - * ```swift - * class HybridAutoSizeInput : HybridAutoSizeInputSpec { - * // ... - * } - * ``` - */ -public typealias HybridAutoSizeInputSpec = HybridAutoSizeInputSpec_protocol & HybridAutoSizeInputSpec_base diff --git a/native-views/react-native-auto-size-input/nitrogen/generated/ios/swift/HybridAutoSizeInputSpec_cxx.swift b/native-views/react-native-auto-size-input/nitrogen/generated/ios/swift/HybridAutoSizeInputSpec_cxx.swift deleted file mode 100644 index bbeec8d..0000000 --- a/native-views/react-native-auto-size-input/nitrogen/generated/ios/swift/HybridAutoSizeInputSpec_cxx.swift +++ /dev/null @@ -1,860 +0,0 @@ -/// -/// HybridAutoSizeInputSpec_cxx.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * A class implementation that bridges HybridAutoSizeInputSpec over to C++. - * In C++, we cannot use Swift protocols - so we need to wrap it in a class to make it strongly defined. - * - * Also, some Swift types need to be bridged with special handling: - * - Enums need to be wrapped in Structs, otherwise they cannot be accessed bi-directionally (Swift bug: https://github.com/swiftlang/swift/issues/75330) - * - Other HybridObjects need to be wrapped/unwrapped from the Swift TCxx wrapper - * - Throwing methods need to be wrapped with a Result type, as exceptions cannot be propagated to C++ - */ -open class HybridAutoSizeInputSpec_cxx { - /** - * The Swift <> C++ bridge's namespace (`margelo::nitro::autosizeinput::bridge::swift`) - * from `AutoSizeInput-Swift-Cxx-Bridge.hpp`. - * This contains specialized C++ templates, and C++ helper functions that can be accessed from Swift. - */ - public typealias bridge = margelo.nitro.autosizeinput.bridge.swift - - /** - * Holds an instance of the `HybridAutoSizeInputSpec` Swift protocol. - */ - private var __implementation: any HybridAutoSizeInputSpec - - /** - * Holds a weak pointer to the C++ class that wraps the Swift class. - */ - private var __cxxPart: bridge.std__weak_ptr_HybridAutoSizeInputSpec_ - - /** - * Create a new `HybridAutoSizeInputSpec_cxx` that wraps the given `HybridAutoSizeInputSpec`. - * All properties and methods bridge to C++ types. - */ - public init(_ implementation: any HybridAutoSizeInputSpec) { - self.__implementation = implementation - self.__cxxPart = .init() - /* no base class */ - } - - /** - * Get the actual `HybridAutoSizeInputSpec` instance this class wraps. - */ - @inline(__always) - public func getHybridAutoSizeInputSpec() -> any HybridAutoSizeInputSpec { - return __implementation - } - - /** - * Casts this instance to a retained unsafe raw pointer. - * This acquires one additional strong reference on the object! - */ - public func toUnsafe() -> UnsafeMutableRawPointer { - return Unmanaged.passRetained(self).toOpaque() - } - - /** - * Casts an unsafe pointer to a `HybridAutoSizeInputSpec_cxx`. - * The pointer has to be a retained opaque `Unmanaged`. - * This removes one strong reference from the object! - */ - public class func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> HybridAutoSizeInputSpec_cxx { - return Unmanaged.fromOpaque(pointer).takeRetainedValue() - } - - /** - * Gets (or creates) the C++ part of this Hybrid Object. - * The C++ part is a `std::shared_ptr`. - */ - public func getCxxPart() -> bridge.std__shared_ptr_HybridAutoSizeInputSpec_ { - let cachedCxxPart = self.__cxxPart.lock() - if Bool(fromCxx: cachedCxxPart) { - return cachedCxxPart - } else { - let newCxxPart = bridge.create_std__shared_ptr_HybridAutoSizeInputSpec_(self.toUnsafe()) - __cxxPart = bridge.weakify_std__shared_ptr_HybridAutoSizeInputSpec_(newCxxPart) - return newCxxPart - } - } - - - - /** - * Get the memory size of the Swift class (plus size of any other allocations) - * so the JS VM can properly track it and garbage-collect the JS object if needed. - */ - @inline(__always) - public var memorySize: Int { - return MemoryHelper.getSizeOf(self.__implementation) + self.__implementation.memorySize - } - - /** - * Call dispose() on the Swift class. - * This _may_ be called manually from JS. - */ - @inline(__always) - public func dispose() { - self.__implementation.dispose() - } - - /** - * Call toString() on the Swift class. - */ - @inline(__always) - public func toString() -> String { - return self.__implementation.toString() - } - - // Properties - public final var text: bridge.std__optional_std__string_ { - @inline(__always) - get { - return { () -> bridge.std__optional_std__string_ in - if let __unwrappedValue = self.__implementation.text { - return bridge.create_std__optional_std__string_(std.string(__unwrappedValue)) - } else { - return .init() - } - }() - } - @inline(__always) - set { - self.__implementation.text = { () -> String? in - if bridge.has_value_std__optional_std__string_(newValue) { - let __unwrapped = bridge.get_std__optional_std__string_(newValue) - return String(__unwrapped) - } else { - return nil - } - }() - } - } - - public final var prefix: bridge.std__optional_std__string_ { - @inline(__always) - get { - return { () -> bridge.std__optional_std__string_ in - if let __unwrappedValue = self.__implementation.prefix { - return bridge.create_std__optional_std__string_(std.string(__unwrappedValue)) - } else { - return .init() - } - }() - } - @inline(__always) - set { - self.__implementation.prefix = { () -> String? in - if bridge.has_value_std__optional_std__string_(newValue) { - let __unwrapped = bridge.get_std__optional_std__string_(newValue) - return String(__unwrapped) - } else { - return nil - } - }() - } - } - - public final var suffix: bridge.std__optional_std__string_ { - @inline(__always) - get { - return { () -> bridge.std__optional_std__string_ in - if let __unwrappedValue = self.__implementation.suffix { - return bridge.create_std__optional_std__string_(std.string(__unwrappedValue)) - } else { - return .init() - } - }() - } - @inline(__always) - set { - self.__implementation.suffix = { () -> String? in - if bridge.has_value_std__optional_std__string_(newValue) { - let __unwrapped = bridge.get_std__optional_std__string_(newValue) - return String(__unwrapped) - } else { - return nil - } - }() - } - } - - public final var placeholder: bridge.std__optional_std__string_ { - @inline(__always) - get { - return { () -> bridge.std__optional_std__string_ in - if let __unwrappedValue = self.__implementation.placeholder { - return bridge.create_std__optional_std__string_(std.string(__unwrappedValue)) - } else { - return .init() - } - }() - } - @inline(__always) - set { - self.__implementation.placeholder = { () -> String? in - if bridge.has_value_std__optional_std__string_(newValue) { - let __unwrapped = bridge.get_std__optional_std__string_(newValue) - return String(__unwrapped) - } else { - return nil - } - }() - } - } - - public final var fontSize: bridge.std__optional_double_ { - @inline(__always) - get { - return { () -> bridge.std__optional_double_ in - if let __unwrappedValue = self.__implementation.fontSize { - return bridge.create_std__optional_double_(__unwrappedValue) - } else { - return .init() - } - }() - } - @inline(__always) - set { - self.__implementation.fontSize = newValue.value - } - } - - public final var minFontSize: bridge.std__optional_double_ { - @inline(__always) - get { - return { () -> bridge.std__optional_double_ in - if let __unwrappedValue = self.__implementation.minFontSize { - return bridge.create_std__optional_double_(__unwrappedValue) - } else { - return .init() - } - }() - } - @inline(__always) - set { - self.__implementation.minFontSize = newValue.value - } - } - - public final var multiline: bridge.std__optional_bool_ { - @inline(__always) - get { - return { () -> bridge.std__optional_bool_ in - if let __unwrappedValue = self.__implementation.multiline { - return bridge.create_std__optional_bool_(__unwrappedValue) - } else { - return .init() - } - }() - } - @inline(__always) - set { - self.__implementation.multiline = { () -> Bool? in - if bridge.has_value_std__optional_bool_(newValue) { - let __unwrapped = bridge.get_std__optional_bool_(newValue) - return __unwrapped - } else { - return nil - } - }() - } - } - - public final var maxNumberOfLines: bridge.std__optional_double_ { - @inline(__always) - get { - return { () -> bridge.std__optional_double_ in - if let __unwrappedValue = self.__implementation.maxNumberOfLines { - return bridge.create_std__optional_double_(__unwrappedValue) - } else { - return .init() - } - }() - } - @inline(__always) - set { - self.__implementation.maxNumberOfLines = newValue.value - } - } - - public final var textColor: bridge.std__optional_std__string_ { - @inline(__always) - get { - return { () -> bridge.std__optional_std__string_ in - if let __unwrappedValue = self.__implementation.textColor { - return bridge.create_std__optional_std__string_(std.string(__unwrappedValue)) - } else { - return .init() - } - }() - } - @inline(__always) - set { - self.__implementation.textColor = { () -> String? in - if bridge.has_value_std__optional_std__string_(newValue) { - let __unwrapped = bridge.get_std__optional_std__string_(newValue) - return String(__unwrapped) - } else { - return nil - } - }() - } - } - - public final var prefixColor: bridge.std__optional_std__string_ { - @inline(__always) - get { - return { () -> bridge.std__optional_std__string_ in - if let __unwrappedValue = self.__implementation.prefixColor { - return bridge.create_std__optional_std__string_(std.string(__unwrappedValue)) - } else { - return .init() - } - }() - } - @inline(__always) - set { - self.__implementation.prefixColor = { () -> String? in - if bridge.has_value_std__optional_std__string_(newValue) { - let __unwrapped = bridge.get_std__optional_std__string_(newValue) - return String(__unwrapped) - } else { - return nil - } - }() - } - } - - public final var suffixColor: bridge.std__optional_std__string_ { - @inline(__always) - get { - return { () -> bridge.std__optional_std__string_ in - if let __unwrappedValue = self.__implementation.suffixColor { - return bridge.create_std__optional_std__string_(std.string(__unwrappedValue)) - } else { - return .init() - } - }() - } - @inline(__always) - set { - self.__implementation.suffixColor = { () -> String? in - if bridge.has_value_std__optional_std__string_(newValue) { - let __unwrapped = bridge.get_std__optional_std__string_(newValue) - return String(__unwrapped) - } else { - return nil - } - }() - } - } - - public final var placeholderColor: bridge.std__optional_std__string_ { - @inline(__always) - get { - return { () -> bridge.std__optional_std__string_ in - if let __unwrappedValue = self.__implementation.placeholderColor { - return bridge.create_std__optional_std__string_(std.string(__unwrappedValue)) - } else { - return .init() - } - }() - } - @inline(__always) - set { - self.__implementation.placeholderColor = { () -> String? in - if bridge.has_value_std__optional_std__string_(newValue) { - let __unwrapped = bridge.get_std__optional_std__string_(newValue) - return String(__unwrapped) - } else { - return nil - } - }() - } - } - - public final var textAlign: bridge.std__optional_std__string_ { - @inline(__always) - get { - return { () -> bridge.std__optional_std__string_ in - if let __unwrappedValue = self.__implementation.textAlign { - return bridge.create_std__optional_std__string_(std.string(__unwrappedValue)) - } else { - return .init() - } - }() - } - @inline(__always) - set { - self.__implementation.textAlign = { () -> String? in - if bridge.has_value_std__optional_std__string_(newValue) { - let __unwrapped = bridge.get_std__optional_std__string_(newValue) - return String(__unwrapped) - } else { - return nil - } - }() - } - } - - public final var fontFamily: bridge.std__optional_std__string_ { - @inline(__always) - get { - return { () -> bridge.std__optional_std__string_ in - if let __unwrappedValue = self.__implementation.fontFamily { - return bridge.create_std__optional_std__string_(std.string(__unwrappedValue)) - } else { - return .init() - } - }() - } - @inline(__always) - set { - self.__implementation.fontFamily = { () -> String? in - if bridge.has_value_std__optional_std__string_(newValue) { - let __unwrapped = bridge.get_std__optional_std__string_(newValue) - return String(__unwrapped) - } else { - return nil - } - }() - } - } - - public final var fontWeight: bridge.std__optional_std__string_ { - @inline(__always) - get { - return { () -> bridge.std__optional_std__string_ in - if let __unwrappedValue = self.__implementation.fontWeight { - return bridge.create_std__optional_std__string_(std.string(__unwrappedValue)) - } else { - return .init() - } - }() - } - @inline(__always) - set { - self.__implementation.fontWeight = { () -> String? in - if bridge.has_value_std__optional_std__string_(newValue) { - let __unwrapped = bridge.get_std__optional_std__string_(newValue) - return String(__unwrapped) - } else { - return nil - } - }() - } - } - - public final var editable: bridge.std__optional_bool_ { - @inline(__always) - get { - return { () -> bridge.std__optional_bool_ in - if let __unwrappedValue = self.__implementation.editable { - return bridge.create_std__optional_bool_(__unwrappedValue) - } else { - return .init() - } - }() - } - @inline(__always) - set { - self.__implementation.editable = { () -> Bool? in - if bridge.has_value_std__optional_bool_(newValue) { - let __unwrapped = bridge.get_std__optional_bool_(newValue) - return __unwrapped - } else { - return nil - } - }() - } - } - - public final var keyboardType: bridge.std__optional_std__string_ { - @inline(__always) - get { - return { () -> bridge.std__optional_std__string_ in - if let __unwrappedValue = self.__implementation.keyboardType { - return bridge.create_std__optional_std__string_(std.string(__unwrappedValue)) - } else { - return .init() - } - }() - } - @inline(__always) - set { - self.__implementation.keyboardType = { () -> String? in - if bridge.has_value_std__optional_std__string_(newValue) { - let __unwrapped = bridge.get_std__optional_std__string_(newValue) - return String(__unwrapped) - } else { - return nil - } - }() - } - } - - public final var returnKeyType: bridge.std__optional_std__string_ { - @inline(__always) - get { - return { () -> bridge.std__optional_std__string_ in - if let __unwrappedValue = self.__implementation.returnKeyType { - return bridge.create_std__optional_std__string_(std.string(__unwrappedValue)) - } else { - return .init() - } - }() - } - @inline(__always) - set { - self.__implementation.returnKeyType = { () -> String? in - if bridge.has_value_std__optional_std__string_(newValue) { - let __unwrapped = bridge.get_std__optional_std__string_(newValue) - return String(__unwrapped) - } else { - return nil - } - }() - } - } - - public final var autoCorrect: bridge.std__optional_bool_ { - @inline(__always) - get { - return { () -> bridge.std__optional_bool_ in - if let __unwrappedValue = self.__implementation.autoCorrect { - return bridge.create_std__optional_bool_(__unwrappedValue) - } else { - return .init() - } - }() - } - @inline(__always) - set { - self.__implementation.autoCorrect = { () -> Bool? in - if bridge.has_value_std__optional_bool_(newValue) { - let __unwrapped = bridge.get_std__optional_bool_(newValue) - return __unwrapped - } else { - return nil - } - }() - } - } - - public final var autoCapitalize: bridge.std__optional_std__string_ { - @inline(__always) - get { - return { () -> bridge.std__optional_std__string_ in - if let __unwrappedValue = self.__implementation.autoCapitalize { - return bridge.create_std__optional_std__string_(std.string(__unwrappedValue)) - } else { - return .init() - } - }() - } - @inline(__always) - set { - self.__implementation.autoCapitalize = { () -> String? in - if bridge.has_value_std__optional_std__string_(newValue) { - let __unwrapped = bridge.get_std__optional_std__string_(newValue) - return String(__unwrapped) - } else { - return nil - } - }() - } - } - - public final var selectionColor: bridge.std__optional_std__string_ { - @inline(__always) - get { - return { () -> bridge.std__optional_std__string_ in - if let __unwrappedValue = self.__implementation.selectionColor { - return bridge.create_std__optional_std__string_(std.string(__unwrappedValue)) - } else { - return .init() - } - }() - } - @inline(__always) - set { - self.__implementation.selectionColor = { () -> String? in - if bridge.has_value_std__optional_std__string_(newValue) { - let __unwrapped = bridge.get_std__optional_std__string_(newValue) - return String(__unwrapped) - } else { - return nil - } - }() - } - } - - public final var prefixMarginRight: bridge.std__optional_double_ { - @inline(__always) - get { - return { () -> bridge.std__optional_double_ in - if let __unwrappedValue = self.__implementation.prefixMarginRight { - return bridge.create_std__optional_double_(__unwrappedValue) - } else { - return .init() - } - }() - } - @inline(__always) - set { - self.__implementation.prefixMarginRight = newValue.value - } - } - - public final var suffixMarginLeft: bridge.std__optional_double_ { - @inline(__always) - get { - return { () -> bridge.std__optional_double_ in - if let __unwrappedValue = self.__implementation.suffixMarginLeft { - return bridge.create_std__optional_double_(__unwrappedValue) - } else { - return .init() - } - }() - } - @inline(__always) - set { - self.__implementation.suffixMarginLeft = newValue.value - } - } - - public final var showBorder: bridge.std__optional_bool_ { - @inline(__always) - get { - return { () -> bridge.std__optional_bool_ in - if let __unwrappedValue = self.__implementation.showBorder { - return bridge.create_std__optional_bool_(__unwrappedValue) - } else { - return .init() - } - }() - } - @inline(__always) - set { - self.__implementation.showBorder = { () -> Bool? in - if bridge.has_value_std__optional_bool_(newValue) { - let __unwrapped = bridge.get_std__optional_bool_(newValue) - return __unwrapped - } else { - return nil - } - }() - } - } - - public final var inputBackgroundColor: bridge.std__optional_std__string_ { - @inline(__always) - get { - return { () -> bridge.std__optional_std__string_ in - if let __unwrappedValue = self.__implementation.inputBackgroundColor { - return bridge.create_std__optional_std__string_(std.string(__unwrappedValue)) - } else { - return .init() - } - }() - } - @inline(__always) - set { - self.__implementation.inputBackgroundColor = { () -> String? in - if bridge.has_value_std__optional_std__string_(newValue) { - let __unwrapped = bridge.get_std__optional_std__string_(newValue) - return String(__unwrapped) - } else { - return nil - } - }() - } - } - - public final var contentAutoWidth: bridge.std__optional_bool_ { - @inline(__always) - get { - return { () -> bridge.std__optional_bool_ in - if let __unwrappedValue = self.__implementation.contentAutoWidth { - return bridge.create_std__optional_bool_(__unwrappedValue) - } else { - return .init() - } - }() - } - @inline(__always) - set { - self.__implementation.contentAutoWidth = { () -> Bool? in - if bridge.has_value_std__optional_bool_(newValue) { - let __unwrapped = bridge.get_std__optional_bool_(newValue) - return __unwrapped - } else { - return nil - } - }() - } - } - - public final var contentCentered: bridge.std__optional_bool_ { - @inline(__always) - get { - return { () -> bridge.std__optional_bool_ in - if let __unwrappedValue = self.__implementation.contentCentered { - return bridge.create_std__optional_bool_(__unwrappedValue) - } else { - return .init() - } - }() - } - @inline(__always) - set { - self.__implementation.contentCentered = { () -> Bool? in - if bridge.has_value_std__optional_bool_(newValue) { - let __unwrapped = bridge.get_std__optional_bool_(newValue) - return __unwrapped - } else { - return nil - } - }() - } - } - - public final var onChangeText: bridge.std__optional_std__function_void_const_std__string_____text______ { - @inline(__always) - get { - return { () -> bridge.std__optional_std__function_void_const_std__string_____text______ in - if let __unwrappedValue = self.__implementation.onChangeText { - return bridge.create_std__optional_std__function_void_const_std__string_____text______({ () -> bridge.Func_void_std__string in - let __closureWrapper = Func_void_std__string(__unwrappedValue) - return bridge.create_Func_void_std__string(__closureWrapper.toUnsafe()) - }()) - } else { - return .init() - } - }() - } - @inline(__always) - set { - self.__implementation.onChangeText = { () -> ((_ text: String) -> Void)? in - if bridge.has_value_std__optional_std__function_void_const_std__string_____text______(newValue) { - let __unwrapped = bridge.get_std__optional_std__function_void_const_std__string_____text______(newValue) - return { () -> (String) -> Void in - let __wrappedFunction = bridge.wrap_Func_void_std__string(__unwrapped) - return { (__text: String) -> Void in - __wrappedFunction.call(std.string(__text)) - } - }() - } else { - return nil - } - }() - } - } - - public final var onFocus: bridge.std__optional_std__function_void____ { - @inline(__always) - get { - return { () -> bridge.std__optional_std__function_void____ in - if let __unwrappedValue = self.__implementation.onFocus { - return bridge.create_std__optional_std__function_void____({ () -> bridge.Func_void in - let __closureWrapper = Func_void(__unwrappedValue) - return bridge.create_Func_void(__closureWrapper.toUnsafe()) - }()) - } else { - return .init() - } - }() - } - @inline(__always) - set { - self.__implementation.onFocus = { () -> (() -> Void)? in - if bridge.has_value_std__optional_std__function_void____(newValue) { - let __unwrapped = bridge.get_std__optional_std__function_void____(newValue) - return { () -> () -> Void in - let __wrappedFunction = bridge.wrap_Func_void(__unwrapped) - return { () -> Void in - __wrappedFunction.call() - } - }() - } else { - return nil - } - }() - } - } - - public final var onBlur: bridge.std__optional_std__function_void____ { - @inline(__always) - get { - return { () -> bridge.std__optional_std__function_void____ in - if let __unwrappedValue = self.__implementation.onBlur { - return bridge.create_std__optional_std__function_void____({ () -> bridge.Func_void in - let __closureWrapper = Func_void(__unwrappedValue) - return bridge.create_Func_void(__closureWrapper.toUnsafe()) - }()) - } else { - return .init() - } - }() - } - @inline(__always) - set { - self.__implementation.onBlur = { () -> (() -> Void)? in - if bridge.has_value_std__optional_std__function_void____(newValue) { - let __unwrapped = bridge.get_std__optional_std__function_void____(newValue) - return { () -> () -> Void in - let __wrappedFunction = bridge.wrap_Func_void(__unwrapped) - return { () -> Void in - __wrappedFunction.call() - } - }() - } else { - return nil - } - }() - } - } - - // Methods - @inline(__always) - public final func focus() -> bridge.Result_void_ { - do { - try self.__implementation.focus() - return bridge.create_Result_void_() - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_void_(__exceptionPtr) - } - } - - @inline(__always) - public final func blur() -> bridge.Result_void_ { - do { - try self.__implementation.blur() - return bridge.create_Result_void_() - } catch (let __error) { - let __exceptionPtr = __error.toCpp() - return bridge.create_Result_void_(__exceptionPtr) - } - } - - public final func getView() -> UnsafeMutableRawPointer { - return Unmanaged.passRetained(__implementation.view).toOpaque() - } - - public final func beforeUpdate() { - __implementation.beforeUpdate() - } - - public final func afterUpdate() { - __implementation.afterUpdate() - } -} diff --git a/native-views/react-native-auto-size-input/nitrogen/generated/shared/c++/HybridAutoSizeInputSpec.cpp b/native-views/react-native-auto-size-input/nitrogen/generated/shared/c++/HybridAutoSizeInputSpec.cpp deleted file mode 100644 index 5ca7b68..0000000 --- a/native-views/react-native-auto-size-input/nitrogen/generated/shared/c++/HybridAutoSizeInputSpec.cpp +++ /dev/null @@ -1,82 +0,0 @@ -/// -/// HybridAutoSizeInputSpec.cpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#include "HybridAutoSizeInputSpec.hpp" - -namespace margelo::nitro::autosizeinput { - - void HybridAutoSizeInputSpec::loadHybridMethods() { - // load base methods/properties - HybridObject::loadHybridMethods(); - // load custom methods/properties - registerHybrids(this, [](Prototype& prototype) { - prototype.registerHybridGetter("text", &HybridAutoSizeInputSpec::getText); - prototype.registerHybridSetter("text", &HybridAutoSizeInputSpec::setText); - prototype.registerHybridGetter("prefix", &HybridAutoSizeInputSpec::getPrefix); - prototype.registerHybridSetter("prefix", &HybridAutoSizeInputSpec::setPrefix); - prototype.registerHybridGetter("suffix", &HybridAutoSizeInputSpec::getSuffix); - prototype.registerHybridSetter("suffix", &HybridAutoSizeInputSpec::setSuffix); - prototype.registerHybridGetter("placeholder", &HybridAutoSizeInputSpec::getPlaceholder); - prototype.registerHybridSetter("placeholder", &HybridAutoSizeInputSpec::setPlaceholder); - prototype.registerHybridGetter("fontSize", &HybridAutoSizeInputSpec::getFontSize); - prototype.registerHybridSetter("fontSize", &HybridAutoSizeInputSpec::setFontSize); - prototype.registerHybridGetter("minFontSize", &HybridAutoSizeInputSpec::getMinFontSize); - prototype.registerHybridSetter("minFontSize", &HybridAutoSizeInputSpec::setMinFontSize); - prototype.registerHybridGetter("multiline", &HybridAutoSizeInputSpec::getMultiline); - prototype.registerHybridSetter("multiline", &HybridAutoSizeInputSpec::setMultiline); - prototype.registerHybridGetter("maxNumberOfLines", &HybridAutoSizeInputSpec::getMaxNumberOfLines); - prototype.registerHybridSetter("maxNumberOfLines", &HybridAutoSizeInputSpec::setMaxNumberOfLines); - prototype.registerHybridGetter("textColor", &HybridAutoSizeInputSpec::getTextColor); - prototype.registerHybridSetter("textColor", &HybridAutoSizeInputSpec::setTextColor); - prototype.registerHybridGetter("prefixColor", &HybridAutoSizeInputSpec::getPrefixColor); - prototype.registerHybridSetter("prefixColor", &HybridAutoSizeInputSpec::setPrefixColor); - prototype.registerHybridGetter("suffixColor", &HybridAutoSizeInputSpec::getSuffixColor); - prototype.registerHybridSetter("suffixColor", &HybridAutoSizeInputSpec::setSuffixColor); - prototype.registerHybridGetter("placeholderColor", &HybridAutoSizeInputSpec::getPlaceholderColor); - prototype.registerHybridSetter("placeholderColor", &HybridAutoSizeInputSpec::setPlaceholderColor); - prototype.registerHybridGetter("textAlign", &HybridAutoSizeInputSpec::getTextAlign); - prototype.registerHybridSetter("textAlign", &HybridAutoSizeInputSpec::setTextAlign); - prototype.registerHybridGetter("fontFamily", &HybridAutoSizeInputSpec::getFontFamily); - prototype.registerHybridSetter("fontFamily", &HybridAutoSizeInputSpec::setFontFamily); - prototype.registerHybridGetter("fontWeight", &HybridAutoSizeInputSpec::getFontWeight); - prototype.registerHybridSetter("fontWeight", &HybridAutoSizeInputSpec::setFontWeight); - prototype.registerHybridGetter("editable", &HybridAutoSizeInputSpec::getEditable); - prototype.registerHybridSetter("editable", &HybridAutoSizeInputSpec::setEditable); - prototype.registerHybridGetter("keyboardType", &HybridAutoSizeInputSpec::getKeyboardType); - prototype.registerHybridSetter("keyboardType", &HybridAutoSizeInputSpec::setKeyboardType); - prototype.registerHybridGetter("returnKeyType", &HybridAutoSizeInputSpec::getReturnKeyType); - prototype.registerHybridSetter("returnKeyType", &HybridAutoSizeInputSpec::setReturnKeyType); - prototype.registerHybridGetter("autoCorrect", &HybridAutoSizeInputSpec::getAutoCorrect); - prototype.registerHybridSetter("autoCorrect", &HybridAutoSizeInputSpec::setAutoCorrect); - prototype.registerHybridGetter("autoCapitalize", &HybridAutoSizeInputSpec::getAutoCapitalize); - prototype.registerHybridSetter("autoCapitalize", &HybridAutoSizeInputSpec::setAutoCapitalize); - prototype.registerHybridGetter("selectionColor", &HybridAutoSizeInputSpec::getSelectionColor); - prototype.registerHybridSetter("selectionColor", &HybridAutoSizeInputSpec::setSelectionColor); - prototype.registerHybridGetter("prefixMarginRight", &HybridAutoSizeInputSpec::getPrefixMarginRight); - prototype.registerHybridSetter("prefixMarginRight", &HybridAutoSizeInputSpec::setPrefixMarginRight); - prototype.registerHybridGetter("suffixMarginLeft", &HybridAutoSizeInputSpec::getSuffixMarginLeft); - prototype.registerHybridSetter("suffixMarginLeft", &HybridAutoSizeInputSpec::setSuffixMarginLeft); - prototype.registerHybridGetter("showBorder", &HybridAutoSizeInputSpec::getShowBorder); - prototype.registerHybridSetter("showBorder", &HybridAutoSizeInputSpec::setShowBorder); - prototype.registerHybridGetter("inputBackgroundColor", &HybridAutoSizeInputSpec::getInputBackgroundColor); - prototype.registerHybridSetter("inputBackgroundColor", &HybridAutoSizeInputSpec::setInputBackgroundColor); - prototype.registerHybridGetter("contentAutoWidth", &HybridAutoSizeInputSpec::getContentAutoWidth); - prototype.registerHybridSetter("contentAutoWidth", &HybridAutoSizeInputSpec::setContentAutoWidth); - prototype.registerHybridGetter("contentCentered", &HybridAutoSizeInputSpec::getContentCentered); - prototype.registerHybridSetter("contentCentered", &HybridAutoSizeInputSpec::setContentCentered); - prototype.registerHybridGetter("onChangeText", &HybridAutoSizeInputSpec::getOnChangeText); - prototype.registerHybridSetter("onChangeText", &HybridAutoSizeInputSpec::setOnChangeText); - prototype.registerHybridGetter("onFocus", &HybridAutoSizeInputSpec::getOnFocus); - prototype.registerHybridSetter("onFocus", &HybridAutoSizeInputSpec::setOnFocus); - prototype.registerHybridGetter("onBlur", &HybridAutoSizeInputSpec::getOnBlur); - prototype.registerHybridSetter("onBlur", &HybridAutoSizeInputSpec::setOnBlur); - prototype.registerHybridMethod("focus", &HybridAutoSizeInputSpec::focus); - prototype.registerHybridMethod("blur", &HybridAutoSizeInputSpec::blur); - }); - } - -} // namespace margelo::nitro::autosizeinput diff --git a/native-views/react-native-auto-size-input/nitrogen/generated/shared/c++/HybridAutoSizeInputSpec.hpp b/native-views/react-native-auto-size-input/nitrogen/generated/shared/c++/HybridAutoSizeInputSpec.hpp deleted file mode 100644 index 4e29d93..0000000 --- a/native-views/react-native-auto-size-input/nitrogen/generated/shared/c++/HybridAutoSizeInputSpec.hpp +++ /dev/null @@ -1,124 +0,0 @@ -/// -/// HybridAutoSizeInputSpec.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif - - - -#include -#include -#include - -namespace margelo::nitro::autosizeinput { - - using namespace margelo::nitro; - - /** - * An abstract base class for `AutoSizeInput` - * Inherit this class to create instances of `HybridAutoSizeInputSpec` in C++. - * You must explicitly call `HybridObject`'s constructor yourself, because it is virtual. - * @example - * ```cpp - * class HybridAutoSizeInput: public HybridAutoSizeInputSpec { - * public: - * HybridAutoSizeInput(...): HybridObject(TAG) { ... } - * // ... - * }; - * ``` - */ - class HybridAutoSizeInputSpec: public virtual HybridObject { - public: - // Constructor - explicit HybridAutoSizeInputSpec(): HybridObject(TAG) { } - - // Destructor - ~HybridAutoSizeInputSpec() override = default; - - public: - // Properties - virtual std::optional getText() = 0; - virtual void setText(const std::optional& text) = 0; - virtual std::optional getPrefix() = 0; - virtual void setPrefix(const std::optional& prefix) = 0; - virtual std::optional getSuffix() = 0; - virtual void setSuffix(const std::optional& suffix) = 0; - virtual std::optional getPlaceholder() = 0; - virtual void setPlaceholder(const std::optional& placeholder) = 0; - virtual std::optional getFontSize() = 0; - virtual void setFontSize(std::optional fontSize) = 0; - virtual std::optional getMinFontSize() = 0; - virtual void setMinFontSize(std::optional minFontSize) = 0; - virtual std::optional getMultiline() = 0; - virtual void setMultiline(std::optional multiline) = 0; - virtual std::optional getMaxNumberOfLines() = 0; - virtual void setMaxNumberOfLines(std::optional maxNumberOfLines) = 0; - virtual std::optional getTextColor() = 0; - virtual void setTextColor(const std::optional& textColor) = 0; - virtual std::optional getPrefixColor() = 0; - virtual void setPrefixColor(const std::optional& prefixColor) = 0; - virtual std::optional getSuffixColor() = 0; - virtual void setSuffixColor(const std::optional& suffixColor) = 0; - virtual std::optional getPlaceholderColor() = 0; - virtual void setPlaceholderColor(const std::optional& placeholderColor) = 0; - virtual std::optional getTextAlign() = 0; - virtual void setTextAlign(const std::optional& textAlign) = 0; - virtual std::optional getFontFamily() = 0; - virtual void setFontFamily(const std::optional& fontFamily) = 0; - virtual std::optional getFontWeight() = 0; - virtual void setFontWeight(const std::optional& fontWeight) = 0; - virtual std::optional getEditable() = 0; - virtual void setEditable(std::optional editable) = 0; - virtual std::optional getKeyboardType() = 0; - virtual void setKeyboardType(const std::optional& keyboardType) = 0; - virtual std::optional getReturnKeyType() = 0; - virtual void setReturnKeyType(const std::optional& returnKeyType) = 0; - virtual std::optional getAutoCorrect() = 0; - virtual void setAutoCorrect(std::optional autoCorrect) = 0; - virtual std::optional getAutoCapitalize() = 0; - virtual void setAutoCapitalize(const std::optional& autoCapitalize) = 0; - virtual std::optional getSelectionColor() = 0; - virtual void setSelectionColor(const std::optional& selectionColor) = 0; - virtual std::optional getPrefixMarginRight() = 0; - virtual void setPrefixMarginRight(std::optional prefixMarginRight) = 0; - virtual std::optional getSuffixMarginLeft() = 0; - virtual void setSuffixMarginLeft(std::optional suffixMarginLeft) = 0; - virtual std::optional getShowBorder() = 0; - virtual void setShowBorder(std::optional showBorder) = 0; - virtual std::optional getInputBackgroundColor() = 0; - virtual void setInputBackgroundColor(const std::optional& inputBackgroundColor) = 0; - virtual std::optional getContentAutoWidth() = 0; - virtual void setContentAutoWidth(std::optional contentAutoWidth) = 0; - virtual std::optional getContentCentered() = 0; - virtual void setContentCentered(std::optional contentCentered) = 0; - virtual std::optional> getOnChangeText() = 0; - virtual void setOnChangeText(const std::optional>& onChangeText) = 0; - virtual std::optional> getOnFocus() = 0; - virtual void setOnFocus(const std::optional>& onFocus) = 0; - virtual std::optional> getOnBlur() = 0; - virtual void setOnBlur(const std::optional>& onBlur) = 0; - - public: - // Methods - virtual void focus() = 0; - virtual void blur() = 0; - - protected: - // Hybrid Setup - void loadHybridMethods() override; - - protected: - // Tag for logging - static constexpr auto TAG = "AutoSizeInput"; - }; - -} // namespace margelo::nitro::autosizeinput diff --git a/native-views/react-native-auto-size-input/nitrogen/generated/shared/c++/views/HybridAutoSizeInputComponent.cpp b/native-views/react-native-auto-size-input/nitrogen/generated/shared/c++/views/HybridAutoSizeInputComponent.cpp deleted file mode 100644 index 21ad2e0..0000000 --- a/native-views/react-native-auto-size-input/nitrogen/generated/shared/c++/views/HybridAutoSizeInputComponent.cpp +++ /dev/null @@ -1,435 +0,0 @@ -/// -/// HybridAutoSizeInputComponent.cpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#include "HybridAutoSizeInputComponent.hpp" - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace margelo::nitro::autosizeinput::views { - - extern const char HybridAutoSizeInputComponentName[] = "AutoSizeInput"; - - HybridAutoSizeInputProps::HybridAutoSizeInputProps(const react::PropsParserContext& context, - const HybridAutoSizeInputProps& sourceProps, - const react::RawProps& rawProps): - react::ViewProps(context, sourceProps, rawProps, filterObjectKeys), - text([&]() -> CachedProp> { - try { - const react::RawValue* rawValue = rawProps.at("text", nullptr, nullptr); - if (rawValue == nullptr) return sourceProps.text; - const auto& [runtime, value] = (std::pair)*rawValue; - return CachedProp>::fromRawValue(*runtime, value, sourceProps.text); - } catch (const std::exception& exc) { - throw std::runtime_error(std::string("AutoSizeInput.text: ") + exc.what()); - } - }()), - prefix([&]() -> CachedProp> { - try { - const react::RawValue* rawValue = rawProps.at("prefix", nullptr, nullptr); - if (rawValue == nullptr) return sourceProps.prefix; - const auto& [runtime, value] = (std::pair)*rawValue; - return CachedProp>::fromRawValue(*runtime, value, sourceProps.prefix); - } catch (const std::exception& exc) { - throw std::runtime_error(std::string("AutoSizeInput.prefix: ") + exc.what()); - } - }()), - suffix([&]() -> CachedProp> { - try { - const react::RawValue* rawValue = rawProps.at("suffix", nullptr, nullptr); - if (rawValue == nullptr) return sourceProps.suffix; - const auto& [runtime, value] = (std::pair)*rawValue; - return CachedProp>::fromRawValue(*runtime, value, sourceProps.suffix); - } catch (const std::exception& exc) { - throw std::runtime_error(std::string("AutoSizeInput.suffix: ") + exc.what()); - } - }()), - placeholder([&]() -> CachedProp> { - try { - const react::RawValue* rawValue = rawProps.at("placeholder", nullptr, nullptr); - if (rawValue == nullptr) return sourceProps.placeholder; - const auto& [runtime, value] = (std::pair)*rawValue; - return CachedProp>::fromRawValue(*runtime, value, sourceProps.placeholder); - } catch (const std::exception& exc) { - throw std::runtime_error(std::string("AutoSizeInput.placeholder: ") + exc.what()); - } - }()), - fontSize([&]() -> CachedProp> { - try { - const react::RawValue* rawValue = rawProps.at("fontSize", nullptr, nullptr); - if (rawValue == nullptr) return sourceProps.fontSize; - const auto& [runtime, value] = (std::pair)*rawValue; - return CachedProp>::fromRawValue(*runtime, value, sourceProps.fontSize); - } catch (const std::exception& exc) { - throw std::runtime_error(std::string("AutoSizeInput.fontSize: ") + exc.what()); - } - }()), - minFontSize([&]() -> CachedProp> { - try { - const react::RawValue* rawValue = rawProps.at("minFontSize", nullptr, nullptr); - if (rawValue == nullptr) return sourceProps.minFontSize; - const auto& [runtime, value] = (std::pair)*rawValue; - return CachedProp>::fromRawValue(*runtime, value, sourceProps.minFontSize); - } catch (const std::exception& exc) { - throw std::runtime_error(std::string("AutoSizeInput.minFontSize: ") + exc.what()); - } - }()), - multiline([&]() -> CachedProp> { - try { - const react::RawValue* rawValue = rawProps.at("multiline", nullptr, nullptr); - if (rawValue == nullptr) return sourceProps.multiline; - const auto& [runtime, value] = (std::pair)*rawValue; - return CachedProp>::fromRawValue(*runtime, value, sourceProps.multiline); - } catch (const std::exception& exc) { - throw std::runtime_error(std::string("AutoSizeInput.multiline: ") + exc.what()); - } - }()), - maxNumberOfLines([&]() -> CachedProp> { - try { - const react::RawValue* rawValue = rawProps.at("maxNumberOfLines", nullptr, nullptr); - if (rawValue == nullptr) return sourceProps.maxNumberOfLines; - const auto& [runtime, value] = (std::pair)*rawValue; - return CachedProp>::fromRawValue(*runtime, value, sourceProps.maxNumberOfLines); - } catch (const std::exception& exc) { - throw std::runtime_error(std::string("AutoSizeInput.maxNumberOfLines: ") + exc.what()); - } - }()), - textColor([&]() -> CachedProp> { - try { - const react::RawValue* rawValue = rawProps.at("textColor", nullptr, nullptr); - if (rawValue == nullptr) return sourceProps.textColor; - const auto& [runtime, value] = (std::pair)*rawValue; - return CachedProp>::fromRawValue(*runtime, value, sourceProps.textColor); - } catch (const std::exception& exc) { - throw std::runtime_error(std::string("AutoSizeInput.textColor: ") + exc.what()); - } - }()), - prefixColor([&]() -> CachedProp> { - try { - const react::RawValue* rawValue = rawProps.at("prefixColor", nullptr, nullptr); - if (rawValue == nullptr) return sourceProps.prefixColor; - const auto& [runtime, value] = (std::pair)*rawValue; - return CachedProp>::fromRawValue(*runtime, value, sourceProps.prefixColor); - } catch (const std::exception& exc) { - throw std::runtime_error(std::string("AutoSizeInput.prefixColor: ") + exc.what()); - } - }()), - suffixColor([&]() -> CachedProp> { - try { - const react::RawValue* rawValue = rawProps.at("suffixColor", nullptr, nullptr); - if (rawValue == nullptr) return sourceProps.suffixColor; - const auto& [runtime, value] = (std::pair)*rawValue; - return CachedProp>::fromRawValue(*runtime, value, sourceProps.suffixColor); - } catch (const std::exception& exc) { - throw std::runtime_error(std::string("AutoSizeInput.suffixColor: ") + exc.what()); - } - }()), - placeholderColor([&]() -> CachedProp> { - try { - const react::RawValue* rawValue = rawProps.at("placeholderColor", nullptr, nullptr); - if (rawValue == nullptr) return sourceProps.placeholderColor; - const auto& [runtime, value] = (std::pair)*rawValue; - return CachedProp>::fromRawValue(*runtime, value, sourceProps.placeholderColor); - } catch (const std::exception& exc) { - throw std::runtime_error(std::string("AutoSizeInput.placeholderColor: ") + exc.what()); - } - }()), - textAlign([&]() -> CachedProp> { - try { - const react::RawValue* rawValue = rawProps.at("textAlign", nullptr, nullptr); - if (rawValue == nullptr) return sourceProps.textAlign; - const auto& [runtime, value] = (std::pair)*rawValue; - return CachedProp>::fromRawValue(*runtime, value, sourceProps.textAlign); - } catch (const std::exception& exc) { - throw std::runtime_error(std::string("AutoSizeInput.textAlign: ") + exc.what()); - } - }()), - fontFamily([&]() -> CachedProp> { - try { - const react::RawValue* rawValue = rawProps.at("fontFamily", nullptr, nullptr); - if (rawValue == nullptr) return sourceProps.fontFamily; - const auto& [runtime, value] = (std::pair)*rawValue; - return CachedProp>::fromRawValue(*runtime, value, sourceProps.fontFamily); - } catch (const std::exception& exc) { - throw std::runtime_error(std::string("AutoSizeInput.fontFamily: ") + exc.what()); - } - }()), - fontWeight([&]() -> CachedProp> { - try { - const react::RawValue* rawValue = rawProps.at("fontWeight", nullptr, nullptr); - if (rawValue == nullptr) return sourceProps.fontWeight; - const auto& [runtime, value] = (std::pair)*rawValue; - return CachedProp>::fromRawValue(*runtime, value, sourceProps.fontWeight); - } catch (const std::exception& exc) { - throw std::runtime_error(std::string("AutoSizeInput.fontWeight: ") + exc.what()); - } - }()), - editable([&]() -> CachedProp> { - try { - const react::RawValue* rawValue = rawProps.at("editable", nullptr, nullptr); - if (rawValue == nullptr) return sourceProps.editable; - const auto& [runtime, value] = (std::pair)*rawValue; - return CachedProp>::fromRawValue(*runtime, value, sourceProps.editable); - } catch (const std::exception& exc) { - throw std::runtime_error(std::string("AutoSizeInput.editable: ") + exc.what()); - } - }()), - keyboardType([&]() -> CachedProp> { - try { - const react::RawValue* rawValue = rawProps.at("keyboardType", nullptr, nullptr); - if (rawValue == nullptr) return sourceProps.keyboardType; - const auto& [runtime, value] = (std::pair)*rawValue; - return CachedProp>::fromRawValue(*runtime, value, sourceProps.keyboardType); - } catch (const std::exception& exc) { - throw std::runtime_error(std::string("AutoSizeInput.keyboardType: ") + exc.what()); - } - }()), - returnKeyType([&]() -> CachedProp> { - try { - const react::RawValue* rawValue = rawProps.at("returnKeyType", nullptr, nullptr); - if (rawValue == nullptr) return sourceProps.returnKeyType; - const auto& [runtime, value] = (std::pair)*rawValue; - return CachedProp>::fromRawValue(*runtime, value, sourceProps.returnKeyType); - } catch (const std::exception& exc) { - throw std::runtime_error(std::string("AutoSizeInput.returnKeyType: ") + exc.what()); - } - }()), - autoCorrect([&]() -> CachedProp> { - try { - const react::RawValue* rawValue = rawProps.at("autoCorrect", nullptr, nullptr); - if (rawValue == nullptr) return sourceProps.autoCorrect; - const auto& [runtime, value] = (std::pair)*rawValue; - return CachedProp>::fromRawValue(*runtime, value, sourceProps.autoCorrect); - } catch (const std::exception& exc) { - throw std::runtime_error(std::string("AutoSizeInput.autoCorrect: ") + exc.what()); - } - }()), - autoCapitalize([&]() -> CachedProp> { - try { - const react::RawValue* rawValue = rawProps.at("autoCapitalize", nullptr, nullptr); - if (rawValue == nullptr) return sourceProps.autoCapitalize; - const auto& [runtime, value] = (std::pair)*rawValue; - return CachedProp>::fromRawValue(*runtime, value, sourceProps.autoCapitalize); - } catch (const std::exception& exc) { - throw std::runtime_error(std::string("AutoSizeInput.autoCapitalize: ") + exc.what()); - } - }()), - selectionColor([&]() -> CachedProp> { - try { - const react::RawValue* rawValue = rawProps.at("selectionColor", nullptr, nullptr); - if (rawValue == nullptr) return sourceProps.selectionColor; - const auto& [runtime, value] = (std::pair)*rawValue; - return CachedProp>::fromRawValue(*runtime, value, sourceProps.selectionColor); - } catch (const std::exception& exc) { - throw std::runtime_error(std::string("AutoSizeInput.selectionColor: ") + exc.what()); - } - }()), - prefixMarginRight([&]() -> CachedProp> { - try { - const react::RawValue* rawValue = rawProps.at("prefixMarginRight", nullptr, nullptr); - if (rawValue == nullptr) return sourceProps.prefixMarginRight; - const auto& [runtime, value] = (std::pair)*rawValue; - return CachedProp>::fromRawValue(*runtime, value, sourceProps.prefixMarginRight); - } catch (const std::exception& exc) { - throw std::runtime_error(std::string("AutoSizeInput.prefixMarginRight: ") + exc.what()); - } - }()), - suffixMarginLeft([&]() -> CachedProp> { - try { - const react::RawValue* rawValue = rawProps.at("suffixMarginLeft", nullptr, nullptr); - if (rawValue == nullptr) return sourceProps.suffixMarginLeft; - const auto& [runtime, value] = (std::pair)*rawValue; - return CachedProp>::fromRawValue(*runtime, value, sourceProps.suffixMarginLeft); - } catch (const std::exception& exc) { - throw std::runtime_error(std::string("AutoSizeInput.suffixMarginLeft: ") + exc.what()); - } - }()), - showBorder([&]() -> CachedProp> { - try { - const react::RawValue* rawValue = rawProps.at("showBorder", nullptr, nullptr); - if (rawValue == nullptr) return sourceProps.showBorder; - const auto& [runtime, value] = (std::pair)*rawValue; - return CachedProp>::fromRawValue(*runtime, value, sourceProps.showBorder); - } catch (const std::exception& exc) { - throw std::runtime_error(std::string("AutoSizeInput.showBorder: ") + exc.what()); - } - }()), - inputBackgroundColor([&]() -> CachedProp> { - try { - const react::RawValue* rawValue = rawProps.at("inputBackgroundColor", nullptr, nullptr); - if (rawValue == nullptr) return sourceProps.inputBackgroundColor; - const auto& [runtime, value] = (std::pair)*rawValue; - return CachedProp>::fromRawValue(*runtime, value, sourceProps.inputBackgroundColor); - } catch (const std::exception& exc) { - throw std::runtime_error(std::string("AutoSizeInput.inputBackgroundColor: ") + exc.what()); - } - }()), - contentAutoWidth([&]() -> CachedProp> { - try { - const react::RawValue* rawValue = rawProps.at("contentAutoWidth", nullptr, nullptr); - if (rawValue == nullptr) return sourceProps.contentAutoWidth; - const auto& [runtime, value] = (std::pair)*rawValue; - return CachedProp>::fromRawValue(*runtime, value, sourceProps.contentAutoWidth); - } catch (const std::exception& exc) { - throw std::runtime_error(std::string("AutoSizeInput.contentAutoWidth: ") + exc.what()); - } - }()), - contentCentered([&]() -> CachedProp> { - try { - const react::RawValue* rawValue = rawProps.at("contentCentered", nullptr, nullptr); - if (rawValue == nullptr) return sourceProps.contentCentered; - const auto& [runtime, value] = (std::pair)*rawValue; - return CachedProp>::fromRawValue(*runtime, value, sourceProps.contentCentered); - } catch (const std::exception& exc) { - throw std::runtime_error(std::string("AutoSizeInput.contentCentered: ") + exc.what()); - } - }()), - onChangeText([&]() -> CachedProp>> { - try { - const react::RawValue* rawValue = rawProps.at("onChangeText", nullptr, nullptr); - if (rawValue == nullptr) return sourceProps.onChangeText; - const auto& [runtime, value] = (std::pair)*rawValue; - return CachedProp>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, "f"), sourceProps.onChangeText); - } catch (const std::exception& exc) { - throw std::runtime_error(std::string("AutoSizeInput.onChangeText: ") + exc.what()); - } - }()), - onFocus([&]() -> CachedProp>> { - try { - const react::RawValue* rawValue = rawProps.at("onFocus", nullptr, nullptr); - if (rawValue == nullptr) return sourceProps.onFocus; - const auto& [runtime, value] = (std::pair)*rawValue; - return CachedProp>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, "f"), sourceProps.onFocus); - } catch (const std::exception& exc) { - throw std::runtime_error(std::string("AutoSizeInput.onFocus: ") + exc.what()); - } - }()), - onBlur([&]() -> CachedProp>> { - try { - const react::RawValue* rawValue = rawProps.at("onBlur", nullptr, nullptr); - if (rawValue == nullptr) return sourceProps.onBlur; - const auto& [runtime, value] = (std::pair)*rawValue; - return CachedProp>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, "f"), sourceProps.onBlur); - } catch (const std::exception& exc) { - throw std::runtime_error(std::string("AutoSizeInput.onBlur: ") + exc.what()); - } - }()), - hybridRef([&]() -> CachedProp& /* ref */)>>> { - try { - const react::RawValue* rawValue = rawProps.at("hybridRef", nullptr, nullptr); - if (rawValue == nullptr) return sourceProps.hybridRef; - const auto& [runtime, value] = (std::pair)*rawValue; - return CachedProp& /* ref */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, "f"), sourceProps.hybridRef); - } catch (const std::exception& exc) { - throw std::runtime_error(std::string("AutoSizeInput.hybridRef: ") + exc.what()); - } - }()) { } - - HybridAutoSizeInputProps::HybridAutoSizeInputProps(const HybridAutoSizeInputProps& other): - react::ViewProps(), - text(other.text), - prefix(other.prefix), - suffix(other.suffix), - placeholder(other.placeholder), - fontSize(other.fontSize), - minFontSize(other.minFontSize), - multiline(other.multiline), - maxNumberOfLines(other.maxNumberOfLines), - textColor(other.textColor), - prefixColor(other.prefixColor), - suffixColor(other.suffixColor), - placeholderColor(other.placeholderColor), - textAlign(other.textAlign), - fontFamily(other.fontFamily), - fontWeight(other.fontWeight), - editable(other.editable), - keyboardType(other.keyboardType), - returnKeyType(other.returnKeyType), - autoCorrect(other.autoCorrect), - autoCapitalize(other.autoCapitalize), - selectionColor(other.selectionColor), - prefixMarginRight(other.prefixMarginRight), - suffixMarginLeft(other.suffixMarginLeft), - showBorder(other.showBorder), - inputBackgroundColor(other.inputBackgroundColor), - contentAutoWidth(other.contentAutoWidth), - contentCentered(other.contentCentered), - onChangeText(other.onChangeText), - onFocus(other.onFocus), - onBlur(other.onBlur), - hybridRef(other.hybridRef) { } - - bool HybridAutoSizeInputProps::filterObjectKeys(const std::string& propName) { - switch (hashString(propName)) { - case hashString("text"): return true; - case hashString("prefix"): return true; - case hashString("suffix"): return true; - case hashString("placeholder"): return true; - case hashString("fontSize"): return true; - case hashString("minFontSize"): return true; - case hashString("multiline"): return true; - case hashString("maxNumberOfLines"): return true; - case hashString("textColor"): return true; - case hashString("prefixColor"): return true; - case hashString("suffixColor"): return true; - case hashString("placeholderColor"): return true; - case hashString("textAlign"): return true; - case hashString("fontFamily"): return true; - case hashString("fontWeight"): return true; - case hashString("editable"): return true; - case hashString("keyboardType"): return true; - case hashString("returnKeyType"): return true; - case hashString("autoCorrect"): return true; - case hashString("autoCapitalize"): return true; - case hashString("selectionColor"): return true; - case hashString("prefixMarginRight"): return true; - case hashString("suffixMarginLeft"): return true; - case hashString("showBorder"): return true; - case hashString("inputBackgroundColor"): return true; - case hashString("contentAutoWidth"): return true; - case hashString("contentCentered"): return true; - case hashString("onChangeText"): return true; - case hashString("onFocus"): return true; - case hashString("onBlur"): return true; - case hashString("hybridRef"): return true; - default: return false; - } - } - - HybridAutoSizeInputComponentDescriptor::HybridAutoSizeInputComponentDescriptor(const react::ComponentDescriptorParameters& parameters) - : ConcreteComponentDescriptor(parameters, - react::RawPropsParser(/* enableJsiParser */ true)) {} - - std::shared_ptr HybridAutoSizeInputComponentDescriptor::cloneProps(const react::PropsParserContext& context, - const std::shared_ptr& props, - react::RawProps rawProps) const { - // 1. Prepare raw props parser - rawProps.parse(rawPropsParser_); - // 2. Copy props with Nitro's cached copy constructor - return HybridAutoSizeInputShadowNode::Props(context, /* & */ rawProps, props); - } - -#ifdef ANDROID - void HybridAutoSizeInputComponentDescriptor::adopt(react::ShadowNode& shadowNode) const { - // This is called immediately after `ShadowNode` is created, cloned or in progress. - // On Android, we need to wrap props in our state, which gets routed through Java and later unwrapped in JNI/C++. - auto& concreteShadowNode = dynamic_cast(shadowNode); - const HybridAutoSizeInputProps& props = concreteShadowNode.getConcreteProps(); - HybridAutoSizeInputState state; - state.setProps(props); - concreteShadowNode.setStateData(std::move(state)); - } -#endif - -} // namespace margelo::nitro::autosizeinput::views diff --git a/native-views/react-native-auto-size-input/nitrogen/generated/shared/c++/views/HybridAutoSizeInputComponent.hpp b/native-views/react-native-auto-size-input/nitrogen/generated/shared/c++/views/HybridAutoSizeInputComponent.hpp deleted file mode 100644 index e4c8f15..0000000 --- a/native-views/react-native-auto-size-input/nitrogen/generated/shared/c++/views/HybridAutoSizeInputComponent.hpp +++ /dev/null @@ -1,137 +0,0 @@ -/// -/// HybridAutoSizeInputComponent.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include "HybridAutoSizeInputSpec.hpp" - -namespace margelo::nitro::autosizeinput::views { - - using namespace facebook; - - /** - * The name of the actual native View. - */ - extern const char HybridAutoSizeInputComponentName[]; - - /** - * Props for the "AutoSizeInput" View. - */ - class HybridAutoSizeInputProps final: public react::ViewProps { - public: - HybridAutoSizeInputProps() = default; - HybridAutoSizeInputProps(const HybridAutoSizeInputProps&); - HybridAutoSizeInputProps(const react::PropsParserContext& context, - const HybridAutoSizeInputProps& sourceProps, - const react::RawProps& rawProps); - - public: - CachedProp> text; - CachedProp> prefix; - CachedProp> suffix; - CachedProp> placeholder; - CachedProp> fontSize; - CachedProp> minFontSize; - CachedProp> multiline; - CachedProp> maxNumberOfLines; - CachedProp> textColor; - CachedProp> prefixColor; - CachedProp> suffixColor; - CachedProp> placeholderColor; - CachedProp> textAlign; - CachedProp> fontFamily; - CachedProp> fontWeight; - CachedProp> editable; - CachedProp> keyboardType; - CachedProp> returnKeyType; - CachedProp> autoCorrect; - CachedProp> autoCapitalize; - CachedProp> selectionColor; - CachedProp> prefixMarginRight; - CachedProp> suffixMarginLeft; - CachedProp> showBorder; - CachedProp> inputBackgroundColor; - CachedProp> contentAutoWidth; - CachedProp> contentCentered; - CachedProp>> onChangeText; - CachedProp>> onFocus; - CachedProp>> onBlur; - CachedProp& /* ref */)>>> hybridRef; - - private: - static bool filterObjectKeys(const std::string& propName); - }; - - /** - * State for the "AutoSizeInput" View. - */ - class HybridAutoSizeInputState final { - public: - HybridAutoSizeInputState() = default; - - public: - void setProps(const HybridAutoSizeInputProps& props) { _props.emplace(props); } - const std::optional& getProps() const { return _props; } - - public: -#ifdef ANDROID - HybridAutoSizeInputState(const HybridAutoSizeInputState& /* previousState */, folly::dynamic /* data */) {} - folly::dynamic getDynamic() const { - throw std::runtime_error("HybridAutoSizeInputState does not support folly!"); - } - react::MapBuffer getMapBuffer() const { - throw std::runtime_error("HybridAutoSizeInputState does not support MapBuffer!"); - }; -#endif - - private: - std::optional _props; - }; - - /** - * The Shadow Node for the "AutoSizeInput" View. - */ - using HybridAutoSizeInputShadowNode = react::ConcreteViewShadowNode; - - /** - * The Component Descriptor for the "AutoSizeInput" View. - */ - class HybridAutoSizeInputComponentDescriptor final: public react::ConcreteComponentDescriptor { - public: - HybridAutoSizeInputComponentDescriptor(const react::ComponentDescriptorParameters& parameters); - - public: - /** - * A faster path for cloning props - reuses the caching logic from `HybridAutoSizeInputProps`. - */ - std::shared_ptr cloneProps(const react::PropsParserContext& context, - const std::shared_ptr& props, - react::RawProps rawProps) const override; -#ifdef ANDROID - void adopt(react::ShadowNode& shadowNode) const override; -#endif - }; - - /* The actual view for "AutoSizeInput" needs to be implemented in platform-specific code. */ - -} // namespace margelo::nitro::autosizeinput::views diff --git a/native-views/react-native-auto-size-input/nitrogen/generated/shared/json/AutoSizeInputConfig.json b/native-views/react-native-auto-size-input/nitrogen/generated/shared/json/AutoSizeInputConfig.json deleted file mode 100644 index 261adfa..0000000 --- a/native-views/react-native-auto-size-input/nitrogen/generated/shared/json/AutoSizeInputConfig.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "uiViewClassName": "AutoSizeInput", - "supportsRawText": false, - "bubblingEventTypes": {}, - "directEventTypes": {}, - "validAttributes": { - "text": true, - "prefix": true, - "suffix": true, - "placeholder": true, - "fontSize": true, - "minFontSize": true, - "multiline": true, - "maxNumberOfLines": true, - "textColor": true, - "prefixColor": true, - "suffixColor": true, - "placeholderColor": true, - "textAlign": true, - "fontFamily": true, - "fontWeight": true, - "editable": true, - "keyboardType": true, - "returnKeyType": true, - "autoCorrect": true, - "autoCapitalize": true, - "selectionColor": true, - "prefixMarginRight": true, - "suffixMarginLeft": true, - "showBorder": true, - "inputBackgroundColor": true, - "contentAutoWidth": true, - "contentCentered": true, - "onChangeText": true, - "onFocus": true, - "onBlur": true, - "hybridRef": true - } -} diff --git a/native-views/react-native-pager-view/.gitignore b/native-views/react-native-pager-view/.gitignore index c5361f0..05827e4 100644 --- a/native-views/react-native-pager-view/.gitignore +++ b/native-views/react-native-pager-view/.gitignore @@ -1,2 +1,5 @@ # generated by bob lib/ + +# generated by nitrogen +nitrogen/ diff --git a/native-views/react-native-scroll-guard/.gitignore b/native-views/react-native-scroll-guard/.gitignore index 3df57f4..05827e4 100644 --- a/native-views/react-native-scroll-guard/.gitignore +++ b/native-views/react-native-scroll-guard/.gitignore @@ -1,81 +1,5 @@ -node_modules -__generated__ +# generated by bob +lib/ -.expo-shared -.expo -.DS_Store -.idea/ -.vscode/ -.chat/ -.claude/PRPs -.claude/settings.local.json -.clauderc -.tmp/ - -dist -build-electron -.next -build -*.tsbuildinfo -yarn-error.log - -.pnp.* -.yarn/* -!.yarn/patches -!.yarn/plugins -!.yarn/releases -!.yarn/sdks -!.yarn/versions - -.env -webpack.config.preview.json -webpack.config.preview.devServer.json - -*.jks -*.p8 -*.p12 -*.key -*.mobileprovision -*.orig.* -web-build/ -# !/apps/web-embed/web-build/ -/inpage-provider-bak - -### VisualStudioCode ### -.vscode/* -!.vscode/settings.json -!.vscode/tasks.json -!.vscode/launch.json -!.vscode/extensions.json -!.vscode/*.code-snippets - -### VisualStudioCode Patch ### -# Ignore all local history of files -.history -.ionide - -# Support for Project snippet scope -.vscode/*.code-snippets - -# Ignore code-workspaces -*.code-workspace - -# Ignore yalc -.yalc/ -yalc.lock - -stats.json -stats.html -.java-version -.eslintcache -tsconfig.tsbuildinfo - -test-report.html - -# Temporary files created by Metro to check the health of the file watcher -.metro-health-check* - -# Ignore tamagui config file -.tamagui -scripts/nitro-view/template/android/.gradle -lib \ No newline at end of file +# generated by nitrogen +nitrogen/ diff --git a/native-views/react-native-scroll-guard/nitrogen/generated/.gitattributes b/native-views/react-native-scroll-guard/nitrogen/generated/.gitattributes deleted file mode 100644 index fb7a0d5..0000000 --- a/native-views/react-native-scroll-guard/nitrogen/generated/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -** linguist-generated=true diff --git a/native-views/react-native-scroll-guard/nitrogen/generated/android/c++/JHybridScrollGuardSpec.cpp b/native-views/react-native-scroll-guard/nitrogen/generated/android/c++/JHybridScrollGuardSpec.cpp deleted file mode 100644 index 67c81ec..0000000 --- a/native-views/react-native-scroll-guard/nitrogen/generated/android/c++/JHybridScrollGuardSpec.cpp +++ /dev/null @@ -1,59 +0,0 @@ -/// -/// JHybridScrollGuardSpec.cpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#include "JHybridScrollGuardSpec.hpp" - -// Forward declaration of `ScrollGuardDirection` to properly resolve imports. -namespace margelo::nitro::scrollguard { enum class ScrollGuardDirection; } - -#include "ScrollGuardDirection.hpp" -#include -#include "JScrollGuardDirection.hpp" - -namespace margelo::nitro::scrollguard { - - jni::local_ref JHybridScrollGuardSpec::initHybrid(jni::alias_ref jThis) { - return makeCxxInstance(jThis); - } - - void JHybridScrollGuardSpec::registerNatives() { - registerHybrid({ - makeNativeMethod("initHybrid", JHybridScrollGuardSpec::initHybrid), - }); - } - - size_t JHybridScrollGuardSpec::getExternalMemorySize() noexcept { - static const auto method = javaClassStatic()->getMethod("getMemorySize"); - return method(_javaPart); - } - - void JHybridScrollGuardSpec::dispose() noexcept { - static const auto method = javaClassStatic()->getMethod("dispose"); - method(_javaPart); - } - - std::string JHybridScrollGuardSpec::toString() { - static const auto method = javaClassStatic()->getMethod("toString"); - auto javaString = method(_javaPart); - return javaString->toStdString(); - } - - // Properties - std::optional JHybridScrollGuardSpec::getDirection() { - static const auto method = javaClassStatic()->getMethod()>("getDirection"); - auto __result = method(_javaPart); - return __result != nullptr ? std::make_optional(__result->toCpp()) : std::nullopt; - } - void JHybridScrollGuardSpec::setDirection(std::optional direction) { - static const auto method = javaClassStatic()->getMethod /* direction */)>("setDirection"); - method(_javaPart, direction.has_value() ? JScrollGuardDirection::fromCpp(direction.value()) : nullptr); - } - - // Methods - - -} // namespace margelo::nitro::scrollguard diff --git a/native-views/react-native-scroll-guard/nitrogen/generated/android/c++/JHybridScrollGuardSpec.hpp b/native-views/react-native-scroll-guard/nitrogen/generated/android/c++/JHybridScrollGuardSpec.hpp deleted file mode 100644 index 40d1db5..0000000 --- a/native-views/react-native-scroll-guard/nitrogen/generated/android/c++/JHybridScrollGuardSpec.hpp +++ /dev/null @@ -1,66 +0,0 @@ -/// -/// HybridScrollGuardSpec.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#include -#include -#include "HybridScrollGuardSpec.hpp" - - - - -namespace margelo::nitro::scrollguard { - - using namespace facebook; - - class JHybridScrollGuardSpec: public jni::HybridClass, - public virtual HybridScrollGuardSpec { - public: - static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/scrollguard/HybridScrollGuardSpec;"; - static jni::local_ref initHybrid(jni::alias_ref jThis); - static void registerNatives(); - - protected: - // C++ constructor (called from Java via `initHybrid()`) - explicit JHybridScrollGuardSpec(jni::alias_ref jThis) : - HybridObject(HybridScrollGuardSpec::TAG), - HybridBase(jThis), - _javaPart(jni::make_global(jThis)) {} - - public: - ~JHybridScrollGuardSpec() override { - // Hermes GC can destroy JS objects on a non-JNI Thread. - jni::ThreadScope::WithClassLoader([&] { _javaPart.reset(); }); - } - - public: - size_t getExternalMemorySize() noexcept override; - void dispose() noexcept override; - std::string toString() override; - - public: - inline const jni::global_ref& getJavaPart() const noexcept { - return _javaPart; - } - - public: - // Properties - std::optional getDirection() override; - void setDirection(std::optional direction) override; - - public: - // Methods - - - private: - friend HybridBase; - using HybridBase::HybridBase; - jni::global_ref _javaPart; - }; - -} // namespace margelo::nitro::scrollguard diff --git a/native-views/react-native-scroll-guard/nitrogen/generated/android/c++/JScrollGuardDirection.hpp b/native-views/react-native-scroll-guard/nitrogen/generated/android/c++/JScrollGuardDirection.hpp deleted file mode 100644 index 797687c..0000000 --- a/native-views/react-native-scroll-guard/nitrogen/generated/android/c++/JScrollGuardDirection.hpp +++ /dev/null @@ -1,62 +0,0 @@ -/// -/// JScrollGuardDirection.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#include -#include "ScrollGuardDirection.hpp" - -namespace margelo::nitro::scrollguard { - - using namespace facebook; - - /** - * The C++ JNI bridge between the C++ enum "ScrollGuardDirection" and the the Kotlin enum "ScrollGuardDirection". - */ - struct JScrollGuardDirection final: public jni::JavaClass { - public: - static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/scrollguard/ScrollGuardDirection;"; - - public: - /** - * Convert this Java/Kotlin-based enum to the C++ enum ScrollGuardDirection. - */ - [[maybe_unused]] - [[nodiscard]] - ScrollGuardDirection toCpp() const { - static const auto clazz = javaClassStatic(); - static const auto fieldOrdinal = clazz->getField("value"); - int ordinal = this->getFieldValue(fieldOrdinal); - return static_cast(ordinal); - } - - public: - /** - * Create a Java/Kotlin-based enum with the given C++ enum's value. - */ - [[maybe_unused]] - static jni::alias_ref fromCpp(ScrollGuardDirection value) { - static const auto clazz = javaClassStatic(); - static const auto fieldHORIZONTAL = clazz->getStaticField("HORIZONTAL"); - static const auto fieldVERTICAL = clazz->getStaticField("VERTICAL"); - static const auto fieldBOTH = clazz->getStaticField("BOTH"); - - switch (value) { - case ScrollGuardDirection::HORIZONTAL: - return clazz->getStaticFieldValue(fieldHORIZONTAL); - case ScrollGuardDirection::VERTICAL: - return clazz->getStaticFieldValue(fieldVERTICAL); - case ScrollGuardDirection::BOTH: - return clazz->getStaticFieldValue(fieldBOTH); - default: - std::string stringValue = std::to_string(static_cast(value)); - throw std::invalid_argument("Invalid enum value (" + stringValue + "!"); - } - } - }; - -} // namespace margelo::nitro::scrollguard diff --git a/native-views/react-native-scroll-guard/nitrogen/generated/android/c++/views/JHybridScrollGuardStateUpdater.cpp b/native-views/react-native-scroll-guard/nitrogen/generated/android/c++/views/JHybridScrollGuardStateUpdater.cpp deleted file mode 100644 index 21575ab..0000000 --- a/native-views/react-native-scroll-guard/nitrogen/generated/android/c++/views/JHybridScrollGuardStateUpdater.cpp +++ /dev/null @@ -1,56 +0,0 @@ -/// -/// JHybridScrollGuardStateUpdater.cpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#include "JHybridScrollGuardStateUpdater.hpp" -#include "views/HybridScrollGuardComponent.hpp" -#include - -namespace margelo::nitro::scrollguard::views { - -using namespace facebook; -using ConcreteStateData = react::ConcreteState; - -void JHybridScrollGuardStateUpdater::updateViewProps(jni::alias_ref /* class */, - jni::alias_ref javaView, - jni::alias_ref stateWrapperInterface) { - JHybridScrollGuardSpec* view = javaView->cthis(); - - // Get concrete StateWrapperImpl from passed StateWrapper interface object - jobject rawStateWrapper = stateWrapperInterface.get(); - if (!stateWrapperInterface->isInstanceOf(react::StateWrapperImpl::javaClassStatic())) { - throw std::runtime_error("StateWrapper is not a StateWrapperImpl"); - } - auto stateWrapper = jni::alias_ref{ - static_cast(rawStateWrapper)}; - - std::shared_ptr state = stateWrapper->cthis()->getState(); - auto concreteState = std::dynamic_pointer_cast(state); - const HybridScrollGuardState& data = concreteState->getData(); - const std::optional& maybeProps = data.getProps(); - if (!maybeProps.has_value()) { - // Props aren't set yet! - throw std::runtime_error("HybridScrollGuardState's data doesn't contain any props!"); - } - const HybridScrollGuardProps& props = maybeProps.value(); - if (props.direction.isDirty) { - view->setDirection(props.direction.value); - // TODO: Set isDirty = false - } - - // Update hybridRef if it changed - if (props.hybridRef.isDirty) { - // hybridRef changed - call it with new this - const auto& maybeFunc = props.hybridRef.value; - if (maybeFunc.has_value()) { - std::shared_ptr shared = javaView->cthis()->shared_cast(); - maybeFunc.value()(shared); - } - // TODO: Set isDirty = false - } -} - -} // namespace margelo::nitro::scrollguard::views diff --git a/native-views/react-native-scroll-guard/nitrogen/generated/android/c++/views/JHybridScrollGuardStateUpdater.hpp b/native-views/react-native-scroll-guard/nitrogen/generated/android/c++/views/JHybridScrollGuardStateUpdater.hpp deleted file mode 100644 index 2550605..0000000 --- a/native-views/react-native-scroll-guard/nitrogen/generated/android/c++/views/JHybridScrollGuardStateUpdater.hpp +++ /dev/null @@ -1,49 +0,0 @@ -/// -/// JHybridScrollGuardStateUpdater.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#ifndef RN_SERIALIZABLE_STATE -#error scrollguard was compiled without the 'RN_SERIALIZABLE_STATE' flag. This flag is required for Nitro Views - set it in your CMakeLists! -#endif - -#include -#include -#include -#include -#include -#include -#include "JHybridScrollGuardSpec.hpp" -#include "views/HybridScrollGuardComponent.hpp" - -namespace margelo::nitro::scrollguard::views { - -using namespace facebook; - -class JHybridScrollGuardStateUpdater: public jni::JavaClass { -public: - static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/scrollguard/views/HybridScrollGuardStateUpdater;"; - -public: - static void updateViewProps(jni::alias_ref /* class */, - jni::alias_ref view, - jni::alias_ref stateWrapperInterface); - -public: - static void registerNatives() { - // Register JNI calls - javaClassStatic()->registerNatives({ - makeNativeMethod("updateViewProps", JHybridScrollGuardStateUpdater::updateViewProps), - }); - // Register React Native view component descriptor - auto provider = react::concreteComponentDescriptorProvider(); - auto providerRegistry = react::CoreComponentsRegistry::sharedProviderRegistry(); - providerRegistry->add(provider); - } -}; - -} // namespace margelo::nitro::scrollguard::views diff --git a/native-views/react-native-scroll-guard/nitrogen/generated/android/kotlin/com/margelo/nitro/scrollguard/HybridScrollGuardSpec.kt b/native-views/react-native-scroll-guard/nitrogen/generated/android/kotlin/com/margelo/nitro/scrollguard/HybridScrollGuardSpec.kt deleted file mode 100644 index 17bccb7..0000000 --- a/native-views/react-native-scroll-guard/nitrogen/generated/android/kotlin/com/margelo/nitro/scrollguard/HybridScrollGuardSpec.kt +++ /dev/null @@ -1,59 +0,0 @@ -/// -/// HybridScrollGuardSpec.kt -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -package com.margelo.nitro.scrollguard - -import androidx.annotation.Keep -import com.facebook.jni.HybridData -import com.facebook.proguard.annotations.DoNotStrip -import com.margelo.nitro.views.HybridView - -/** - * A Kotlin class representing the ScrollGuard HybridObject. - * Implement this abstract class to create Kotlin-based instances of ScrollGuard. - */ -@DoNotStrip -@Keep -@Suppress( - "KotlinJniMissingFunction", "unused", - "RedundantSuppression", "RedundantUnitReturnType", "SimpleRedundantLet", - "LocalVariableName", "PropertyName", "PrivatePropertyName", "FunctionName" -) -abstract class HybridScrollGuardSpec: HybridView() { - @DoNotStrip - private var mHybridData: HybridData = initHybrid() - - init { - super.updateNative(mHybridData) - } - - override fun updateNative(hybridData: HybridData) { - mHybridData = hybridData - super.updateNative(hybridData) - } - - // Default implementation of `HybridObject.toString()` - override fun toString(): String { - return "[HybridObject ScrollGuard]" - } - - // Properties - @get:DoNotStrip - @get:Keep - @set:DoNotStrip - @set:Keep - abstract var direction: ScrollGuardDirection? - - // Methods - - - private external fun initHybrid(): HybridData - - companion object { - protected const val TAG = "HybridScrollGuardSpec" - } -} diff --git a/native-views/react-native-scroll-guard/nitrogen/generated/android/kotlin/com/margelo/nitro/scrollguard/ScrollGuardDirection.kt b/native-views/react-native-scroll-guard/nitrogen/generated/android/kotlin/com/margelo/nitro/scrollguard/ScrollGuardDirection.kt deleted file mode 100644 index 38678a5..0000000 --- a/native-views/react-native-scroll-guard/nitrogen/generated/android/kotlin/com/margelo/nitro/scrollguard/ScrollGuardDirection.kt +++ /dev/null @@ -1,22 +0,0 @@ -/// -/// ScrollGuardDirection.kt -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -package com.margelo.nitro.scrollguard - -import androidx.annotation.Keep -import com.facebook.proguard.annotations.DoNotStrip - -/** - * Represents the JavaScript enum/union "ScrollGuardDirection". - */ -@DoNotStrip -@Keep -enum class ScrollGuardDirection(@DoNotStrip @Keep val value: Int) { - HORIZONTAL(0), - VERTICAL(1), - BOTH(2); -} diff --git a/native-views/react-native-scroll-guard/nitrogen/generated/android/kotlin/com/margelo/nitro/scrollguard/scrollguardOnLoad.kt b/native-views/react-native-scroll-guard/nitrogen/generated/android/kotlin/com/margelo/nitro/scrollguard/scrollguardOnLoad.kt deleted file mode 100644 index c6c0116..0000000 --- a/native-views/react-native-scroll-guard/nitrogen/generated/android/kotlin/com/margelo/nitro/scrollguard/scrollguardOnLoad.kt +++ /dev/null @@ -1,35 +0,0 @@ -/// -/// scrollguardOnLoad.kt -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -package com.margelo.nitro.scrollguard - -import android.util.Log - -internal class scrollguardOnLoad { - companion object { - private const val TAG = "scrollguardOnLoad" - private var didLoad = false - /** - * Initializes the native part of "scrollguard". - * This method is idempotent and can be called more than once. - */ - @JvmStatic - fun initializeNative() { - if (didLoad) return - try { - Log.i(TAG, "Loading scrollguard C++ library...") - System.loadLibrary("scrollguard") - Log.i(TAG, "Successfully loaded scrollguard C++ library!") - didLoad = true - } catch (e: Error) { - Log.e(TAG, "Failed to load scrollguard C++ library! Is it properly installed and linked? " + - "Is the name correct? (see `CMakeLists.txt`, at `add_library(...)`)", e) - throw e - } - } - } -} diff --git a/native-views/react-native-scroll-guard/nitrogen/generated/android/kotlin/com/margelo/nitro/scrollguard/views/HybridScrollGuardManager.kt b/native-views/react-native-scroll-guard/nitrogen/generated/android/kotlin/com/margelo/nitro/scrollguard/views/HybridScrollGuardManager.kt deleted file mode 100644 index 0a4a476..0000000 --- a/native-views/react-native-scroll-guard/nitrogen/generated/android/kotlin/com/margelo/nitro/scrollguard/views/HybridScrollGuardManager.kt +++ /dev/null @@ -1,50 +0,0 @@ -/// -/// HybridScrollGuardManager.kt -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -package com.margelo.nitro.scrollguard.views - -import android.view.View -import com.facebook.react.uimanager.ReactStylesDiffMap -import com.facebook.react.uimanager.SimpleViewManager -import com.facebook.react.uimanager.StateWrapper -import com.facebook.react.uimanager.ThemedReactContext -import com.margelo.nitro.scrollguard.* - -/** - * Represents the React Native `ViewManager` for the "ScrollGuard" Nitro HybridView. - */ -open class HybridScrollGuardManager: SimpleViewManager() { - private val views = hashMapOf() - - override fun getName(): String { - return "ScrollGuard" - } - - override fun createViewInstance(reactContext: ThemedReactContext): View { - val hybridView = HybridScrollGuard(reactContext) - val view = hybridView.view - views[view] = hybridView - return view - } - - override fun onDropViewInstance(view: View) { - super.onDropViewInstance(view) - views.remove(view) - } - - override fun updateState(view: View, props: ReactStylesDiffMap, stateWrapper: StateWrapper): Any? { - val hybridView = views[view] ?: throw Error("Couldn't find view $view in local views table!") - - // 1. Update each prop individually - hybridView.beforeUpdate() - HybridScrollGuardStateUpdater.updateViewProps(hybridView, stateWrapper) - hybridView.afterUpdate() - - // 2. Continue in base View props - return super.updateState(view, props, stateWrapper) - } -} diff --git a/native-views/react-native-scroll-guard/nitrogen/generated/android/kotlin/com/margelo/nitro/scrollguard/views/HybridScrollGuardStateUpdater.kt b/native-views/react-native-scroll-guard/nitrogen/generated/android/kotlin/com/margelo/nitro/scrollguard/views/HybridScrollGuardStateUpdater.kt deleted file mode 100644 index d248b3a..0000000 --- a/native-views/react-native-scroll-guard/nitrogen/generated/android/kotlin/com/margelo/nitro/scrollguard/views/HybridScrollGuardStateUpdater.kt +++ /dev/null @@ -1,23 +0,0 @@ -/// -/// HybridScrollGuardStateUpdater.kt -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -package com.margelo.nitro.scrollguard.views - -import com.facebook.react.uimanager.StateWrapper -import com.margelo.nitro.scrollguard.* - -internal class HybridScrollGuardStateUpdater { - companion object { - /** - * Updates the props for [view] through C++. - * The [state] prop is expected to contain [view]'s props as wrapped Fabric state. - */ - @Suppress("KotlinJniMissingFunction") - @JvmStatic - external fun updateViewProps(view: HybridScrollGuardSpec, state: StateWrapper) - } -} diff --git a/native-views/react-native-scroll-guard/nitrogen/generated/android/scrollguard+autolinking.cmake b/native-views/react-native-scroll-guard/nitrogen/generated/android/scrollguard+autolinking.cmake deleted file mode 100644 index 2a14bdd..0000000 --- a/native-views/react-native-scroll-guard/nitrogen/generated/android/scrollguard+autolinking.cmake +++ /dev/null @@ -1,83 +0,0 @@ -# -# scrollguard+autolinking.cmake -# This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -# https://github.com/mrousavy/nitro -# Copyright © 2026 Marc Rousavy @ Margelo -# - -# This is a CMake file that adds all files generated by Nitrogen -# to the current CMake project. -# -# To use it, add this to your CMakeLists.txt: -# ```cmake -# include(${CMAKE_SOURCE_DIR}/../nitrogen/generated/android/scrollguard+autolinking.cmake) -# ``` - -# Define a flag to check if we are building properly -add_definitions(-DBUILDING_SCROLLGUARD_WITH_GENERATED_CMAKE_PROJECT) - -# Enable Raw Props parsing in react-native (for Nitro Views) -add_definitions(-DRN_SERIALIZABLE_STATE) - -# Add all headers that were generated by Nitrogen -include_directories( - "../nitrogen/generated/shared/c++" - "../nitrogen/generated/android/c++" - "../nitrogen/generated/android/" -) - -# Add all .cpp sources that were generated by Nitrogen -target_sources( - # CMake project name (Android C++ library name) - scrollguard PRIVATE - # Autolinking Setup - ../nitrogen/generated/android/scrollguardOnLoad.cpp - # Shared Nitrogen C++ sources - ../nitrogen/generated/shared/c++/HybridScrollGuardSpec.cpp - ../nitrogen/generated/shared/c++/views/HybridScrollGuardComponent.cpp - # Android-specific Nitrogen C++ sources - ../nitrogen/generated/android/c++/JHybridScrollGuardSpec.cpp - ../nitrogen/generated/android/c++/views/JHybridScrollGuardStateUpdater.cpp -) - -# From node_modules/react-native/ReactAndroid/cmake-utils/folly-flags.cmake -# Used in node_modules/react-native/ReactAndroid/cmake-utils/ReactNative-application.cmake -target_compile_definitions( - scrollguard PRIVATE - -DFOLLY_NO_CONFIG=1 - -DFOLLY_HAVE_CLOCK_GETTIME=1 - -DFOLLY_USE_LIBCPP=1 - -DFOLLY_CFG_NO_COROUTINES=1 - -DFOLLY_MOBILE=1 - -DFOLLY_HAVE_RECVMMSG=1 - -DFOLLY_HAVE_PTHREAD=1 - # Once we target android-23 above, we can comment - # the following line. NDK uses GNU style stderror_r() after API 23. - -DFOLLY_HAVE_XSI_STRERROR_R=1 -) - -# Add all libraries required by the generated specs -find_package(fbjni REQUIRED) # <-- Used for communication between Java <-> C++ -find_package(ReactAndroid REQUIRED) # <-- Used to set up React Native bindings (e.g. CallInvoker/TurboModule) -find_package(react-native-nitro-modules REQUIRED) # <-- Used to create all HybridObjects and use the Nitro core library - -# Link all libraries together -target_link_libraries( - scrollguard - fbjni::fbjni # <-- Facebook C++ JNI helpers - ReactAndroid::jsi # <-- RN: JSI - react-native-nitro-modules::NitroModules # <-- NitroModules Core :) -) - -# Link react-native (different prefab between RN 0.75 and RN 0.76) -if(ReactAndroid_VERSION_MINOR GREATER_EQUAL 76) - target_link_libraries( - scrollguard - ReactAndroid::reactnative # <-- RN: Native Modules umbrella prefab - ) -else() - target_link_libraries( - scrollguard - ReactAndroid::react_nativemodule_core # <-- RN: TurboModules Core - ) -endif() diff --git a/native-views/react-native-scroll-guard/nitrogen/generated/android/scrollguard+autolinking.gradle b/native-views/react-native-scroll-guard/nitrogen/generated/android/scrollguard+autolinking.gradle deleted file mode 100644 index 4919b89..0000000 --- a/native-views/react-native-scroll-guard/nitrogen/generated/android/scrollguard+autolinking.gradle +++ /dev/null @@ -1,27 +0,0 @@ -/// -/// scrollguard+autolinking.gradle -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -/// This is a Gradle file that adds all files generated by Nitrogen -/// to the current Gradle project. -/// -/// To use it, add this to your build.gradle: -/// ```gradle -/// apply from: '../nitrogen/generated/android/scrollguard+autolinking.gradle' -/// ``` - -logger.warn("[NitroModules] 🔥 scrollguard is boosted by nitro!") - -android { - sourceSets { - main { - java.srcDirs += [ - // Nitrogen files - "${project.projectDir}/../nitrogen/generated/android/kotlin" - ] - } - } -} diff --git a/native-views/react-native-scroll-guard/nitrogen/generated/android/scrollguardOnLoad.cpp b/native-views/react-native-scroll-guard/nitrogen/generated/android/scrollguardOnLoad.cpp deleted file mode 100644 index cae7801..0000000 --- a/native-views/react-native-scroll-guard/nitrogen/generated/android/scrollguardOnLoad.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/// -/// scrollguardOnLoad.cpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#ifndef BUILDING_SCROLLGUARD_WITH_GENERATED_CMAKE_PROJECT -#error scrollguardOnLoad.cpp is not being built with the autogenerated CMakeLists.txt project. Is a different CMakeLists.txt building this? -#endif - -#include "scrollguardOnLoad.hpp" - -#include -#include -#include - -#include "JHybridScrollGuardSpec.hpp" -#include "views/JHybridScrollGuardStateUpdater.hpp" -#include - -namespace margelo::nitro::scrollguard { - -int initialize(JavaVM* vm) { - using namespace margelo::nitro; - using namespace margelo::nitro::scrollguard; - using namespace facebook; - - return facebook::jni::initialize(vm, [] { - // Register native JNI methods - margelo::nitro::scrollguard::JHybridScrollGuardSpec::registerNatives(); - margelo::nitro::scrollguard::views::JHybridScrollGuardStateUpdater::registerNatives(); - - // Register Nitro Hybrid Objects - HybridObjectRegistry::registerHybridObjectConstructor( - "ScrollGuard", - []() -> std::shared_ptr { - static DefaultConstructableObject object("com/margelo/nitro/scrollguard/HybridScrollGuard"); - auto instance = object.create(); - return instance->cthis()->shared(); - } - ); - }); -} - -} // namespace margelo::nitro::scrollguard diff --git a/native-views/react-native-scroll-guard/nitrogen/generated/android/scrollguardOnLoad.hpp b/native-views/react-native-scroll-guard/nitrogen/generated/android/scrollguardOnLoad.hpp deleted file mode 100644 index 9e629ca..0000000 --- a/native-views/react-native-scroll-guard/nitrogen/generated/android/scrollguardOnLoad.hpp +++ /dev/null @@ -1,25 +0,0 @@ -/// -/// scrollguardOnLoad.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#include -#include - -namespace margelo::nitro::scrollguard { - - /** - * Initializes the native (C++) part of scrollguard, and autolinks all Hybrid Objects. - * Call this in your `JNI_OnLoad` function (probably inside `cpp-adapter.cpp`). - * Example: - * ```cpp (cpp-adapter.cpp) - * JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void*) { - * return margelo::nitro::scrollguard::initialize(vm); - * } - * ``` - */ - int initialize(JavaVM* vm); - -} // namespace margelo::nitro::scrollguard diff --git a/native-views/react-native-scroll-guard/nitrogen/generated/ios/ScrollGuard+autolinking.rb b/native-views/react-native-scroll-guard/nitrogen/generated/ios/ScrollGuard+autolinking.rb deleted file mode 100644 index c58fc77..0000000 --- a/native-views/react-native-scroll-guard/nitrogen/generated/ios/ScrollGuard+autolinking.rb +++ /dev/null @@ -1,60 +0,0 @@ -# -# ScrollGuard+autolinking.rb -# This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -# https://github.com/mrousavy/nitro -# Copyright © 2026 Marc Rousavy @ Margelo -# - -# This is a Ruby script that adds all files generated by Nitrogen -# to the given podspec. -# -# To use it, add this to your .podspec: -# ```ruby -# Pod::Spec.new do |spec| -# # ... -# -# # Add all files generated by Nitrogen -# load 'nitrogen/generated/ios/ScrollGuard+autolinking.rb' -# add_nitrogen_files(spec) -# end -# ``` - -def add_nitrogen_files(spec) - Pod::UI.puts "[NitroModules] 🔥 ScrollGuard is boosted by nitro!" - - spec.dependency "NitroModules" - - current_source_files = Array(spec.attributes_hash['source_files']) - spec.source_files = current_source_files + [ - # Generated cross-platform specs - "nitrogen/generated/shared/**/*.{h,hpp,c,cpp,swift}", - # Generated bridges for the cross-platform specs - "nitrogen/generated/ios/**/*.{h,hpp,c,cpp,mm,swift}", - ] - - current_public_header_files = Array(spec.attributes_hash['public_header_files']) - spec.public_header_files = current_public_header_files + [ - # Generated specs - "nitrogen/generated/shared/**/*.{h,hpp}", - # Swift to C++ bridging helpers - "nitrogen/generated/ios/ScrollGuard-Swift-Cxx-Bridge.hpp" - ] - - current_private_header_files = Array(spec.attributes_hash['private_header_files']) - spec.private_header_files = current_private_header_files + [ - # iOS specific specs - "nitrogen/generated/ios/c++/**/*.{h,hpp}", - # Views are framework-specific and should be private - "nitrogen/generated/shared/**/views/**/*" - ] - - current_pod_target_xcconfig = spec.attributes_hash['pod_target_xcconfig'] || {} - spec.pod_target_xcconfig = current_pod_target_xcconfig.merge({ - # Use C++ 20 - "CLANG_CXX_LANGUAGE_STANDARD" => "c++20", - # Enables C++ <-> Swift interop (by default it's only C) - "SWIFT_OBJC_INTEROP_MODE" => "objcxx", - # Enables stricter modular headers - "DEFINES_MODULE" => "YES", - }) -end diff --git a/native-views/react-native-scroll-guard/nitrogen/generated/ios/ScrollGuard-Swift-Cxx-Bridge.cpp b/native-views/react-native-scroll-guard/nitrogen/generated/ios/ScrollGuard-Swift-Cxx-Bridge.cpp deleted file mode 100644 index 9d19a72..0000000 --- a/native-views/react-native-scroll-guard/nitrogen/generated/ios/ScrollGuard-Swift-Cxx-Bridge.cpp +++ /dev/null @@ -1,33 +0,0 @@ -/// -/// ScrollGuard-Swift-Cxx-Bridge.cpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#include "ScrollGuard-Swift-Cxx-Bridge.hpp" - -// Include C++ implementation defined types -#include "HybridScrollGuardSpecSwift.hpp" -#include "ScrollGuard-Swift-Cxx-Umbrella.hpp" -#include - -namespace margelo::nitro::scrollguard::bridge::swift { - - // pragma MARK: std::shared_ptr - std::shared_ptr create_std__shared_ptr_HybridScrollGuardSpec_(void* NON_NULL swiftUnsafePointer) noexcept { - ScrollGuard::HybridScrollGuardSpec_cxx swiftPart = ScrollGuard::HybridScrollGuardSpec_cxx::fromUnsafe(swiftUnsafePointer); - return std::make_shared(swiftPart); - } - void* NON_NULL get_std__shared_ptr_HybridScrollGuardSpec_(std__shared_ptr_HybridScrollGuardSpec_ cppType) { - std::shared_ptr swiftWrapper = std::dynamic_pointer_cast(cppType); - #ifdef NITRO_DEBUG - if (swiftWrapper == nullptr) [[unlikely]] { - throw std::runtime_error("Class \"HybridScrollGuardSpec\" is not implemented in Swift!"); - } - #endif - ScrollGuard::HybridScrollGuardSpec_cxx& swiftPart = swiftWrapper->getSwiftPart(); - return swiftPart.toUnsafe(); - } - -} // namespace margelo::nitro::scrollguard::bridge::swift diff --git a/native-views/react-native-scroll-guard/nitrogen/generated/ios/ScrollGuard-Swift-Cxx-Bridge.hpp b/native-views/react-native-scroll-guard/nitrogen/generated/ios/ScrollGuard-Swift-Cxx-Bridge.hpp deleted file mode 100644 index b88ea20..0000000 --- a/native-views/react-native-scroll-guard/nitrogen/generated/ios/ScrollGuard-Swift-Cxx-Bridge.hpp +++ /dev/null @@ -1,59 +0,0 @@ -/// -/// ScrollGuard-Swift-Cxx-Bridge.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -// Forward declarations of C++ defined types -// Forward declaration of `HybridScrollGuardSpec` to properly resolve imports. -namespace margelo::nitro::scrollguard { class HybridScrollGuardSpec; } -// Forward declaration of `ScrollGuardDirection` to properly resolve imports. -namespace margelo::nitro::scrollguard { enum class ScrollGuardDirection; } - -// Forward declarations of Swift defined types -// Forward declaration of `HybridScrollGuardSpec_cxx` to properly resolve imports. -namespace ScrollGuard { class HybridScrollGuardSpec_cxx; } - -// Include C++ defined types -#include "HybridScrollGuardSpec.hpp" -#include "ScrollGuardDirection.hpp" -#include -#include - -/** - * Contains specialized versions of C++ templated types so they can be accessed from Swift, - * as well as helper functions to interact with those C++ types from Swift. - */ -namespace margelo::nitro::scrollguard::bridge::swift { - - // pragma MARK: std::optional - /** - * Specialized version of `std::optional`. - */ - using std__optional_ScrollGuardDirection_ = std::optional; - inline std::optional create_std__optional_ScrollGuardDirection_(const ScrollGuardDirection& value) noexcept { - return std::optional(value); - } - inline bool has_value_std__optional_ScrollGuardDirection_(const std::optional& optional) noexcept { - return optional.has_value(); - } - inline ScrollGuardDirection get_std__optional_ScrollGuardDirection_(const std::optional& optional) noexcept { - return *optional; - } - - // pragma MARK: std::shared_ptr - /** - * Specialized version of `std::shared_ptr`. - */ - using std__shared_ptr_HybridScrollGuardSpec_ = std::shared_ptr; - std::shared_ptr create_std__shared_ptr_HybridScrollGuardSpec_(void* NON_NULL swiftUnsafePointer) noexcept; - void* NON_NULL get_std__shared_ptr_HybridScrollGuardSpec_(std__shared_ptr_HybridScrollGuardSpec_ cppType); - - // pragma MARK: std::weak_ptr - using std__weak_ptr_HybridScrollGuardSpec_ = std::weak_ptr; - inline std__weak_ptr_HybridScrollGuardSpec_ weakify_std__shared_ptr_HybridScrollGuardSpec_(const std::shared_ptr& strong) noexcept { return strong; } - -} // namespace margelo::nitro::scrollguard::bridge::swift diff --git a/native-views/react-native-scroll-guard/nitrogen/generated/ios/ScrollGuard-Swift-Cxx-Umbrella.hpp b/native-views/react-native-scroll-guard/nitrogen/generated/ios/ScrollGuard-Swift-Cxx-Umbrella.hpp deleted file mode 100644 index 5005e8b..0000000 --- a/native-views/react-native-scroll-guard/nitrogen/generated/ios/ScrollGuard-Swift-Cxx-Umbrella.hpp +++ /dev/null @@ -1,45 +0,0 @@ -/// -/// ScrollGuard-Swift-Cxx-Umbrella.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -// Forward declarations of C++ defined types -// Forward declaration of `HybridScrollGuardSpec` to properly resolve imports. -namespace margelo::nitro::scrollguard { class HybridScrollGuardSpec; } -// Forward declaration of `ScrollGuardDirection` to properly resolve imports. -namespace margelo::nitro::scrollguard { enum class ScrollGuardDirection; } - -// Include C++ defined types -#include "HybridScrollGuardSpec.hpp" -#include "ScrollGuardDirection.hpp" -#include -#include - -// C++ helpers for Swift -#include "ScrollGuard-Swift-Cxx-Bridge.hpp" - -// Common C++ types used in Swift -#include -#include -#include -#include - -// Forward declarations of Swift defined types -// Forward declaration of `HybridScrollGuardSpec_cxx` to properly resolve imports. -namespace ScrollGuard { class HybridScrollGuardSpec_cxx; } - -// Include Swift defined types -#if __has_include("ScrollGuard-Swift.h") -// This header is generated by Xcode/Swift on every app build. -// If it cannot be found, make sure the Swift module's name (= podspec name) is actually "ScrollGuard". -#include "ScrollGuard-Swift.h" -// Same as above, but used when building with frameworks (`use_frameworks`) -#elif __has_include() -#include -#else -#error ScrollGuard's autogenerated Swift header cannot be found! Make sure the Swift module's name (= podspec name) is actually "ScrollGuard", and try building the app first. -#endif diff --git a/native-views/react-native-scroll-guard/nitrogen/generated/ios/ScrollGuardAutolinking.mm b/native-views/react-native-scroll-guard/nitrogen/generated/ios/ScrollGuardAutolinking.mm deleted file mode 100644 index 8a40d3f..0000000 --- a/native-views/react-native-scroll-guard/nitrogen/generated/ios/ScrollGuardAutolinking.mm +++ /dev/null @@ -1,33 +0,0 @@ -/// -/// ScrollGuardAutolinking.mm -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#import -#import -#import "ScrollGuard-Swift-Cxx-Umbrella.hpp" -#import - -#include "HybridScrollGuardSpecSwift.hpp" - -@interface ScrollGuardAutolinking : NSObject -@end - -@implementation ScrollGuardAutolinking - -+ (void) load { - using namespace margelo::nitro; - using namespace margelo::nitro::scrollguard; - - HybridObjectRegistry::registerHybridObjectConstructor( - "ScrollGuard", - []() -> std::shared_ptr { - std::shared_ptr hybridObject = ScrollGuard::ScrollGuardAutolinking::createScrollGuard(); - return hybridObject; - } - ); -} - -@end diff --git a/native-views/react-native-scroll-guard/nitrogen/generated/ios/ScrollGuardAutolinking.swift b/native-views/react-native-scroll-guard/nitrogen/generated/ios/ScrollGuardAutolinking.swift deleted file mode 100644 index 418c9fd..0000000 --- a/native-views/react-native-scroll-guard/nitrogen/generated/ios/ScrollGuardAutolinking.swift +++ /dev/null @@ -1,25 +0,0 @@ -/// -/// ScrollGuardAutolinking.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -public final class ScrollGuardAutolinking { - public typealias bridge = margelo.nitro.scrollguard.bridge.swift - - /** - * Creates an instance of a Swift class that implements `HybridScrollGuardSpec`, - * and wraps it in a Swift class that can directly interop with C++ (`HybridScrollGuardSpec_cxx`) - * - * This is generated by Nitrogen and will initialize the class specified - * in the `"autolinking"` property of `nitro.json` (in this case, `HybridScrollGuard`). - */ - public static func createScrollGuard() -> bridge.std__shared_ptr_HybridScrollGuardSpec_ { - let hybridObject = HybridScrollGuard() - return { () -> bridge.std__shared_ptr_HybridScrollGuardSpec_ in - let __cxxWrapped = hybridObject.getCxxWrapper() - return __cxxWrapped.getCxxPart() - }() - } -} diff --git a/native-views/react-native-scroll-guard/nitrogen/generated/ios/c++/HybridScrollGuardSpecSwift.cpp b/native-views/react-native-scroll-guard/nitrogen/generated/ios/c++/HybridScrollGuardSpecSwift.cpp deleted file mode 100644 index cc884b3..0000000 --- a/native-views/react-native-scroll-guard/nitrogen/generated/ios/c++/HybridScrollGuardSpecSwift.cpp +++ /dev/null @@ -1,11 +0,0 @@ -/// -/// HybridScrollGuardSpecSwift.cpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#include "HybridScrollGuardSpecSwift.hpp" - -namespace margelo::nitro::scrollguard { -} // namespace margelo::nitro::scrollguard diff --git a/native-views/react-native-scroll-guard/nitrogen/generated/ios/c++/HybridScrollGuardSpecSwift.hpp b/native-views/react-native-scroll-guard/nitrogen/generated/ios/c++/HybridScrollGuardSpecSwift.hpp deleted file mode 100644 index a04e1ca..0000000 --- a/native-views/react-native-scroll-guard/nitrogen/generated/ios/c++/HybridScrollGuardSpecSwift.hpp +++ /dev/null @@ -1,77 +0,0 @@ -/// -/// HybridScrollGuardSpecSwift.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#include "HybridScrollGuardSpec.hpp" - -// Forward declaration of `HybridScrollGuardSpec_cxx` to properly resolve imports. -namespace ScrollGuard { class HybridScrollGuardSpec_cxx; } - -// Forward declaration of `ScrollGuardDirection` to properly resolve imports. -namespace margelo::nitro::scrollguard { enum class ScrollGuardDirection; } - -#include "ScrollGuardDirection.hpp" -#include - -#include "ScrollGuard-Swift-Cxx-Umbrella.hpp" - -namespace margelo::nitro::scrollguard { - - /** - * The C++ part of HybridScrollGuardSpec_cxx.swift. - * - * HybridScrollGuardSpecSwift (C++) accesses HybridScrollGuardSpec_cxx (Swift), and might - * contain some additional bridging code for C++ <> Swift interop. - * - * Since this obviously introduces an overhead, I hope at some point in - * the future, HybridScrollGuardSpec_cxx can directly inherit from the C++ class HybridScrollGuardSpec - * to simplify the whole structure and memory management. - */ - class HybridScrollGuardSpecSwift: public virtual HybridScrollGuardSpec { - public: - // Constructor from a Swift instance - explicit HybridScrollGuardSpecSwift(const ScrollGuard::HybridScrollGuardSpec_cxx& swiftPart): - HybridObject(HybridScrollGuardSpec::TAG), - _swiftPart(swiftPart) { } - - public: - // Get the Swift part - inline ScrollGuard::HybridScrollGuardSpec_cxx& getSwiftPart() noexcept { - return _swiftPart; - } - - public: - inline size_t getExternalMemorySize() noexcept override { - return _swiftPart.getMemorySize(); - } - void dispose() noexcept override { - _swiftPart.dispose(); - } - std::string toString() override { - return _swiftPart.toString(); - } - - public: - // Properties - inline std::optional getDirection() noexcept override { - auto __result = _swiftPart.getDirection(); - return __result; - } - inline void setDirection(std::optional direction) noexcept override { - _swiftPart.setDirection(direction); - } - - public: - // Methods - - - private: - ScrollGuard::HybridScrollGuardSpec_cxx _swiftPart; - }; - -} // namespace margelo::nitro::scrollguard diff --git a/native-views/react-native-scroll-guard/nitrogen/generated/ios/c++/views/HybridScrollGuardComponent.mm b/native-views/react-native-scroll-guard/nitrogen/generated/ios/c++/views/HybridScrollGuardComponent.mm deleted file mode 100644 index fdb3bdc..0000000 --- a/native-views/react-native-scroll-guard/nitrogen/generated/ios/c++/views/HybridScrollGuardComponent.mm +++ /dev/null @@ -1,96 +0,0 @@ -/// -/// HybridScrollGuardComponent.mm -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#import "HybridScrollGuardComponent.hpp" -#import -#import -#import -#import -#import -#import -#import - -#import "HybridScrollGuardSpecSwift.hpp" -#import "ScrollGuard-Swift-Cxx-Umbrella.hpp" - -using namespace facebook; -using namespace margelo::nitro::scrollguard; -using namespace margelo::nitro::scrollguard::views; - -/** - * Represents the React Native View holder for the Nitro "ScrollGuard" HybridView. - */ -@interface HybridScrollGuardComponent: RCTViewComponentView -@end - -@implementation HybridScrollGuardComponent { - std::shared_ptr _hybridView; -} - -+ (void) load { - [super load]; - [RCTComponentViewFactory.currentComponentViewFactory registerComponentViewClass:[HybridScrollGuardComponent class]]; -} - -+ (react::ComponentDescriptorProvider) componentDescriptorProvider { - return react::concreteComponentDescriptorProvider(); -} - -- (instancetype) init { - if (self = [super init]) { - std::shared_ptr hybridView = ScrollGuard::ScrollGuardAutolinking::createScrollGuard(); - _hybridView = std::dynamic_pointer_cast(hybridView); - [self updateView]; - } - return self; -} - -- (void) updateView { - // 1. Get Swift part - ScrollGuard::HybridScrollGuardSpec_cxx& swiftPart = _hybridView->getSwiftPart(); - - // 2. Get UIView* - void* viewUnsafe = swiftPart.getView(); - UIView* view = (__bridge_transfer UIView*) viewUnsafe; - - // 3. Update RCTViewComponentView's [contentView] - [self setContentView:view]; -} - -- (void) updateProps:(const std::shared_ptr&)props - oldProps:(const std::shared_ptr&)oldProps { - // 1. Downcast props - const auto& newViewPropsConst = *std::static_pointer_cast(props); - auto& newViewProps = const_cast(newViewPropsConst); - ScrollGuard::HybridScrollGuardSpec_cxx& swiftPart = _hybridView->getSwiftPart(); - - // 2. Update each prop individually - swiftPart.beforeUpdate(); - - // direction: optional - if (newViewProps.direction.isDirty) { - swiftPart.setDirection(newViewProps.direction.value); - newViewProps.direction.isDirty = false; - } - - swiftPart.afterUpdate(); - - // 3. Update hybridRef if it changed - if (newViewProps.hybridRef.isDirty) { - // hybridRef changed - call it with new this - const auto& maybeFunc = newViewProps.hybridRef.value; - if (maybeFunc.has_value()) { - maybeFunc.value()(_hybridView); - } - newViewProps.hybridRef.isDirty = false; - } - - // 4. Continue in base class - [super updateProps:props oldProps:oldProps]; -} - -@end diff --git a/native-views/react-native-scroll-guard/nitrogen/generated/ios/swift/HybridScrollGuardSpec.swift b/native-views/react-native-scroll-guard/nitrogen/generated/ios/swift/HybridScrollGuardSpec.swift deleted file mode 100644 index 904b4f6..0000000 --- a/native-views/react-native-scroll-guard/nitrogen/generated/ios/swift/HybridScrollGuardSpec.swift +++ /dev/null @@ -1,56 +0,0 @@ -/// -/// HybridScrollGuardSpec.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/// See ``HybridScrollGuardSpec`` -public protocol HybridScrollGuardSpec_protocol: HybridObject, HybridView { - // Properties - var direction: ScrollGuardDirection? { get set } - - // Methods - -} - -public extension HybridScrollGuardSpec_protocol { - /// Default implementation of ``HybridObject.toString`` - func toString() -> String { - return "[HybridObject ScrollGuard]" - } -} - -/// See ``HybridScrollGuardSpec`` -open class HybridScrollGuardSpec_base { - private weak var cxxWrapper: HybridScrollGuardSpec_cxx? = nil - public init() { } - public func getCxxWrapper() -> HybridScrollGuardSpec_cxx { - #if DEBUG - guard self is HybridScrollGuardSpec else { - fatalError("`self` is not a `HybridScrollGuardSpec`! Did you accidentally inherit from `HybridScrollGuardSpec_base` instead of `HybridScrollGuardSpec`?") - } - #endif - if let cxxWrapper = self.cxxWrapper { - return cxxWrapper - } else { - let cxxWrapper = HybridScrollGuardSpec_cxx(self as! HybridScrollGuardSpec) - self.cxxWrapper = cxxWrapper - return cxxWrapper - } - } -} - -/** - * A Swift base-protocol representing the ScrollGuard HybridObject. - * Implement this protocol to create Swift-based instances of ScrollGuard. - * ```swift - * class HybridScrollGuard : HybridScrollGuardSpec { - * // ... - * } - * ``` - */ -public typealias HybridScrollGuardSpec = HybridScrollGuardSpec_protocol & HybridScrollGuardSpec_base diff --git a/native-views/react-native-scroll-guard/nitrogen/generated/ios/swift/HybridScrollGuardSpec_cxx.swift b/native-views/react-native-scroll-guard/nitrogen/generated/ios/swift/HybridScrollGuardSpec_cxx.swift deleted file mode 100644 index 9bc1294..0000000 --- a/native-views/react-native-scroll-guard/nitrogen/generated/ios/swift/HybridScrollGuardSpec_cxx.swift +++ /dev/null @@ -1,146 +0,0 @@ -/// -/// HybridScrollGuardSpec_cxx.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -import Foundation -import NitroModules - -/** - * A class implementation that bridges HybridScrollGuardSpec over to C++. - * In C++, we cannot use Swift protocols - so we need to wrap it in a class to make it strongly defined. - * - * Also, some Swift types need to be bridged with special handling: - * - Enums need to be wrapped in Structs, otherwise they cannot be accessed bi-directionally (Swift bug: https://github.com/swiftlang/swift/issues/75330) - * - Other HybridObjects need to be wrapped/unwrapped from the Swift TCxx wrapper - * - Throwing methods need to be wrapped with a Result type, as exceptions cannot be propagated to C++ - */ -open class HybridScrollGuardSpec_cxx { - /** - * The Swift <> C++ bridge's namespace (`margelo::nitro::scrollguard::bridge::swift`) - * from `ScrollGuard-Swift-Cxx-Bridge.hpp`. - * This contains specialized C++ templates, and C++ helper functions that can be accessed from Swift. - */ - public typealias bridge = margelo.nitro.scrollguard.bridge.swift - - /** - * Holds an instance of the `HybridScrollGuardSpec` Swift protocol. - */ - private var __implementation: any HybridScrollGuardSpec - - /** - * Holds a weak pointer to the C++ class that wraps the Swift class. - */ - private var __cxxPart: bridge.std__weak_ptr_HybridScrollGuardSpec_ - - /** - * Create a new `HybridScrollGuardSpec_cxx` that wraps the given `HybridScrollGuardSpec`. - * All properties and methods bridge to C++ types. - */ - public init(_ implementation: any HybridScrollGuardSpec) { - self.__implementation = implementation - self.__cxxPart = .init() - /* no base class */ - } - - /** - * Get the actual `HybridScrollGuardSpec` instance this class wraps. - */ - @inline(__always) - public func getHybridScrollGuardSpec() -> any HybridScrollGuardSpec { - return __implementation - } - - /** - * Casts this instance to a retained unsafe raw pointer. - * This acquires one additional strong reference on the object! - */ - public func toUnsafe() -> UnsafeMutableRawPointer { - return Unmanaged.passRetained(self).toOpaque() - } - - /** - * Casts an unsafe pointer to a `HybridScrollGuardSpec_cxx`. - * The pointer has to be a retained opaque `Unmanaged`. - * This removes one strong reference from the object! - */ - public class func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> HybridScrollGuardSpec_cxx { - return Unmanaged.fromOpaque(pointer).takeRetainedValue() - } - - /** - * Gets (or creates) the C++ part of this Hybrid Object. - * The C++ part is a `std::shared_ptr`. - */ - public func getCxxPart() -> bridge.std__shared_ptr_HybridScrollGuardSpec_ { - let cachedCxxPart = self.__cxxPart.lock() - if Bool(fromCxx: cachedCxxPart) { - return cachedCxxPart - } else { - let newCxxPart = bridge.create_std__shared_ptr_HybridScrollGuardSpec_(self.toUnsafe()) - __cxxPart = bridge.weakify_std__shared_ptr_HybridScrollGuardSpec_(newCxxPart) - return newCxxPart - } - } - - - - /** - * Get the memory size of the Swift class (plus size of any other allocations) - * so the JS VM can properly track it and garbage-collect the JS object if needed. - */ - @inline(__always) - public var memorySize: Int { - return MemoryHelper.getSizeOf(self.__implementation) + self.__implementation.memorySize - } - - /** - * Call dispose() on the Swift class. - * This _may_ be called manually from JS. - */ - @inline(__always) - public func dispose() { - self.__implementation.dispose() - } - - /** - * Call toString() on the Swift class. - */ - @inline(__always) - public func toString() -> String { - return self.__implementation.toString() - } - - // Properties - public final var direction: bridge.std__optional_ScrollGuardDirection_ { - @inline(__always) - get { - return { () -> bridge.std__optional_ScrollGuardDirection_ in - if let __unwrappedValue = self.__implementation.direction { - return bridge.create_std__optional_ScrollGuardDirection_(__unwrappedValue) - } else { - return .init() - } - }() - } - @inline(__always) - set { - self.__implementation.direction = newValue.value - } - } - - // Methods - public final func getView() -> UnsafeMutableRawPointer { - return Unmanaged.passRetained(__implementation.view).toOpaque() - } - - public final func beforeUpdate() { - __implementation.beforeUpdate() - } - - public final func afterUpdate() { - __implementation.afterUpdate() - } -} diff --git a/native-views/react-native-scroll-guard/nitrogen/generated/ios/swift/ScrollGuardDirection.swift b/native-views/react-native-scroll-guard/nitrogen/generated/ios/swift/ScrollGuardDirection.swift deleted file mode 100644 index 66d2452..0000000 --- a/native-views/react-native-scroll-guard/nitrogen/generated/ios/swift/ScrollGuardDirection.swift +++ /dev/null @@ -1,44 +0,0 @@ -/// -/// ScrollGuardDirection.swift -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -/** - * Represents the JS union `ScrollGuardDirection`, backed by a C++ enum. - */ -public typealias ScrollGuardDirection = margelo.nitro.scrollguard.ScrollGuardDirection - -public extension ScrollGuardDirection { - /** - * Get a ScrollGuardDirection for the given String value, or - * return `nil` if the given value was invalid/unknown. - */ - init?(fromString string: String) { - switch string { - case "horizontal": - self = .horizontal - case "vertical": - self = .vertical - case "both": - self = .both - default: - return nil - } - } - - /** - * Get the String value this ScrollGuardDirection represents. - */ - var stringValue: String { - switch self { - case .horizontal: - return "horizontal" - case .vertical: - return "vertical" - case .both: - return "both" - } - } -} diff --git a/native-views/react-native-scroll-guard/nitrogen/generated/shared/c++/HybridScrollGuardSpec.cpp b/native-views/react-native-scroll-guard/nitrogen/generated/shared/c++/HybridScrollGuardSpec.cpp deleted file mode 100644 index bee575f..0000000 --- a/native-views/react-native-scroll-guard/nitrogen/generated/shared/c++/HybridScrollGuardSpec.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/// -/// HybridScrollGuardSpec.cpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#include "HybridScrollGuardSpec.hpp" - -namespace margelo::nitro::scrollguard { - - void HybridScrollGuardSpec::loadHybridMethods() { - // load base methods/properties - HybridObject::loadHybridMethods(); - // load custom methods/properties - registerHybrids(this, [](Prototype& prototype) { - prototype.registerHybridGetter("direction", &HybridScrollGuardSpec::getDirection); - prototype.registerHybridSetter("direction", &HybridScrollGuardSpec::setDirection); - }); - } - -} // namespace margelo::nitro::scrollguard diff --git a/native-views/react-native-scroll-guard/nitrogen/generated/shared/c++/HybridScrollGuardSpec.hpp b/native-views/react-native-scroll-guard/nitrogen/generated/shared/c++/HybridScrollGuardSpec.hpp deleted file mode 100644 index 00ffcf6..0000000 --- a/native-views/react-native-scroll-guard/nitrogen/generated/shared/c++/HybridScrollGuardSpec.hpp +++ /dev/null @@ -1,65 +0,0 @@ -/// -/// HybridScrollGuardSpec.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif - -// Forward declaration of `ScrollGuardDirection` to properly resolve imports. -namespace margelo::nitro::scrollguard { enum class ScrollGuardDirection; } - -#include "ScrollGuardDirection.hpp" -#include - -namespace margelo::nitro::scrollguard { - - using namespace margelo::nitro; - - /** - * An abstract base class for `ScrollGuard` - * Inherit this class to create instances of `HybridScrollGuardSpec` in C++. - * You must explicitly call `HybridObject`'s constructor yourself, because it is virtual. - * @example - * ```cpp - * class HybridScrollGuard: public HybridScrollGuardSpec { - * public: - * HybridScrollGuard(...): HybridObject(TAG) { ... } - * // ... - * }; - * ``` - */ - class HybridScrollGuardSpec: public virtual HybridObject { - public: - // Constructor - explicit HybridScrollGuardSpec(): HybridObject(TAG) { } - - // Destructor - ~HybridScrollGuardSpec() override = default; - - public: - // Properties - virtual std::optional getDirection() = 0; - virtual void setDirection(std::optional direction) = 0; - - public: - // Methods - - - protected: - // Hybrid Setup - void loadHybridMethods() override; - - protected: - // Tag for logging - static constexpr auto TAG = "ScrollGuard"; - }; - -} // namespace margelo::nitro::scrollguard diff --git a/native-views/react-native-scroll-guard/nitrogen/generated/shared/c++/ScrollGuardDirection.hpp b/native-views/react-native-scroll-guard/nitrogen/generated/shared/c++/ScrollGuardDirection.hpp deleted file mode 100644 index 78fe5a4..0000000 --- a/native-views/react-native-scroll-guard/nitrogen/generated/shared/c++/ScrollGuardDirection.hpp +++ /dev/null @@ -1,80 +0,0 @@ -/// -/// ScrollGuardDirection.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif -#if __has_include() -#include -#else -#error NitroModules cannot be found! Are you sure you installed NitroModules properly? -#endif - -namespace margelo::nitro::scrollguard { - - /** - * An enum which can be represented as a JavaScript union (ScrollGuardDirection). - */ - enum class ScrollGuardDirection { - HORIZONTAL SWIFT_NAME(horizontal) = 0, - VERTICAL SWIFT_NAME(vertical) = 1, - BOTH SWIFT_NAME(both) = 2, - } CLOSED_ENUM; - -} // namespace margelo::nitro::scrollguard - -namespace margelo::nitro { - - // C++ ScrollGuardDirection <> JS ScrollGuardDirection (union) - template <> - struct JSIConverter final { - static inline margelo::nitro::scrollguard::ScrollGuardDirection fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { - std::string unionValue = JSIConverter::fromJSI(runtime, arg); - switch (hashString(unionValue.c_str(), unionValue.size())) { - case hashString("horizontal"): return margelo::nitro::scrollguard::ScrollGuardDirection::HORIZONTAL; - case hashString("vertical"): return margelo::nitro::scrollguard::ScrollGuardDirection::VERTICAL; - case hashString("both"): return margelo::nitro::scrollguard::ScrollGuardDirection::BOTH; - default: [[unlikely]] - throw std::invalid_argument("Cannot convert \"" + unionValue + "\" to enum ScrollGuardDirection - invalid value!"); - } - } - static inline jsi::Value toJSI(jsi::Runtime& runtime, margelo::nitro::scrollguard::ScrollGuardDirection arg) { - switch (arg) { - case margelo::nitro::scrollguard::ScrollGuardDirection::HORIZONTAL: return JSIConverter::toJSI(runtime, "horizontal"); - case margelo::nitro::scrollguard::ScrollGuardDirection::VERTICAL: return JSIConverter::toJSI(runtime, "vertical"); - case margelo::nitro::scrollguard::ScrollGuardDirection::BOTH: return JSIConverter::toJSI(runtime, "both"); - default: [[unlikely]] - throw std::invalid_argument("Cannot convert ScrollGuardDirection to JS - invalid value: " - + std::to_string(static_cast(arg)) + "!"); - } - } - static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) { - if (!value.isString()) { - return false; - } - std::string unionValue = JSIConverter::fromJSI(runtime, value); - switch (hashString(unionValue.c_str(), unionValue.size())) { - case hashString("horizontal"): - case hashString("vertical"): - case hashString("both"): - return true; - default: - return false; - } - } - }; - -} // namespace margelo::nitro diff --git a/native-views/react-native-scroll-guard/nitrogen/generated/shared/c++/views/HybridScrollGuardComponent.cpp b/native-views/react-native-scroll-guard/nitrogen/generated/shared/c++/views/HybridScrollGuardComponent.cpp deleted file mode 100644 index 9a43af7..0000000 --- a/native-views/react-native-scroll-guard/nitrogen/generated/shared/c++/views/HybridScrollGuardComponent.cpp +++ /dev/null @@ -1,87 +0,0 @@ -/// -/// HybridScrollGuardComponent.cpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#include "HybridScrollGuardComponent.hpp" - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace margelo::nitro::scrollguard::views { - - extern const char HybridScrollGuardComponentName[] = "ScrollGuard"; - - HybridScrollGuardProps::HybridScrollGuardProps(const react::PropsParserContext& context, - const HybridScrollGuardProps& sourceProps, - const react::RawProps& rawProps): - react::ViewProps(context, sourceProps, rawProps, filterObjectKeys), - direction([&]() -> CachedProp> { - try { - const react::RawValue* rawValue = rawProps.at("direction", nullptr, nullptr); - if (rawValue == nullptr) return sourceProps.direction; - const auto& [runtime, value] = (std::pair)*rawValue; - return CachedProp>::fromRawValue(*runtime, value, sourceProps.direction); - } catch (const std::exception& exc) { - throw std::runtime_error(std::string("ScrollGuard.direction: ") + exc.what()); - } - }()), - hybridRef([&]() -> CachedProp& /* ref */)>>> { - try { - const react::RawValue* rawValue = rawProps.at("hybridRef", nullptr, nullptr); - if (rawValue == nullptr) return sourceProps.hybridRef; - const auto& [runtime, value] = (std::pair)*rawValue; - return CachedProp& /* ref */)>>>::fromRawValue(*runtime, value.asObject(*runtime).getProperty(*runtime, "f"), sourceProps.hybridRef); - } catch (const std::exception& exc) { - throw std::runtime_error(std::string("ScrollGuard.hybridRef: ") + exc.what()); - } - }()) { } - - HybridScrollGuardProps::HybridScrollGuardProps(const HybridScrollGuardProps& other): - react::ViewProps(), - direction(other.direction), - hybridRef(other.hybridRef) { } - - bool HybridScrollGuardProps::filterObjectKeys(const std::string& propName) { - switch (hashString(propName)) { - case hashString("direction"): return true; - case hashString("hybridRef"): return true; - default: return false; - } - } - - HybridScrollGuardComponentDescriptor::HybridScrollGuardComponentDescriptor(const react::ComponentDescriptorParameters& parameters) - : ConcreteComponentDescriptor(parameters, - react::RawPropsParser(/* enableJsiParser */ true)) {} - - std::shared_ptr HybridScrollGuardComponentDescriptor::cloneProps(const react::PropsParserContext& context, - const std::shared_ptr& props, - react::RawProps rawProps) const { - // 1. Prepare raw props parser - rawProps.parse(rawPropsParser_); - // 2. Copy props with Nitro's cached copy constructor - return HybridScrollGuardShadowNode::Props(context, /* & */ rawProps, props); - } - -#ifdef ANDROID - void HybridScrollGuardComponentDescriptor::adopt(react::ShadowNode& shadowNode) const { - // This is called immediately after `ShadowNode` is created, cloned or in progress. - // On Android, we need to wrap props in our state, which gets routed through Java and later unwrapped in JNI/C++. - auto& concreteShadowNode = dynamic_cast(shadowNode); - const HybridScrollGuardProps& props = concreteShadowNode.getConcreteProps(); - HybridScrollGuardState state; - state.setProps(props); - concreteShadowNode.setStateData(std::move(state)); - } -#endif - -} // namespace margelo::nitro::scrollguard::views diff --git a/native-views/react-native-scroll-guard/nitrogen/generated/shared/c++/views/HybridScrollGuardComponent.hpp b/native-views/react-native-scroll-guard/nitrogen/generated/shared/c++/views/HybridScrollGuardComponent.hpp deleted file mode 100644 index c489f1f..0000000 --- a/native-views/react-native-scroll-guard/nitrogen/generated/shared/c++/views/HybridScrollGuardComponent.hpp +++ /dev/null @@ -1,108 +0,0 @@ -/// -/// HybridScrollGuardComponent.hpp -/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. -/// https://github.com/mrousavy/nitro -/// Copyright © 2026 Marc Rousavy @ Margelo -/// - -#pragma once - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "ScrollGuardDirection.hpp" -#include -#include -#include "HybridScrollGuardSpec.hpp" -#include - -namespace margelo::nitro::scrollguard::views { - - using namespace facebook; - - /** - * The name of the actual native View. - */ - extern const char HybridScrollGuardComponentName[]; - - /** - * Props for the "ScrollGuard" View. - */ - class HybridScrollGuardProps final: public react::ViewProps { - public: - HybridScrollGuardProps() = default; - HybridScrollGuardProps(const HybridScrollGuardProps&); - HybridScrollGuardProps(const react::PropsParserContext& context, - const HybridScrollGuardProps& sourceProps, - const react::RawProps& rawProps); - - public: - CachedProp> direction; - CachedProp& /* ref */)>>> hybridRef; - - private: - static bool filterObjectKeys(const std::string& propName); - }; - - /** - * State for the "ScrollGuard" View. - */ - class HybridScrollGuardState final { - public: - HybridScrollGuardState() = default; - - public: - void setProps(const HybridScrollGuardProps& props) { _props.emplace(props); } - const std::optional& getProps() const { return _props; } - - public: -#ifdef ANDROID - HybridScrollGuardState(const HybridScrollGuardState& /* previousState */, folly::dynamic /* data */) {} - folly::dynamic getDynamic() const { - throw std::runtime_error("HybridScrollGuardState does not support folly!"); - } - react::MapBuffer getMapBuffer() const { - throw std::runtime_error("HybridScrollGuardState does not support MapBuffer!"); - }; -#endif - - private: - std::optional _props; - }; - - /** - * The Shadow Node for the "ScrollGuard" View. - */ - using HybridScrollGuardShadowNode = react::ConcreteViewShadowNode; - - /** - * The Component Descriptor for the "ScrollGuard" View. - */ - class HybridScrollGuardComponentDescriptor final: public react::ConcreteComponentDescriptor { - public: - HybridScrollGuardComponentDescriptor(const react::ComponentDescriptorParameters& parameters); - - public: - /** - * A faster path for cloning props - reuses the caching logic from `HybridScrollGuardProps`. - */ - std::shared_ptr cloneProps(const react::PropsParserContext& context, - const std::shared_ptr& props, - react::RawProps rawProps) const override; -#ifdef ANDROID - void adopt(react::ShadowNode& shadowNode) const override; -#endif - }; - - /* The actual view for "ScrollGuard" needs to be implemented in platform-specific code. */ - -} // namespace margelo::nitro::scrollguard::views diff --git a/native-views/react-native-scroll-guard/nitrogen/generated/shared/json/ScrollGuardConfig.json b/native-views/react-native-scroll-guard/nitrogen/generated/shared/json/ScrollGuardConfig.json deleted file mode 100644 index 0b4aae9..0000000 --- a/native-views/react-native-scroll-guard/nitrogen/generated/shared/json/ScrollGuardConfig.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "uiViewClassName": "ScrollGuard", - "supportsRawText": false, - "bubblingEventTypes": {}, - "directEventTypes": {}, - "validAttributes": { - "direction": true, - "hybridRef": true - } -} diff --git a/native-views/react-native-tab-view/.gitignore b/native-views/react-native-tab-view/.gitignore index c5361f0..05827e4 100644 --- a/native-views/react-native-tab-view/.gitignore +++ b/native-views/react-native-tab-view/.gitignore @@ -1,2 +1,5 @@ # generated by bob lib/ + +# generated by nitrogen +nitrogen/ From 3231f2cbeeae299f2dbf4c14e8468909dff36dbc Mon Sep 17 00:00:00 2001 From: huhuanming Date: Sat, 14 Mar 2026 00:59:58 +0800 Subject: [PATCH 09/14] update ignore files --- .../react-native-pager-view/.gitignore | 83 ++++++++++++++++++- .../android/src/main/AndroidManifest.xml | 2 +- .../react-native-scroll-guard/.gitignore | 83 ++++++++++++++++++- native-views/react-native-tab-view/.gitignore | 83 ++++++++++++++++++- 4 files changed, 247 insertions(+), 4 deletions(-) diff --git a/native-views/react-native-pager-view/.gitignore b/native-views/react-native-pager-view/.gitignore index 05827e4..67f3212 100644 --- a/native-views/react-native-pager-view/.gitignore +++ b/native-views/react-native-pager-view/.gitignore @@ -1,5 +1,86 @@ +# OSX +# +.DS_Store + +# XDE +.expo/ + +# VSCode +.vscode/ +jsconfig.json + +# Xcode +# +build/ +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 +xcuserdata +*.xccheckout +*.moved-aside +DerivedData +*.hmap +*.ipa +*.xcuserstate +project.xcworkspace +**/.xcode.env.local + +# Android/IJ +# +.classpath +.cxx +.gradle +.idea +.project +.settings +local.properties +android.iml + +# Cocoapods +# +example/ios/Pods + +# Ruby +example/vendor/ + +# node.js +# +node_modules/ +npm-debug.log +yarn-debug.log +yarn-error.log + +# BUCK +buck-out/ +\.buckd/ +android/app/libs +android/keystores/debug.keystore + +# Yarn +.yarn/* +!.yarn/patches +!.yarn/plugins +!.yarn/releases +!.yarn/sdks +!.yarn/versions + +# Expo +.expo/ + +# Turborepo +.turbo/ + # generated by bob lib/ -# generated by nitrogen +# React Native Codegen +ios/generated +android/generated + +# React Native Nitro Modules nitrogen/ diff --git a/native-views/react-native-pager-view/android/src/main/AndroidManifest.xml b/native-views/react-native-pager-view/android/src/main/AndroidManifest.xml index 068070f..eb2812a 100644 --- a/native-views/react-native-pager-view/android/src/main/AndroidManifest.xml +++ b/native-views/react-native-pager-view/android/src/main/AndroidManifest.xml @@ -1,4 +1,4 @@ + > diff --git a/native-views/react-native-scroll-guard/.gitignore b/native-views/react-native-scroll-guard/.gitignore index 05827e4..67f3212 100644 --- a/native-views/react-native-scroll-guard/.gitignore +++ b/native-views/react-native-scroll-guard/.gitignore @@ -1,5 +1,86 @@ +# OSX +# +.DS_Store + +# XDE +.expo/ + +# VSCode +.vscode/ +jsconfig.json + +# Xcode +# +build/ +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 +xcuserdata +*.xccheckout +*.moved-aside +DerivedData +*.hmap +*.ipa +*.xcuserstate +project.xcworkspace +**/.xcode.env.local + +# Android/IJ +# +.classpath +.cxx +.gradle +.idea +.project +.settings +local.properties +android.iml + +# Cocoapods +# +example/ios/Pods + +# Ruby +example/vendor/ + +# node.js +# +node_modules/ +npm-debug.log +yarn-debug.log +yarn-error.log + +# BUCK +buck-out/ +\.buckd/ +android/app/libs +android/keystores/debug.keystore + +# Yarn +.yarn/* +!.yarn/patches +!.yarn/plugins +!.yarn/releases +!.yarn/sdks +!.yarn/versions + +# Expo +.expo/ + +# Turborepo +.turbo/ + # generated by bob lib/ -# generated by nitrogen +# React Native Codegen +ios/generated +android/generated + +# React Native Nitro Modules nitrogen/ diff --git a/native-views/react-native-tab-view/.gitignore b/native-views/react-native-tab-view/.gitignore index 05827e4..67f3212 100644 --- a/native-views/react-native-tab-view/.gitignore +++ b/native-views/react-native-tab-view/.gitignore @@ -1,5 +1,86 @@ +# OSX +# +.DS_Store + +# XDE +.expo/ + +# VSCode +.vscode/ +jsconfig.json + +# Xcode +# +build/ +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 +xcuserdata +*.xccheckout +*.moved-aside +DerivedData +*.hmap +*.ipa +*.xcuserstate +project.xcworkspace +**/.xcode.env.local + +# Android/IJ +# +.classpath +.cxx +.gradle +.idea +.project +.settings +local.properties +android.iml + +# Cocoapods +# +example/ios/Pods + +# Ruby +example/vendor/ + +# node.js +# +node_modules/ +npm-debug.log +yarn-debug.log +yarn-error.log + +# BUCK +buck-out/ +\.buckd/ +android/app/libs +android/keystores/debug.keystore + +# Yarn +.yarn/* +!.yarn/patches +!.yarn/plugins +!.yarn/releases +!.yarn/sdks +!.yarn/versions + +# Expo +.expo/ + +# Turborepo +.turbo/ + # generated by bob lib/ -# generated by nitrogen +# React Native Codegen +ios/generated +android/generated + +# React Native Nitro Modules nitrogen/ From bfb1db11bd7dde8a7d954b177a0ce36c3a43cc8a Mon Sep 17 00:00:00 2001 From: huhuanming Date: Sat, 14 Mar 2026 01:02:17 +0800 Subject: [PATCH 10/14] Update PagerViewNativeComponent.ts --- .../src/PagerViewNativeComponent.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/native-views/react-native-pager-view/src/PagerViewNativeComponent.ts b/native-views/react-native-pager-view/src/PagerViewNativeComponent.ts index 5506285..e8c60c4 100644 --- a/native-views/react-native-pager-view/src/PagerViewNativeComponent.ts +++ b/native-views/react-native-pager-view/src/PagerViewNativeComponent.ts @@ -1,7 +1,10 @@ import type * as React from 'react'; -import type { HostComponent, ViewProps } from 'react-native'; -import codegenNativeCommands from 'react-native/Libraries/Utilities/codegenNativeCommands'; -import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; +import { + codegenNativeCommands, + codegenNativeComponent, + type HostComponent, + type ViewProps, +} from 'react-native'; import type { DirectEventHandler, From 008d5d727a98858c9c236ed023e12b2624d2ec40 Mon Sep 17 00:00:00 2001 From: huhuanming Date: Sat, 14 Mar 2026 01:06:45 +0800 Subject: [PATCH 11/14] fix(scroll-guard): use ViewGroupManager to support child views on Android HybridScrollGuardManager (generated by nitrogen) extends SimpleViewManager which doesn't implement IViewGroupManager, causing a ClassCastException when React Native tries to add child views. Replace with a custom ScrollGuardViewGroupManager that extends ViewGroupManager to properly support containing child scrollable views. Co-Authored-By: Claude Opus 4.6 --- .../nitro/scrollguard/ScrollGuardPackage.kt | 4 +- .../ScrollGuardViewGroupManager.kt | 48 +++++++++++++++++++ 2 files changed, 49 insertions(+), 3 deletions(-) create mode 100644 native-views/react-native-scroll-guard/android/src/main/java/com/margelo/nitro/scrollguard/ScrollGuardViewGroupManager.kt diff --git a/native-views/react-native-scroll-guard/android/src/main/java/com/margelo/nitro/scrollguard/ScrollGuardPackage.kt b/native-views/react-native-scroll-guard/android/src/main/java/com/margelo/nitro/scrollguard/ScrollGuardPackage.kt index c479518..67da571 100644 --- a/native-views/react-native-scroll-guard/android/src/main/java/com/margelo/nitro/scrollguard/ScrollGuardPackage.kt +++ b/native-views/react-native-scroll-guard/android/src/main/java/com/margelo/nitro/scrollguard/ScrollGuardPackage.kt @@ -6,8 +6,6 @@ import com.facebook.react.bridge.ReactApplicationContext import com.facebook.react.module.model.ReactModuleInfoProvider import com.facebook.react.uimanager.ViewManager -import com.margelo.nitro.scrollguard.views.HybridScrollGuardManager - class ScrollGuardPackage : BaseReactPackage() { override fun getModule(name: String, reactContext: ReactApplicationContext): NativeModule? { return null @@ -18,7 +16,7 @@ class ScrollGuardPackage : BaseReactPackage() { } override fun createViewManagers(reactContext: ReactApplicationContext): List> { - return listOf(HybridScrollGuardManager()) + return listOf(ScrollGuardViewGroupManager()) } companion object { diff --git a/native-views/react-native-scroll-guard/android/src/main/java/com/margelo/nitro/scrollguard/ScrollGuardViewGroupManager.kt b/native-views/react-native-scroll-guard/android/src/main/java/com/margelo/nitro/scrollguard/ScrollGuardViewGroupManager.kt new file mode 100644 index 0000000..151920e --- /dev/null +++ b/native-views/react-native-scroll-guard/android/src/main/java/com/margelo/nitro/scrollguard/ScrollGuardViewGroupManager.kt @@ -0,0 +1,48 @@ +package com.margelo.nitro.scrollguard + +import android.view.View +import com.facebook.react.uimanager.ReactStylesDiffMap +import com.facebook.react.uimanager.StateWrapper +import com.facebook.react.uimanager.ThemedReactContext +import com.facebook.react.uimanager.ViewGroupManager +import com.margelo.nitro.scrollguard.views.HybridScrollGuardStateUpdater + +/** + * Custom ViewGroupManager for ScrollGuard that supports child views. + * + * The nitrogen-generated HybridScrollGuardManager extends SimpleViewManager, + * which does not implement IViewGroupManager. Since ScrollGuardFrameLayout + * is a FrameLayout that wraps child scrollable views, we need a ViewGroupManager. + */ +class ScrollGuardViewGroupManager : ViewGroupManager() { + private val views = hashMapOf() + + override fun getName(): String = "ScrollGuard" + + override fun createViewInstance(reactContext: ThemedReactContext): ScrollGuardFrameLayout { + val hybridView = HybridScrollGuard(reactContext) + val view = hybridView.view as ScrollGuardFrameLayout + views[view] = hybridView + return view + } + + override fun onDropViewInstance(view: ScrollGuardFrameLayout) { + super.onDropViewInstance(view) + views.remove(view) + } + + override fun updateState( + view: ScrollGuardFrameLayout, + props: ReactStylesDiffMap, + stateWrapper: StateWrapper + ): Any? { + val hybridView = views[view] + ?: throw Error("Couldn't find view $view in local views table!") + + hybridView.beforeUpdate() + HybridScrollGuardStateUpdater.updateViewProps(hybridView, stateWrapper) + hybridView.afterUpdate() + + return super.updateState(view, props, stateWrapper) + } +} From 45f005818ca67f14d90568beaaf1ddca532f5d7a Mon Sep 17 00:00:00 2001 From: huhuanming Date: Sat, 14 Mar 2026 01:11:38 +0800 Subject: [PATCH 12/14] Update AndroidManifest.xml --- .../android/src/main/AndroidManifest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/native-views/react-native-pager-view/android/src/main/AndroidManifest.xml b/native-views/react-native-pager-view/android/src/main/AndroidManifest.xml index eb2812a..0f53015 100644 --- a/native-views/react-native-pager-view/android/src/main/AndroidManifest.xml +++ b/native-views/react-native-pager-view/android/src/main/AndroidManifest.xml @@ -1,4 +1,4 @@ + > From 00994c5a4813a847978bcb880d32685c3efb2233 Mon Sep 17 00:00:00 2001 From: huhuanming Date: Sat, 14 Mar 2026 01:11:51 +0800 Subject: [PATCH 13/14] 1.1.38 --- example/react-native/package.json | 2 +- native-modules/native-logger/package.json | 2 +- native-modules/react-native-app-update/package.json | 2 +- native-modules/react-native-background-thread/package.json | 2 +- native-modules/react-native-bundle-update/package.json | 2 +- .../react-native-check-biometric-auth-changed/package.json | 2 +- native-modules/react-native-cloud-kit-module/package.json | 2 +- native-modules/react-native-device-utils/package.json | 2 +- native-modules/react-native-get-random-values/package.json | 2 +- native-modules/react-native-keychain-module/package.json | 2 +- native-modules/react-native-lite-card/package.json | 2 +- native-modules/react-native-perf-memory/package.json | 2 +- native-modules/react-native-splash-screen/package.json | 2 +- native-views/react-native-auto-size-input/package.json | 2 +- native-views/react-native-pager-view/package.json | 2 +- native-views/react-native-scroll-guard/package.json | 2 +- native-views/react-native-skeleton/package.json | 2 +- native-views/react-native-tab-view/package.json | 2 +- yarn.lock | 7 ++++--- 19 files changed, 22 insertions(+), 21 deletions(-) diff --git a/example/react-native/package.json b/example/react-native/package.json index af78529..ef60ee5 100644 --- a/example/react-native/package.json +++ b/example/react-native/package.json @@ -23,8 +23,8 @@ "@onekeyfe/react-native-lite-card": "workspace:*", "@onekeyfe/react-native-native-logger": "workspace:*", "@onekeyfe/react-native-pager-view": "workspace:*", - "@onekeyfe/react-native-scroll-guard": "workspace:*", "@onekeyfe/react-native-perf-memory": "workspace:*", + "@onekeyfe/react-native-scroll-guard": "workspace:*", "@onekeyfe/react-native-skeleton": "workspace:*", "@onekeyfe/react-native-splash-screen": "workspace:*", "@onekeyfe/react-native-tab-view": "workspace:*", diff --git a/native-modules/native-logger/package.json b/native-modules/native-logger/package.json index d4724fb..48f994d 100644 --- a/native-modules/native-logger/package.json +++ b/native-modules/native-logger/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/react-native-native-logger", - "version": "1.1.37", + "version": "1.1.38", "description": "react-native-native-logger", "main": "./lib/module/index.js", "types": "./lib/typescript/src/index.d.ts", diff --git a/native-modules/react-native-app-update/package.json b/native-modules/react-native-app-update/package.json index 8efb22c..caa9373 100644 --- a/native-modules/react-native-app-update/package.json +++ b/native-modules/react-native-app-update/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/react-native-app-update", - "version": "1.1.37", + "version": "1.1.38", "description": "react-native-app-update", "main": "./lib/module/index.js", "types": "./lib/typescript/src/index.d.ts", diff --git a/native-modules/react-native-background-thread/package.json b/native-modules/react-native-background-thread/package.json index f63741b..3355ac3 100644 --- a/native-modules/react-native-background-thread/package.json +++ b/native-modules/react-native-background-thread/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/react-native-background-thread", - "version": "1.1.37", + "version": "1.1.38", "description": "react-native-background-thread", "main": "./lib/module/index.js", "types": "./lib/typescript/src/index.d.ts", diff --git a/native-modules/react-native-bundle-update/package.json b/native-modules/react-native-bundle-update/package.json index a699e3e..f068a18 100644 --- a/native-modules/react-native-bundle-update/package.json +++ b/native-modules/react-native-bundle-update/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/react-native-bundle-update", - "version": "1.1.37", + "version": "1.1.38", "description": "react-native-bundle-update", "main": "./lib/module/index.js", "types": "./lib/typescript/src/index.d.ts", diff --git a/native-modules/react-native-check-biometric-auth-changed/package.json b/native-modules/react-native-check-biometric-auth-changed/package.json index 0252dd8..5e7151b 100644 --- a/native-modules/react-native-check-biometric-auth-changed/package.json +++ b/native-modules/react-native-check-biometric-auth-changed/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/react-native-check-biometric-auth-changed", - "version": "1.1.37", + "version": "1.1.38", "description": "react-native-check-biometric-auth-changed", "main": "./lib/module/index.js", "types": "./lib/typescript/src/index.d.ts", diff --git a/native-modules/react-native-cloud-kit-module/package.json b/native-modules/react-native-cloud-kit-module/package.json index a96f536..14cbc5f 100644 --- a/native-modules/react-native-cloud-kit-module/package.json +++ b/native-modules/react-native-cloud-kit-module/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/react-native-cloud-kit-module", - "version": "1.1.37", + "version": "1.1.38", "description": "react-native-cloud-kit-module", "main": "./lib/module/index.js", "types": "./lib/typescript/src/index.d.ts", diff --git a/native-modules/react-native-device-utils/package.json b/native-modules/react-native-device-utils/package.json index 4765b56..3d117a1 100644 --- a/native-modules/react-native-device-utils/package.json +++ b/native-modules/react-native-device-utils/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/react-native-device-utils", - "version": "1.1.37", + "version": "1.1.38", "description": "react-native-device-utils", "main": "./lib/module/index.js", "types": "./lib/typescript/src/index.d.ts", diff --git a/native-modules/react-native-get-random-values/package.json b/native-modules/react-native-get-random-values/package.json index 5bfd801..17b17a5 100644 --- a/native-modules/react-native-get-random-values/package.json +++ b/native-modules/react-native-get-random-values/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/react-native-get-random-values", - "version": "1.1.37", + "version": "1.1.38", "description": "react-native-get-random-values", "main": "./lib/module/index.js", "types": "./lib/typescript/src/index.d.ts", diff --git a/native-modules/react-native-keychain-module/package.json b/native-modules/react-native-keychain-module/package.json index ef8ed00..d6bda4b 100644 --- a/native-modules/react-native-keychain-module/package.json +++ b/native-modules/react-native-keychain-module/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/react-native-keychain-module", - "version": "1.1.37", + "version": "1.1.38", "description": "react-native-keychain-module", "main": "./lib/module/index.js", "types": "./lib/typescript/src/index.d.ts", diff --git a/native-modules/react-native-lite-card/package.json b/native-modules/react-native-lite-card/package.json index d842f36..da6bd4e 100644 --- a/native-modules/react-native-lite-card/package.json +++ b/native-modules/react-native-lite-card/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/react-native-lite-card", - "version": "1.1.37", + "version": "1.1.38", "description": "lite card", "main": "./lib/module/index.js", "types": "./lib/typescript/src/index.d.ts", diff --git a/native-modules/react-native-perf-memory/package.json b/native-modules/react-native-perf-memory/package.json index f06388c..6e7c532 100644 --- a/native-modules/react-native-perf-memory/package.json +++ b/native-modules/react-native-perf-memory/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/react-native-perf-memory", - "version": "1.1.37", + "version": "1.1.38", "description": "react-native-perf-memory", "main": "./lib/module/index.js", "types": "./lib/typescript/src/index.d.ts", diff --git a/native-modules/react-native-splash-screen/package.json b/native-modules/react-native-splash-screen/package.json index 30942ba..3051693 100644 --- a/native-modules/react-native-splash-screen/package.json +++ b/native-modules/react-native-splash-screen/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/react-native-splash-screen", - "version": "1.1.37", + "version": "1.1.38", "description": "react-native-splash-screen", "main": "./lib/module/index.js", "types": "./lib/typescript/src/index.d.ts", diff --git a/native-views/react-native-auto-size-input/package.json b/native-views/react-native-auto-size-input/package.json index f458c4f..2b7762d 100644 --- a/native-views/react-native-auto-size-input/package.json +++ b/native-views/react-native-auto-size-input/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/react-native-auto-size-input", - "version": "1.1.37", + "version": "1.1.38", "description": "Auto-sizing text input with font scaling, prefix and suffix support", "main": "./lib/module/index.js", "types": "./lib/typescript/src/index.d.ts", diff --git a/native-views/react-native-pager-view/package.json b/native-views/react-native-pager-view/package.json index ad2911e..be31a44 100644 --- a/native-views/react-native-pager-view/package.json +++ b/native-views/react-native-pager-view/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/react-native-pager-view", - "version": "1.1.37", + "version": "1.1.38", "description": "React Native wrapper for Android and iOS ViewPager", "source": "./src/index.tsx", "main": "./lib/module/index.js", diff --git a/native-views/react-native-scroll-guard/package.json b/native-views/react-native-scroll-guard/package.json index d4db646..6c827a2 100644 --- a/native-views/react-native-scroll-guard/package.json +++ b/native-views/react-native-scroll-guard/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/react-native-scroll-guard", - "version": "0.1.0", + "version": "0.1.1", "description": "A native view wrapper that prevents parent scrollable containers (PagerView/ViewPager2) from intercepting child scroll gestures", "main": "./lib/module/index.js", "types": "./lib/typescript/src/index.d.ts", diff --git a/native-views/react-native-skeleton/package.json b/native-views/react-native-skeleton/package.json index 37117c4..99ad02a 100644 --- a/native-views/react-native-skeleton/package.json +++ b/native-views/react-native-skeleton/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/react-native-skeleton", - "version": "1.1.37", + "version": "1.1.38", "description": "react-native-skeleton", "main": "./lib/module/index.js", "types": "./lib/typescript/src/index.d.ts", diff --git a/native-views/react-native-tab-view/package.json b/native-views/react-native-tab-view/package.json index 4b1824b..0768967 100644 --- a/native-views/react-native-tab-view/package.json +++ b/native-views/react-native-tab-view/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/react-native-tab-view", - "version": "1.1.37", + "version": "1.1.38", "description": "Native Bottom Tabs for React Native (UIKit implementation)", "source": "./src/index.tsx", "main": "./lib/module/index.js", diff --git a/yarn.lock b/yarn.lock index 981be69..d155860 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2757,6 +2757,7 @@ __metadata: "@onekeyfe/react-native-native-logger": "workspace:*" "@onekeyfe/react-native-pager-view": "workspace:*" "@onekeyfe/react-native-perf-memory": "workspace:*" + "@onekeyfe/react-native-scroll-guard": "workspace:*" "@onekeyfe/react-native-skeleton": "workspace:*" "@onekeyfe/react-native-splash-screen": "workspace:*" "@onekeyfe/react-native-tab-view": "workspace:*" @@ -3266,7 +3267,7 @@ __metadata: languageName: unknown linkType: soft -"@onekeyfe/react-native-scroll-guard@workspace:native-views/react-native-scroll-guard": +"@onekeyfe/react-native-scroll-guard@workspace:*, @onekeyfe/react-native-scroll-guard@workspace:native-views/react-native-scroll-guard": version: 0.0.0-use.local resolution: "@onekeyfe/react-native-scroll-guard@workspace:native-views/react-native-scroll-guard" dependencies: @@ -12612,11 +12613,11 @@ __metadata: "typescript@patch:typescript@npm%3A^5.8.3#optional!builtin, typescript@patch:typescript@npm%3A^5.9.2#optional!builtin": version: 5.9.3 - resolution: "typescript@patch:typescript@npm%3A5.9.3#optional!builtin::version=5.9.3&hash=5786d5" + resolution: "typescript@patch:typescript@npm%3A5.9.3#optional!builtin::version=5.9.3&hash=d69c25" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 10/696e1b017bc2635f4e0c94eb4435357701008e2f272f553d06e35b494b8ddc60aa221145e286c28ace0c89ee32827a28c2040e3a69bdc108b1a5dc8fb40b72e3 + checksum: 10/5d416ad4f2ea564f515a3f919e901edbfa4b497cc17dd325c5726046c3eef7ed22d1f59c787267d478311f6f0a265ff790f8a6c7e9df3ea3471458f5ec81e8b7 languageName: node linkType: hard From 60807ec272059e49a7735dea41c7eb820ae22a32 Mon Sep 17 00:00:00 2001 From: huhuanming Date: Sat, 14 Mar 2026 02:06:38 +0800 Subject: [PATCH 14/14] docs: add 1.1.38 changelog entry Co-Authored-By: Claude Opus 4.6 --- CHANGELOG.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index db24bf2..5e23af1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,20 @@ All notable changes to this project will be documented in this file. +## [1.1.38] - 2026-03-14 + +### Features +- **scroll-guard**: Add new `@onekeyfe/react-native-scroll-guard` native view module that prevents parent scrollable containers (PagerView/ViewPager2) from intercepting child scroll gestures +- **scroll-guard**: Support `direction` prop with horizontal, vertical, and both modes + +### Bug Fixes +- **scroll-guard (Android)**: Use `ViewGroupManager` instead of nitrogen-generated `SimpleViewManager` to properly support child views (fixes `IViewGroupManager` ClassCastException) +- **scroll-guard (iOS)**: Improve gesture blocking reliability + +### Chores +- Add `nitrogen/` to `.gitignore` and remove tracked nitrogen files +- Bump all native modules and views to 1.1.38 + ## [1.1.37] - 2026-03-12 ### Features