react-native-video-trim 3.0.9 → 4.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.
Files changed (88) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +64 -61
  3. package/VideoTrim.podspec +24 -0
  4. package/android/CMakeLists.txt +24 -0
  5. package/android/build.gradle +77 -51
  6. package/android/gradle.properties +5 -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 +629 -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 -4
  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/margelo/nitro/videotrim/utils/VideoTrimmerUtil.java +157 -0
  17. package/android/src/main/java/com/{videotrim → margelo/nitro/videotrim}/widgets/VideoTrimmerView.java +44 -72
  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 +38 -739
  22. package/ios/VideoTrimImpl.swift +860 -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 +71 -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} +63 -89
  33. package/lib/typescript/src/VideoTrim.nitro.d.ts.map +1 -0
  34. package/lib/typescript/src/index.d.ts +41 -0
  35. package/lib/typescript/src/index.d.ts.map +1 -0
  36. package/nitrogen/generated/android/c++/JEditorConfig.hpp +229 -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 +131 -0
  41. package/nitrogen/generated/android/c++/JHybridVideoTrimSpec.hpp +67 -0
  42. package/nitrogen/generated/android/kotlin/com/margelo/nitro/videotrim/EditorConfig.kt +70 -0
  43. package/nitrogen/generated/android/kotlin/com/margelo/nitro/videotrim/FileValidationResult.kt +28 -0
  44. package/nitrogen/generated/android/kotlin/com/margelo/nitro/videotrim/Func_void.kt +80 -0
  45. package/nitrogen/generated/android/kotlin/com/margelo/nitro/videotrim/Func_void_std__string_std__unordered_map_std__string__std__string_.kt +80 -0
  46. package/nitrogen/generated/android/kotlin/com/margelo/nitro/videotrim/HybridVideoTrimSpec.kt +82 -0
  47. package/nitrogen/generated/android/kotlin/com/margelo/nitro/videotrim/videotrimOnLoad.kt +35 -0
  48. package/nitrogen/generated/android/videotrim+autolinking.cmake +78 -0
  49. package/nitrogen/generated/android/videotrim+autolinking.gradle +27 -0
  50. package/nitrogen/generated/android/videotrimOnLoad.cpp +50 -0
  51. package/nitrogen/generated/android/videotrimOnLoad.hpp +25 -0
  52. package/nitrogen/generated/ios/VideoTrim+autolinking.rb +60 -0
  53. package/nitrogen/generated/ios/VideoTrim-Swift-Cxx-Bridge.cpp +88 -0
  54. package/nitrogen/generated/ios/VideoTrim-Swift-Cxx-Bridge.hpp +331 -0
  55. package/nitrogen/generated/ios/VideoTrim-Swift-Cxx-Umbrella.hpp +53 -0
  56. package/nitrogen/generated/ios/VideoTrimAutolinking.mm +33 -0
  57. package/nitrogen/generated/ios/VideoTrimAutolinking.swift +25 -0
  58. package/nitrogen/generated/ios/c++/HybridVideoTrimSpecSwift.cpp +11 -0
  59. package/nitrogen/generated/ios/c++/HybridVideoTrimSpecSwift.hpp +116 -0
  60. package/nitrogen/generated/ios/swift/EditorConfig.swift +519 -0
  61. package/nitrogen/generated/ios/swift/FileValidationResult.swift +57 -0
  62. package/nitrogen/generated/ios/swift/Func_void.swift +46 -0
  63. package/nitrogen/generated/ios/swift/Func_void_FileValidationResult.swift +46 -0
  64. package/nitrogen/generated/ios/swift/Func_void_bool.swift +46 -0
  65. package/nitrogen/generated/ios/swift/Func_void_double.swift +46 -0
  66. package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +46 -0
  67. package/nitrogen/generated/ios/swift/Func_void_std__string_std__unordered_map_std__string__std__string_.swift +54 -0
  68. package/nitrogen/generated/ios/swift/Func_void_std__vector_std__string_.swift +46 -0
  69. package/nitrogen/generated/ios/swift/HybridVideoTrimSpec.swift +53 -0
  70. package/nitrogen/generated/ios/swift/HybridVideoTrimSpec_cxx.swift +222 -0
  71. package/nitrogen/generated/shared/c++/EditorConfig.hpp +245 -0
  72. package/nitrogen/generated/shared/c++/FileValidationResult.hpp +77 -0
  73. package/nitrogen/generated/shared/c++/HybridVideoTrimSpec.cpp +26 -0
  74. package/nitrogen/generated/shared/c++/HybridVideoTrimSpec.hpp +76 -0
  75. package/package.json +75 -71
  76. package/src/VideoTrim.nitro.ts +244 -0
  77. package/src/index.tsx +87 -258
  78. package/android/src/main/AndroidManifestDeprecated.xml +0 -3
  79. package/android/src/main/java/com/videotrim/VideoTrimModule.java +0 -600
  80. package/android/src/main/java/com/videotrim/VideoTrimPackage.java +0 -28
  81. package/android/src/main/java/com/videotrim/utils/VideoTrimmerUtil.java +0 -270
  82. package/ios/VideoTrim-Bridging-Header.h +0 -2
  83. package/ios/VideoTrim.mm +0 -17
  84. package/ios/VideoTrim.xcodeproj/project.pbxproj +0 -283
  85. package/lib/commonjs/index.js +0 -87
  86. package/lib/commonjs/index.js.map +0 -1
  87. package/lib/typescript/index.d.ts.map +0 -1
  88. package/react-native-video-trim.podspec +0 -41
