react-native-video-trim 3.0.10 → 4.1.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.
Files changed (92) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +80 -63
  3. package/VideoTrim.podspec +24 -0
  4. package/android/CMakeLists.txt +24 -0
  5. package/android/build.gradle +82 -49
  6. package/android/gradle.properties +7 -5
  7. package/android/src/main/AndroidManifest.xml +4 -2
  8. package/android/src/main/cpp/cpp-adapter.cpp +6 -0
  9. package/android/src/main/java/com/margelo/nitro/videotrim/VideoTrim.kt +646 -0
  10. package/android/src/main/java/com/margelo/nitro/videotrim/VideoTrimPackage.kt +22 -0
  11. package/android/src/main/java/com/{videotrim → margelo/nitro/videotrim}/enums/ErrorCode.java +1 -1
  12. package/android/src/main/java/com/{videotrim → margelo/nitro/videotrim}/interfaces/IVideoTrimmerView.java +1 -1
  13. package/android/src/main/java/com/{videotrim → margelo/nitro/videotrim}/interfaces/VideoTrimListener.java +6 -5
  14. package/android/src/main/java/com/{videotrim → margelo/nitro/videotrim}/utils/MediaMetadataUtil.java +1 -1
  15. package/android/src/main/java/com/{videotrim → margelo/nitro/videotrim}/utils/StorageUtil.java +3 -1
  16. package/android/src/main/java/com/{videotrim → margelo/nitro/videotrim}/utils/VideoTrimmerUtil.java +51 -41
  17. package/android/src/main/java/com/{videotrim → margelo/nitro/videotrim}/widgets/VideoTrimmerView.java +45 -69
  18. package/ios/AssetLoader.swift +2 -2
  19. package/ios/ErrorCode.swift +2 -2
  20. package/ios/ProgressAlertController.swift +2 -2
  21. package/ios/VideoTrim.swift +52 -835
  22. package/ios/VideoTrimImpl.swift +957 -0
  23. package/ios/VideoTrimmer.swift +2 -3
  24. package/ios/VideoTrimmerThumb.swift +33 -26
  25. package/ios/VideoTrimmerViewController.swift +47 -28
  26. package/lib/module/VideoTrim.nitro.js +4 -0
  27. package/lib/module/VideoTrim.nitro.js.map +1 -0
  28. package/lib/module/index.js +98 -22
  29. package/lib/module/index.js.map +1 -1
  30. package/lib/module/package.json +1 -0
  31. package/lib/typescript/package.json +1 -0
  32. package/lib/typescript/{index.d.ts → src/VideoTrim.nitro.d.ts} +125 -134
  33. package/lib/typescript/src/VideoTrim.nitro.d.ts.map +1 -0
  34. package/lib/typescript/src/index.d.ts +49 -0
  35. package/lib/typescript/src/index.d.ts.map +1 -0
  36. package/nitrogen/generated/android/c++/JEditorConfig.hpp +237 -0
  37. package/nitrogen/generated/android/c++/JFileValidationResult.hpp +61 -0
  38. package/nitrogen/generated/android/c++/JFunc_void.hpp +74 -0
  39. package/nitrogen/generated/android/c++/JFunc_void_std__string_std__unordered_map_std__string__std__string_.hpp +89 -0
  40. package/nitrogen/generated/android/c++/JHybridVideoTrimSpec.cpp +151 -0
  41. package/nitrogen/generated/android/c++/JHybridVideoTrimSpec.hpp +68 -0
  42. package/nitrogen/generated/android/c++/JTrimOptions.hpp +109 -0
  43. package/nitrogen/generated/android/kotlin/com/margelo/nitro/videotrim/EditorConfig.kt +72 -0
  44. package/nitrogen/generated/android/kotlin/com/margelo/nitro/videotrim/FileValidationResult.kt +28 -0
  45. package/nitrogen/generated/android/kotlin/com/margelo/nitro/videotrim/Func_void.kt +80 -0
  46. package/nitrogen/generated/android/kotlin/com/margelo/nitro/videotrim/Func_void_std__string_std__unordered_map_std__string__std__string_.kt +80 -0
  47. package/nitrogen/generated/android/kotlin/com/margelo/nitro/videotrim/HybridVideoTrimSpec.kt +86 -0
  48. package/nitrogen/generated/android/kotlin/com/margelo/nitro/videotrim/TrimOptions.kt +40 -0
  49. package/nitrogen/generated/android/kotlin/com/margelo/nitro/videotrim/videotrimOnLoad.kt +35 -0
  50. package/nitrogen/generated/android/videotrim+autolinking.cmake +78 -0
  51. package/nitrogen/generated/android/videotrim+autolinking.gradle +27 -0
  52. package/nitrogen/generated/android/videotrimOnLoad.cpp +50 -0
  53. package/nitrogen/generated/android/videotrimOnLoad.hpp +25 -0
  54. package/nitrogen/generated/ios/VideoTrim+autolinking.rb +60 -0
  55. package/nitrogen/generated/ios/VideoTrim-Swift-Cxx-Bridge.cpp +96 -0
  56. package/nitrogen/generated/ios/VideoTrim-Swift-Cxx-Bridge.hpp +374 -0
  57. package/nitrogen/generated/ios/VideoTrim-Swift-Cxx-Umbrella.hpp +56 -0
  58. package/nitrogen/generated/ios/VideoTrimAutolinking.mm +33 -0
  59. package/nitrogen/generated/ios/VideoTrimAutolinking.swift +25 -0
  60. package/nitrogen/generated/ios/c++/HybridVideoTrimSpecSwift.cpp +11 -0
  61. package/nitrogen/generated/ios/c++/HybridVideoTrimSpecSwift.hpp +127 -0
  62. package/nitrogen/generated/ios/swift/EditorConfig.swift +541 -0
  63. package/nitrogen/generated/ios/swift/FileValidationResult.swift +57 -0
  64. package/nitrogen/generated/ios/swift/Func_void.swift +46 -0
  65. package/nitrogen/generated/ios/swift/Func_void_FileValidationResult.swift +46 -0
  66. package/nitrogen/generated/ios/swift/Func_void_bool.swift +46 -0
  67. package/nitrogen/generated/ios/swift/Func_void_double.swift +46 -0
  68. package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +46 -0
  69. package/nitrogen/generated/ios/swift/Func_void_std__string.swift +46 -0
  70. package/nitrogen/generated/ios/swift/Func_void_std__string_std__unordered_map_std__string__std__string_.swift +54 -0
  71. package/nitrogen/generated/ios/swift/Func_void_std__vector_std__string_.swift +46 -0
  72. package/nitrogen/generated/ios/swift/HybridVideoTrimSpec.swift +54 -0
  73. package/nitrogen/generated/ios/swift/HybridVideoTrimSpec_cxx.swift +241 -0
  74. package/nitrogen/generated/ios/swift/TrimOptions.swift +189 -0
  75. package/nitrogen/generated/shared/c++/EditorConfig.hpp +253 -0
  76. package/nitrogen/generated/shared/c++/FileValidationResult.hpp +77 -0
  77. package/nitrogen/generated/shared/c++/HybridVideoTrimSpec.cpp +27 -0
  78. package/nitrogen/generated/shared/c++/HybridVideoTrimSpec.hpp +80 -0
  79. package/nitrogen/generated/shared/c++/TrimOptions.hpp +125 -0
  80. package/package.json +75 -71
  81. package/src/VideoTrim.nitro.ts +263 -0
  82. package/src/index.tsx +120 -257
  83. package/android/src/main/AndroidManifestDeprecated.xml +0 -3
  84. package/android/src/main/java/com/videotrim/VideoTrimModule.java +0 -603
  85. package/android/src/main/java/com/videotrim/VideoTrimPackage.java +0 -28
  86. package/ios/VideoTrim-Bridging-Header.h +0 -2
  87. package/ios/VideoTrim.mm +0 -17
  88. package/ios/VideoTrim.xcodeproj/project.pbxproj +0 -283
  89. package/lib/commonjs/index.js +0 -87
  90. package/lib/commonjs/index.js.map +0 -1
  91. package/lib/typescript/index.d.ts.map +0 -1
  92. package/react-native-video-trim.podspec +0 -43
