cactus-react-native 0.2.11 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Cactus.podspec +34 -0
- package/LICENSE +38 -0
- package/README.md +550 -69
- package/android/CMakeLists.txt +40 -0
- package/android/build.gradle +68 -44
- package/android/gradle.properties +5 -5
- package/android/src/main/AndroidManifest.xml +1 -3
- package/android/src/main/cpp/cpp-adapter.cpp +6 -0
- package/android/src/main/java/com/margelo/nitro/cactus/CactusPackage.kt +22 -0
- package/android/src/main/java/com/margelo/nitro/cactus/HybridCactusCrypto.kt +38 -0
- package/android/src/main/java/com/margelo/nitro/cactus/HybridCactusDeviceInfo.kt +24 -0
- package/android/src/main/java/com/margelo/nitro/cactus/HybridCactusFileSystem.kt +227 -0
- package/android/src/main/jniLibs/arm64-v8a/{libcactus_v8.so → libcactus.a} +0 -0
- package/android/src/main/jniLibs/arm64-v8a/libcactus_util.so +0 -0
- package/cpp/HybridCactus.cpp +135 -0
- package/cpp/HybridCactus.hpp +42 -0
- package/cpp/HybridCactusUtil.cpp +47 -0
- package/cpp/HybridCactusUtil.hpp +26 -0
- package/cpp/cactus_ffi.h +55 -0
- package/cpp/cactus_util.h +25 -0
- package/ios/HybridCactusCrypto.swift +37 -0
- package/ios/HybridCactusDeviceInfo.swift +32 -0
- package/ios/HybridCactusFileSystem.swift +234 -0
- package/ios/cactus.xcframework/{info.plist → Info.plist} +2 -37
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/cactus.h +8 -229
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/cactus_ffi.h +28 -229
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/engine.h +545 -0
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/ffi_utils.h +400 -0
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/graph.h +338 -0
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/kernel.h +275 -0
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/kernel_utils.h +343 -0
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Info.plist +0 -0
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/cactus +0 -0
- package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/Headers/cactus.h +11 -0
- package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/Headers/cactus_ffi.h +55 -0
- package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/Headers/engine.h +545 -0
- package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/Headers/ffi_utils.h +400 -0
- package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/Headers/graph.h +338 -0
- package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/Headers/kernel.h +275 -0
- package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/Headers/kernel_utils.h +343 -0
- package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/Info.plist +0 -0
- package/ios/cactus.xcframework/{tvos-arm64_x86_64-simulator → ios-arm64-simulator}/cactus.framework/_CodeSignature/CodeResources +1 -1
- package/ios/cactus.xcframework/ios-arm64-simulator/cactus.framework/cactus +0 -0
- package/ios/cactus_util.xcframework/Info.plist +39 -0
- package/ios/cactus_util.xcframework/ios-arm64/cactus_util.framework/Headers/cactus_util.h +25 -0
- package/ios/cactus_util.xcframework/ios-arm64/cactus_util.framework/Headers/ios_utils.h +10 -0
- package/ios/cactus_util.xcframework/ios-arm64/cactus_util.framework/Headers/logging.h +25 -0
- package/ios/cactus_util.xcframework/ios-arm64/cactus_util.framework/Info.plist +0 -0
- package/ios/cactus_util.xcframework/ios-arm64/cactus_util.framework/cactus_util +0 -0
- package/ios/cactus_util.xcframework/ios-arm64-simulator/cactus_util.framework/Headers/cactus_util.h +25 -0
- package/ios/cactus_util.xcframework/ios-arm64-simulator/cactus_util.framework/Headers/ios_utils.h +10 -0
- package/ios/cactus_util.xcframework/ios-arm64-simulator/cactus_util.framework/Headers/logging.h +25 -0
- package/ios/{cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework → cactus_util.xcframework/ios-arm64-simulator/cactus_util.framework}/Info.plist +0 -0
- package/ios/{cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework → cactus_util.xcframework/ios-arm64-simulator/cactus_util.framework}/_CodeSignature/CodeResources +36 -2
- package/ios/cactus_util.xcframework/ios-arm64-simulator/cactus_util.framework/cactus_util +0 -0
- package/lib/module/api/Database.js +60 -0
- package/lib/module/api/Database.js.map +1 -0
- package/lib/module/classes/CactusLM.js +151 -0
- package/lib/module/classes/CactusLM.js.map +1 -0
- package/lib/module/config/CactusConfig.js +6 -0
- package/lib/module/config/CactusConfig.js.map +1 -0
- package/lib/module/constants/packageVersion.js +4 -0
- package/lib/module/constants/packageVersion.js.map +1 -0
- package/lib/module/hooks/useCactusLM.js +238 -0
- package/lib/module/hooks/useCactusLM.js.map +1 -0
- package/lib/module/index.js +9 -409
- package/lib/module/index.js.map +1 -1
- package/lib/module/native/Cactus.js +50 -0
- package/lib/module/native/Cactus.js.map +1 -0
- package/lib/module/native/CactusCrypto.js +10 -0
- package/lib/module/native/CactusCrypto.js.map +1 -0
- package/lib/module/native/CactusDeviceInfo.js +13 -0
- package/lib/module/native/CactusDeviceInfo.js.map +1 -0
- package/lib/module/native/CactusFileSystem.js +35 -0
- package/lib/module/native/CactusFileSystem.js.map +1 -0
- package/lib/module/native/CactusUtil.js +23 -0
- package/lib/module/native/CactusUtil.js.map +1 -0
- package/lib/module/native/index.js +8 -0
- package/lib/module/native/index.js.map +1 -0
- package/lib/module/specs/Cactus.nitro.js +4 -0
- package/lib/module/specs/Cactus.nitro.js.map +1 -0
- package/lib/module/specs/CactusCrypto.nitro.js +4 -0
- package/lib/module/specs/CactusCrypto.nitro.js.map +1 -0
- package/lib/module/specs/CactusDeviceInfo.nitro.js +4 -0
- package/lib/module/specs/CactusDeviceInfo.nitro.js.map +1 -0
- package/lib/module/specs/CactusFileSystem.nitro.js +4 -0
- package/lib/module/specs/CactusFileSystem.nitro.js.map +1 -0
- package/lib/module/specs/CactusUtil.nitro.js +4 -0
- package/lib/module/specs/CactusUtil.nitro.js.map +1 -0
- package/lib/module/telemetry/Telemetry.js +100 -0
- package/lib/module/telemetry/Telemetry.js.map +1 -0
- package/lib/module/types/CactusLM.js +2 -0
- package/lib/module/types/CactusLM.js.map +1 -0
- package/lib/module/types/CactusModel.js +2 -0
- package/lib/module/types/CactusModel.js.map +1 -0
- package/lib/module/utils/error.js +4 -0
- package/lib/module/utils/error.js.map +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/api/Database.d.ts +11 -0
- package/lib/typescript/src/api/Database.d.ts.map +1 -0
- package/lib/typescript/src/classes/CactusLM.d.ts +26 -0
- package/lib/typescript/src/classes/CactusLM.d.ts.map +1 -0
- package/lib/typescript/src/config/CactusConfig.d.ts +5 -0
- package/lib/typescript/src/config/CactusConfig.d.ts.map +1 -0
- package/lib/typescript/src/constants/packageVersion.d.ts +2 -0
- package/lib/typescript/src/constants/packageVersion.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useCactusLM.d.ts +20 -0
- package/lib/typescript/src/hooks/useCactusLM.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +6 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/native/Cactus.d.ts +11 -0
- package/lib/typescript/src/native/Cactus.d.ts.map +1 -0
- package/lib/typescript/src/native/CactusCrypto.d.ts +5 -0
- package/lib/typescript/src/native/CactusCrypto.d.ts.map +1 -0
- package/lib/typescript/src/native/CactusDeviceInfo.d.ts +7 -0
- package/lib/typescript/src/native/CactusDeviceInfo.d.ts.map +1 -0
- package/lib/typescript/src/native/CactusFileSystem.d.ts +13 -0
- package/lib/typescript/src/native/CactusFileSystem.d.ts.map +1 -0
- package/lib/typescript/src/native/CactusUtil.d.ts +6 -0
- package/lib/typescript/src/native/CactusUtil.d.ts.map +1 -0
- package/lib/typescript/src/native/index.d.ts +6 -0
- package/lib/typescript/src/native/index.d.ts.map +1 -0
- package/lib/typescript/src/specs/Cactus.nitro.d.ts +13 -0
- package/lib/typescript/src/specs/Cactus.nitro.d.ts.map +1 -0
- package/lib/typescript/src/specs/CactusCrypto.nitro.d.ts +8 -0
- package/lib/typescript/src/specs/CactusCrypto.nitro.d.ts.map +1 -0
- package/lib/typescript/src/specs/CactusDeviceInfo.nitro.d.ts +16 -0
- package/lib/typescript/src/specs/CactusDeviceInfo.nitro.d.ts.map +1 -0
- package/lib/typescript/src/specs/CactusFileSystem.nitro.d.ts +16 -0
- package/lib/typescript/src/specs/CactusFileSystem.nitro.d.ts.map +1 -0
- package/lib/typescript/src/specs/CactusUtil.nitro.d.ts +10 -0
- package/lib/typescript/src/specs/CactusUtil.nitro.d.ts.map +1 -0
- package/lib/typescript/src/telemetry/Telemetry.d.ts +30 -0
- package/lib/typescript/src/telemetry/Telemetry.d.ts.map +1 -0
- package/lib/typescript/src/types/CactusLM.d.ts +67 -0
- package/lib/typescript/src/types/CactusLM.d.ts.map +1 -0
- package/lib/typescript/src/types/CactusModel.d.ts +12 -0
- package/lib/typescript/src/types/CactusModel.d.ts.map +1 -0
- package/lib/typescript/src/utils/error.d.ts +2 -0
- package/lib/typescript/src/utils/error.d.ts.map +1 -0
- package/nitro.json +31 -0
- package/nitrogen/generated/android/c++/JDeviceInfo.hpp +74 -0
- package/nitrogen/generated/android/c++/JFunc_void_double.hpp +74 -0
- package/nitrogen/generated/android/c++/JHybridCactusCryptoSpec.cpp +65 -0
- package/nitrogen/generated/android/c++/JHybridCactusCryptoSpec.hpp +65 -0
- package/nitrogen/generated/android/c++/JHybridCactusDeviceInfoSpec.cpp +85 -0
- package/nitrogen/generated/android/c++/JHybridCactusDeviceInfoSpec.hpp +66 -0
- package/nitrogen/generated/android/c++/JHybridCactusFileSystemSpec.cpp +192 -0
- package/nitrogen/generated/android/c++/JHybridCactusFileSystemSpec.hpp +73 -0
- package/nitrogen/generated/android/cactus+autolinking.cmake +87 -0
- package/nitrogen/generated/android/cactus+autolinking.gradle +27 -0
- package/nitrogen/generated/android/cactusOnLoad.cpp +86 -0
- package/nitrogen/generated/android/cactusOnLoad.hpp +25 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/cactus/DeviceInfo.kt +50 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/cactus/Func_void_double.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/cactus/HybridCactusCryptoSpec.kt +58 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/cactus/HybridCactusDeviceInfoSpec.kt +62 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/cactus/HybridCactusFileSystemSpec.kt +95 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/cactus/cactusOnLoad.kt +35 -0
- package/nitrogen/generated/ios/Cactus+autolinking.rb +60 -0
- package/nitrogen/generated/ios/Cactus-Swift-Cxx-Bridge.cpp +122 -0
- package/nitrogen/generated/ios/Cactus-Swift-Cxx-Bridge.hpp +373 -0
- package/nitrogen/generated/ios/Cactus-Swift-Cxx-Umbrella.hpp +60 -0
- package/nitrogen/generated/ios/CactusAutolinking.mm +69 -0
- package/nitrogen/generated/ios/CactusAutolinking.swift +55 -0
- package/nitrogen/generated/ios/c++/HybridCactusCryptoSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridCactusCryptoSpecSwift.hpp +77 -0
- package/nitrogen/generated/ios/c++/HybridCactusDeviceInfoSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridCactusDeviceInfoSpecSwift.hpp +88 -0
- package/nitrogen/generated/ios/c++/HybridCactusFileSystemSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridCactusFileSystemSpecSwift.hpp +143 -0
- package/nitrogen/generated/ios/swift/DeviceInfo.swift +98 -0
- package/nitrogen/generated/ios/swift/Func_void.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_DeviceInfo.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_bool.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_double.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_std__optional_std__string_.swift +54 -0
- package/nitrogen/generated/ios/swift/Func_void_std__string.swift +47 -0
- package/nitrogen/generated/ios/swift/HybridCactusCryptoSpec.swift +57 -0
- package/nitrogen/generated/ios/swift/HybridCactusCryptoSpec_cxx.swift +139 -0
- package/nitrogen/generated/ios/swift/HybridCactusDeviceInfoSpec.swift +58 -0
- package/nitrogen/generated/ios/swift/HybridCactusDeviceInfoSpec_cxx.swift +164 -0
- package/nitrogen/generated/ios/swift/HybridCactusFileSystemSpec.swift +65 -0
- package/nitrogen/generated/ios/swift/HybridCactusFileSystemSpec_cxx.swift +303 -0
- package/nitrogen/generated/shared/c++/DeviceInfo.hpp +92 -0
- package/nitrogen/generated/shared/c++/HybridCactusCryptoSpec.cpp +21 -0
- package/nitrogen/generated/shared/c++/HybridCactusCryptoSpec.hpp +63 -0
- package/nitrogen/generated/shared/c++/HybridCactusDeviceInfoSpec.cpp +22 -0
- package/nitrogen/generated/shared/c++/HybridCactusDeviceInfoSpec.hpp +67 -0
- package/nitrogen/generated/shared/c++/HybridCactusFileSystemSpec.cpp +29 -0
- package/nitrogen/generated/shared/c++/HybridCactusFileSystemSpec.hpp +73 -0
- package/nitrogen/generated/shared/c++/HybridCactusSpec.cpp +26 -0
- package/nitrogen/generated/shared/c++/HybridCactusSpec.hpp +71 -0
- package/nitrogen/generated/shared/c++/HybridCactusUtilSpec.cpp +23 -0
- package/nitrogen/generated/shared/c++/HybridCactusUtilSpec.hpp +66 -0
- package/package.json +84 -143
- package/src/api/Database.ts +83 -0
- package/src/classes/CactusLM.ts +205 -0
- package/src/config/CactusConfig.ts +4 -0
- package/src/constants/packageVersion.ts +1 -0
- package/src/hooks/useCactusLM.ts +285 -0
- package/src/index.tsx +23 -0
- package/src/native/Cactus.ts +83 -0
- package/src/native/CactusCrypto.ts +11 -0
- package/src/native/CactusDeviceInfo.ts +18 -0
- package/src/native/CactusFileSystem.ts +47 -0
- package/src/native/CactusUtil.ts +27 -0
- package/src/native/index.ts +5 -0
- package/src/specs/Cactus.nitro.ts +20 -0
- package/src/specs/CactusCrypto.nitro.ts +6 -0
- package/src/specs/CactusDeviceInfo.nitro.ts +15 -0
- package/src/specs/CactusFileSystem.nitro.ts +21 -0
- package/src/specs/CactusUtil.nitro.ts +8 -0
- package/src/telemetry/Telemetry.ts +159 -0
- package/src/types/CactusLM.ts +73 -0
- package/src/types/CactusModel.ts +14 -0
- package/src/utils/error.ts +2 -0
- package/LICENSE.txt +0 -20
- package/android/src/main/CMakeLists.txt +0 -140
- package/android/src/main/java/com/cactus/Cactus.java +0 -1190
- package/android/src/main/java/com/cactus/CactusPackage.java +0 -48
- package/android/src/main/java/com/cactus/LlamaContext.java +0 -748
- package/android/src/main/jni-utils.h +0 -100
- package/android/src/main/jni.cpp +0 -1605
- package/android/src/main/jniLibs/arm64-v8a/libcactus.so +0 -0
- package/android/src/main/jniLibs/arm64-v8a/libcactus_v8_2.so +0 -0
- package/android/src/main/jniLibs/arm64-v8a/libcactus_v8_2_dotprod.so +0 -0
- package/android/src/main/jniLibs/arm64-v8a/libcactus_v8_2_dotprod_i8mm.so +0 -0
- package/android/src/main/jniLibs/arm64-v8a/libcactus_v8_2_i8mm.so +0 -0
- package/android/src/newarch/java/com/cactus/CactusModule.java +0 -204
- package/android/src/oldarch/java/com/cactus/CactusModule.java +0 -205
- package/cactus-react-native.podspec +0 -42
- package/ios/CMakeLists.txt +0 -131
- package/ios/Cactus.h +0 -6
- package/ios/Cactus.mm +0 -681
- package/ios/CactusContext.h +0 -81
- package/ios/CactusContext.mm +0 -1032
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/chat.h +0 -145
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/common.h +0 -674
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/ggml-alloc.h +0 -76
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/ggml-backend-impl.h +0 -255
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/ggml-backend.h +0 -354
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/ggml-common.h +0 -1857
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/ggml-cpp.h +0 -39
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/ggml-cpu.h +0 -143
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/ggml-impl.h +0 -601
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/ggml-metal-impl.h +0 -622
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/ggml-metal.h +0 -66
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/ggml-opt.h +0 -237
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/ggml-quants.h +0 -100
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/ggml-threading.h +0 -14
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/ggml.h +0 -2202
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/gguf.h +0 -202
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/json-schema-to-grammar.h +0 -21
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/json.hpp +0 -24766
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-adapter.h +0 -76
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-arch.h +0 -437
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-batch.h +0 -89
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-chat.h +0 -58
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-context.h +0 -276
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-cparams.h +0 -39
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-cpp.h +0 -30
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-grammar.h +0 -173
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-graph.h +0 -640
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-hparams.h +0 -190
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-impl.h +0 -61
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-io.h +0 -35
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-kv-cache.h +0 -515
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-memory.h +0 -32
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-mmap.h +0 -68
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-model-loader.h +0 -169
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-model-saver.h +0 -37
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-model.h +0 -425
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-sampling.h +0 -32
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama-vocab.h +0 -131
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/llama.h +0 -1376
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/log.h +0 -103
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/minja/chat-template.hpp +0 -542
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/minja/minja.hpp +0 -2974
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/sampling.h +0 -107
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/unicode-data.h +0 -20
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/Headers/unicode.h +0 -66
- package/ios/cactus.xcframework/ios-arm64/cactus.framework/ggml-llama.metallib +0 -0
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/cactus.h +0 -232
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/cactus_ffi.h +0 -256
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/chat.h +0 -145
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/common.h +0 -674
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/ggml-alloc.h +0 -76
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/ggml-backend-impl.h +0 -255
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/ggml-backend.h +0 -354
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/ggml-common.h +0 -1857
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/ggml-cpp.h +0 -39
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/ggml-cpu.h +0 -143
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/ggml-impl.h +0 -601
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/ggml-metal-impl.h +0 -622
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/ggml-metal.h +0 -66
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/ggml-opt.h +0 -237
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/ggml-quants.h +0 -100
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/ggml-threading.h +0 -14
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/ggml.h +0 -2202
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/gguf.h +0 -202
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/json-schema-to-grammar.h +0 -21
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/json.hpp +0 -24766
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-adapter.h +0 -76
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-arch.h +0 -437
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-batch.h +0 -89
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-chat.h +0 -58
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-context.h +0 -276
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-cparams.h +0 -39
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-cpp.h +0 -30
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-grammar.h +0 -173
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-graph.h +0 -640
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-hparams.h +0 -190
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-impl.h +0 -61
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-io.h +0 -35
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-kv-cache.h +0 -515
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-memory.h +0 -32
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-mmap.h +0 -68
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-model-loader.h +0 -169
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-model-saver.h +0 -37
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-model.h +0 -425
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-sampling.h +0 -32
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama-vocab.h +0 -131
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/llama.h +0 -1376
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/log.h +0 -103
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/minja/chat-template.hpp +0 -542
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/minja/minja.hpp +0 -2974
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/sampling.h +0 -107
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/unicode-data.h +0 -20
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/Headers/unicode.h +0 -66
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/cactus +0 -0
- package/ios/cactus.xcframework/ios-arm64_x86_64-simulator/cactus.framework/ggml-llama-sim.metallib +0 -0
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/cactus.h +0 -232
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/cactus_ffi.h +0 -256
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/chat.h +0 -145
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/common.h +0 -674
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/ggml-alloc.h +0 -76
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/ggml-backend-impl.h +0 -255
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/ggml-backend.h +0 -354
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/ggml-common.h +0 -1857
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/ggml-cpp.h +0 -39
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/ggml-cpu.h +0 -143
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/ggml-impl.h +0 -601
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/ggml-metal-impl.h +0 -622
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/ggml-metal.h +0 -66
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/ggml-opt.h +0 -237
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/ggml-quants.h +0 -100
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/ggml-threading.h +0 -14
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/ggml.h +0 -2202
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/gguf.h +0 -202
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/json-schema-to-grammar.h +0 -21
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/json.hpp +0 -24766
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-adapter.h +0 -76
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-arch.h +0 -437
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-batch.h +0 -89
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-chat.h +0 -58
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-context.h +0 -276
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-cparams.h +0 -39
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-cpp.h +0 -30
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-grammar.h +0 -173
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-graph.h +0 -640
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-hparams.h +0 -190
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-impl.h +0 -61
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-io.h +0 -35
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-kv-cache.h +0 -515
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-memory.h +0 -32
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-mmap.h +0 -68
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-model-loader.h +0 -169
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-model-saver.h +0 -37
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-model.h +0 -425
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-sampling.h +0 -32
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama-vocab.h +0 -131
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/llama.h +0 -1376
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/log.h +0 -103
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/minja/chat-template.hpp +0 -542
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/minja/minja.hpp +0 -2974
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/sampling.h +0 -107
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/unicode-data.h +0 -20
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Headers/unicode.h +0 -66
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/Info.plist +0 -0
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/cactus +0 -0
- package/ios/cactus.xcframework/tvos-arm64/cactus.framework/ggml-llama.metallib +0 -0
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/cactus.h +0 -232
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/cactus_ffi.h +0 -256
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/chat.h +0 -145
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/common.h +0 -674
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/ggml-alloc.h +0 -76
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/ggml-backend-impl.h +0 -255
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/ggml-backend.h +0 -354
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/ggml-common.h +0 -1857
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/ggml-cpp.h +0 -39
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/ggml-cpu.h +0 -143
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/ggml-impl.h +0 -601
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/ggml-metal-impl.h +0 -622
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/ggml-metal.h +0 -66
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/ggml-opt.h +0 -237
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/ggml-quants.h +0 -100
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/ggml-threading.h +0 -14
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/ggml.h +0 -2202
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/gguf.h +0 -202
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/json-schema-to-grammar.h +0 -21
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/json.hpp +0 -24766
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-adapter.h +0 -76
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-arch.h +0 -437
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-batch.h +0 -89
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-chat.h +0 -58
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-context.h +0 -276
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-cparams.h +0 -39
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-cpp.h +0 -30
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-grammar.h +0 -173
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-graph.h +0 -640
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-hparams.h +0 -190
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-impl.h +0 -61
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-io.h +0 -35
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-kv-cache.h +0 -515
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-memory.h +0 -32
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-mmap.h +0 -68
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-model-loader.h +0 -169
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-model-saver.h +0 -37
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-model.h +0 -425
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-sampling.h +0 -32
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama-vocab.h +0 -131
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/llama.h +0 -1376
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/log.h +0 -103
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/minja/chat-template.hpp +0 -542
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/minja/minja.hpp +0 -2974
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/sampling.h +0 -107
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/unicode-data.h +0 -20
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Headers/unicode.h +0 -66
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/Info.plist +0 -0
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/cactus +0 -0
- package/ios/cactus.xcframework/tvos-arm64_x86_64-simulator/cactus.framework/ggml-llama-sim.metallib +0 -0
- package/lib/commonjs/NativeCactus.js +0 -9
- package/lib/commonjs/NativeCactus.js.map +0 -1
- package/lib/commonjs/agent.js +0 -73
- package/lib/commonjs/agent.js.map +0 -1
- package/lib/commonjs/chat.js +0 -73
- package/lib/commonjs/chat.js.map +0 -1
- package/lib/commonjs/index.js +0 -523
- package/lib/commonjs/index.js.map +0 -1
- package/lib/commonjs/lm.js +0 -272
- package/lib/commonjs/lm.js.map +0 -1
- package/lib/commonjs/package.json +0 -1
- package/lib/commonjs/projectId.js +0 -9
- package/lib/commonjs/projectId.js.map +0 -1
- package/lib/commonjs/remote.js +0 -100
- package/lib/commonjs/remote.js.map +0 -1
- package/lib/commonjs/telemetry.js +0 -102
- package/lib/commonjs/telemetry.js.map +0 -1
- package/lib/commonjs/tools.js +0 -72
- package/lib/commonjs/tools.js.map +0 -1
- package/lib/commonjs/tts.js +0 -141
- package/lib/commonjs/tts.js.map +0 -1
- package/lib/commonjs/vlm.js +0 -221
- package/lib/commonjs/vlm.js.map +0 -1
- package/lib/module/NativeCactus.js +0 -5
- package/lib/module/NativeCactus.js.map +0 -1
- package/lib/module/agent.js +0 -68
- package/lib/module/agent.js.map +0 -1
- package/lib/module/chat.js +0 -67
- package/lib/module/chat.js.map +0 -1
- package/lib/module/lm.js +0 -267
- package/lib/module/lm.js.map +0 -1
- package/lib/module/projectId.js +0 -5
- package/lib/module/projectId.js.map +0 -1
- package/lib/module/remote.js +0 -91
- package/lib/module/remote.js.map +0 -1
- package/lib/module/telemetry.js +0 -97
- package/lib/module/telemetry.js.map +0 -1
- package/lib/module/tools.js +0 -66
- package/lib/module/tools.js.map +0 -1
- package/lib/module/tts.js +0 -135
- package/lib/module/tts.js.map +0 -1
- package/lib/module/vlm.js +0 -216
- package/lib/module/vlm.js.map +0 -1
- package/lib/typescript/NativeCactus.d.ts +0 -252
- package/lib/typescript/NativeCactus.d.ts.map +0 -1
- package/lib/typescript/agent.d.ts +0 -31
- package/lib/typescript/agent.d.ts.map +0 -1
- package/lib/typescript/chat.d.ts +0 -23
- package/lib/typescript/chat.d.ts.map +0 -1
- package/lib/typescript/index.d.ts +0 -114
- package/lib/typescript/index.d.ts.map +0 -1
- package/lib/typescript/lm.d.ts +0 -36
- package/lib/typescript/lm.d.ts.map +0 -1
- package/lib/typescript/projectId.d.ts +0 -2
- package/lib/typescript/projectId.d.ts.map +0 -1
- package/lib/typescript/remote.d.ts +0 -8
- package/lib/typescript/remote.d.ts.map +0 -1
- package/lib/typescript/telemetry.d.ts +0 -25
- package/lib/typescript/telemetry.d.ts.map +0 -1
- package/lib/typescript/tools.d.ts +0 -36
- package/lib/typescript/tools.d.ts.map +0 -1
- package/lib/typescript/tts.d.ts +0 -54
- package/lib/typescript/tts.d.ts.map +0 -1
- package/lib/typescript/vlm.d.ts +0 -33
- package/lib/typescript/vlm.d.ts.map +0 -1
- package/scripts/postInstall.js +0 -33
- package/src/NativeCactus.ts +0 -317
- package/src/agent.ts +0 -112
- package/src/chat.ts +0 -91
- package/src/index.ts +0 -663
- package/src/lm.ts +0 -324
- package/src/projectId.ts +0 -1
- package/src/remote.ts +0 -113
- package/src/telemetry.ts +0 -137
- package/src/tools.ts +0 -94
- package/src/tts.ts +0 -236
- package/src/vlm.ts +0 -276
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Cactus+autolinking.rb
|
|
3
|
+
# This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
# https://github.com/mrousavy/nitro
|
|
5
|
+
# Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
#
|
|
7
|
+
|
|
8
|
+
# This is a Ruby script that adds all files generated by Nitrogen
|
|
9
|
+
# to the given podspec.
|
|
10
|
+
#
|
|
11
|
+
# To use it, add this to your .podspec:
|
|
12
|
+
# ```ruby
|
|
13
|
+
# Pod::Spec.new do |spec|
|
|
14
|
+
# # ...
|
|
15
|
+
#
|
|
16
|
+
# # Add all files generated by Nitrogen
|
|
17
|
+
# load 'nitrogen/generated/ios/Cactus+autolinking.rb'
|
|
18
|
+
# add_nitrogen_files(spec)
|
|
19
|
+
# end
|
|
20
|
+
# ```
|
|
21
|
+
|
|
22
|
+
def add_nitrogen_files(spec)
|
|
23
|
+
Pod::UI.puts "[NitroModules] 🔥 Cactus is boosted by nitro!"
|
|
24
|
+
|
|
25
|
+
spec.dependency "NitroModules"
|
|
26
|
+
|
|
27
|
+
current_source_files = Array(spec.attributes_hash['source_files'])
|
|
28
|
+
spec.source_files = current_source_files + [
|
|
29
|
+
# Generated cross-platform specs
|
|
30
|
+
"nitrogen/generated/shared/**/*.{h,hpp,c,cpp,swift}",
|
|
31
|
+
# Generated bridges for the cross-platform specs
|
|
32
|
+
"nitrogen/generated/ios/**/*.{h,hpp,c,cpp,mm,swift}",
|
|
33
|
+
]
|
|
34
|
+
|
|
35
|
+
current_public_header_files = Array(spec.attributes_hash['public_header_files'])
|
|
36
|
+
spec.public_header_files = current_public_header_files + [
|
|
37
|
+
# Generated specs
|
|
38
|
+
"nitrogen/generated/shared/**/*.{h,hpp}",
|
|
39
|
+
# Swift to C++ bridging helpers
|
|
40
|
+
"nitrogen/generated/ios/Cactus-Swift-Cxx-Bridge.hpp"
|
|
41
|
+
]
|
|
42
|
+
|
|
43
|
+
current_private_header_files = Array(spec.attributes_hash['private_header_files'])
|
|
44
|
+
spec.private_header_files = current_private_header_files + [
|
|
45
|
+
# iOS specific specs
|
|
46
|
+
"nitrogen/generated/ios/c++/**/*.{h,hpp}",
|
|
47
|
+
# Views are framework-specific and should be private
|
|
48
|
+
"nitrogen/generated/shared/**/views/**/*"
|
|
49
|
+
]
|
|
50
|
+
|
|
51
|
+
current_pod_target_xcconfig = spec.attributes_hash['pod_target_xcconfig'] || {}
|
|
52
|
+
spec.pod_target_xcconfig = current_pod_target_xcconfig.merge({
|
|
53
|
+
# Use C++ 20
|
|
54
|
+
"CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
|
|
55
|
+
# Enables C++ <-> Swift interop (by default it's only C)
|
|
56
|
+
"SWIFT_OBJC_INTEROP_MODE" => "objcxx",
|
|
57
|
+
# Enables stricter modular headers
|
|
58
|
+
"DEFINES_MODULE" => "YES",
|
|
59
|
+
})
|
|
60
|
+
end
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// Cactus-Swift-Cxx-Bridge.cpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#include "Cactus-Swift-Cxx-Bridge.hpp"
|
|
9
|
+
|
|
10
|
+
// Include C++ implementation defined types
|
|
11
|
+
#include "Cactus-Swift-Cxx-Umbrella.hpp"
|
|
12
|
+
#include "HybridCactusCryptoSpecSwift.hpp"
|
|
13
|
+
#include "HybridCactusDeviceInfoSpecSwift.hpp"
|
|
14
|
+
#include "HybridCactusFileSystemSpecSwift.hpp"
|
|
15
|
+
|
|
16
|
+
namespace margelo::nitro::cactus::bridge::swift {
|
|
17
|
+
|
|
18
|
+
// pragma MARK: std::function<void(const std::string& /* result */)>
|
|
19
|
+
Func_void_std__string create_Func_void_std__string(void* NON_NULL swiftClosureWrapper) noexcept {
|
|
20
|
+
auto swiftClosure = Cactus::Func_void_std__string::fromUnsafe(swiftClosureWrapper);
|
|
21
|
+
return [swiftClosure = std::move(swiftClosure)](const std::string& result) mutable -> void {
|
|
22
|
+
swiftClosure.call(result);
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// pragma MARK: std::function<void(const std::exception_ptr& /* error */)>
|
|
27
|
+
Func_void_std__exception_ptr create_Func_void_std__exception_ptr(void* NON_NULL swiftClosureWrapper) noexcept {
|
|
28
|
+
auto swiftClosure = Cactus::Func_void_std__exception_ptr::fromUnsafe(swiftClosureWrapper);
|
|
29
|
+
return [swiftClosure = std::move(swiftClosure)](const std::exception_ptr& error) mutable -> void {
|
|
30
|
+
swiftClosure.call(error);
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// pragma MARK: std::shared_ptr<HybridCactusCryptoSpec>
|
|
35
|
+
std::shared_ptr<HybridCactusCryptoSpec> create_std__shared_ptr_HybridCactusCryptoSpec_(void* NON_NULL swiftUnsafePointer) noexcept {
|
|
36
|
+
Cactus::HybridCactusCryptoSpec_cxx swiftPart = Cactus::HybridCactusCryptoSpec_cxx::fromUnsafe(swiftUnsafePointer);
|
|
37
|
+
return std::make_shared<margelo::nitro::cactus::HybridCactusCryptoSpecSwift>(swiftPart);
|
|
38
|
+
}
|
|
39
|
+
void* NON_NULL get_std__shared_ptr_HybridCactusCryptoSpec_(std__shared_ptr_HybridCactusCryptoSpec_ cppType) {
|
|
40
|
+
std::shared_ptr<margelo::nitro::cactus::HybridCactusCryptoSpecSwift> swiftWrapper = std::dynamic_pointer_cast<margelo::nitro::cactus::HybridCactusCryptoSpecSwift>(cppType);
|
|
41
|
+
#ifdef NITRO_DEBUG
|
|
42
|
+
if (swiftWrapper == nullptr) [[unlikely]] {
|
|
43
|
+
throw std::runtime_error("Class \"HybridCactusCryptoSpec\" is not implemented in Swift!");
|
|
44
|
+
}
|
|
45
|
+
#endif
|
|
46
|
+
Cactus::HybridCactusCryptoSpec_cxx& swiftPart = swiftWrapper->getSwiftPart();
|
|
47
|
+
return swiftPart.toUnsafe();
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// pragma MARK: std::function<void(const std::optional<std::string>& /* result */)>
|
|
51
|
+
Func_void_std__optional_std__string_ create_Func_void_std__optional_std__string_(void* NON_NULL swiftClosureWrapper) noexcept {
|
|
52
|
+
auto swiftClosure = Cactus::Func_void_std__optional_std__string_::fromUnsafe(swiftClosureWrapper);
|
|
53
|
+
return [swiftClosure = std::move(swiftClosure)](const std::optional<std::string>& result) mutable -> void {
|
|
54
|
+
swiftClosure.call(result);
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// pragma MARK: std::function<void(const DeviceInfo& /* result */)>
|
|
59
|
+
Func_void_DeviceInfo create_Func_void_DeviceInfo(void* NON_NULL swiftClosureWrapper) noexcept {
|
|
60
|
+
auto swiftClosure = Cactus::Func_void_DeviceInfo::fromUnsafe(swiftClosureWrapper);
|
|
61
|
+
return [swiftClosure = std::move(swiftClosure)](const DeviceInfo& result) mutable -> void {
|
|
62
|
+
swiftClosure.call(result);
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// pragma MARK: std::shared_ptr<HybridCactusDeviceInfoSpec>
|
|
67
|
+
std::shared_ptr<HybridCactusDeviceInfoSpec> create_std__shared_ptr_HybridCactusDeviceInfoSpec_(void* NON_NULL swiftUnsafePointer) noexcept {
|
|
68
|
+
Cactus::HybridCactusDeviceInfoSpec_cxx swiftPart = Cactus::HybridCactusDeviceInfoSpec_cxx::fromUnsafe(swiftUnsafePointer);
|
|
69
|
+
return std::make_shared<margelo::nitro::cactus::HybridCactusDeviceInfoSpecSwift>(swiftPart);
|
|
70
|
+
}
|
|
71
|
+
void* NON_NULL get_std__shared_ptr_HybridCactusDeviceInfoSpec_(std__shared_ptr_HybridCactusDeviceInfoSpec_ cppType) {
|
|
72
|
+
std::shared_ptr<margelo::nitro::cactus::HybridCactusDeviceInfoSpecSwift> swiftWrapper = std::dynamic_pointer_cast<margelo::nitro::cactus::HybridCactusDeviceInfoSpecSwift>(cppType);
|
|
73
|
+
#ifdef NITRO_DEBUG
|
|
74
|
+
if (swiftWrapper == nullptr) [[unlikely]] {
|
|
75
|
+
throw std::runtime_error("Class \"HybridCactusDeviceInfoSpec\" is not implemented in Swift!");
|
|
76
|
+
}
|
|
77
|
+
#endif
|
|
78
|
+
Cactus::HybridCactusDeviceInfoSpec_cxx& swiftPart = swiftWrapper->getSwiftPart();
|
|
79
|
+
return swiftPart.toUnsafe();
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// pragma MARK: std::function<void(bool /* result */)>
|
|
83
|
+
Func_void_bool create_Func_void_bool(void* NON_NULL swiftClosureWrapper) noexcept {
|
|
84
|
+
auto swiftClosure = Cactus::Func_void_bool::fromUnsafe(swiftClosureWrapper);
|
|
85
|
+
return [swiftClosure = std::move(swiftClosure)](bool result) mutable -> void {
|
|
86
|
+
swiftClosure.call(result);
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// pragma MARK: std::function<void()>
|
|
91
|
+
Func_void create_Func_void(void* NON_NULL swiftClosureWrapper) noexcept {
|
|
92
|
+
auto swiftClosure = Cactus::Func_void::fromUnsafe(swiftClosureWrapper);
|
|
93
|
+
return [swiftClosure = std::move(swiftClosure)]() mutable -> void {
|
|
94
|
+
swiftClosure.call();
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// pragma MARK: std::function<void(double /* progress */)>
|
|
99
|
+
Func_void_double create_Func_void_double(void* NON_NULL swiftClosureWrapper) noexcept {
|
|
100
|
+
auto swiftClosure = Cactus::Func_void_double::fromUnsafe(swiftClosureWrapper);
|
|
101
|
+
return [swiftClosure = std::move(swiftClosure)](double progress) mutable -> void {
|
|
102
|
+
swiftClosure.call(progress);
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// pragma MARK: std::shared_ptr<HybridCactusFileSystemSpec>
|
|
107
|
+
std::shared_ptr<HybridCactusFileSystemSpec> create_std__shared_ptr_HybridCactusFileSystemSpec_(void* NON_NULL swiftUnsafePointer) noexcept {
|
|
108
|
+
Cactus::HybridCactusFileSystemSpec_cxx swiftPart = Cactus::HybridCactusFileSystemSpec_cxx::fromUnsafe(swiftUnsafePointer);
|
|
109
|
+
return std::make_shared<margelo::nitro::cactus::HybridCactusFileSystemSpecSwift>(swiftPart);
|
|
110
|
+
}
|
|
111
|
+
void* NON_NULL get_std__shared_ptr_HybridCactusFileSystemSpec_(std__shared_ptr_HybridCactusFileSystemSpec_ cppType) {
|
|
112
|
+
std::shared_ptr<margelo::nitro::cactus::HybridCactusFileSystemSpecSwift> swiftWrapper = std::dynamic_pointer_cast<margelo::nitro::cactus::HybridCactusFileSystemSpecSwift>(cppType);
|
|
113
|
+
#ifdef NITRO_DEBUG
|
|
114
|
+
if (swiftWrapper == nullptr) [[unlikely]] {
|
|
115
|
+
throw std::runtime_error("Class \"HybridCactusFileSystemSpec\" is not implemented in Swift!");
|
|
116
|
+
}
|
|
117
|
+
#endif
|
|
118
|
+
Cactus::HybridCactusFileSystemSpec_cxx& swiftPart = swiftWrapper->getSwiftPart();
|
|
119
|
+
return swiftPart.toUnsafe();
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
} // namespace margelo::nitro::cactus::bridge::swift
|
|
@@ -0,0 +1,373 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// Cactus-Swift-Cxx-Bridge.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
// Forward declarations of C++ defined types
|
|
11
|
+
// Forward declaration of `DeviceInfo` to properly resolve imports.
|
|
12
|
+
namespace margelo::nitro::cactus { struct DeviceInfo; }
|
|
13
|
+
// Forward declaration of `HybridCactusCryptoSpec` to properly resolve imports.
|
|
14
|
+
namespace margelo::nitro::cactus { class HybridCactusCryptoSpec; }
|
|
15
|
+
// Forward declaration of `HybridCactusDeviceInfoSpec` to properly resolve imports.
|
|
16
|
+
namespace margelo::nitro::cactus { class HybridCactusDeviceInfoSpec; }
|
|
17
|
+
// Forward declaration of `HybridCactusFileSystemSpec` to properly resolve imports.
|
|
18
|
+
namespace margelo::nitro::cactus { class HybridCactusFileSystemSpec; }
|
|
19
|
+
|
|
20
|
+
// Forward declarations of Swift defined types
|
|
21
|
+
// Forward declaration of `HybridCactusCryptoSpec_cxx` to properly resolve imports.
|
|
22
|
+
namespace Cactus { class HybridCactusCryptoSpec_cxx; }
|
|
23
|
+
// Forward declaration of `HybridCactusDeviceInfoSpec_cxx` to properly resolve imports.
|
|
24
|
+
namespace Cactus { class HybridCactusDeviceInfoSpec_cxx; }
|
|
25
|
+
// Forward declaration of `HybridCactusFileSystemSpec_cxx` to properly resolve imports.
|
|
26
|
+
namespace Cactus { class HybridCactusFileSystemSpec_cxx; }
|
|
27
|
+
|
|
28
|
+
// Include C++ defined types
|
|
29
|
+
#include "DeviceInfo.hpp"
|
|
30
|
+
#include "HybridCactusCryptoSpec.hpp"
|
|
31
|
+
#include "HybridCactusDeviceInfoSpec.hpp"
|
|
32
|
+
#include "HybridCactusFileSystemSpec.hpp"
|
|
33
|
+
#include <NitroModules/Promise.hpp>
|
|
34
|
+
#include <NitroModules/PromiseHolder.hpp>
|
|
35
|
+
#include <NitroModules/Result.hpp>
|
|
36
|
+
#include <exception>
|
|
37
|
+
#include <functional>
|
|
38
|
+
#include <memory>
|
|
39
|
+
#include <optional>
|
|
40
|
+
#include <string>
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Contains specialized versions of C++ templated types so they can be accessed from Swift,
|
|
44
|
+
* as well as helper functions to interact with those C++ types from Swift.
|
|
45
|
+
*/
|
|
46
|
+
namespace margelo::nitro::cactus::bridge::swift {
|
|
47
|
+
|
|
48
|
+
// pragma MARK: std::shared_ptr<Promise<std::string>>
|
|
49
|
+
/**
|
|
50
|
+
* Specialized version of `std::shared_ptr<Promise<std::string>>`.
|
|
51
|
+
*/
|
|
52
|
+
using std__shared_ptr_Promise_std__string__ = std::shared_ptr<Promise<std::string>>;
|
|
53
|
+
inline std::shared_ptr<Promise<std::string>> create_std__shared_ptr_Promise_std__string__() noexcept {
|
|
54
|
+
return Promise<std::string>::create();
|
|
55
|
+
}
|
|
56
|
+
inline PromiseHolder<std::string> wrap_std__shared_ptr_Promise_std__string__(std::shared_ptr<Promise<std::string>> promise) noexcept {
|
|
57
|
+
return PromiseHolder<std::string>(std::move(promise));
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// pragma MARK: std::function<void(const std::string& /* result */)>
|
|
61
|
+
/**
|
|
62
|
+
* Specialized version of `std::function<void(const std::string&)>`.
|
|
63
|
+
*/
|
|
64
|
+
using Func_void_std__string = std::function<void(const std::string& /* result */)>;
|
|
65
|
+
/**
|
|
66
|
+
* Wrapper class for a `std::function<void(const std::string& / * result * /)>`, this can be used from Swift.
|
|
67
|
+
*/
|
|
68
|
+
class Func_void_std__string_Wrapper final {
|
|
69
|
+
public:
|
|
70
|
+
explicit Func_void_std__string_Wrapper(std::function<void(const std::string& /* result */)>&& func): _function(std::make_unique<std::function<void(const std::string& /* result */)>>(std::move(func))) {}
|
|
71
|
+
inline void call(std::string result) const noexcept {
|
|
72
|
+
_function->operator()(result);
|
|
73
|
+
}
|
|
74
|
+
private:
|
|
75
|
+
std::unique_ptr<std::function<void(const std::string& /* result */)>> _function;
|
|
76
|
+
} SWIFT_NONCOPYABLE;
|
|
77
|
+
Func_void_std__string create_Func_void_std__string(void* NON_NULL swiftClosureWrapper) noexcept;
|
|
78
|
+
inline Func_void_std__string_Wrapper wrap_Func_void_std__string(Func_void_std__string value) noexcept {
|
|
79
|
+
return Func_void_std__string_Wrapper(std::move(value));
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// pragma MARK: std::function<void(const std::exception_ptr& /* error */)>
|
|
83
|
+
/**
|
|
84
|
+
* Specialized version of `std::function<void(const std::exception_ptr&)>`.
|
|
85
|
+
*/
|
|
86
|
+
using Func_void_std__exception_ptr = std::function<void(const std::exception_ptr& /* error */)>;
|
|
87
|
+
/**
|
|
88
|
+
* Wrapper class for a `std::function<void(const std::exception_ptr& / * error * /)>`, this can be used from Swift.
|
|
89
|
+
*/
|
|
90
|
+
class Func_void_std__exception_ptr_Wrapper final {
|
|
91
|
+
public:
|
|
92
|
+
explicit Func_void_std__exception_ptr_Wrapper(std::function<void(const std::exception_ptr& /* error */)>&& func): _function(std::make_unique<std::function<void(const std::exception_ptr& /* error */)>>(std::move(func))) {}
|
|
93
|
+
inline void call(std::exception_ptr error) const noexcept {
|
|
94
|
+
_function->operator()(error);
|
|
95
|
+
}
|
|
96
|
+
private:
|
|
97
|
+
std::unique_ptr<std::function<void(const std::exception_ptr& /* error */)>> _function;
|
|
98
|
+
} SWIFT_NONCOPYABLE;
|
|
99
|
+
Func_void_std__exception_ptr create_Func_void_std__exception_ptr(void* NON_NULL swiftClosureWrapper) noexcept;
|
|
100
|
+
inline Func_void_std__exception_ptr_Wrapper wrap_Func_void_std__exception_ptr(Func_void_std__exception_ptr value) noexcept {
|
|
101
|
+
return Func_void_std__exception_ptr_Wrapper(std::move(value));
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// pragma MARK: std::shared_ptr<HybridCactusCryptoSpec>
|
|
105
|
+
/**
|
|
106
|
+
* Specialized version of `std::shared_ptr<HybridCactusCryptoSpec>`.
|
|
107
|
+
*/
|
|
108
|
+
using std__shared_ptr_HybridCactusCryptoSpec_ = std::shared_ptr<HybridCactusCryptoSpec>;
|
|
109
|
+
std::shared_ptr<HybridCactusCryptoSpec> create_std__shared_ptr_HybridCactusCryptoSpec_(void* NON_NULL swiftUnsafePointer) noexcept;
|
|
110
|
+
void* NON_NULL get_std__shared_ptr_HybridCactusCryptoSpec_(std__shared_ptr_HybridCactusCryptoSpec_ cppType);
|
|
111
|
+
|
|
112
|
+
// pragma MARK: std::weak_ptr<HybridCactusCryptoSpec>
|
|
113
|
+
using std__weak_ptr_HybridCactusCryptoSpec_ = std::weak_ptr<HybridCactusCryptoSpec>;
|
|
114
|
+
inline std__weak_ptr_HybridCactusCryptoSpec_ weakify_std__shared_ptr_HybridCactusCryptoSpec_(const std::shared_ptr<HybridCactusCryptoSpec>& strong) noexcept { return strong; }
|
|
115
|
+
|
|
116
|
+
// pragma MARK: Result<std::shared_ptr<Promise<std::string>>>
|
|
117
|
+
using Result_std__shared_ptr_Promise_std__string___ = Result<std::shared_ptr<Promise<std::string>>>;
|
|
118
|
+
inline Result_std__shared_ptr_Promise_std__string___ create_Result_std__shared_ptr_Promise_std__string___(const std::shared_ptr<Promise<std::string>>& value) noexcept {
|
|
119
|
+
return Result<std::shared_ptr<Promise<std::string>>>::withValue(value);
|
|
120
|
+
}
|
|
121
|
+
inline Result_std__shared_ptr_Promise_std__string___ create_Result_std__shared_ptr_Promise_std__string___(const std::exception_ptr& error) noexcept {
|
|
122
|
+
return Result<std::shared_ptr<Promise<std::string>>>::withError(error);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// pragma MARK: std::optional<std::string>
|
|
126
|
+
/**
|
|
127
|
+
* Specialized version of `std::optional<std::string>`.
|
|
128
|
+
*/
|
|
129
|
+
using std__optional_std__string_ = std::optional<std::string>;
|
|
130
|
+
inline std::optional<std::string> create_std__optional_std__string_(const std::string& value) noexcept {
|
|
131
|
+
return std::optional<std::string>(value);
|
|
132
|
+
}
|
|
133
|
+
inline bool has_value_std__optional_std__string_(const std::optional<std::string>& optional) noexcept {
|
|
134
|
+
return optional.has_value();
|
|
135
|
+
}
|
|
136
|
+
inline std::string get_std__optional_std__string_(const std::optional<std::string>& optional) noexcept {
|
|
137
|
+
return *optional;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// pragma MARK: std::shared_ptr<Promise<std::optional<std::string>>>
|
|
141
|
+
/**
|
|
142
|
+
* Specialized version of `std::shared_ptr<Promise<std::optional<std::string>>>`.
|
|
143
|
+
*/
|
|
144
|
+
using std__shared_ptr_Promise_std__optional_std__string___ = std::shared_ptr<Promise<std::optional<std::string>>>;
|
|
145
|
+
inline std::shared_ptr<Promise<std::optional<std::string>>> create_std__shared_ptr_Promise_std__optional_std__string___() noexcept {
|
|
146
|
+
return Promise<std::optional<std::string>>::create();
|
|
147
|
+
}
|
|
148
|
+
inline PromiseHolder<std::optional<std::string>> wrap_std__shared_ptr_Promise_std__optional_std__string___(std::shared_ptr<Promise<std::optional<std::string>>> promise) noexcept {
|
|
149
|
+
return PromiseHolder<std::optional<std::string>>(std::move(promise));
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// pragma MARK: std::function<void(const std::optional<std::string>& /* result */)>
|
|
153
|
+
/**
|
|
154
|
+
* Specialized version of `std::function<void(const std::optional<std::string>&)>`.
|
|
155
|
+
*/
|
|
156
|
+
using Func_void_std__optional_std__string_ = std::function<void(const std::optional<std::string>& /* result */)>;
|
|
157
|
+
/**
|
|
158
|
+
* Wrapper class for a `std::function<void(const std::optional<std::string>& / * result * /)>`, this can be used from Swift.
|
|
159
|
+
*/
|
|
160
|
+
class Func_void_std__optional_std__string__Wrapper final {
|
|
161
|
+
public:
|
|
162
|
+
explicit Func_void_std__optional_std__string__Wrapper(std::function<void(const std::optional<std::string>& /* result */)>&& func): _function(std::make_unique<std::function<void(const std::optional<std::string>& /* result */)>>(std::move(func))) {}
|
|
163
|
+
inline void call(std::optional<std::string> result) const noexcept {
|
|
164
|
+
_function->operator()(result);
|
|
165
|
+
}
|
|
166
|
+
private:
|
|
167
|
+
std::unique_ptr<std::function<void(const std::optional<std::string>& /* result */)>> _function;
|
|
168
|
+
} SWIFT_NONCOPYABLE;
|
|
169
|
+
Func_void_std__optional_std__string_ create_Func_void_std__optional_std__string_(void* NON_NULL swiftClosureWrapper) noexcept;
|
|
170
|
+
inline Func_void_std__optional_std__string__Wrapper wrap_Func_void_std__optional_std__string_(Func_void_std__optional_std__string_ value) noexcept {
|
|
171
|
+
return Func_void_std__optional_std__string__Wrapper(std::move(value));
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
// pragma MARK: std::shared_ptr<Promise<DeviceInfo>>
|
|
175
|
+
/**
|
|
176
|
+
* Specialized version of `std::shared_ptr<Promise<DeviceInfo>>`.
|
|
177
|
+
*/
|
|
178
|
+
using std__shared_ptr_Promise_DeviceInfo__ = std::shared_ptr<Promise<DeviceInfo>>;
|
|
179
|
+
inline std::shared_ptr<Promise<DeviceInfo>> create_std__shared_ptr_Promise_DeviceInfo__() noexcept {
|
|
180
|
+
return Promise<DeviceInfo>::create();
|
|
181
|
+
}
|
|
182
|
+
inline PromiseHolder<DeviceInfo> wrap_std__shared_ptr_Promise_DeviceInfo__(std::shared_ptr<Promise<DeviceInfo>> promise) noexcept {
|
|
183
|
+
return PromiseHolder<DeviceInfo>(std::move(promise));
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
// pragma MARK: std::function<void(const DeviceInfo& /* result */)>
|
|
187
|
+
/**
|
|
188
|
+
* Specialized version of `std::function<void(const DeviceInfo&)>`.
|
|
189
|
+
*/
|
|
190
|
+
using Func_void_DeviceInfo = std::function<void(const DeviceInfo& /* result */)>;
|
|
191
|
+
/**
|
|
192
|
+
* Wrapper class for a `std::function<void(const DeviceInfo& / * result * /)>`, this can be used from Swift.
|
|
193
|
+
*/
|
|
194
|
+
class Func_void_DeviceInfo_Wrapper final {
|
|
195
|
+
public:
|
|
196
|
+
explicit Func_void_DeviceInfo_Wrapper(std::function<void(const DeviceInfo& /* result */)>&& func): _function(std::make_unique<std::function<void(const DeviceInfo& /* result */)>>(std::move(func))) {}
|
|
197
|
+
inline void call(DeviceInfo result) const noexcept {
|
|
198
|
+
_function->operator()(result);
|
|
199
|
+
}
|
|
200
|
+
private:
|
|
201
|
+
std::unique_ptr<std::function<void(const DeviceInfo& /* result */)>> _function;
|
|
202
|
+
} SWIFT_NONCOPYABLE;
|
|
203
|
+
Func_void_DeviceInfo create_Func_void_DeviceInfo(void* NON_NULL swiftClosureWrapper) noexcept;
|
|
204
|
+
inline Func_void_DeviceInfo_Wrapper wrap_Func_void_DeviceInfo(Func_void_DeviceInfo value) noexcept {
|
|
205
|
+
return Func_void_DeviceInfo_Wrapper(std::move(value));
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
// pragma MARK: std::shared_ptr<HybridCactusDeviceInfoSpec>
|
|
209
|
+
/**
|
|
210
|
+
* Specialized version of `std::shared_ptr<HybridCactusDeviceInfoSpec>`.
|
|
211
|
+
*/
|
|
212
|
+
using std__shared_ptr_HybridCactusDeviceInfoSpec_ = std::shared_ptr<HybridCactusDeviceInfoSpec>;
|
|
213
|
+
std::shared_ptr<HybridCactusDeviceInfoSpec> create_std__shared_ptr_HybridCactusDeviceInfoSpec_(void* NON_NULL swiftUnsafePointer) noexcept;
|
|
214
|
+
void* NON_NULL get_std__shared_ptr_HybridCactusDeviceInfoSpec_(std__shared_ptr_HybridCactusDeviceInfoSpec_ cppType);
|
|
215
|
+
|
|
216
|
+
// pragma MARK: std::weak_ptr<HybridCactusDeviceInfoSpec>
|
|
217
|
+
using std__weak_ptr_HybridCactusDeviceInfoSpec_ = std::weak_ptr<HybridCactusDeviceInfoSpec>;
|
|
218
|
+
inline std__weak_ptr_HybridCactusDeviceInfoSpec_ weakify_std__shared_ptr_HybridCactusDeviceInfoSpec_(const std::shared_ptr<HybridCactusDeviceInfoSpec>& strong) noexcept { return strong; }
|
|
219
|
+
|
|
220
|
+
// pragma MARK: Result<std::shared_ptr<Promise<std::optional<std::string>>>>
|
|
221
|
+
using Result_std__shared_ptr_Promise_std__optional_std__string____ = Result<std::shared_ptr<Promise<std::optional<std::string>>>>;
|
|
222
|
+
inline Result_std__shared_ptr_Promise_std__optional_std__string____ create_Result_std__shared_ptr_Promise_std__optional_std__string____(const std::shared_ptr<Promise<std::optional<std::string>>>& value) noexcept {
|
|
223
|
+
return Result<std::shared_ptr<Promise<std::optional<std::string>>>>::withValue(value);
|
|
224
|
+
}
|
|
225
|
+
inline Result_std__shared_ptr_Promise_std__optional_std__string____ create_Result_std__shared_ptr_Promise_std__optional_std__string____(const std::exception_ptr& error) noexcept {
|
|
226
|
+
return Result<std::shared_ptr<Promise<std::optional<std::string>>>>::withError(error);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
// pragma MARK: Result<std::shared_ptr<Promise<DeviceInfo>>>
|
|
230
|
+
using Result_std__shared_ptr_Promise_DeviceInfo___ = Result<std::shared_ptr<Promise<DeviceInfo>>>;
|
|
231
|
+
inline Result_std__shared_ptr_Promise_DeviceInfo___ create_Result_std__shared_ptr_Promise_DeviceInfo___(const std::shared_ptr<Promise<DeviceInfo>>& value) noexcept {
|
|
232
|
+
return Result<std::shared_ptr<Promise<DeviceInfo>>>::withValue(value);
|
|
233
|
+
}
|
|
234
|
+
inline Result_std__shared_ptr_Promise_DeviceInfo___ create_Result_std__shared_ptr_Promise_DeviceInfo___(const std::exception_ptr& error) noexcept {
|
|
235
|
+
return Result<std::shared_ptr<Promise<DeviceInfo>>>::withError(error);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
// pragma MARK: std::shared_ptr<Promise<bool>>
|
|
239
|
+
/**
|
|
240
|
+
* Specialized version of `std::shared_ptr<Promise<bool>>`.
|
|
241
|
+
*/
|
|
242
|
+
using std__shared_ptr_Promise_bool__ = std::shared_ptr<Promise<bool>>;
|
|
243
|
+
inline std::shared_ptr<Promise<bool>> create_std__shared_ptr_Promise_bool__() noexcept {
|
|
244
|
+
return Promise<bool>::create();
|
|
245
|
+
}
|
|
246
|
+
inline PromiseHolder<bool> wrap_std__shared_ptr_Promise_bool__(std::shared_ptr<Promise<bool>> promise) noexcept {
|
|
247
|
+
return PromiseHolder<bool>(std::move(promise));
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
// pragma MARK: std::function<void(bool /* result */)>
|
|
251
|
+
/**
|
|
252
|
+
* Specialized version of `std::function<void(bool)>`.
|
|
253
|
+
*/
|
|
254
|
+
using Func_void_bool = std::function<void(bool /* result */)>;
|
|
255
|
+
/**
|
|
256
|
+
* Wrapper class for a `std::function<void(bool / * result * /)>`, this can be used from Swift.
|
|
257
|
+
*/
|
|
258
|
+
class Func_void_bool_Wrapper final {
|
|
259
|
+
public:
|
|
260
|
+
explicit Func_void_bool_Wrapper(std::function<void(bool /* result */)>&& func): _function(std::make_unique<std::function<void(bool /* result */)>>(std::move(func))) {}
|
|
261
|
+
inline void call(bool result) const noexcept {
|
|
262
|
+
_function->operator()(result);
|
|
263
|
+
}
|
|
264
|
+
private:
|
|
265
|
+
std::unique_ptr<std::function<void(bool /* result */)>> _function;
|
|
266
|
+
} SWIFT_NONCOPYABLE;
|
|
267
|
+
Func_void_bool create_Func_void_bool(void* NON_NULL swiftClosureWrapper) noexcept;
|
|
268
|
+
inline Func_void_bool_Wrapper wrap_Func_void_bool(Func_void_bool value) noexcept {
|
|
269
|
+
return Func_void_bool_Wrapper(std::move(value));
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
// pragma MARK: std::shared_ptr<Promise<void>>
|
|
273
|
+
/**
|
|
274
|
+
* Specialized version of `std::shared_ptr<Promise<void>>`.
|
|
275
|
+
*/
|
|
276
|
+
using std__shared_ptr_Promise_void__ = std::shared_ptr<Promise<void>>;
|
|
277
|
+
inline std::shared_ptr<Promise<void>> create_std__shared_ptr_Promise_void__() noexcept {
|
|
278
|
+
return Promise<void>::create();
|
|
279
|
+
}
|
|
280
|
+
inline PromiseHolder<void> wrap_std__shared_ptr_Promise_void__(std::shared_ptr<Promise<void>> promise) noexcept {
|
|
281
|
+
return PromiseHolder<void>(std::move(promise));
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
// pragma MARK: std::function<void()>
|
|
285
|
+
/**
|
|
286
|
+
* Specialized version of `std::function<void()>`.
|
|
287
|
+
*/
|
|
288
|
+
using Func_void = std::function<void()>;
|
|
289
|
+
/**
|
|
290
|
+
* Wrapper class for a `std::function<void()>`, this can be used from Swift.
|
|
291
|
+
*/
|
|
292
|
+
class Func_void_Wrapper final {
|
|
293
|
+
public:
|
|
294
|
+
explicit Func_void_Wrapper(std::function<void()>&& func): _function(std::make_unique<std::function<void()>>(std::move(func))) {}
|
|
295
|
+
inline void call() const noexcept {
|
|
296
|
+
_function->operator()();
|
|
297
|
+
}
|
|
298
|
+
private:
|
|
299
|
+
std::unique_ptr<std::function<void()>> _function;
|
|
300
|
+
} SWIFT_NONCOPYABLE;
|
|
301
|
+
Func_void create_Func_void(void* NON_NULL swiftClosureWrapper) noexcept;
|
|
302
|
+
inline Func_void_Wrapper wrap_Func_void(Func_void value) noexcept {
|
|
303
|
+
return Func_void_Wrapper(std::move(value));
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
// pragma MARK: std::function<void(double /* progress */)>
|
|
307
|
+
/**
|
|
308
|
+
* Specialized version of `std::function<void(double)>`.
|
|
309
|
+
*/
|
|
310
|
+
using Func_void_double = std::function<void(double /* progress */)>;
|
|
311
|
+
/**
|
|
312
|
+
* Wrapper class for a `std::function<void(double / * progress * /)>`, this can be used from Swift.
|
|
313
|
+
*/
|
|
314
|
+
class Func_void_double_Wrapper final {
|
|
315
|
+
public:
|
|
316
|
+
explicit Func_void_double_Wrapper(std::function<void(double /* progress */)>&& func): _function(std::make_unique<std::function<void(double /* progress */)>>(std::move(func))) {}
|
|
317
|
+
inline void call(double progress) const noexcept {
|
|
318
|
+
_function->operator()(progress);
|
|
319
|
+
}
|
|
320
|
+
private:
|
|
321
|
+
std::unique_ptr<std::function<void(double /* progress */)>> _function;
|
|
322
|
+
} SWIFT_NONCOPYABLE;
|
|
323
|
+
Func_void_double create_Func_void_double(void* NON_NULL swiftClosureWrapper) noexcept;
|
|
324
|
+
inline Func_void_double_Wrapper wrap_Func_void_double(Func_void_double value) noexcept {
|
|
325
|
+
return Func_void_double_Wrapper(std::move(value));
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
// pragma MARK: std::optional<std::function<void(double /* progress */)>>
|
|
329
|
+
/**
|
|
330
|
+
* Specialized version of `std::optional<std::function<void(double / * progress * /)>>`.
|
|
331
|
+
*/
|
|
332
|
+
using std__optional_std__function_void_double____progress______ = std::optional<std::function<void(double /* progress */)>>;
|
|
333
|
+
inline std::optional<std::function<void(double /* progress */)>> create_std__optional_std__function_void_double____progress______(const std::function<void(double /* progress */)>& value) noexcept {
|
|
334
|
+
return std::optional<std::function<void(double /* progress */)>>(value);
|
|
335
|
+
}
|
|
336
|
+
inline bool has_value_std__optional_std__function_void_double____progress______(const std::optional<std::function<void(double /* progress */)>>& optional) noexcept {
|
|
337
|
+
return optional.has_value();
|
|
338
|
+
}
|
|
339
|
+
inline std::function<void(double /* progress */)> get_std__optional_std__function_void_double____progress______(const std::optional<std::function<void(double /* progress */)>>& optional) noexcept {
|
|
340
|
+
return *optional;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
// pragma MARK: std::shared_ptr<HybridCactusFileSystemSpec>
|
|
344
|
+
/**
|
|
345
|
+
* Specialized version of `std::shared_ptr<HybridCactusFileSystemSpec>`.
|
|
346
|
+
*/
|
|
347
|
+
using std__shared_ptr_HybridCactusFileSystemSpec_ = std::shared_ptr<HybridCactusFileSystemSpec>;
|
|
348
|
+
std::shared_ptr<HybridCactusFileSystemSpec> create_std__shared_ptr_HybridCactusFileSystemSpec_(void* NON_NULL swiftUnsafePointer) noexcept;
|
|
349
|
+
void* NON_NULL get_std__shared_ptr_HybridCactusFileSystemSpec_(std__shared_ptr_HybridCactusFileSystemSpec_ cppType);
|
|
350
|
+
|
|
351
|
+
// pragma MARK: std::weak_ptr<HybridCactusFileSystemSpec>
|
|
352
|
+
using std__weak_ptr_HybridCactusFileSystemSpec_ = std::weak_ptr<HybridCactusFileSystemSpec>;
|
|
353
|
+
inline std__weak_ptr_HybridCactusFileSystemSpec_ weakify_std__shared_ptr_HybridCactusFileSystemSpec_(const std::shared_ptr<HybridCactusFileSystemSpec>& strong) noexcept { return strong; }
|
|
354
|
+
|
|
355
|
+
// pragma MARK: Result<std::shared_ptr<Promise<bool>>>
|
|
356
|
+
using Result_std__shared_ptr_Promise_bool___ = Result<std::shared_ptr<Promise<bool>>>;
|
|
357
|
+
inline Result_std__shared_ptr_Promise_bool___ create_Result_std__shared_ptr_Promise_bool___(const std::shared_ptr<Promise<bool>>& value) noexcept {
|
|
358
|
+
return Result<std::shared_ptr<Promise<bool>>>::withValue(value);
|
|
359
|
+
}
|
|
360
|
+
inline Result_std__shared_ptr_Promise_bool___ create_Result_std__shared_ptr_Promise_bool___(const std::exception_ptr& error) noexcept {
|
|
361
|
+
return Result<std::shared_ptr<Promise<bool>>>::withError(error);
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
// pragma MARK: Result<std::shared_ptr<Promise<void>>>
|
|
365
|
+
using Result_std__shared_ptr_Promise_void___ = Result<std::shared_ptr<Promise<void>>>;
|
|
366
|
+
inline Result_std__shared_ptr_Promise_void___ create_Result_std__shared_ptr_Promise_void___(const std::shared_ptr<Promise<void>>& value) noexcept {
|
|
367
|
+
return Result<std::shared_ptr<Promise<void>>>::withValue(value);
|
|
368
|
+
}
|
|
369
|
+
inline Result_std__shared_ptr_Promise_void___ create_Result_std__shared_ptr_Promise_void___(const std::exception_ptr& error) noexcept {
|
|
370
|
+
return Result<std::shared_ptr<Promise<void>>>::withError(error);
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
} // namespace margelo::nitro::cactus::bridge::swift
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// Cactus-Swift-Cxx-Umbrella.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
// Forward declarations of C++ defined types
|
|
11
|
+
// Forward declaration of `DeviceInfo` to properly resolve imports.
|
|
12
|
+
namespace margelo::nitro::cactus { struct DeviceInfo; }
|
|
13
|
+
// Forward declaration of `HybridCactusCryptoSpec` to properly resolve imports.
|
|
14
|
+
namespace margelo::nitro::cactus { class HybridCactusCryptoSpec; }
|
|
15
|
+
// Forward declaration of `HybridCactusDeviceInfoSpec` to properly resolve imports.
|
|
16
|
+
namespace margelo::nitro::cactus { class HybridCactusDeviceInfoSpec; }
|
|
17
|
+
// Forward declaration of `HybridCactusFileSystemSpec` to properly resolve imports.
|
|
18
|
+
namespace margelo::nitro::cactus { class HybridCactusFileSystemSpec; }
|
|
19
|
+
|
|
20
|
+
// Include C++ defined types
|
|
21
|
+
#include "DeviceInfo.hpp"
|
|
22
|
+
#include "HybridCactusCryptoSpec.hpp"
|
|
23
|
+
#include "HybridCactusDeviceInfoSpec.hpp"
|
|
24
|
+
#include "HybridCactusFileSystemSpec.hpp"
|
|
25
|
+
#include <NitroModules/Promise.hpp>
|
|
26
|
+
#include <NitroModules/Result.hpp>
|
|
27
|
+
#include <exception>
|
|
28
|
+
#include <functional>
|
|
29
|
+
#include <memory>
|
|
30
|
+
#include <optional>
|
|
31
|
+
#include <string>
|
|
32
|
+
|
|
33
|
+
// C++ helpers for Swift
|
|
34
|
+
#include "Cactus-Swift-Cxx-Bridge.hpp"
|
|
35
|
+
|
|
36
|
+
// Common C++ types used in Swift
|
|
37
|
+
#include <NitroModules/ArrayBufferHolder.hpp>
|
|
38
|
+
#include <NitroModules/AnyMapUtils.hpp>
|
|
39
|
+
#include <NitroModules/RuntimeError.hpp>
|
|
40
|
+
#include <NitroModules/DateToChronoDate.hpp>
|
|
41
|
+
|
|
42
|
+
// Forward declarations of Swift defined types
|
|
43
|
+
// Forward declaration of `HybridCactusCryptoSpec_cxx` to properly resolve imports.
|
|
44
|
+
namespace Cactus { class HybridCactusCryptoSpec_cxx; }
|
|
45
|
+
// Forward declaration of `HybridCactusDeviceInfoSpec_cxx` to properly resolve imports.
|
|
46
|
+
namespace Cactus { class HybridCactusDeviceInfoSpec_cxx; }
|
|
47
|
+
// Forward declaration of `HybridCactusFileSystemSpec_cxx` to properly resolve imports.
|
|
48
|
+
namespace Cactus { class HybridCactusFileSystemSpec_cxx; }
|
|
49
|
+
|
|
50
|
+
// Include Swift defined types
|
|
51
|
+
#if __has_include("Cactus-Swift.h")
|
|
52
|
+
// This header is generated by Xcode/Swift on every app build.
|
|
53
|
+
// If it cannot be found, make sure the Swift module's name (= podspec name) is actually "Cactus".
|
|
54
|
+
#include "Cactus-Swift.h"
|
|
55
|
+
// Same as above, but used when building with frameworks (`use_frameworks`)
|
|
56
|
+
#elif __has_include(<Cactus/Cactus-Swift.h>)
|
|
57
|
+
#include <Cactus/Cactus-Swift.h>
|
|
58
|
+
#else
|
|
59
|
+
#error Cactus's autogenerated Swift header cannot be found! Make sure the Swift module's name (= podspec name) is actually "Cactus", and try building the app first.
|
|
60
|
+
#endif
|