@@ -0,0 +1,331 @@
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<margelo::nitro::videotrim::HybridVideoTrimSpec>
275
+ /**
276
+ * Specialized version of `std::shared_ptr<margelo::nitro::videotrim::HybridVideoTrimSpec>`.
277
+ */
278
+ using std__shared_ptr_margelo__nitro__videotrim__HybridVideoTrimSpec_ = std::shared_ptr<margelo::nitro::videotrim::HybridVideoTrimSpec>;
279
+ std::shared_ptr<margelo::nitro::videotrim::HybridVideoTrimSpec> create_std__shared_ptr_margelo__nitro__videotrim__HybridVideoTrimSpec_(void* _Nonnull swiftUnsafePointer);
280
+ void* _Nonnull get_std__shared_ptr_margelo__nitro__videotrim__HybridVideoTrimSpec_(std__shared_ptr_margelo__nitro__videotrim__HybridVideoTrimSpec_ cppType);
281
+
282
+ // pragma MARK: std::weak_ptr<margelo::nitro::videotrim::HybridVideoTrimSpec>
283
+ using std__weak_ptr_margelo__nitro__videotrim__HybridVideoTrimSpec_ = std::weak_ptr<margelo::nitro::videotrim::HybridVideoTrimSpec>;
284
+ 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; }
285
+
286
+ // pragma MARK: Result<void>
287
+ using Result_void_ = Result<void>;
288
+ inline Result_void_ create_Result_void_() {
289
+ return Result<void>::withValue();
290
+ }
291
+ inline Result_void_ create_Result_void_(const std::exception_ptr& error) {
292
+ return Result<void>::withError(error);
293
+ }
294
+
295
+ // pragma MARK: Result<std::shared_ptr<Promise<std::vector<std::string>>>>
296
+ using Result_std__shared_ptr_Promise_std__vector_std__string____ = Result<std::shared_ptr<Promise<std::vector<std::string>>>>;
297
+ 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) {
298
+ return Result<std::shared_ptr<Promise<std::vector<std::string>>>>::withValue(value);
299
+ }
300
+ 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) {
301
+ return Result<std::shared_ptr<Promise<std::vector<std::string>>>>::withError(error);
302
+ }
303
+
304
+ // pragma MARK: Result<std::shared_ptr<Promise<double>>>
305
+ using Result_std__shared_ptr_Promise_double___ = Result<std::shared_ptr<Promise<double>>>;
306
+ inline Result_std__shared_ptr_Promise_double___ create_Result_std__shared_ptr_Promise_double___(const std::shared_ptr<Promise<double>>& value) {
307
+ return Result<std::shared_ptr<Promise<double>>>::withValue(value);
308
+ }
309
+ inline Result_std__shared_ptr_Promise_double___ create_Result_std__shared_ptr_Promise_double___(const std::exception_ptr& error) {
310
+ return Result<std::shared_ptr<Promise<double>>>::withError(error);
311
+ }
312
+
313
+ // pragma MARK: Result<std::shared_ptr<Promise<bool>>>
314
+ using Result_std__shared_ptr_Promise_bool___ = Result<std::shared_ptr<Promise<bool>>>;
315
+ inline Result_std__shared_ptr_Promise_bool___ create_Result_std__shared_ptr_Promise_bool___(const std::shared_ptr<Promise<bool>>& value) {
316
+ return Result<std::shared_ptr<Promise<bool>>>::withValue(value);
317
+ }
318
+ inline Result_std__shared_ptr_Promise_bool___ create_Result_std__shared_ptr_Promise_bool___(const std::exception_ptr& error) {
319
+ return Result<std::shared_ptr<Promise<bool>>>::withError(error);
320
+ }
321
+
322
+ // pragma MARK: Result<std::shared_ptr<Promise<FileValidationResult>>>
323
+ using Result_std__shared_ptr_Promise_FileValidationResult___ = Result<std::shared_ptr<Promise<FileValidationResult>>>;
324
+ inline Result_std__shared_ptr_Promise_FileValidationResult___ create_Result_std__shared_ptr_Promise_FileValidationResult___(const std::shared_ptr<Promise<FileValidationResult>>& value) {
325
+ return Result<std::shared_ptr<Promise<FileValidationResult>>>::withValue(value);
326
+ }
327
+ inline Result_std__shared_ptr_Promise_FileValidationResult___ create_Result_std__shared_ptr_Promise_FileValidationResult___(const std::exception_ptr& error) {
328
+ return Result<std::shared_ptr<Promise<FileValidationResult>>>::withError(error);
329
+ }
330
+
331
+ } // namespace margelo::nitro::videotrim::bridge::swift
@@ -0,0 +1,53 @@
1
+ ///
2
+ /// VideoTrim-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 `EditorConfig` to properly resolve imports.
12
+ namespace margelo::nitro::videotrim { struct EditorConfig; }
13
+ // Forward declaration of `FileValidationResult` to properly resolve imports.
14
+ namespace margelo::nitro::videotrim { struct FileValidationResult; }
15
+ // Forward declaration of `HybridVideoTrimSpec` to properly resolve imports.
16
+ namespace margelo::nitro::videotrim { class HybridVideoTrimSpec; }
17
+
18
+ // Include C++ defined types
19
+ #include "EditorConfig.hpp"
20
+ #include "FileValidationResult.hpp"
21
+ #include "HybridVideoTrimSpec.hpp"
22
+ #include <NitroModules/Promise.hpp>
23
+ #include <NitroModules/Result.hpp>
24
+ #include <exception>
25
+ #include <functional>
26
+ #include <memory>
27
+ #include <string>
28
+ #include <unordered_map>
29
+ #include <vector>
30
+
31
+ // C++ helpers for Swift
32
+ #include "VideoTrim-Swift-Cxx-Bridge.hpp"
33
+
34
+ // Common C++ types used in Swift
35
+ #include <NitroModules/ArrayBufferHolder.hpp>
36
+ #include <NitroModules/AnyMapHolder.hpp>
37
+ #include <NitroModules/RuntimeError.hpp>
38
+
39
+ // Forward declarations of Swift defined types
40
+ // Forward declaration of `HybridVideoTrimSpec_cxx` to properly resolve imports.
41
+ namespace VideoTrim { class HybridVideoTrimSpec_cxx; }
42
+
43
+ // Include Swift defined types
44
+ #if __has_include("VideoTrim-Swift.h")
45
+ // This header is generated by Xcode/Swift on every app build.
46
+ // If it cannot be found, make sure the Swift module's name (= podspec name) is actually "VideoTrim".
47
+ #include "VideoTrim-Swift.h"
48
+ // Same as above, but used when building with frameworks (`use_frameworks`)
49
+ #elif __has_include(<VideoTrim/VideoTrim-Swift.h>)
50
+ #include <VideoTrim/VideoTrim-Swift.h>
51
+ #else
52
+ #error VideoTrim's autogenerated Swift header cannot be found! Make sure the Swift module's name (= podspec name) is actually "VideoTrim", and try building the app first.
53
+ #endif
@@ -0,0 +1,33 @@
1
+ ///
2
+ /// VideoTrimAutolinking.mm
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
+ #import <Foundation/Foundation.h>
9
+ #import <NitroModules/HybridObjectRegistry.hpp>
10
+ #import "VideoTrim-Swift-Cxx-Umbrella.hpp"
11
+ #import <type_traits>
12
+
13
+ #include "HybridVideoTrimSpecSwift.hpp"
14
+
15
+ @interface VideoTrimAutolinking : NSObject
16
+ @end
17
+
18
+ @implementation VideoTrimAutolinking
19
+
20
+ + (void) load {
21
+ using namespace margelo::nitro;
22
+ using namespace margelo::nitro::videotrim;
23
+
24
+ HybridObjectRegistry::registerHybridObjectConstructor(
25
+ "VideoTrim",
26
+ []() -> std::shared_ptr<HybridObject> {
27
+ std::shared_ptr<margelo::nitro::videotrim::HybridVideoTrimSpec> hybridObject = VideoTrim::VideoTrimAutolinking::createVideoTrim();
28
+ return hybridObject;
29
+ }
30
+ );
31
+ }
32
+
33
+ @end
@@ -0,0 +1,25 @@
1
+ ///
2
+ /// VideoTrimAutolinking.swift
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
+ public final class VideoTrimAutolinking {
9
+ public typealias bridge = margelo.nitro.videotrim.bridge.swift
10
+
11
+ /**
12
+ * Creates an instance of a Swift class that implements `HybridVideoTrimSpec`,
13
+ * and wraps it in a Swift class that can directly interop with C++ (`HybridVideoTrimSpec_cxx`)
14
+ *
15
+ * This is generated by Nitrogen and will initialize the class specified
16
+ * in the `"autolinking"` property of `nitro.json` (in this case, `VideoTrim`).
17
+ */
18
+ public static func createVideoTrim() -> bridge.std__shared_ptr_margelo__nitro__videotrim__HybridVideoTrimSpec_ {
19
+ let hybridObject = VideoTrim()
20
+ return { () -> bridge.std__shared_ptr_margelo__nitro__videotrim__HybridVideoTrimSpec_ in
21
+ let __cxxWrapped = hybridObject.getCxxWrapper()
22
+ return __cxxWrapped.getCxxPart()
23
+ }()
24
+ }
25
+ }
@@ -0,0 +1,11 @@
1
+ ///
2
+ /// HybridVideoTrimSpecSwift.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 "HybridVideoTrimSpecSwift.hpp"
9
+
10
+ namespace margelo::nitro::videotrim {
11
+ } // namespace margelo::nitro::videotrim
@@ -0,0 +1,116 @@
1
+ ///
2
+ /// HybridVideoTrimSpecSwift.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
+ #include "HybridVideoTrimSpec.hpp"
11
+
12
+ // Forward declaration of `HybridVideoTrimSpec_cxx` to properly resolve imports.
13
+ namespace VideoTrim { class HybridVideoTrimSpec_cxx; }
14
+
15
+ // Forward declaration of `EditorConfig` to properly resolve imports.
16
+ namespace margelo::nitro::videotrim { struct EditorConfig; }
17
+ // Forward declaration of `FileValidationResult` to properly resolve imports.
18
+ namespace margelo::nitro::videotrim { struct FileValidationResult; }
19
+
20
+ #include <string>
21
+ #include "EditorConfig.hpp"
22
+ #include <functional>
23
+ #include <unordered_map>
24
+ #include <NitroModules/Promise.hpp>
25
+ #include <vector>
26
+ #include "FileValidationResult.hpp"
27
+
28
+ #include "VideoTrim-Swift-Cxx-Umbrella.hpp"
29
+
30
+ namespace margelo::nitro::videotrim {
31
+
32
+ /**
33
+ * The C++ part of HybridVideoTrimSpec_cxx.swift.
34
+ *
35
+ * HybridVideoTrimSpecSwift (C++) accesses HybridVideoTrimSpec_cxx (Swift), and might
36
+ * contain some additional bridging code for C++ <> Swift interop.
37
+ *
38
+ * Since this obviously introduces an overhead, I hope at some point in
39
+ * the future, HybridVideoTrimSpec_cxx can directly inherit from the C++ class HybridVideoTrimSpec
40
+ * to simplify the whole structure and memory management.
41
+ */
42
+ class HybridVideoTrimSpecSwift: public virtual HybridVideoTrimSpec {
43
+ public:
44
+ // Constructor from a Swift instance
45
+ explicit HybridVideoTrimSpecSwift(const VideoTrim::HybridVideoTrimSpec_cxx& swiftPart):
46
+ HybridObject(HybridVideoTrimSpec::TAG),
47
+ _swiftPart(swiftPart) { }
48
+
49
+ public:
50
+ // Get the Swift part
51
+ inline VideoTrim::HybridVideoTrimSpec_cxx& getSwiftPart() noexcept {
52
+ return _swiftPart;
53
+ }
54
+
55
+ public:
56
+ // Get memory pressure
57
+ inline size_t getExternalMemorySize() noexcept override {
58
+ return _swiftPart.getMemorySize();
59
+ }
60
+
61
+ public:
62
+ // Properties
63
+
64
+
65
+ public:
66
+ // Methods
67
+ inline void showEditor(const std::string& filePath, const EditorConfig& config, const std::function<void(const std::string& /* eventName */, const std::unordered_map<std::string, std::string>& /* payload */)>& onEvent) override {
68
+ auto __result = _swiftPart.showEditor(filePath, config, onEvent);
69
+ if (__result.hasError()) [[unlikely]] {
70
+ std::rethrow_exception(__result.error());
71
+ }
72
+ }
73
+ inline std::shared_ptr<Promise<std::vector<std::string>>> listFiles() override {
74
+ auto __result = _swiftPart.listFiles();
75
+ if (__result.hasError()) [[unlikely]] {
76
+ std::rethrow_exception(__result.error());
77
+ }
78
+ auto __value = std::move(__result.value());
79
+ return __value;
80
+ }
81
+ inline std::shared_ptr<Promise<double>> cleanFiles() override {
82
+ auto __result = _swiftPart.cleanFiles();
83
+ if (__result.hasError()) [[unlikely]] {
84
+ std::rethrow_exception(__result.error());
85
+ }
86
+ auto __value = std::move(__result.value());
87
+ return __value;
88
+ }
89
+ inline std::shared_ptr<Promise<bool>> deleteFile(const std::string& filePath) override {
90
+ auto __result = _swiftPart.deleteFile(filePath);
91
+ if (__result.hasError()) [[unlikely]] {
92
+ std::rethrow_exception(__result.error());
93
+ }
94
+ auto __value = std::move(__result.value());
95
+ return __value;
96
+ }
97
+ inline void closeEditor(const std::function<void()>& onComplete) override {
98
+ auto __result = _swiftPart.closeEditor(onComplete);
99
+ if (__result.hasError()) [[unlikely]] {
100
+ std::rethrow_exception(__result.error());
101
+ }
102
+ }
103
+ inline std::shared_ptr<Promise<FileValidationResult>> isValidFile(const std::string& url) override {
104
+ auto __result = _swiftPart.isValidFile(url);
105
+ if (__result.hasError()) [[unlikely]] {
106
+ std::rethrow_exception(__result.error());
107
+ }
108
+ auto __value = std::move(__result.value());
109
+ return __value;
110
+ }
111
+
112
+ private:
113
+ VideoTrim::HybridVideoTrimSpec_cxx _swiftPart;
114
+ };
115
+
116
+ } // namespace margelo::nitro::videotrim