react-native-compressor 1.18.2 → 2.0.0
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/android/CMakeLists.txt +27 -0
- package/android/build.gradle +56 -58
- package/android/gradle.properties +5 -5
- package/android/src/main/AndroidManifestNew.xml +3 -0
- package/android/src/main/cpp/cpp-adapter.cpp +8 -0
- package/android/src/main/java/com/margelo/nitro/compressor/HybridCompressor.kt +213 -0
- package/android/src/main/java/com/reactnativecompressor/Image/ImageCompressor.kt +41 -21
- package/android/src/main/java/com/reactnativecompressor/NitroCompressorPackage.kt +30 -0
- package/android/src/main/java/com/reactnativecompressor/NitroPromiseAdapter.kt +55 -0
- package/android/src/main/java/com/reactnativecompressor/Utils/EventEmitterHandler.kt +49 -45
- package/android/src/main/java/com/reactnativecompressor/Utils/Utils.kt +1 -1
- package/android/src/main/java/com/reactnativecompressor/Video/AutoVideoCompression.kt +1 -1
- package/android/src/main/java/com/reactnativecompressor/Video/VideoCompressionProfile.kt +21 -11
- package/android/src/main/java/com/reactnativecompressor/Video/VideoCompressor/compressor/Compressor.kt +311 -76
- package/android/src/main/java/com/reactnativecompressor/Video/VideoCompressor/utils/CompressorUtils.kt +96 -5
- package/android/src/main/java/com/reactnativecompressor/Video/VideoCompressor/utils/LocationExtractor.kt +397 -0
- package/android/src/main/java/com/reactnativecompressor/Video/VideoCompressor/videoHelpers/LocationBox.kt +47 -0
- package/android/src/main/java/com/reactnativecompressor/Video/VideoCompressor/videoHelpers/MP4Builder.kt +39 -7
- package/android/src/main/java/com/reactnativecompressor/Video/VideoCompressor/videoHelpers/Mp4Movie.kt +7 -0
- package/android/src/main/java/com/reactnativecompressor/Video/VideoCompressor/videoHelpers/OutputSurface.kt +30 -4
- package/android/src/main/java/com/reactnativecompressor/Video/VideoCompressorHelper.kt +28 -2
- package/ios/Audio/FormatConverter/FormatConverter+Compressed.swift +1 -1
- package/ios/Audio/FormatConverter/FormatConverter+Utilities.swift +1 -1
- package/ios/Audio/FormatConverter/FormatConverter.swift +5 -3
- package/ios/HybridCompressor.swift +247 -0
- package/ios/Image/ImageCompressor.swift +8 -2
- package/ios/Utils/EventEmitterHandler.swift +56 -34
- package/ios/Video/NextLevelSessionExporter.swift +43 -8
- package/ios/Video/VideoMain.swift +44 -14
- package/lib/commonjs/Audio/index.js +1 -1
- package/lib/commonjs/Audio/index.js.map +1 -1
- package/lib/commonjs/Image/index.js +2 -22
- package/lib/commonjs/Image/index.js.map +1 -1
- package/lib/commonjs/Main.js +8 -8
- package/lib/commonjs/Main.js.map +1 -1
- package/lib/commonjs/Video/index.js +25 -65
- package/lib/commonjs/Video/index.js.map +1 -1
- package/lib/commonjs/specs/Compressor.nitro.js +6 -0
- package/lib/commonjs/specs/Compressor.nitro.js.map +1 -0
- package/lib/commonjs/utils/Downloader.js +8 -24
- package/lib/commonjs/utils/Downloader.js.map +1 -1
- package/lib/commonjs/utils/Uploader.js +3 -18
- package/lib/commonjs/utils/Uploader.js.map +1 -1
- package/lib/commonjs/utils/helpers.js +18 -1
- package/lib/commonjs/utils/helpers.js.map +1 -1
- package/lib/commonjs/utils/index.js +13 -13
- package/lib/commonjs/utils/index.js.map +1 -1
- package/lib/module/Audio/index.js +2 -2
- package/lib/module/Audio/index.js.map +1 -1
- package/lib/module/Image/index.js +3 -23
- package/lib/module/Image/index.js.map +1 -1
- package/lib/module/Main.js +9 -9
- package/lib/module/Main.js.map +1 -1
- package/lib/module/Video/index.js +26 -66
- package/lib/module/Video/index.js.map +1 -1
- package/lib/module/specs/Compressor.nitro.js +4 -0
- package/lib/module/specs/Compressor.nitro.js.map +1 -0
- package/lib/module/utils/Downloader.js +10 -26
- package/lib/module/utils/Downloader.js.map +1 -1
- package/lib/module/utils/Uploader.js +5 -20
- package/lib/module/utils/Uploader.js.map +1 -1
- package/lib/module/utils/helpers.js +16 -0
- package/lib/module/utils/helpers.js.map +1 -1
- package/lib/module/utils/index.js +2 -1
- package/lib/module/utils/index.js.map +1 -1
- package/lib/typescript/src/Image/index.d.ts.map +1 -1
- package/lib/typescript/src/Main.d.ts +2 -1
- package/lib/typescript/src/Main.d.ts.map +1 -1
- package/lib/typescript/src/Video/index.d.ts +1 -1
- package/lib/typescript/src/Video/index.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/specs/Compressor.nitro.d.ts +44 -0
- package/lib/typescript/src/specs/Compressor.nitro.d.ts.map +1 -0
- package/lib/typescript/src/utils/Downloader.d.ts.map +1 -1
- package/lib/typescript/src/utils/Uploader.d.ts.map +1 -1
- package/lib/typescript/src/utils/helpers.d.ts +7 -0
- package/lib/typescript/src/utils/helpers.d.ts.map +1 -1
- package/lib/typescript/src/utils/index.d.ts.map +1 -1
- package/nitrogen/generated/android/NitroCompressor+autolinking.cmake +81 -0
- package/nitrogen/generated/android/NitroCompressor+autolinking.gradle +27 -0
- package/nitrogen/generated/android/NitroCompressorOnLoad.cpp +60 -0
- package/nitrogen/generated/android/NitroCompressorOnLoad.hpp +34 -0
- package/nitrogen/generated/android/c++/JFunc_void.hpp +75 -0
- package/nitrogen/generated/android/c++/JFunc_void_double.hpp +75 -0
- package/nitrogen/generated/android/c++/JFunc_void_double_double.hpp +75 -0
- package/nitrogen/generated/android/c++/JHybridCompressorSpec.cpp +293 -0
- package/nitrogen/generated/android/c++/JHybridCompressorSpec.hpp +78 -0
- package/nitrogen/generated/android/c++/JVideoThumbnailResult.hpp +73 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/compressor/Func_void.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/compressor/Func_void_double.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/compressor/Func_void_double_double.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/compressor/HybridCompressorSpec.kt +141 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/compressor/NitroCompressorOnLoad.kt +35 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/compressor/VideoThumbnailResult.kt +71 -0
- package/nitrogen/generated/ios/c++/HybridCompressorSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridCompressorSpecSwift.hpp +204 -0
- package/nitrogen/generated/ios/react_native_compressor+autolinking.rb +62 -0
- package/nitrogen/generated/ios/react_native_compressor-Swift-Cxx-Bridge.cpp +89 -0
- package/nitrogen/generated/ios/react_native_compressor-Swift-Cxx-Bridge.hpp +337 -0
- package/nitrogen/generated/ios/react_native_compressor-Swift-Cxx-Umbrella.hpp +51 -0
- package/nitrogen/generated/ios/react_native_compressorAutolinking.mm +33 -0
- package/nitrogen/generated/ios/react_native_compressorAutolinking.swift +26 -0
- package/nitrogen/generated/ios/swift/Func_void.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_VideoThumbnailResult.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_double.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_double_double.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__shared_ptr_AnyMap_.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__string.swift +46 -0
- package/nitrogen/generated/ios/swift/HybridCompressorSpec.swift +70 -0
- package/nitrogen/generated/ios/swift/HybridCompressorSpec_cxx.swift +493 -0
- package/nitrogen/generated/ios/swift/VideoThumbnailResult.swift +49 -0
- package/nitrogen/generated/shared/c++/HybridCompressorSpec.cpp +36 -0
- package/nitrogen/generated/shared/c++/HybridCompressorSpec.hpp +83 -0
- package/nitrogen/generated/shared/c++/VideoThumbnailResult.hpp +99 -0
- package/package.json +8 -12
- package/react-native-compressor.podspec +6 -24
- package/src/Audio/index.tsx +2 -2
- package/src/Image/index.tsx +3 -26
- package/src/Main.tsx +14 -16
- package/src/Video/index.tsx +25 -77
- package/src/specs/Compressor.nitro.ts +56 -0
- package/src/utils/Downloader.tsx +8 -27
- package/src/utils/Uploader.tsx +12 -24
- package/src/utils/helpers.ts +18 -0
- package/src/utils/index.tsx +3 -2
- package/android/src/main/java/com/reactnativecompressor/CompressorModule.kt +0 -180
- package/android/src/main/java/com/reactnativecompressor/CompressorPackage.kt +0 -34
- package/android/src/newarch/CompressorSpec.kt +0 -5
- package/android/src/oldarch/CompressorSpec.kt +0 -36
- package/ios/Compressor-Bridging-Header.h +0 -6
- package/ios/Compressor.h +0 -5
- package/ios/Compressor.mm +0 -82
- package/ios/CompressorManager.swift +0 -117
- package/lib/commonjs/Spec/NativeCompressor.js +0 -9
- package/lib/commonjs/Spec/NativeCompressor.js.map +0 -1
- package/lib/module/Spec/NativeCompressor.js +0 -5
- package/lib/module/Spec/NativeCompressor.js.map +0 -1
- package/lib/typescript/src/Spec/NativeCompressor.d.ts +0 -30
- package/lib/typescript/src/Spec/NativeCompressor.d.ts.map +0 -1
- package/src/Spec/NativeCompressor.ts +0 -41
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// react_native_compressor-Swift-Cxx-Bridge.cpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#include "react_native_compressor-Swift-Cxx-Bridge.hpp"
|
|
9
|
+
|
|
10
|
+
// Include C++ implementation defined types
|
|
11
|
+
#include "HybridCompressorSpecSwift.hpp"
|
|
12
|
+
#include "react_native_compressor-Swift-Cxx-Umbrella.hpp"
|
|
13
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
14
|
+
|
|
15
|
+
namespace margelo::nitro::compressor::bridge::swift {
|
|
16
|
+
|
|
17
|
+
// pragma MARK: std::function<void(const std::string& /* result */)>
|
|
18
|
+
Func_void_std__string create_Func_void_std__string(void* NON_NULL swiftClosureWrapper) noexcept {
|
|
19
|
+
auto swiftClosure = react_native_compressor::Func_void_std__string::fromUnsafe(swiftClosureWrapper);
|
|
20
|
+
return [swiftClosure = std::move(swiftClosure)](const std::string& result) mutable -> void {
|
|
21
|
+
swiftClosure.call(result);
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// pragma MARK: std::function<void(const std::exception_ptr& /* error */)>
|
|
26
|
+
Func_void_std__exception_ptr create_Func_void_std__exception_ptr(void* NON_NULL swiftClosureWrapper) noexcept {
|
|
27
|
+
auto swiftClosure = react_native_compressor::Func_void_std__exception_ptr::fromUnsafe(swiftClosureWrapper);
|
|
28
|
+
return [swiftClosure = std::move(swiftClosure)](const std::exception_ptr& error) mutable -> void {
|
|
29
|
+
swiftClosure.call(error);
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// pragma MARK: std::function<void(double /* progress */)>
|
|
34
|
+
Func_void_double create_Func_void_double(void* NON_NULL swiftClosureWrapper) noexcept {
|
|
35
|
+
auto swiftClosure = react_native_compressor::Func_void_double::fromUnsafe(swiftClosureWrapper);
|
|
36
|
+
return [swiftClosure = std::move(swiftClosure)](double progress) mutable -> void {
|
|
37
|
+
swiftClosure.call(progress);
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// pragma MARK: std::function<void(const std::shared_ptr<AnyMap>& /* result */)>
|
|
42
|
+
Func_void_std__shared_ptr_AnyMap_ create_Func_void_std__shared_ptr_AnyMap_(void* NON_NULL swiftClosureWrapper) noexcept {
|
|
43
|
+
auto swiftClosure = react_native_compressor::Func_void_std__shared_ptr_AnyMap_::fromUnsafe(swiftClosureWrapper);
|
|
44
|
+
return [swiftClosure = std::move(swiftClosure)](const std::shared_ptr<AnyMap>& result) mutable -> void {
|
|
45
|
+
swiftClosure.call(result);
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// pragma MARK: std::function<void()>
|
|
50
|
+
Func_void create_Func_void(void* NON_NULL swiftClosureWrapper) noexcept {
|
|
51
|
+
auto swiftClosure = react_native_compressor::Func_void::fromUnsafe(swiftClosureWrapper);
|
|
52
|
+
return [swiftClosure = std::move(swiftClosure)]() mutable -> void {
|
|
53
|
+
swiftClosure.call();
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// pragma MARK: std::function<void(double /* written */, double /* total */)>
|
|
58
|
+
Func_void_double_double create_Func_void_double_double(void* NON_NULL swiftClosureWrapper) noexcept {
|
|
59
|
+
auto swiftClosure = react_native_compressor::Func_void_double_double::fromUnsafe(swiftClosureWrapper);
|
|
60
|
+
return [swiftClosure = std::move(swiftClosure)](double written, double total) mutable -> void {
|
|
61
|
+
swiftClosure.call(written, total);
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// pragma MARK: std::function<void(const VideoThumbnailResult& /* result */)>
|
|
66
|
+
Func_void_VideoThumbnailResult create_Func_void_VideoThumbnailResult(void* NON_NULL swiftClosureWrapper) noexcept {
|
|
67
|
+
auto swiftClosure = react_native_compressor::Func_void_VideoThumbnailResult::fromUnsafe(swiftClosureWrapper);
|
|
68
|
+
return [swiftClosure = std::move(swiftClosure)](const VideoThumbnailResult& result) mutable -> void {
|
|
69
|
+
swiftClosure.call(result);
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// pragma MARK: std::shared_ptr<HybridCompressorSpec>
|
|
74
|
+
std::shared_ptr<HybridCompressorSpec> create_std__shared_ptr_HybridCompressorSpec_(void* NON_NULL swiftUnsafePointer) noexcept {
|
|
75
|
+
react_native_compressor::HybridCompressorSpec_cxx swiftPart = react_native_compressor::HybridCompressorSpec_cxx::fromUnsafe(swiftUnsafePointer);
|
|
76
|
+
return std::make_shared<margelo::nitro::compressor::HybridCompressorSpecSwift>(swiftPart);
|
|
77
|
+
}
|
|
78
|
+
void* NON_NULL get_std__shared_ptr_HybridCompressorSpec_(std__shared_ptr_HybridCompressorSpec_ cppType) {
|
|
79
|
+
std::shared_ptr<margelo::nitro::compressor::HybridCompressorSpecSwift> swiftWrapper = std::dynamic_pointer_cast<margelo::nitro::compressor::HybridCompressorSpecSwift>(cppType);
|
|
80
|
+
#ifdef NITRO_DEBUG
|
|
81
|
+
if (swiftWrapper == nullptr) [[unlikely]] {
|
|
82
|
+
throw std::runtime_error("Class \"HybridCompressorSpec\" is not implemented in Swift!");
|
|
83
|
+
}
|
|
84
|
+
#endif
|
|
85
|
+
react_native_compressor::HybridCompressorSpec_cxx& swiftPart = swiftWrapper->getSwiftPart();
|
|
86
|
+
return swiftPart.toUnsafe();
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
} // namespace margelo::nitro::compressor::bridge::swift
|
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// react_native_compressor-Swift-Cxx-Bridge.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
// Forward declarations of C++ defined types
|
|
11
|
+
// Forward declaration of `HybridCompressorSpec` to properly resolve imports.
|
|
12
|
+
namespace margelo::nitro::compressor { class HybridCompressorSpec; }
|
|
13
|
+
// Forward declaration of `VideoThumbnailResult` to properly resolve imports.
|
|
14
|
+
namespace margelo::nitro::compressor { struct VideoThumbnailResult; }
|
|
15
|
+
|
|
16
|
+
// Forward declarations of Swift defined types
|
|
17
|
+
// Forward declaration of `HybridCompressorSpec_cxx` to properly resolve imports.
|
|
18
|
+
namespace react_native_compressor { class HybridCompressorSpec_cxx; }
|
|
19
|
+
|
|
20
|
+
// Include C++ defined types
|
|
21
|
+
#include "HybridCompressorSpec.hpp"
|
|
22
|
+
#include "VideoThumbnailResult.hpp"
|
|
23
|
+
#include <NitroModules/AnyMap.hpp>
|
|
24
|
+
#include <NitroModules/Promise.hpp>
|
|
25
|
+
#include <NitroModules/PromiseHolder.hpp>
|
|
26
|
+
#include <NitroModules/Result.hpp>
|
|
27
|
+
#include <exception>
|
|
28
|
+
#include <functional>
|
|
29
|
+
#include <memory>
|
|
30
|
+
#include <optional>
|
|
31
|
+
#include <string>
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Contains specialized versions of C++ templated types so they can be accessed from Swift,
|
|
35
|
+
* as well as helper functions to interact with those C++ types from Swift.
|
|
36
|
+
*/
|
|
37
|
+
namespace margelo::nitro::compressor::bridge::swift {
|
|
38
|
+
|
|
39
|
+
// pragma MARK: std::shared_ptr<Promise<std::string>>
|
|
40
|
+
/**
|
|
41
|
+
* Specialized version of `std::shared_ptr<Promise<std::string>>`.
|
|
42
|
+
*/
|
|
43
|
+
using std__shared_ptr_Promise_std__string__ = std::shared_ptr<Promise<std::string>>;
|
|
44
|
+
inline std::shared_ptr<Promise<std::string>> create_std__shared_ptr_Promise_std__string__() noexcept {
|
|
45
|
+
return Promise<std::string>::create();
|
|
46
|
+
}
|
|
47
|
+
inline PromiseHolder<std::string> wrap_std__shared_ptr_Promise_std__string__(std::shared_ptr<Promise<std::string>> promise) noexcept {
|
|
48
|
+
return PromiseHolder<std::string>(std::move(promise));
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// pragma MARK: std::function<void(const std::string& /* result */)>
|
|
52
|
+
/**
|
|
53
|
+
* Specialized version of `std::function<void(const std::string&)>`.
|
|
54
|
+
*/
|
|
55
|
+
using Func_void_std__string = std::function<void(const std::string& /* result */)>;
|
|
56
|
+
/**
|
|
57
|
+
* Wrapper class for a `std::function<void(const std::string& / * result * /)>`, this can be used from Swift.
|
|
58
|
+
*/
|
|
59
|
+
class Func_void_std__string_Wrapper final {
|
|
60
|
+
public:
|
|
61
|
+
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))) {}
|
|
62
|
+
inline void call(std::string result) const noexcept {
|
|
63
|
+
_function->operator()(result);
|
|
64
|
+
}
|
|
65
|
+
private:
|
|
66
|
+
std::unique_ptr<std::function<void(const std::string& /* result */)>> _function;
|
|
67
|
+
} SWIFT_NONCOPYABLE;
|
|
68
|
+
Func_void_std__string create_Func_void_std__string(void* NON_NULL swiftClosureWrapper) noexcept;
|
|
69
|
+
inline Func_void_std__string_Wrapper wrap_Func_void_std__string(Func_void_std__string value) noexcept {
|
|
70
|
+
return Func_void_std__string_Wrapper(std::move(value));
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// pragma MARK: std::function<void(const std::exception_ptr& /* error */)>
|
|
74
|
+
/**
|
|
75
|
+
* Specialized version of `std::function<void(const std::exception_ptr&)>`.
|
|
76
|
+
*/
|
|
77
|
+
using Func_void_std__exception_ptr = std::function<void(const std::exception_ptr& /* error */)>;
|
|
78
|
+
/**
|
|
79
|
+
* Wrapper class for a `std::function<void(const std::exception_ptr& / * error * /)>`, this can be used from Swift.
|
|
80
|
+
*/
|
|
81
|
+
class Func_void_std__exception_ptr_Wrapper final {
|
|
82
|
+
public:
|
|
83
|
+
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))) {}
|
|
84
|
+
inline void call(std::exception_ptr error) const noexcept {
|
|
85
|
+
_function->operator()(error);
|
|
86
|
+
}
|
|
87
|
+
private:
|
|
88
|
+
std::unique_ptr<std::function<void(const std::exception_ptr& /* error */)>> _function;
|
|
89
|
+
} SWIFT_NONCOPYABLE;
|
|
90
|
+
Func_void_std__exception_ptr create_Func_void_std__exception_ptr(void* NON_NULL swiftClosureWrapper) noexcept;
|
|
91
|
+
inline Func_void_std__exception_ptr_Wrapper wrap_Func_void_std__exception_ptr(Func_void_std__exception_ptr value) noexcept {
|
|
92
|
+
return Func_void_std__exception_ptr_Wrapper(std::move(value));
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// pragma MARK: std::function<void(double /* progress */)>
|
|
96
|
+
/**
|
|
97
|
+
* Specialized version of `std::function<void(double)>`.
|
|
98
|
+
*/
|
|
99
|
+
using Func_void_double = std::function<void(double /* progress */)>;
|
|
100
|
+
/**
|
|
101
|
+
* Wrapper class for a `std::function<void(double / * progress * /)>`, this can be used from Swift.
|
|
102
|
+
*/
|
|
103
|
+
class Func_void_double_Wrapper final {
|
|
104
|
+
public:
|
|
105
|
+
explicit Func_void_double_Wrapper(std::function<void(double /* progress */)>&& func): _function(std::make_unique<std::function<void(double /* progress */)>>(std::move(func))) {}
|
|
106
|
+
inline void call(double progress) const noexcept {
|
|
107
|
+
_function->operator()(progress);
|
|
108
|
+
}
|
|
109
|
+
private:
|
|
110
|
+
std::unique_ptr<std::function<void(double /* progress */)>> _function;
|
|
111
|
+
} SWIFT_NONCOPYABLE;
|
|
112
|
+
Func_void_double create_Func_void_double(void* NON_NULL swiftClosureWrapper) noexcept;
|
|
113
|
+
inline Func_void_double_Wrapper wrap_Func_void_double(Func_void_double value) noexcept {
|
|
114
|
+
return Func_void_double_Wrapper(std::move(value));
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// pragma MARK: std::optional<std::function<void(double /* progress */)>>
|
|
118
|
+
/**
|
|
119
|
+
* Specialized version of `std::optional<std::function<void(double / * progress * /)>>`.
|
|
120
|
+
*/
|
|
121
|
+
using std__optional_std__function_void_double____progress______ = std::optional<std::function<void(double /* progress */)>>;
|
|
122
|
+
inline std::optional<std::function<void(double /* progress */)>> create_std__optional_std__function_void_double____progress______(const std::function<void(double /* progress */)>& value) noexcept {
|
|
123
|
+
return std::optional<std::function<void(double /* progress */)>>(value);
|
|
124
|
+
}
|
|
125
|
+
inline bool has_value_std__optional_std__function_void_double____progress______(const std::optional<std::function<void(double /* progress */)>>& optional) noexcept {
|
|
126
|
+
return optional.has_value();
|
|
127
|
+
}
|
|
128
|
+
inline std::function<void(double /* progress */)> get_std__optional_std__function_void_double____progress______(const std::optional<std::function<void(double /* progress */)>>& optional) noexcept {
|
|
129
|
+
return optional.value();
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// pragma MARK: std::shared_ptr<Promise<std::shared_ptr<AnyMap>>>
|
|
133
|
+
/**
|
|
134
|
+
* Specialized version of `std::shared_ptr<Promise<std::shared_ptr<AnyMap>>>`.
|
|
135
|
+
*/
|
|
136
|
+
using std__shared_ptr_Promise_std__shared_ptr_AnyMap___ = std::shared_ptr<Promise<std::shared_ptr<AnyMap>>>;
|
|
137
|
+
inline std::shared_ptr<Promise<std::shared_ptr<AnyMap>>> create_std__shared_ptr_Promise_std__shared_ptr_AnyMap___() noexcept {
|
|
138
|
+
return Promise<std::shared_ptr<AnyMap>>::create();
|
|
139
|
+
}
|
|
140
|
+
inline PromiseHolder<std::shared_ptr<AnyMap>> wrap_std__shared_ptr_Promise_std__shared_ptr_AnyMap___(std::shared_ptr<Promise<std::shared_ptr<AnyMap>>> promise) noexcept {
|
|
141
|
+
return PromiseHolder<std::shared_ptr<AnyMap>>(std::move(promise));
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// pragma MARK: std::function<void(const std::shared_ptr<AnyMap>& /* result */)>
|
|
145
|
+
/**
|
|
146
|
+
* Specialized version of `std::function<void(const std::shared_ptr<AnyMap>&)>`.
|
|
147
|
+
*/
|
|
148
|
+
using Func_void_std__shared_ptr_AnyMap_ = std::function<void(const std::shared_ptr<AnyMap>& /* result */)>;
|
|
149
|
+
/**
|
|
150
|
+
* Wrapper class for a `std::function<void(const std::shared_ptr<AnyMap>& / * result * /)>`, this can be used from Swift.
|
|
151
|
+
*/
|
|
152
|
+
class Func_void_std__shared_ptr_AnyMap__Wrapper final {
|
|
153
|
+
public:
|
|
154
|
+
explicit Func_void_std__shared_ptr_AnyMap__Wrapper(std::function<void(const std::shared_ptr<AnyMap>& /* result */)>&& func): _function(std::make_unique<std::function<void(const std::shared_ptr<AnyMap>& /* result */)>>(std::move(func))) {}
|
|
155
|
+
inline void call(std::shared_ptr<AnyMap> result) const noexcept {
|
|
156
|
+
_function->operator()(result);
|
|
157
|
+
}
|
|
158
|
+
private:
|
|
159
|
+
std::unique_ptr<std::function<void(const std::shared_ptr<AnyMap>& /* result */)>> _function;
|
|
160
|
+
} SWIFT_NONCOPYABLE;
|
|
161
|
+
Func_void_std__shared_ptr_AnyMap_ create_Func_void_std__shared_ptr_AnyMap_(void* NON_NULL swiftClosureWrapper) noexcept;
|
|
162
|
+
inline Func_void_std__shared_ptr_AnyMap__Wrapper wrap_Func_void_std__shared_ptr_AnyMap_(Func_void_std__shared_ptr_AnyMap_ value) noexcept {
|
|
163
|
+
return Func_void_std__shared_ptr_AnyMap__Wrapper(std::move(value));
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
// pragma MARK: std::function<void()>
|
|
167
|
+
/**
|
|
168
|
+
* Specialized version of `std::function<void()>`.
|
|
169
|
+
*/
|
|
170
|
+
using Func_void = std::function<void()>;
|
|
171
|
+
/**
|
|
172
|
+
* Wrapper class for a `std::function<void()>`, this can be used from Swift.
|
|
173
|
+
*/
|
|
174
|
+
class Func_void_Wrapper final {
|
|
175
|
+
public:
|
|
176
|
+
explicit Func_void_Wrapper(std::function<void()>&& func): _function(std::make_unique<std::function<void()>>(std::move(func))) {}
|
|
177
|
+
inline void call() const noexcept {
|
|
178
|
+
_function->operator()();
|
|
179
|
+
}
|
|
180
|
+
private:
|
|
181
|
+
std::unique_ptr<std::function<void()>> _function;
|
|
182
|
+
} SWIFT_NONCOPYABLE;
|
|
183
|
+
Func_void create_Func_void(void* NON_NULL swiftClosureWrapper) noexcept;
|
|
184
|
+
inline Func_void_Wrapper wrap_Func_void(Func_void value) noexcept {
|
|
185
|
+
return Func_void_Wrapper(std::move(value));
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
// pragma MARK: std::optional<std::function<void()>>
|
|
189
|
+
/**
|
|
190
|
+
* Specialized version of `std::optional<std::function<void()>>`.
|
|
191
|
+
*/
|
|
192
|
+
using std__optional_std__function_void____ = std::optional<std::function<void()>>;
|
|
193
|
+
inline std::optional<std::function<void()>> create_std__optional_std__function_void____(const std::function<void()>& value) noexcept {
|
|
194
|
+
return std::optional<std::function<void()>>(value);
|
|
195
|
+
}
|
|
196
|
+
inline bool has_value_std__optional_std__function_void____(const std::optional<std::function<void()>>& optional) noexcept {
|
|
197
|
+
return optional.has_value();
|
|
198
|
+
}
|
|
199
|
+
inline std::function<void()> get_std__optional_std__function_void____(const std::optional<std::function<void()>>& optional) noexcept {
|
|
200
|
+
return optional.value();
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// pragma MARK: std::function<void(double /* written */, double /* total */)>
|
|
204
|
+
/**
|
|
205
|
+
* Specialized version of `std::function<void(double, double)>`.
|
|
206
|
+
*/
|
|
207
|
+
using Func_void_double_double = std::function<void(double /* written */, double /* total */)>;
|
|
208
|
+
/**
|
|
209
|
+
* Wrapper class for a `std::function<void(double / * written * /, double / * total * /)>`, this can be used from Swift.
|
|
210
|
+
*/
|
|
211
|
+
class Func_void_double_double_Wrapper final {
|
|
212
|
+
public:
|
|
213
|
+
explicit Func_void_double_double_Wrapper(std::function<void(double /* written */, double /* total */)>&& func): _function(std::make_unique<std::function<void(double /* written */, double /* total */)>>(std::move(func))) {}
|
|
214
|
+
inline void call(double written, double total) const noexcept {
|
|
215
|
+
_function->operator()(written, total);
|
|
216
|
+
}
|
|
217
|
+
private:
|
|
218
|
+
std::unique_ptr<std::function<void(double /* written */, double /* total */)>> _function;
|
|
219
|
+
} SWIFT_NONCOPYABLE;
|
|
220
|
+
Func_void_double_double create_Func_void_double_double(void* NON_NULL swiftClosureWrapper) noexcept;
|
|
221
|
+
inline Func_void_double_double_Wrapper wrap_Func_void_double_double(Func_void_double_double value) noexcept {
|
|
222
|
+
return Func_void_double_double_Wrapper(std::move(value));
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
// pragma MARK: std::optional<std::function<void(double /* written */, double /* total */)>>
|
|
226
|
+
/**
|
|
227
|
+
* Specialized version of `std::optional<std::function<void(double / * written * /, double / * total * /)>>`.
|
|
228
|
+
*/
|
|
229
|
+
using std__optional_std__function_void_double____written_____double____total______ = std::optional<std::function<void(double /* written */, double /* total */)>>;
|
|
230
|
+
inline std::optional<std::function<void(double /* written */, double /* total */)>> create_std__optional_std__function_void_double____written_____double____total______(const std::function<void(double /* written */, double /* total */)>& value) noexcept {
|
|
231
|
+
return std::optional<std::function<void(double /* written */, double /* total */)>>(value);
|
|
232
|
+
}
|
|
233
|
+
inline bool has_value_std__optional_std__function_void_double____written_____double____total______(const std::optional<std::function<void(double /* written */, double /* total */)>>& optional) noexcept {
|
|
234
|
+
return optional.has_value();
|
|
235
|
+
}
|
|
236
|
+
inline std::function<void(double /* written */, double /* total */)> get_std__optional_std__function_void_double____written_____double____total______(const std::optional<std::function<void(double /* written */, double /* total */)>>& optional) noexcept {
|
|
237
|
+
return optional.value();
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
// pragma MARK: std::shared_ptr<Promise<VideoThumbnailResult>>
|
|
241
|
+
/**
|
|
242
|
+
* Specialized version of `std::shared_ptr<Promise<VideoThumbnailResult>>`.
|
|
243
|
+
*/
|
|
244
|
+
using std__shared_ptr_Promise_VideoThumbnailResult__ = std::shared_ptr<Promise<VideoThumbnailResult>>;
|
|
245
|
+
inline std::shared_ptr<Promise<VideoThumbnailResult>> create_std__shared_ptr_Promise_VideoThumbnailResult__() noexcept {
|
|
246
|
+
return Promise<VideoThumbnailResult>::create();
|
|
247
|
+
}
|
|
248
|
+
inline PromiseHolder<VideoThumbnailResult> wrap_std__shared_ptr_Promise_VideoThumbnailResult__(std::shared_ptr<Promise<VideoThumbnailResult>> promise) noexcept {
|
|
249
|
+
return PromiseHolder<VideoThumbnailResult>(std::move(promise));
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
// pragma MARK: std::function<void(const VideoThumbnailResult& /* result */)>
|
|
253
|
+
/**
|
|
254
|
+
* Specialized version of `std::function<void(const VideoThumbnailResult&)>`.
|
|
255
|
+
*/
|
|
256
|
+
using Func_void_VideoThumbnailResult = std::function<void(const VideoThumbnailResult& /* result */)>;
|
|
257
|
+
/**
|
|
258
|
+
* Wrapper class for a `std::function<void(const VideoThumbnailResult& / * result * /)>`, this can be used from Swift.
|
|
259
|
+
*/
|
|
260
|
+
class Func_void_VideoThumbnailResult_Wrapper final {
|
|
261
|
+
public:
|
|
262
|
+
explicit Func_void_VideoThumbnailResult_Wrapper(std::function<void(const VideoThumbnailResult& /* result */)>&& func): _function(std::make_unique<std::function<void(const VideoThumbnailResult& /* result */)>>(std::move(func))) {}
|
|
263
|
+
inline void call(VideoThumbnailResult result) const noexcept {
|
|
264
|
+
_function->operator()(result);
|
|
265
|
+
}
|
|
266
|
+
private:
|
|
267
|
+
std::unique_ptr<std::function<void(const VideoThumbnailResult& /* result */)>> _function;
|
|
268
|
+
} SWIFT_NONCOPYABLE;
|
|
269
|
+
Func_void_VideoThumbnailResult create_Func_void_VideoThumbnailResult(void* NON_NULL swiftClosureWrapper) noexcept;
|
|
270
|
+
inline Func_void_VideoThumbnailResult_Wrapper wrap_Func_void_VideoThumbnailResult(Func_void_VideoThumbnailResult value) noexcept {
|
|
271
|
+
return Func_void_VideoThumbnailResult_Wrapper(std::move(value));
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
// pragma MARK: std::optional<std::string>
|
|
275
|
+
/**
|
|
276
|
+
* Specialized version of `std::optional<std::string>`.
|
|
277
|
+
*/
|
|
278
|
+
using std__optional_std__string_ = std::optional<std::string>;
|
|
279
|
+
inline std::optional<std::string> create_std__optional_std__string_(const std::string& value) noexcept {
|
|
280
|
+
return std::optional<std::string>(value);
|
|
281
|
+
}
|
|
282
|
+
inline bool has_value_std__optional_std__string_(const std::optional<std::string>& optional) noexcept {
|
|
283
|
+
return optional.has_value();
|
|
284
|
+
}
|
|
285
|
+
inline std::string get_std__optional_std__string_(const std::optional<std::string>& optional) noexcept {
|
|
286
|
+
return optional.value();
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
// pragma MARK: std::shared_ptr<HybridCompressorSpec>
|
|
290
|
+
/**
|
|
291
|
+
* Specialized version of `std::shared_ptr<HybridCompressorSpec>`.
|
|
292
|
+
*/
|
|
293
|
+
using std__shared_ptr_HybridCompressorSpec_ = std::shared_ptr<HybridCompressorSpec>;
|
|
294
|
+
std::shared_ptr<HybridCompressorSpec> create_std__shared_ptr_HybridCompressorSpec_(void* NON_NULL swiftUnsafePointer) noexcept;
|
|
295
|
+
void* NON_NULL get_std__shared_ptr_HybridCompressorSpec_(std__shared_ptr_HybridCompressorSpec_ cppType);
|
|
296
|
+
|
|
297
|
+
// pragma MARK: std::weak_ptr<HybridCompressorSpec>
|
|
298
|
+
using std__weak_ptr_HybridCompressorSpec_ = std::weak_ptr<HybridCompressorSpec>;
|
|
299
|
+
inline std__weak_ptr_HybridCompressorSpec_ weakify_std__shared_ptr_HybridCompressorSpec_(const std::shared_ptr<HybridCompressorSpec>& strong) noexcept { return strong; }
|
|
300
|
+
|
|
301
|
+
// pragma MARK: Result<std::shared_ptr<Promise<std::string>>>
|
|
302
|
+
using Result_std__shared_ptr_Promise_std__string___ = Result<std::shared_ptr<Promise<std::string>>>;
|
|
303
|
+
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 {
|
|
304
|
+
return Result<std::shared_ptr<Promise<std::string>>>::withValue(value);
|
|
305
|
+
}
|
|
306
|
+
inline Result_std__shared_ptr_Promise_std__string___ create_Result_std__shared_ptr_Promise_std__string___(const std::exception_ptr& error) noexcept {
|
|
307
|
+
return Result<std::shared_ptr<Promise<std::string>>>::withError(error);
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
// pragma MARK: Result<std::shared_ptr<Promise<std::shared_ptr<AnyMap>>>>
|
|
311
|
+
using Result_std__shared_ptr_Promise_std__shared_ptr_AnyMap____ = Result<std::shared_ptr<Promise<std::shared_ptr<AnyMap>>>>;
|
|
312
|
+
inline Result_std__shared_ptr_Promise_std__shared_ptr_AnyMap____ create_Result_std__shared_ptr_Promise_std__shared_ptr_AnyMap____(const std::shared_ptr<Promise<std::shared_ptr<AnyMap>>>& value) noexcept {
|
|
313
|
+
return Result<std::shared_ptr<Promise<std::shared_ptr<AnyMap>>>>::withValue(value);
|
|
314
|
+
}
|
|
315
|
+
inline Result_std__shared_ptr_Promise_std__shared_ptr_AnyMap____ create_Result_std__shared_ptr_Promise_std__shared_ptr_AnyMap____(const std::exception_ptr& error) noexcept {
|
|
316
|
+
return Result<std::shared_ptr<Promise<std::shared_ptr<AnyMap>>>>::withError(error);
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
// pragma MARK: Result<void>
|
|
320
|
+
using Result_void_ = Result<void>;
|
|
321
|
+
inline Result_void_ create_Result_void_() noexcept {
|
|
322
|
+
return Result<void>::withValue();
|
|
323
|
+
}
|
|
324
|
+
inline Result_void_ create_Result_void_(const std::exception_ptr& error) noexcept {
|
|
325
|
+
return Result<void>::withError(error);
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
// pragma MARK: Result<std::shared_ptr<Promise<VideoThumbnailResult>>>
|
|
329
|
+
using Result_std__shared_ptr_Promise_VideoThumbnailResult___ = Result<std::shared_ptr<Promise<VideoThumbnailResult>>>;
|
|
330
|
+
inline Result_std__shared_ptr_Promise_VideoThumbnailResult___ create_Result_std__shared_ptr_Promise_VideoThumbnailResult___(const std::shared_ptr<Promise<VideoThumbnailResult>>& value) noexcept {
|
|
331
|
+
return Result<std::shared_ptr<Promise<VideoThumbnailResult>>>::withValue(value);
|
|
332
|
+
}
|
|
333
|
+
inline Result_std__shared_ptr_Promise_VideoThumbnailResult___ create_Result_std__shared_ptr_Promise_VideoThumbnailResult___(const std::exception_ptr& error) noexcept {
|
|
334
|
+
return Result<std::shared_ptr<Promise<VideoThumbnailResult>>>::withError(error);
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
} // namespace margelo::nitro::compressor::bridge::swift
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// react_native_compressor-Swift-Cxx-Umbrella.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
// Forward declarations of C++ defined types
|
|
11
|
+
// Forward declaration of `HybridCompressorSpec` to properly resolve imports.
|
|
12
|
+
namespace margelo::nitro::compressor { class HybridCompressorSpec; }
|
|
13
|
+
// Forward declaration of `VideoThumbnailResult` to properly resolve imports.
|
|
14
|
+
namespace margelo::nitro::compressor { struct VideoThumbnailResult; }
|
|
15
|
+
|
|
16
|
+
// Include C++ defined types
|
|
17
|
+
#include "HybridCompressorSpec.hpp"
|
|
18
|
+
#include "VideoThumbnailResult.hpp"
|
|
19
|
+
#include <NitroModules/AnyMap.hpp>
|
|
20
|
+
#include <NitroModules/Promise.hpp>
|
|
21
|
+
#include <NitroModules/Result.hpp>
|
|
22
|
+
#include <exception>
|
|
23
|
+
#include <functional>
|
|
24
|
+
#include <memory>
|
|
25
|
+
#include <optional>
|
|
26
|
+
#include <string>
|
|
27
|
+
|
|
28
|
+
// C++ helpers for Swift
|
|
29
|
+
#include "react_native_compressor-Swift-Cxx-Bridge.hpp"
|
|
30
|
+
|
|
31
|
+
// Common C++ types used in Swift
|
|
32
|
+
#include <NitroModules/ArrayBufferHolder.hpp>
|
|
33
|
+
#include <NitroModules/AnyMapUtils.hpp>
|
|
34
|
+
#include <NitroModules/RuntimeError.hpp>
|
|
35
|
+
#include <NitroModules/DateToChronoDate.hpp>
|
|
36
|
+
|
|
37
|
+
// Forward declarations of Swift defined types
|
|
38
|
+
// Forward declaration of `HybridCompressorSpec_cxx` to properly resolve imports.
|
|
39
|
+
namespace react_native_compressor { class HybridCompressorSpec_cxx; }
|
|
40
|
+
|
|
41
|
+
// Include Swift defined types
|
|
42
|
+
#if __has_include("react_native_compressor-Swift.h")
|
|
43
|
+
// This header is generated by Xcode/Swift on every app build.
|
|
44
|
+
// If it cannot be found, make sure the Swift module's name (= podspec name) is actually "react_native_compressor".
|
|
45
|
+
#include "react_native_compressor-Swift.h"
|
|
46
|
+
// Same as above, but used when building with frameworks (`use_frameworks`)
|
|
47
|
+
#elif __has_include(<react_native_compressor/react_native_compressor-Swift.h>)
|
|
48
|
+
#include <react_native_compressor/react_native_compressor-Swift.h>
|
|
49
|
+
#else
|
|
50
|
+
#error react_native_compressor's autogenerated Swift header cannot be found! Make sure the Swift module's name (= podspec name) is actually "react_native_compressor", and try building the app first.
|
|
51
|
+
#endif
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// react_native_compressorAutolinking.mm
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#import <Foundation/Foundation.h>
|
|
9
|
+
#import <NitroModules/HybridObjectRegistry.hpp>
|
|
10
|
+
#import "react_native_compressor-Swift-Cxx-Umbrella.hpp"
|
|
11
|
+
#import <type_traits>
|
|
12
|
+
|
|
13
|
+
#include "HybridCompressorSpecSwift.hpp"
|
|
14
|
+
|
|
15
|
+
@interface react_native_compressorAutolinking : NSObject
|
|
16
|
+
@end
|
|
17
|
+
|
|
18
|
+
@implementation react_native_compressorAutolinking
|
|
19
|
+
|
|
20
|
+
+ (void) load {
|
|
21
|
+
using namespace margelo::nitro;
|
|
22
|
+
using namespace margelo::nitro::compressor;
|
|
23
|
+
|
|
24
|
+
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
25
|
+
"Compressor",
|
|
26
|
+
[]() -> std::shared_ptr<HybridObject> {
|
|
27
|
+
std::shared_ptr<HybridCompressorSpec> hybridObject = react_native_compressor::react_native_compressorAutolinking::createCompressor();
|
|
28
|
+
return hybridObject;
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// react_native_compressorAutolinking.swift
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
import NitroModules
|
|
9
|
+
|
|
10
|
+
// TODO: Use empty enums once Swift supports exporting them as namespaces
|
|
11
|
+
// See: https://github.com/swiftlang/swift/pull/83616
|
|
12
|
+
public final class react_native_compressorAutolinking {
|
|
13
|
+
public typealias bridge = margelo.nitro.compressor.bridge.swift
|
|
14
|
+
|
|
15
|
+
public static func createCompressor() -> bridge.std__shared_ptr_HybridCompressorSpec_ {
|
|
16
|
+
let hybridObject = HybridCompressor()
|
|
17
|
+
return { () -> bridge.std__shared_ptr_HybridCompressorSpec_ in
|
|
18
|
+
let __cxxWrapped = hybridObject.getCxxWrapper()
|
|
19
|
+
return __cxxWrapped.getCxxPart()
|
|
20
|
+
}()
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
public static func isCompressorRecyclable() -> Bool {
|
|
24
|
+
return HybridCompressor.self is any RecyclableView.Type
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// Func_void.swift
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
import NitroModules
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Wraps a Swift `() -> Void` as a class.
|
|
12
|
+
* This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
|
|
13
|
+
*/
|
|
14
|
+
public final class Func_void {
|
|
15
|
+
public typealias bridge = margelo.nitro.compressor.bridge.swift
|
|
16
|
+
|
|
17
|
+
private let closure: () -> Void
|
|
18
|
+
|
|
19
|
+
public init(_ closure: @escaping () -> Void) {
|
|
20
|
+
self.closure = closure
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@inline(__always)
|
|
24
|
+
public func call() -> Void {
|
|
25
|
+
self.closure()
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Casts this instance to a retained unsafe raw pointer.
|
|
30
|
+
* This acquires one additional strong reference on the object!
|
|
31
|
+
*/
|
|
32
|
+
@inline(__always)
|
|
33
|
+
public func toUnsafe() -> UnsafeMutableRawPointer {
|
|
34
|
+
return Unmanaged.passRetained(self).toOpaque()
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Casts an unsafe pointer to a `Func_void`.
|
|
39
|
+
* The pointer has to be a retained opaque `Unmanaged<Func_void>`.
|
|
40
|
+
* This removes one strong reference from the object!
|
|
41
|
+
*/
|
|
42
|
+
@inline(__always)
|
|
43
|
+
public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void {
|
|
44
|
+
return Unmanaged<Func_void>.fromOpaque(pointer).takeRetainedValue()
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// Func_void_VideoThumbnailResult.swift
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
import NitroModules
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Wraps a Swift `(_ value: VideoThumbnailResult) -> Void` as a class.
|
|
12
|
+
* This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
|
|
13
|
+
*/
|
|
14
|
+
public final class Func_void_VideoThumbnailResult {
|
|
15
|
+
public typealias bridge = margelo.nitro.compressor.bridge.swift
|
|
16
|
+
|
|
17
|
+
private let closure: (_ value: VideoThumbnailResult) -> Void
|
|
18
|
+
|
|
19
|
+
public init(_ closure: @escaping (_ value: VideoThumbnailResult) -> Void) {
|
|
20
|
+
self.closure = closure
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@inline(__always)
|
|
24
|
+
public func call(value: VideoThumbnailResult) -> Void {
|
|
25
|
+
self.closure(value)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Casts this instance to a retained unsafe raw pointer.
|
|
30
|
+
* This acquires one additional strong reference on the object!
|
|
31
|
+
*/
|
|
32
|
+
@inline(__always)
|
|
33
|
+
public func toUnsafe() -> UnsafeMutableRawPointer {
|
|
34
|
+
return Unmanaged.passRetained(self).toOpaque()
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Casts an unsafe pointer to a `Func_void_VideoThumbnailResult`.
|
|
39
|
+
* The pointer has to be a retained opaque `Unmanaged<Func_void_VideoThumbnailResult>`.
|
|
40
|
+
* This removes one strong reference from the object!
|
|
41
|
+
*/
|
|
42
|
+
@inline(__always)
|
|
43
|
+
public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_VideoThumbnailResult {
|
|
44
|
+
return Unmanaged<Func_void_VideoThumbnailResult>.fromOpaque(pointer).takeRetainedValue()
|
|
45
|
+
}
|
|
46
|
+
}
|