react-native-video-trim 4.1.0 → 5.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 (99) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +89 -76
  3. package/VideoTrim.podspec +3 -3
  4. package/android/build.gradle +6 -53
  5. package/android/gradle.properties +1 -1
  6. package/android/src/main/AndroidManifest.xml +1 -1
  7. package/android/src/main/java/com/{margelo/nitro/videotrim/VideoTrim.kt → videotrim/VideoTrimModule.kt} +246 -232
  8. package/android/src/main/java/com/videotrim/VideoTrimPackage.kt +33 -0
  9. package/android/src/main/java/com/{margelo/nitro/videotrim → videotrim}/enums/ErrorCode.java +1 -1
  10. package/android/src/main/java/com/{margelo/nitro/videotrim → videotrim}/interfaces/IVideoTrimmerView.java +1 -1
  11. package/android/src/main/java/com/{margelo/nitro/videotrim → videotrim}/interfaces/VideoTrimListener.java +5 -4
  12. package/android/src/main/java/com/{margelo/nitro/videotrim → videotrim}/utils/MediaMetadataUtil.java +1 -1
  13. package/android/src/main/java/com/{margelo/nitro/videotrim → videotrim}/utils/StorageUtil.java +1 -1
  14. package/android/src/main/java/com/{margelo/nitro/videotrim → videotrim}/utils/VideoTrimmerUtil.java +20 -18
  15. package/android/src/main/java/com/{margelo/nitro/videotrim → videotrim}/widgets/VideoTrimmerView.java +44 -45
  16. package/ios/AssetLoader.h +19 -0
  17. package/ios/AssetLoader.mm +87 -0
  18. package/ios/ErrorCode.h +9 -0
  19. package/ios/ProgressAlertController.h +15 -0
  20. package/ios/ProgressAlertController.mm +78 -0
  21. package/ios/VideoTrim.h +31 -0
  22. package/ios/VideoTrim.mm +663 -0
  23. package/ios/VideoTrimmer.h +67 -0
  24. package/ios/VideoTrimmer.mm +863 -0
  25. package/ios/VideoTrimmerThumb.h +23 -0
  26. package/ios/VideoTrimmerThumb.mm +175 -0
  27. package/ios/VideoTrimmerViewController.h +52 -0
  28. package/ios/VideoTrimmerViewController.mm +533 -0
  29. package/lib/module/NativeVideoTrim.js +5 -0
  30. package/lib/module/NativeVideoTrim.js.map +1 -0
  31. package/lib/module/index.js +22 -24
  32. package/lib/module/index.js.map +1 -1
  33. package/lib/typescript/src/NativeVideoTrim.d.ts +107 -0
  34. package/lib/typescript/src/NativeVideoTrim.d.ts.map +1 -0
  35. package/lib/typescript/src/index.d.ts +13 -10
  36. package/lib/typescript/src/index.d.ts.map +1 -1
  37. package/package.json +15 -18
  38. package/src/NativeVideoTrim.ts +113 -0
  39. package/src/index.tsx +26 -31
  40. package/android/CMakeLists.txt +0 -24
  41. package/android/src/main/cpp/cpp-adapter.cpp +0 -6
  42. package/android/src/main/java/com/margelo/nitro/videotrim/VideoTrimPackage.kt +0 -22
  43. package/ios/AssetLoader.swift +0 -99
  44. package/ios/ErrorCode.swift +0 -17
  45. package/ios/ProgressAlertController.swift +0 -100
  46. package/ios/VideoTrim.swift +0 -67
  47. package/ios/VideoTrimImpl.swift +0 -957
  48. package/ios/VideoTrimmer.swift +0 -872
  49. package/ios/VideoTrimmerThumb.swift +0 -175
  50. package/ios/VideoTrimmerViewController.swift +0 -557
  51. package/lib/module/VideoTrim.nitro.js +0 -4
  52. package/lib/module/VideoTrim.nitro.js.map +0 -1
  53. package/lib/typescript/src/VideoTrim.nitro.d.ts +0 -257
  54. package/lib/typescript/src/VideoTrim.nitro.d.ts.map +0 -1
  55. package/nitrogen/generated/android/c++/JEditorConfig.hpp +0 -237
  56. package/nitrogen/generated/android/c++/JFileValidationResult.hpp +0 -61
  57. package/nitrogen/generated/android/c++/JFunc_void.hpp +0 -74
  58. package/nitrogen/generated/android/c++/JFunc_void_std__string_std__unordered_map_std__string__std__string_.hpp +0 -89
  59. package/nitrogen/generated/android/c++/JHybridVideoTrimSpec.cpp +0 -151
  60. package/nitrogen/generated/android/c++/JHybridVideoTrimSpec.hpp +0 -68
  61. package/nitrogen/generated/android/c++/JTrimOptions.hpp +0 -109
  62. package/nitrogen/generated/android/kotlin/com/margelo/nitro/videotrim/EditorConfig.kt +0 -72
  63. package/nitrogen/generated/android/kotlin/com/margelo/nitro/videotrim/FileValidationResult.kt +0 -28
  64. package/nitrogen/generated/android/kotlin/com/margelo/nitro/videotrim/Func_void.kt +0 -80
  65. package/nitrogen/generated/android/kotlin/com/margelo/nitro/videotrim/Func_void_std__string_std__unordered_map_std__string__std__string_.kt +0 -80
  66. package/nitrogen/generated/android/kotlin/com/margelo/nitro/videotrim/HybridVideoTrimSpec.kt +0 -86
  67. package/nitrogen/generated/android/kotlin/com/margelo/nitro/videotrim/TrimOptions.kt +0 -40
  68. package/nitrogen/generated/android/kotlin/com/margelo/nitro/videotrim/videotrimOnLoad.kt +0 -35
  69. package/nitrogen/generated/android/videotrim+autolinking.cmake +0 -78
  70. package/nitrogen/generated/android/videotrim+autolinking.gradle +0 -27
  71. package/nitrogen/generated/android/videotrimOnLoad.cpp +0 -50
  72. package/nitrogen/generated/android/videotrimOnLoad.hpp +0 -25
  73. package/nitrogen/generated/ios/VideoTrim+autolinking.rb +0 -60
  74. package/nitrogen/generated/ios/VideoTrim-Swift-Cxx-Bridge.cpp +0 -96
  75. package/nitrogen/generated/ios/VideoTrim-Swift-Cxx-Bridge.hpp +0 -374
  76. package/nitrogen/generated/ios/VideoTrim-Swift-Cxx-Umbrella.hpp +0 -56
  77. package/nitrogen/generated/ios/VideoTrimAutolinking.mm +0 -33
  78. package/nitrogen/generated/ios/VideoTrimAutolinking.swift +0 -25
  79. package/nitrogen/generated/ios/c++/HybridVideoTrimSpecSwift.cpp +0 -11
  80. package/nitrogen/generated/ios/c++/HybridVideoTrimSpecSwift.hpp +0 -127
  81. package/nitrogen/generated/ios/swift/EditorConfig.swift +0 -541
  82. package/nitrogen/generated/ios/swift/FileValidationResult.swift +0 -57
  83. package/nitrogen/generated/ios/swift/Func_void.swift +0 -46
  84. package/nitrogen/generated/ios/swift/Func_void_FileValidationResult.swift +0 -46
  85. package/nitrogen/generated/ios/swift/Func_void_bool.swift +0 -46
  86. package/nitrogen/generated/ios/swift/Func_void_double.swift +0 -46
  87. package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +0 -46
  88. package/nitrogen/generated/ios/swift/Func_void_std__string.swift +0 -46
  89. package/nitrogen/generated/ios/swift/Func_void_std__string_std__unordered_map_std__string__std__string_.swift +0 -54
  90. package/nitrogen/generated/ios/swift/Func_void_std__vector_std__string_.swift +0 -46
  91. package/nitrogen/generated/ios/swift/HybridVideoTrimSpec.swift +0 -54
  92. package/nitrogen/generated/ios/swift/HybridVideoTrimSpec_cxx.swift +0 -241
  93. package/nitrogen/generated/ios/swift/TrimOptions.swift +0 -189
  94. package/nitrogen/generated/shared/c++/EditorConfig.hpp +0 -253
  95. package/nitrogen/generated/shared/c++/FileValidationResult.hpp +0 -77
  96. package/nitrogen/generated/shared/c++/HybridVideoTrimSpec.cpp +0 -27
  97. package/nitrogen/generated/shared/c++/HybridVideoTrimSpec.hpp +0 -80
  98. package/nitrogen/generated/shared/c++/TrimOptions.hpp +0 -125
  99. package/src/VideoTrim.nitro.ts +0 -263