@@ -0,0 +1,27 @@
1
+ ///
2
+ /// videotrim+autolinking.gradle
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 Gradle file that adds all files generated by Nitrogen
9
+ /// to the current Gradle project.
10
+ ///
11
+ /// To use it, add this to your build.gradle:
12
+ /// ```gradle
13
+ /// apply from: '../nitrogen/generated/android/videotrim+autolinking.gradle'
14
+ /// ```
15
+
16
+ logger.warn("[NitroModules] 🔥 videotrim is boosted by nitro!")
17
+
18
+ android {
19
+ sourceSets {
20
+ main {
21
+ java.srcDirs += [
22
+ // Nitrogen files
23
+ "${project.projectDir}/../nitrogen/generated/android/kotlin"
24
+ ]
25
+ }
26
+ }
27
+ }
@@ -0,0 +1,50 @@
1
+ ///
2
+ /// videotrimOnLoad.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
+ #ifndef BUILDING_VIDEOTRIM_WITH_GENERATED_CMAKE_PROJECT
9
+ #error videotrimOnLoad.cpp is not being built with the autogenerated CMakeLists.txt project. Is a different CMakeLists.txt building this?
10
+ #endif
11
+
12
+ #include "videotrimOnLoad.hpp"
13
+
14
+ #include <jni.h>
15
+ #include <fbjni/fbjni.h>
16
+ #include <NitroModules/HybridObjectRegistry.hpp>
17
+
18
+ #include "JHybridVideoTrimSpec.hpp"
19
+ #include "JFunc_void_std__string_std__unordered_map_std__string__std__string_.hpp"
20
+ #include "JFunc_void.hpp"
21
+ #include <NitroModules/JNISharedPtr.hpp>
22
+ #include <NitroModules/DefaultConstructableObject.hpp>
23
+
24
+ namespace margelo::nitro::videotrim {
25
+
26
+ int initialize(JavaVM* vm) {
27
+ using namespace margelo::nitro;
28
+ using namespace margelo::nitro::videotrim;
29
+ using namespace facebook;
30
+
31
+ return facebook::jni::initialize(vm, [] {
32
+ // Register native JNI methods
33
+ margelo::nitro::videotrim::JHybridVideoTrimSpec::registerNatives();
34
+ margelo::nitro::videotrim::JFunc_void_std__string_std__unordered_map_std__string__std__string__cxx::registerNatives();
35
+ margelo::nitro::videotrim::JFunc_void_cxx::registerNatives();
36
+
37
+ // Register Nitro Hybrid Objects
38
+ HybridObjectRegistry::registerHybridObjectConstructor(
39
+ "VideoTrim",
40
+ []() -> std::shared_ptr<HybridObject> {
41
+ static DefaultConstructableObject<JHybridVideoTrimSpec::javaobject> object("com/margelo/nitro/videotrim/VideoTrim");
42
+ auto instance = object.create();
43
+ auto globalRef = jni::make_global(instance);
44
+ return JNISharedPtr::make_shared_from_jni<JHybridVideoTrimSpec>(globalRef);
45
+ }
46
+ );
47
+ });
48
+ }
49
+
50
+ } // namespace margelo::nitro::videotrim
@@ -0,0 +1,25 @@
1
+ ///
2
+ /// videotrimOnLoad.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
+ #include <jni.h>
9
+ #include <NitroModules/NitroDefines.hpp>
10
+
11
+ namespace margelo::nitro::videotrim {
12
+
13
+ /**
14
+ * Initializes the native (C++) part of videotrim, and autolinks all Hybrid Objects.
15
+ * Call this in your `JNI_OnLoad` function (probably inside `cpp-adapter.cpp`).
16
+ * Example:
17
+ * ```cpp (cpp-adapter.cpp)
18
+ * JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void*) {
19
+ * return margelo::nitro::videotrim::initialize(vm);
20
+ * }
21
+ * ```
22
+ */
23
+ int initialize(JavaVM* vm);
24
+
25
+ } // namespace margelo::nitro::videotrim
@@ -0,0 +1,60 @@
1
+ #
2
+ # VideoTrim+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/VideoTrim+autolinking.rb'
18
+ # add_nitrogen_files(spec)
19
+ # end
20
+ # ```
21
+
22
+ def add_nitrogen_files(spec)
23
+ Pod::UI.puts "[NitroModules] 🔥 VideoTrim 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/VideoTrim-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,96 @@
1
+ ///
2
+ /// VideoTrim-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 "VideoTrim-Swift-Cxx-Bridge.hpp"
9
+
10
+ // Include C++ implementation defined types
11
+ #include "HybridVideoTrimSpecSwift.hpp"
12
+ #include "VideoTrim-Swift-Cxx-Umbrella.hpp"
13
+
14
+ namespace margelo::nitro::videotrim::bridge::swift {
15
+
16
+ // pragma MARK: std::function<void(const std::string& /* eventName */, const std::unordered_map<std::string, std::string>& /* payload */)>
17
+ Func_void_std__string_std__unordered_map_std__string__std__string_ create_Func_void_std__string_std__unordered_map_std__string__std__string_(void* _Nonnull swiftClosureWrapper) {
18
+ auto swiftClosure = VideoTrim::Func_void_std__string_std__unordered_map_std__string__std__string_::fromUnsafe(swiftClosureWrapper);
19
+ return [swiftClosure = std::move(swiftClosure)](const std::string& eventName, const std::unordered_map<std::string, std::string>& payload) mutable -> void {
20
+ swiftClosure.call(eventName, payload);
21
+ };
22
+ }
23
+
24
+ // pragma MARK: std::function<void(const std::vector<std::string>& /* result */)>
25
+ Func_void_std__vector_std__string_ create_Func_void_std__vector_std__string_(void* _Nonnull swiftClosureWrapper) {
26
+ auto swiftClosure = VideoTrim::Func_void_std__vector_std__string_::fromUnsafe(swiftClosureWrapper);
27
+ return [swiftClosure = std::move(swiftClosure)](const std::vector<std::string>& result) mutable -> void {
28
+ swiftClosure.call(result);
29
+ };
30
+ }
31
+
32
+ // pragma MARK: std::function<void(const std::exception_ptr& /* error */)>
33
+ Func_void_std__exception_ptr create_Func_void_std__exception_ptr(void* _Nonnull swiftClosureWrapper) {
34
+ auto swiftClosure = VideoTrim::Func_void_std__exception_ptr::fromUnsafe(swiftClosureWrapper);
35
+ return [swiftClosure = std::move(swiftClosure)](const std::exception_ptr& error) mutable -> void {
36
+ swiftClosure.call(error);
37
+ };
38
+ }
39
+
40
+ // pragma MARK: std::function<void(double /* result */)>
41
+ Func_void_double create_Func_void_double(void* _Nonnull swiftClosureWrapper) {
42
+ auto swiftClosure = VideoTrim::Func_void_double::fromUnsafe(swiftClosureWrapper);
43
+ return [swiftClosure = std::move(swiftClosure)](double result) mutable -> void {
44
+ swiftClosure.call(result);
45
+ };
46
+ }
47
+
48
+ // pragma MARK: std::function<void(bool /* result */)>
49
+ Func_void_bool create_Func_void_bool(void* _Nonnull swiftClosureWrapper) {
50
+ auto swiftClosure = VideoTrim::Func_void_bool::fromUnsafe(swiftClosureWrapper);
51
+ return [swiftClosure = std::move(swiftClosure)](bool result) mutable -> void {
52
+ swiftClosure.call(result);
53
+ };
54
+ }
55
+
56
+ // pragma MARK: std::function<void()>
57
+ Func_void create_Func_void(void* _Nonnull swiftClosureWrapper) {
58
+ auto swiftClosure = VideoTrim::Func_void::fromUnsafe(swiftClosureWrapper);
59
+ return [swiftClosure = std::move(swiftClosure)]() mutable -> void {
60
+ swiftClosure.call();
61
+ };
62
+ }
63
+
64
+ // pragma MARK: std::function<void(const FileValidationResult& /* result */)>
65
+ Func_void_FileValidationResult create_Func_void_FileValidationResult(void* _Nonnull swiftClosureWrapper) {
66
+ auto swiftClosure = VideoTrim::Func_void_FileValidationResult::fromUnsafe(swiftClosureWrapper);
67
+ return [swiftClosure = std::move(swiftClosure)](const FileValidationResult& result) mutable -> void {
68
+ swiftClosure.call(result);
69
+ };
70
+ }
71
+
72
+ // pragma MARK: std::function<void(const std::string& /* result */)>
73
+ Func_void_std__string create_Func_void_std__string(void* _Nonnull swiftClosureWrapper) {
74
+ auto swiftClosure = VideoTrim::Func_void_std__string::fromUnsafe(swiftClosureWrapper);
75
+ return [swiftClosure = std::move(swiftClosure)](const std::string& result) mutable -> void {
76
+ swiftClosure.call(result);
77
+ };
78
+ }
79
+
80
+ // pragma MARK: std::shared_ptr<margelo::nitro::videotrim::HybridVideoTrimSpec>
81
+ std::shared_ptr<margelo::nitro::videotrim::HybridVideoTrimSpec> create_std__shared_ptr_margelo__nitro__videotrim__HybridVideoTrimSpec_(void* _Nonnull swiftUnsafePointer) {
82
+ VideoTrim::HybridVideoTrimSpec_cxx swiftPart = VideoTrim::HybridVideoTrimSpec_cxx::fromUnsafe(swiftUnsafePointer);
83
+ return std::make_shared<margelo::nitro::videotrim::HybridVideoTrimSpecSwift>(swiftPart);
84
+ }
85
+ void* _Nonnull get_std__shared_ptr_margelo__nitro__videotrim__HybridVideoTrimSpec_(std__shared_ptr_margelo__nitro__videotrim__HybridVideoTrimSpec_ cppType) {
86
+ std::shared_ptr<margelo::nitro::videotrim::HybridVideoTrimSpecSwift> swiftWrapper = std::dynamic_pointer_cast<margelo::nitro::videotrim::HybridVideoTrimSpecSwift>(cppType);
87
+ #ifdef NITRO_DEBUG
88
+ if (swiftWrapper == nullptr) [[unlikely]] {
89
+ throw std::runtime_error("Class \"HybridVideoTrimSpec\" is not implemented in Swift!");
90
+ }
91
+ #endif
92
+ VideoTrim::HybridVideoTrimSpec_cxx& swiftPart = swiftWrapper->getSwiftPart();
93
+ return swiftPart.toUnsafe();
94
+ }
95
+
96
+ } // namespace margelo::nitro::videotrim::bridge::swift
@@ -0,0 +1,374 @@
1
+ ///
2
+ /// VideoTrim-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 `FileValidationResult` to properly resolve imports.
12
+ namespace margelo::nitro::videotrim { struct FileValidationResult; }
13
+ // Forward declaration of `HybridVideoTrimSpec` to properly resolve imports.
14
+ namespace margelo::nitro::videotrim { class HybridVideoTrimSpec; }
15
+
16
+ // Forward declarations of Swift defined types
17
+ // Forward declaration of `HybridVideoTrimSpec_cxx` to properly resolve imports.
18
+ namespace VideoTrim { class HybridVideoTrimSpec_cxx; }
19
+
20
+ // Include C++ defined types
21
+ #include "FileValidationResult.hpp"
22
+ #include "HybridVideoTrimSpec.hpp"
23
+ #include <NitroModules/Promise.hpp>
24
+ #include <NitroModules/PromiseHolder.hpp>
25
+ #include <NitroModules/Result.hpp>
26
+ #include <exception>
27
+ #include <functional>
28
+ #include <memory>
29
+ #include <string>
30
+ #include <unordered_map>
31
+ #include <vector>
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::videotrim::bridge::swift {
38
+
39
+ // pragma MARK: std::unordered_map<std::string, std::string>
40
+ /**
41
+ * Specialized version of `std::unordered_map<std::string, std::string>`.
42
+ */
43
+ using std__unordered_map_std__string__std__string_ = std::unordered_map<std::string, std::string>;
44
+ inline std::unordered_map<std::string, std::string> create_std__unordered_map_std__string__std__string_(size_t size) {
45
+ std::unordered_map<std::string, std::string> map;
46
+ map.reserve(size);
47
+ return map;
48
+ }
49
+ inline std::vector<std::string> get_std__unordered_map_std__string__std__string__keys(const std__unordered_map_std__string__std__string_& map) {
50
+ std::vector<std::string> keys;
51
+ keys.reserve(map.size());
52
+ for (const auto& entry : map) {
53
+ keys.push_back(entry.first);
54
+ }
55
+ return keys;
56
+ }
57
+ inline void emplace_std__unordered_map_std__string__std__string_(std__unordered_map_std__string__std__string_& map, const std::string& key, const std::string& value) {
58
+ map.emplace(key, value);
59
+ }
60
+
61
+ // pragma MARK: std::function<void(const std::string& /* eventName */, const std::unordered_map<std::string, std::string>& /* payload */)>
62
+ /**
63
+ * Specialized version of `std::function<void(const std::string&, const std::unordered_map<std::string, std::string>&)>`.
64
+ */
65
+ using Func_void_std__string_std__unordered_map_std__string__std__string_ = std::function<void(const std::string& /* eventName */, const std::unordered_map<std::string, std::string>& /* payload */)>;
66
+ /**
67
+ * Wrapper class for a `std::function<void(const std::string& / * eventName * /, const std::unordered_map<std::string, std::string>& / * payload * /)>`, this can be used from Swift.
68
+ */
69
+ class Func_void_std__string_std__unordered_map_std__string__std__string__Wrapper final {
70
+ public:
71
+ explicit Func_void_std__string_std__unordered_map_std__string__std__string__Wrapper(std::function<void(const std::string& /* eventName */, const std::unordered_map<std::string, std::string>& /* payload */)>&& func): _function(std::make_shared<std::function<void(const std::string& /* eventName */, const std::unordered_map<std::string, std::string>& /* payload */)>>(std::move(func))) {}
72
+ inline void call(std::string eventName, std::unordered_map<std::string, std::string> payload) const {
73
+ _function->operator()(eventName, payload);
74
+ }
75
+ private:
76
+ std::shared_ptr<std::function<void(const std::string& /* eventName */, const std::unordered_map<std::string, std::string>& /* payload */)>> _function;
77
+ };
78
+ Func_void_std__string_std__unordered_map_std__string__std__string_ create_Func_void_std__string_std__unordered_map_std__string__std__string_(void* _Nonnull swiftClosureWrapper);
79
+ inline Func_void_std__string_std__unordered_map_std__string__std__string__Wrapper wrap_Func_void_std__string_std__unordered_map_std__string__std__string_(Func_void_std__string_std__unordered_map_std__string__std__string_ value) {
80
+ return Func_void_std__string_std__unordered_map_std__string__std__string__Wrapper(std::move(value));
81
+ }
82
+
83
+ // pragma MARK: std::vector<std::string>
84
+ /**
85
+ * Specialized version of `std::vector<std::string>`.
86
+ */
87
+ using std__vector_std__string_ = std::vector<std::string>;
88
+ inline std::vector<std::string> create_std__vector_std__string_(size_t size) {
89
+ std::vector<std::string> vector;
90
+ vector.reserve(size);
91
+ return vector;
92
+ }
93
+
94
+ // pragma MARK: std::shared_ptr<Promise<std::vector<std::string>>>
95
+ /**
96
+ * Specialized version of `std::shared_ptr<Promise<std::vector<std::string>>>`.
97
+ */
98
+ using std__shared_ptr_Promise_std__vector_std__string___ = std::shared_ptr<Promise<std::vector<std::string>>>;
99
+ inline std::shared_ptr<Promise<std::vector<std::string>>> create_std__shared_ptr_Promise_std__vector_std__string___() {
100
+ return Promise<std::vector<std::string>>::create();
101
+ }
102
+ inline PromiseHolder<std::vector<std::string>> wrap_std__shared_ptr_Promise_std__vector_std__string___(std::shared_ptr<Promise<std::vector<std::string>>> promise) {
103
+ return PromiseHolder<std::vector<std::string>>(std::move(promise));
104
+ }
105
+
106
+ // pragma MARK: std::function<void(const std::vector<std::string>& /* result */)>
107
+ /**
108
+ * Specialized version of `std::function<void(const std::vector<std::string>&)>`.
109
+ */
110
+ using Func_void_std__vector_std__string_ = std::function<void(const std::vector<std::string>& /* result */)>;
111
+ /**
112
+ * Wrapper class for a `std::function<void(const std::vector<std::string>& / * result * /)>`, this can be used from Swift.
113
+ */
114
+ class Func_void_std__vector_std__string__Wrapper final {
115
+ public:
116
+ explicit Func_void_std__vector_std__string__Wrapper(std::function<void(const std::vector<std::string>& /* result */)>&& func): _function(std::make_shared<std::function<void(const std::vector<std::string>& /* result */)>>(std::move(func))) {}
117
+ inline void call(std::vector<std::string> result) const {
118
+ _function->operator()(result);
119
+ }
120
+ private:
121
+ std::shared_ptr<std::function<void(const std::vector<std::string>& /* result */)>> _function;
122
+ };
123
+ Func_void_std__vector_std__string_ create_Func_void_std__vector_std__string_(void* _Nonnull swiftClosureWrapper);
124
+ inline Func_void_std__vector_std__string__Wrapper wrap_Func_void_std__vector_std__string_(Func_void_std__vector_std__string_ value) {
125
+ return Func_void_std__vector_std__string__Wrapper(std::move(value));
126
+ }
127
+
128
+ // pragma MARK: std::function<void(const std::exception_ptr& /* error */)>
129
+ /**
130
+ * Specialized version of `std::function<void(const std::exception_ptr&)>`.
131
+ */
132
+ using Func_void_std__exception_ptr = std::function<void(const std::exception_ptr& /* error */)>;
133
+ /**
134
+ * Wrapper class for a `std::function<void(const std::exception_ptr& / * error * /)>`, this can be used from Swift.
135
+ */
136
+ class Func_void_std__exception_ptr_Wrapper final {
137
+ public:
138
+ explicit Func_void_std__exception_ptr_Wrapper(std::function<void(const std::exception_ptr& /* error */)>&& func): _function(std::make_shared<std::function<void(const std::exception_ptr& /* error */)>>(std::move(func))) {}
139
+ inline void call(std::exception_ptr error) const {
140
+ _function->operator()(error);
141
+ }
142
+ private:
143
+ std::shared_ptr<std::function<void(const std::exception_ptr& /* error */)>> _function;
144
+ };
145
+ Func_void_std__exception_ptr create_Func_void_std__exception_ptr(void* _Nonnull swiftClosureWrapper);
146
+ inline Func_void_std__exception_ptr_Wrapper wrap_Func_void_std__exception_ptr(Func_void_std__exception_ptr value) {
147
+ return Func_void_std__exception_ptr_Wrapper(std::move(value));
148
+ }
149
+
150
+ // pragma MARK: std::shared_ptr<Promise<double>>
151
+ /**
152
+ * Specialized version of `std::shared_ptr<Promise<double>>`.
153
+ */
154
+ using std__shared_ptr_Promise_double__ = std::shared_ptr<Promise<double>>;
155
+ inline std::shared_ptr<Promise<double>> create_std__shared_ptr_Promise_double__() {
156
+ return Promise<double>::create();
157
+ }
158
+ inline PromiseHolder<double> wrap_std__shared_ptr_Promise_double__(std::shared_ptr<Promise<double>> promise) {
159
+ return PromiseHolder<double>(std::move(promise));
160
+ }
161
+
162
+ // pragma MARK: std::function<void(double /* result */)>
163
+ /**
164
+ * Specialized version of `std::function<void(double)>`.
165
+ */
166
+ using Func_void_double = std::function<void(double /* result */)>;
167
+ /**
168
+ * Wrapper class for a `std::function<void(double / * result * /)>`, this can be used from Swift.
169
+ */
170
+ class Func_void_double_Wrapper final {
171
+ public:
172
+ explicit Func_void_double_Wrapper(std::function<void(double /* result */)>&& func): _function(std::make_shared<std::function<void(double /* result */)>>(std::move(func))) {}
173
+ inline void call(double result) const {
174
+ _function->operator()(result);
175
+ }
176
+ private:
177
+ std::shared_ptr<std::function<void(double /* result */)>> _function;
178
+ };
179
+ Func_void_double create_Func_void_double(void* _Nonnull swiftClosureWrapper);
180
+ inline Func_void_double_Wrapper wrap_Func_void_double(Func_void_double value) {
181
+ return Func_void_double_Wrapper(std::move(value));
182
+ }
183
+
184
+ // pragma MARK: std::shared_ptr<Promise<bool>>
185
+ /**
186
+ * Specialized version of `std::shared_ptr<Promise<bool>>`.
187
+ */
188
+ using std__shared_ptr_Promise_bool__ = std::shared_ptr<Promise<bool>>;
189
+ inline std::shared_ptr<Promise<bool>> create_std__shared_ptr_Promise_bool__() {
190
+ return Promise<bool>::create();
191
+ }
192
+ inline PromiseHolder<bool> wrap_std__shared_ptr_Promise_bool__(std::shared_ptr<Promise<bool>> promise) {
193
+ return PromiseHolder<bool>(std::move(promise));
194
+ }
195
+
196
+ // pragma MARK: std::function<void(bool /* result */)>
197
+ /**
198
+ * Specialized version of `std::function<void(bool)>`.
199
+ */
200
+ using Func_void_bool = std::function<void(bool /* result */)>;
201
+ /**
202
+ * Wrapper class for a `std::function<void(bool / * result * /)>`, this can be used from Swift.
203
+ */
204
+ class Func_void_bool_Wrapper final {
205
+ public:
206
+ explicit Func_void_bool_Wrapper(std::function<void(bool /* result */)>&& func): _function(std::make_shared<std::function<void(bool /* result */)>>(std::move(func))) {}
207
+ inline void call(bool result) const {
208
+ _function->operator()(result);
209
+ }
210
+ private:
211
+ std::shared_ptr<std::function<void(bool /* result */)>> _function;
212
+ };
213
+ Func_void_bool create_Func_void_bool(void* _Nonnull swiftClosureWrapper);
214
+ inline Func_void_bool_Wrapper wrap_Func_void_bool(Func_void_bool value) {
215
+ return Func_void_bool_Wrapper(std::move(value));
216
+ }
217
+
218
+ // pragma MARK: std::function<void()>
219
+ /**
220
+ * Specialized version of `std::function<void()>`.
221
+ */
222
+ using Func_void = std::function<void()>;
223
+ /**
224
+ * Wrapper class for a `std::function<void()>`, this can be used from Swift.
225
+ */
226
+ class Func_void_Wrapper final {
227
+ public:
228
+ explicit Func_void_Wrapper(std::function<void()>&& func): _function(std::make_shared<std::function<void()>>(std::move(func))) {}
229
+ inline void call() const {
230
+ _function->operator()();
231
+ }
232
+ private:
233
+ std::shared_ptr<std::function<void()>> _function;
234
+ };
235
+ Func_void create_Func_void(void* _Nonnull swiftClosureWrapper);
236
+ inline Func_void_Wrapper wrap_Func_void(Func_void value) {
237
+ return Func_void_Wrapper(std::move(value));
238
+ }
239
+
240
+ // pragma MARK: std::shared_ptr<Promise<FileValidationResult>>
241
+ /**
242
+ * Specialized version of `std::shared_ptr<Promise<FileValidationResult>>`.
243
+ */
244
+ using std__shared_ptr_Promise_FileValidationResult__ = std::shared_ptr<Promise<FileValidationResult>>;
245
+ inline std::shared_ptr<Promise<FileValidationResult>> create_std__shared_ptr_Promise_FileValidationResult__() {
246
+ return Promise<FileValidationResult>::create();
247
+ }
248
+ inline PromiseHolder<FileValidationResult> wrap_std__shared_ptr_Promise_FileValidationResult__(std::shared_ptr<Promise<FileValidationResult>> promise) {
249
+ return PromiseHolder<FileValidationResult>(std::move(promise));
250
+ }
251
+
252
+ // pragma MARK: std::function<void(const FileValidationResult& /* result */)>
253
+ /**
254
+ * Specialized version of `std::function<void(const FileValidationResult&)>`.
255
+ */
256
+ using Func_void_FileValidationResult = std::function<void(const FileValidationResult& /* result */)>;
257
+ /**
258
+ * Wrapper class for a `std::function<void(const FileValidationResult& / * result * /)>`, this can be used from Swift.
259
+ */
260
+ class Func_void_FileValidationResult_Wrapper final {
261
+ public:
262
+ explicit Func_void_FileValidationResult_Wrapper(std::function<void(const FileValidationResult& /* result */)>&& func): _function(std::make_shared<std::function<void(const FileValidationResult& /* result */)>>(std::move(func))) {}
263
+ inline void call(FileValidationResult result) const {
264
+ _function->operator()(result);
265
+ }
266
+ private:
267
+ std::shared_ptr<std::function<void(const FileValidationResult& /* result */)>> _function;
268
+ };
269
+ Func_void_FileValidationResult create_Func_void_FileValidationResult(void* _Nonnull swiftClosureWrapper);
270
+ inline Func_void_FileValidationResult_Wrapper wrap_Func_void_FileValidationResult(Func_void_FileValidationResult value) {
271
+ return Func_void_FileValidationResult_Wrapper(std::move(value));
272
+ }
273
+
274
+ // pragma MARK: std::shared_ptr<Promise<std::string>>
275
+ /**
276
+ * Specialized version of `std::shared_ptr<Promise<std::string>>`.
277
+ */
278
+ using std__shared_ptr_Promise_std__string__ = std::shared_ptr<Promise<std::string>>;
279
+ inline std::shared_ptr<Promise<std::string>> create_std__shared_ptr_Promise_std__string__() {
280
+ return Promise<std::string>::create();
281
+ }
282
+ inline PromiseHolder<std::string> wrap_std__shared_ptr_Promise_std__string__(std::shared_ptr<Promise<std::string>> promise) {
283
+ return PromiseHolder<std::string>(std::move(promise));
284
+ }
285
+
286
+ // pragma MARK: std::function<void(const std::string& /* result */)>
287
+ /**
288
+ * Specialized version of `std::function<void(const std::string&)>`.
289
+ */
290
+ using Func_void_std__string = std::function<void(const std::string& /* result */)>;
291
+ /**
292
+ * Wrapper class for a `std::function<void(const std::string& / * result * /)>`, this can be used from Swift.
293
+ */
294
+ class Func_void_std__string_Wrapper final {
295
+ public:
296
+ explicit Func_void_std__string_Wrapper(std::function<void(const std::string& /* result */)>&& func): _function(std::make_shared<std::function<void(const std::string& /* result */)>>(std::move(func))) {}
297
+ inline void call(std::string result) const {
298
+ _function->operator()(result);
299
+ }
300
+ private:
301
+ std::shared_ptr<std::function<void(const std::string& /* result */)>> _function;
302
+ };
303
+ Func_void_std__string create_Func_void_std__string(void* _Nonnull swiftClosureWrapper);
304
+ inline Func_void_std__string_Wrapper wrap_Func_void_std__string(Func_void_std__string value) {
305
+ return Func_void_std__string_Wrapper(std::move(value));
306
+ }
307
+
308
+ // pragma MARK: std::shared_ptr<margelo::nitro::videotrim::HybridVideoTrimSpec>
309
+ /**
310
+ * Specialized version of `std::shared_ptr<margelo::nitro::videotrim::HybridVideoTrimSpec>`.
311
+ */
312
+ using std__shared_ptr_margelo__nitro__videotrim__HybridVideoTrimSpec_ = std::shared_ptr<margelo::nitro::videotrim::HybridVideoTrimSpec>;
313
+ std::shared_ptr<margelo::nitro::videotrim::HybridVideoTrimSpec> create_std__shared_ptr_margelo__nitro__videotrim__HybridVideoTrimSpec_(void* _Nonnull swiftUnsafePointer);
314
+ void* _Nonnull get_std__shared_ptr_margelo__nitro__videotrim__HybridVideoTrimSpec_(std__shared_ptr_margelo__nitro__videotrim__HybridVideoTrimSpec_ cppType);
315
+
316
+ // pragma MARK: std::weak_ptr<margelo::nitro::videotrim::HybridVideoTrimSpec>
317
+ using std__weak_ptr_margelo__nitro__videotrim__HybridVideoTrimSpec_ = std::weak_ptr<margelo::nitro::videotrim::HybridVideoTrimSpec>;
318
+ inline std__weak_ptr_margelo__nitro__videotrim__HybridVideoTrimSpec_ weakify_std__shared_ptr_margelo__nitro__videotrim__HybridVideoTrimSpec_(const std::shared_ptr<margelo::nitro::videotrim::HybridVideoTrimSpec>& strong) { return strong; }
319
+
320
+ // pragma MARK: Result<void>
321
+ using Result_void_ = Result<void>;
322
+ inline Result_void_ create_Result_void_() {
323
+ return Result<void>::withValue();
324
+ }
325
+ inline Result_void_ create_Result_void_(const std::exception_ptr& error) {
326
+ return Result<void>::withError(error);
327
+ }
328
+
329
+ // pragma MARK: Result<std::shared_ptr<Promise<std::vector<std::string>>>>
330
+ using Result_std__shared_ptr_Promise_std__vector_std__string____ = Result<std::shared_ptr<Promise<std::vector<std::string>>>>;
331
+ inline Result_std__shared_ptr_Promise_std__vector_std__string____ create_Result_std__shared_ptr_Promise_std__vector_std__string____(const std::shared_ptr<Promise<std::vector<std::string>>>& value) {
332
+ return Result<std::shared_ptr<Promise<std::vector<std::string>>>>::withValue(value);
333
+ }
334
+ inline Result_std__shared_ptr_Promise_std__vector_std__string____ create_Result_std__shared_ptr_Promise_std__vector_std__string____(const std::exception_ptr& error) {
335
+ return Result<std::shared_ptr<Promise<std::vector<std::string>>>>::withError(error);
336
+ }
337
+
338
+ // pragma MARK: Result<std::shared_ptr<Promise<double>>>
339
+ using Result_std__shared_ptr_Promise_double___ = Result<std::shared_ptr<Promise<double>>>;
340
+ inline Result_std__shared_ptr_Promise_double___ create_Result_std__shared_ptr_Promise_double___(const std::shared_ptr<Promise<double>>& value) {
341
+ return Result<std::shared_ptr<Promise<double>>>::withValue(value);
342
+ }
343
+ inline Result_std__shared_ptr_Promise_double___ create_Result_std__shared_ptr_Promise_double___(const std::exception_ptr& error) {
344
+ return Result<std::shared_ptr<Promise<double>>>::withError(error);
345
+ }
346
+
347
+ // pragma MARK: Result<std::shared_ptr<Promise<bool>>>
348
+ using Result_std__shared_ptr_Promise_bool___ = Result<std::shared_ptr<Promise<bool>>>;
349
+ inline Result_std__shared_ptr_Promise_bool___ create_Result_std__shared_ptr_Promise_bool___(const std::shared_ptr<Promise<bool>>& value) {
350
+ return Result<std::shared_ptr<Promise<bool>>>::withValue(value);
351
+ }
352
+ inline Result_std__shared_ptr_Promise_bool___ create_Result_std__shared_ptr_Promise_bool___(const std::exception_ptr& error) {
353
+ return Result<std::shared_ptr<Promise<bool>>>::withError(error);
354
+ }
355
+
356
+ // pragma MARK: Result<std::shared_ptr<Promise<FileValidationResult>>>
357
+ using Result_std__shared_ptr_Promise_FileValidationResult___ = Result<std::shared_ptr<Promise<FileValidationResult>>>;
358
+ inline Result_std__shared_ptr_Promise_FileValidationResult___ create_Result_std__shared_ptr_Promise_FileValidationResult___(const std::shared_ptr<Promise<FileValidationResult>>& value) {
359
+ return Result<std::shared_ptr<Promise<FileValidationResult>>>::withValue(value);
360
+ }
361
+ inline Result_std__shared_ptr_Promise_FileValidationResult___ create_Result_std__shared_ptr_Promise_FileValidationResult___(const std::exception_ptr& error) {
362
+ return Result<std::shared_ptr<Promise<FileValidationResult>>>::withError(error);
363
+ }
364
+
365
+ // pragma MARK: Result<std::shared_ptr<Promise<std::string>>>
366
+ using Result_std__shared_ptr_Promise_std__string___ = Result<std::shared_ptr<Promise<std::string>>>;
367
+ inline Result_std__shared_ptr_Promise_std__string___ create_Result_std__shared_ptr_Promise_std__string___(const std::shared_ptr<Promise<std::string>>& value) {
368
+ return Result<std::shared_ptr<Promise<std::string>>>::withValue(value);
369
+ }
370
+ inline Result_std__shared_ptr_Promise_std__string___ create_Result_std__shared_ptr_Promise_std__string___(const std::exception_ptr& error) {
371
+ return Result<std::shared_ptr<Promise<std::string>>>::withError(error);
372
+ }
373
+
374
+ } // namespace margelo::nitro::videotrim::bridge::swift