@@ -1,374 +0,0 @@
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
@@ -1,56 +0,0 @@
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
- // Forward declaration of `TrimOptions` to properly resolve imports.
18
- namespace margelo::nitro::videotrim { struct TrimOptions; }
19
-
20
- // Include C++ defined types
21
- #include "EditorConfig.hpp"
22
- #include "FileValidationResult.hpp"
23
- #include "HybridVideoTrimSpec.hpp"
24
- #include "TrimOptions.hpp"
25
- #include <NitroModules/Promise.hpp>
26
- #include <NitroModules/Result.hpp>
27
- #include <exception>
28
- #include <functional>
29
- #include <memory>
30
- #include <string>
31
- #include <unordered_map>
32
- #include <vector>
33
-
34
- // C++ helpers for Swift
35
- #include "VideoTrim-Swift-Cxx-Bridge.hpp"
36
-
37
- // Common C++ types used in Swift
38
- #include <NitroModules/ArrayBufferHolder.hpp>
39
- #include <NitroModules/AnyMapHolder.hpp>
40
- #include <NitroModules/RuntimeError.hpp>
41
-
42
- // Forward declarations of Swift defined types
43
- // Forward declaration of `HybridVideoTrimSpec_cxx` to properly resolve imports.
44
- namespace VideoTrim { class HybridVideoTrimSpec_cxx; }
45
-
46
- // Include Swift defined types
47
- #if __has_include("VideoTrim-Swift.h")
48
- // This header is generated by Xcode/Swift on every app build.
49
- // If it cannot be found, make sure the Swift module's name (= podspec name) is actually "VideoTrim".
50
- #include "VideoTrim-Swift.h"
51
- // Same as above, but used when building with frameworks (`use_frameworks`)
52
- #elif __has_include(<VideoTrim/VideoTrim-Swift.h>)
53
- #include <VideoTrim/VideoTrim-Swift.h>
54
- #else
55
- #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.
56
- #endif
@@ -1,33 +0,0 @@
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
@@ -1,25 +0,0 @@
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
- }
@@ -1,11 +0,0 @@
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
@@ -1,127 +0,0 @@
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
- // Forward declaration of `TrimOptions` to properly resolve imports.
20
- namespace margelo::nitro::videotrim { struct TrimOptions; }
21
-
22
- #include <string>
23
- #include "EditorConfig.hpp"
24
- #include <functional>
25
- #include <unordered_map>
26
- #include <NitroModules/Promise.hpp>
27
- #include <vector>
28
- #include "FileValidationResult.hpp"
29
- #include "TrimOptions.hpp"
30
-
31
- #include "VideoTrim-Swift-Cxx-Umbrella.hpp"
32
-
33
- namespace margelo::nitro::videotrim {
34
-
35
- /**
36
- * The C++ part of HybridVideoTrimSpec_cxx.swift.
37
- *
38
- * HybridVideoTrimSpecSwift (C++) accesses HybridVideoTrimSpec_cxx (Swift), and might
39
- * contain some additional bridging code for C++ <> Swift interop.
40
- *
41
- * Since this obviously introduces an overhead, I hope at some point in
42
- * the future, HybridVideoTrimSpec_cxx can directly inherit from the C++ class HybridVideoTrimSpec
43
- * to simplify the whole structure and memory management.
44
- */
45
- class HybridVideoTrimSpecSwift: public virtual HybridVideoTrimSpec {
46
- public:
47
- // Constructor from a Swift instance
48
- explicit HybridVideoTrimSpecSwift(const VideoTrim::HybridVideoTrimSpec_cxx& swiftPart):
49
- HybridObject(HybridVideoTrimSpec::TAG),
50
- _swiftPart(swiftPart) { }
51
-
52
- public:
53
- // Get the Swift part
54
- inline VideoTrim::HybridVideoTrimSpec_cxx& getSwiftPart() noexcept {
55
- return _swiftPart;
56
- }
57
-
58
- public:
59
- // Get memory pressure
60
- inline size_t getExternalMemorySize() noexcept override {
61
- return _swiftPart.getMemorySize();
62
- }
63
-
64
- public:
65
- // Properties
66
-
67
-
68
- public:
69
- // Methods
70
- 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 {
71
- auto __result = _swiftPart.showEditor(filePath, config, onEvent);
72
- if (__result.hasError()) [[unlikely]] {
73
- std::rethrow_exception(__result.error());
74
- }
75
- }
76
- inline std::shared_ptr<Promise<std::vector<std::string>>> listFiles() override {
77
- auto __result = _swiftPart.listFiles();
78
- if (__result.hasError()) [[unlikely]] {
79
- std::rethrow_exception(__result.error());
80
- }
81
- auto __value = std::move(__result.value());
82
- return __value;
83
- }
84
- inline std::shared_ptr<Promise<double>> cleanFiles() override {
85
- auto __result = _swiftPart.cleanFiles();
86
- if (__result.hasError()) [[unlikely]] {
87
- std::rethrow_exception(__result.error());
88
- }
89
- auto __value = std::move(__result.value());
90
- return __value;
91
- }
92
- inline std::shared_ptr<Promise<bool>> deleteFile(const std::string& filePath) override {
93
- auto __result = _swiftPart.deleteFile(filePath);
94
- if (__result.hasError()) [[unlikely]] {
95
- std::rethrow_exception(__result.error());
96
- }
97
- auto __value = std::move(__result.value());
98
- return __value;
99
- }
100
- inline void closeEditor(const std::function<void()>& onComplete) override {
101
- auto __result = _swiftPart.closeEditor(onComplete);
102
- if (__result.hasError()) [[unlikely]] {
103
- std::rethrow_exception(__result.error());
104
- }
105
- }
106
- inline std::shared_ptr<Promise<FileValidationResult>> isValidFile(const std::string& url) override {
107
- auto __result = _swiftPart.isValidFile(url);
108
- if (__result.hasError()) [[unlikely]] {
109
- std::rethrow_exception(__result.error());
110
- }
111
- auto __value = std::move(__result.value());
112
- return __value;
113
- }
114
- inline std::shared_ptr<Promise<std::string>> trim(const std::string& url, const TrimOptions& options) override {
115
- auto __result = _swiftPart.trim(url, options);
116
- if (__result.hasError()) [[unlikely]] {
117
- std::rethrow_exception(__result.error());
118
- }
119
- auto __value = std::move(__result.value());
120
- return __value;
121
- }
122
-
123
- private:
124
- VideoTrim::HybridVideoTrimSpec_cxx _swiftPart;
125
- };
126
-
127
- } // namespace margelo::nitro::videotrim