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,189 @@
1
+ ///
2
+ /// TrimOptions.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
+ import NitroModules
9
+
10
+ /**
11
+ * Represents an instance of `TrimOptions`, backed by a C++ struct.
12
+ */
13
+ public typealias TrimOptions = margelo.nitro.videotrim.TrimOptions
14
+
15
+ public extension TrimOptions {
16
+ private typealias bridge = margelo.nitro.videotrim.bridge.swift
17
+
18
+ /**
19
+ * Create a new instance of `TrimOptions`.
20
+ */
21
+ init(startTime: Double, endTime: Double, saveToPhoto: Bool, type: String, outputExt: String, openDocumentsOnFinish: Bool, openShareSheetOnFinish: Bool, removeAfterSavedToPhoto: Bool, removeAfterFailedToSavePhoto: Bool, removeAfterSavedToDocuments: Bool, removeAfterFailedToSaveDocuments: Bool, removeAfterShared: Bool, removeAfterFailedToShare: Bool, enableRotation: Bool, rotationAngle: Double) {
22
+ self.init(startTime, endTime, saveToPhoto, std.string(type), std.string(outputExt), openDocumentsOnFinish, openShareSheetOnFinish, removeAfterSavedToPhoto, removeAfterFailedToSavePhoto, removeAfterSavedToDocuments, removeAfterFailedToSaveDocuments, removeAfterShared, removeAfterFailedToShare, enableRotation, rotationAngle)
23
+ }
24
+
25
+ var startTime: Double {
26
+ @inline(__always)
27
+ get {
28
+ return self.__startTime
29
+ }
30
+ @inline(__always)
31
+ set {
32
+ self.__startTime = newValue
33
+ }
34
+ }
35
+
36
+ var endTime: Double {
37
+ @inline(__always)
38
+ get {
39
+ return self.__endTime
40
+ }
41
+ @inline(__always)
42
+ set {
43
+ self.__endTime = newValue
44
+ }
45
+ }
46
+
47
+ var saveToPhoto: Bool {
48
+ @inline(__always)
49
+ get {
50
+ return self.__saveToPhoto
51
+ }
52
+ @inline(__always)
53
+ set {
54
+ self.__saveToPhoto = newValue
55
+ }
56
+ }
57
+
58
+ var type: String {
59
+ @inline(__always)
60
+ get {
61
+ return String(self.__type)
62
+ }
63
+ @inline(__always)
64
+ set {
65
+ self.__type = std.string(newValue)
66
+ }
67
+ }
68
+
69
+ var outputExt: String {
70
+ @inline(__always)
71
+ get {
72
+ return String(self.__outputExt)
73
+ }
74
+ @inline(__always)
75
+ set {
76
+ self.__outputExt = std.string(newValue)
77
+ }
78
+ }
79
+
80
+ var openDocumentsOnFinish: Bool {
81
+ @inline(__always)
82
+ get {
83
+ return self.__openDocumentsOnFinish
84
+ }
85
+ @inline(__always)
86
+ set {
87
+ self.__openDocumentsOnFinish = newValue
88
+ }
89
+ }
90
+
91
+ var openShareSheetOnFinish: Bool {
92
+ @inline(__always)
93
+ get {
94
+ return self.__openShareSheetOnFinish
95
+ }
96
+ @inline(__always)
97
+ set {
98
+ self.__openShareSheetOnFinish = newValue
99
+ }
100
+ }
101
+
102
+ var removeAfterSavedToPhoto: Bool {
103
+ @inline(__always)
104
+ get {
105
+ return self.__removeAfterSavedToPhoto
106
+ }
107
+ @inline(__always)
108
+ set {
109
+ self.__removeAfterSavedToPhoto = newValue
110
+ }
111
+ }
112
+
113
+ var removeAfterFailedToSavePhoto: Bool {
114
+ @inline(__always)
115
+ get {
116
+ return self.__removeAfterFailedToSavePhoto
117
+ }
118
+ @inline(__always)
119
+ set {
120
+ self.__removeAfterFailedToSavePhoto = newValue
121
+ }
122
+ }
123
+
124
+ var removeAfterSavedToDocuments: Bool {
125
+ @inline(__always)
126
+ get {
127
+ return self.__removeAfterSavedToDocuments
128
+ }
129
+ @inline(__always)
130
+ set {
131
+ self.__removeAfterSavedToDocuments = newValue
132
+ }
133
+ }
134
+
135
+ var removeAfterFailedToSaveDocuments: Bool {
136
+ @inline(__always)
137
+ get {
138
+ return self.__removeAfterFailedToSaveDocuments
139
+ }
140
+ @inline(__always)
141
+ set {
142
+ self.__removeAfterFailedToSaveDocuments = newValue
143
+ }
144
+ }
145
+
146
+ var removeAfterShared: Bool {
147
+ @inline(__always)
148
+ get {
149
+ return self.__removeAfterShared
150
+ }
151
+ @inline(__always)
152
+ set {
153
+ self.__removeAfterShared = newValue
154
+ }
155
+ }
156
+
157
+ var removeAfterFailedToShare: Bool {
158
+ @inline(__always)
159
+ get {
160
+ return self.__removeAfterFailedToShare
161
+ }
162
+ @inline(__always)
163
+ set {
164
+ self.__removeAfterFailedToShare = newValue
165
+ }
166
+ }
167
+
168
+ var enableRotation: Bool {
169
+ @inline(__always)
170
+ get {
171
+ return self.__enableRotation
172
+ }
173
+ @inline(__always)
174
+ set {
175
+ self.__enableRotation = newValue
176
+ }
177
+ }
178
+
179
+ var rotationAngle: Double {
180
+ @inline(__always)
181
+ get {
182
+ return self.__rotationAngle
183
+ }
184
+ @inline(__always)
185
+ set {
186
+ self.__rotationAngle = newValue
187
+ }
188
+ }
189
+ }
@@ -0,0 +1,253 @@
1
+ ///
2
+ /// EditorConfig.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
+ #if __has_include(<NitroModules/JSIConverter.hpp>)
11
+ #include <NitroModules/JSIConverter.hpp>
12
+ #else
13
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
14
+ #endif
15
+ #if __has_include(<NitroModules/NitroDefines.hpp>)
16
+ #include <NitroModules/NitroDefines.hpp>
17
+ #else
18
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
+ #endif
20
+
21
+
22
+
23
+ #include <string>
24
+
25
+ namespace margelo::nitro::videotrim {
26
+
27
+ /**
28
+ * A struct which can be represented as a JavaScript object (EditorConfig).
29
+ */
30
+ struct EditorConfig {
31
+ public:
32
+ bool enableHapticFeedback SWIFT_PRIVATE;
33
+ double maxDuration SWIFT_PRIVATE;
34
+ double minDuration SWIFT_PRIVATE;
35
+ std::string cancelButtonText SWIFT_PRIVATE;
36
+ std::string saveButtonText SWIFT_PRIVATE;
37
+ bool enableCancelDialog SWIFT_PRIVATE;
38
+ std::string cancelDialogTitle SWIFT_PRIVATE;
39
+ std::string cancelDialogMessage SWIFT_PRIVATE;
40
+ std::string cancelDialogCancelText SWIFT_PRIVATE;
41
+ std::string cancelDialogConfirmText SWIFT_PRIVATE;
42
+ bool enableSaveDialog SWIFT_PRIVATE;
43
+ std::string saveDialogTitle SWIFT_PRIVATE;
44
+ std::string saveDialogMessage SWIFT_PRIVATE;
45
+ std::string saveDialogCancelText SWIFT_PRIVATE;
46
+ std::string saveDialogConfirmText SWIFT_PRIVATE;
47
+ std::string trimmingText SWIFT_PRIVATE;
48
+ bool fullScreenModalIOS SWIFT_PRIVATE;
49
+ bool autoplay SWIFT_PRIVATE;
50
+ double jumpToPositionOnLoad SWIFT_PRIVATE;
51
+ bool closeWhenFinish SWIFT_PRIVATE;
52
+ bool enableCancelTrimming SWIFT_PRIVATE;
53
+ std::string cancelTrimmingButtonText SWIFT_PRIVATE;
54
+ bool enableCancelTrimmingDialog SWIFT_PRIVATE;
55
+ std::string cancelTrimmingDialogTitle SWIFT_PRIVATE;
56
+ std::string cancelTrimmingDialogMessage SWIFT_PRIVATE;
57
+ std::string cancelTrimmingDialogCancelText SWIFT_PRIVATE;
58
+ std::string cancelTrimmingDialogConfirmText SWIFT_PRIVATE;
59
+ std::string headerText SWIFT_PRIVATE;
60
+ double headerTextSize SWIFT_PRIVATE;
61
+ double headerTextColor SWIFT_PRIVATE;
62
+ bool alertOnFailToLoad SWIFT_PRIVATE;
63
+ std::string alertOnFailTitle SWIFT_PRIVATE;
64
+ std::string alertOnFailMessage SWIFT_PRIVATE;
65
+ std::string alertOnFailCloseText SWIFT_PRIVATE;
66
+ bool saveToPhoto SWIFT_PRIVATE;
67
+ std::string type SWIFT_PRIVATE;
68
+ std::string outputExt SWIFT_PRIVATE;
69
+ bool openDocumentsOnFinish SWIFT_PRIVATE;
70
+ bool openShareSheetOnFinish SWIFT_PRIVATE;
71
+ bool removeAfterSavedToPhoto SWIFT_PRIVATE;
72
+ bool removeAfterFailedToSavePhoto SWIFT_PRIVATE;
73
+ bool removeAfterSavedToDocuments SWIFT_PRIVATE;
74
+ bool removeAfterFailedToSaveDocuments SWIFT_PRIVATE;
75
+ bool removeAfterShared SWIFT_PRIVATE;
76
+ bool removeAfterFailedToShare SWIFT_PRIVATE;
77
+ bool enableRotation SWIFT_PRIVATE;
78
+ double rotationAngle SWIFT_PRIVATE;
79
+
80
+ public:
81
+ EditorConfig() = default;
82
+ explicit EditorConfig(bool enableHapticFeedback, double maxDuration, double minDuration, std::string cancelButtonText, std::string saveButtonText, bool enableCancelDialog, std::string cancelDialogTitle, std::string cancelDialogMessage, std::string cancelDialogCancelText, std::string cancelDialogConfirmText, bool enableSaveDialog, std::string saveDialogTitle, std::string saveDialogMessage, std::string saveDialogCancelText, std::string saveDialogConfirmText, std::string trimmingText, bool fullScreenModalIOS, bool autoplay, double jumpToPositionOnLoad, bool closeWhenFinish, bool enableCancelTrimming, std::string cancelTrimmingButtonText, bool enableCancelTrimmingDialog, std::string cancelTrimmingDialogTitle, std::string cancelTrimmingDialogMessage, std::string cancelTrimmingDialogCancelText, std::string cancelTrimmingDialogConfirmText, std::string headerText, double headerTextSize, double headerTextColor, bool alertOnFailToLoad, std::string alertOnFailTitle, std::string alertOnFailMessage, std::string alertOnFailCloseText, bool saveToPhoto, std::string type, std::string outputExt, bool openDocumentsOnFinish, bool openShareSheetOnFinish, bool removeAfterSavedToPhoto, bool removeAfterFailedToSavePhoto, bool removeAfterSavedToDocuments, bool removeAfterFailedToSaveDocuments, bool removeAfterShared, bool removeAfterFailedToShare, bool enableRotation, double rotationAngle): enableHapticFeedback(enableHapticFeedback), maxDuration(maxDuration), minDuration(minDuration), cancelButtonText(cancelButtonText), saveButtonText(saveButtonText), enableCancelDialog(enableCancelDialog), cancelDialogTitle(cancelDialogTitle), cancelDialogMessage(cancelDialogMessage), cancelDialogCancelText(cancelDialogCancelText), cancelDialogConfirmText(cancelDialogConfirmText), enableSaveDialog(enableSaveDialog), saveDialogTitle(saveDialogTitle), saveDialogMessage(saveDialogMessage), saveDialogCancelText(saveDialogCancelText), saveDialogConfirmText(saveDialogConfirmText), trimmingText(trimmingText), fullScreenModalIOS(fullScreenModalIOS), autoplay(autoplay), jumpToPositionOnLoad(jumpToPositionOnLoad), closeWhenFinish(closeWhenFinish), enableCancelTrimming(enableCancelTrimming), cancelTrimmingButtonText(cancelTrimmingButtonText), enableCancelTrimmingDialog(enableCancelTrimmingDialog), cancelTrimmingDialogTitle(cancelTrimmingDialogTitle), cancelTrimmingDialogMessage(cancelTrimmingDialogMessage), cancelTrimmingDialogCancelText(cancelTrimmingDialogCancelText), cancelTrimmingDialogConfirmText(cancelTrimmingDialogConfirmText), headerText(headerText), headerTextSize(headerTextSize), headerTextColor(headerTextColor), alertOnFailToLoad(alertOnFailToLoad), alertOnFailTitle(alertOnFailTitle), alertOnFailMessage(alertOnFailMessage), alertOnFailCloseText(alertOnFailCloseText), saveToPhoto(saveToPhoto), type(type), outputExt(outputExt), openDocumentsOnFinish(openDocumentsOnFinish), openShareSheetOnFinish(openShareSheetOnFinish), removeAfterSavedToPhoto(removeAfterSavedToPhoto), removeAfterFailedToSavePhoto(removeAfterFailedToSavePhoto), removeAfterSavedToDocuments(removeAfterSavedToDocuments), removeAfterFailedToSaveDocuments(removeAfterFailedToSaveDocuments), removeAfterShared(removeAfterShared), removeAfterFailedToShare(removeAfterFailedToShare), enableRotation(enableRotation), rotationAngle(rotationAngle) {}
83
+ };
84
+
85
+ } // namespace margelo::nitro::videotrim
86
+
87
+ namespace margelo::nitro {
88
+
89
+ using namespace margelo::nitro::videotrim;
90
+
91
+ // C++ EditorConfig <> JS EditorConfig (object)
92
+ template <>
93
+ struct JSIConverter<EditorConfig> final {
94
+ static inline EditorConfig fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
95
+ jsi::Object obj = arg.asObject(runtime);
96
+ return EditorConfig(
97
+ JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, "enableHapticFeedback")),
98
+ JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "maxDuration")),
99
+ JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "minDuration")),
100
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "cancelButtonText")),
101
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "saveButtonText")),
102
+ JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, "enableCancelDialog")),
103
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "cancelDialogTitle")),
104
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "cancelDialogMessage")),
105
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "cancelDialogCancelText")),
106
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "cancelDialogConfirmText")),
107
+ JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, "enableSaveDialog")),
108
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "saveDialogTitle")),
109
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "saveDialogMessage")),
110
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "saveDialogCancelText")),
111
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "saveDialogConfirmText")),
112
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "trimmingText")),
113
+ JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, "fullScreenModalIOS")),
114
+ JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, "autoplay")),
115
+ JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "jumpToPositionOnLoad")),
116
+ JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, "closeWhenFinish")),
117
+ JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, "enableCancelTrimming")),
118
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "cancelTrimmingButtonText")),
119
+ JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, "enableCancelTrimmingDialog")),
120
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "cancelTrimmingDialogTitle")),
121
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "cancelTrimmingDialogMessage")),
122
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "cancelTrimmingDialogCancelText")),
123
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "cancelTrimmingDialogConfirmText")),
124
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "headerText")),
125
+ JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "headerTextSize")),
126
+ JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "headerTextColor")),
127
+ JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, "alertOnFailToLoad")),
128
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "alertOnFailTitle")),
129
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "alertOnFailMessage")),
130
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "alertOnFailCloseText")),
131
+ JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, "saveToPhoto")),
132
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "type")),
133
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "outputExt")),
134
+ JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, "openDocumentsOnFinish")),
135
+ JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, "openShareSheetOnFinish")),
136
+ JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, "removeAfterSavedToPhoto")),
137
+ JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, "removeAfterFailedToSavePhoto")),
138
+ JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, "removeAfterSavedToDocuments")),
139
+ JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, "removeAfterFailedToSaveDocuments")),
140
+ JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, "removeAfterShared")),
141
+ JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, "removeAfterFailedToShare")),
142
+ JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, "enableRotation")),
143
+ JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "rotationAngle"))
144
+ );
145
+ }
146
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const EditorConfig& arg) {
147
+ jsi::Object obj(runtime);
148
+ obj.setProperty(runtime, "enableHapticFeedback", JSIConverter<bool>::toJSI(runtime, arg.enableHapticFeedback));
149
+ obj.setProperty(runtime, "maxDuration", JSIConverter<double>::toJSI(runtime, arg.maxDuration));
150
+ obj.setProperty(runtime, "minDuration", JSIConverter<double>::toJSI(runtime, arg.minDuration));
151
+ obj.setProperty(runtime, "cancelButtonText", JSIConverter<std::string>::toJSI(runtime, arg.cancelButtonText));
152
+ obj.setProperty(runtime, "saveButtonText", JSIConverter<std::string>::toJSI(runtime, arg.saveButtonText));
153
+ obj.setProperty(runtime, "enableCancelDialog", JSIConverter<bool>::toJSI(runtime, arg.enableCancelDialog));
154
+ obj.setProperty(runtime, "cancelDialogTitle", JSIConverter<std::string>::toJSI(runtime, arg.cancelDialogTitle));
155
+ obj.setProperty(runtime, "cancelDialogMessage", JSIConverter<std::string>::toJSI(runtime, arg.cancelDialogMessage));
156
+ obj.setProperty(runtime, "cancelDialogCancelText", JSIConverter<std::string>::toJSI(runtime, arg.cancelDialogCancelText));
157
+ obj.setProperty(runtime, "cancelDialogConfirmText", JSIConverter<std::string>::toJSI(runtime, arg.cancelDialogConfirmText));
158
+ obj.setProperty(runtime, "enableSaveDialog", JSIConverter<bool>::toJSI(runtime, arg.enableSaveDialog));
159
+ obj.setProperty(runtime, "saveDialogTitle", JSIConverter<std::string>::toJSI(runtime, arg.saveDialogTitle));
160
+ obj.setProperty(runtime, "saveDialogMessage", JSIConverter<std::string>::toJSI(runtime, arg.saveDialogMessage));
161
+ obj.setProperty(runtime, "saveDialogCancelText", JSIConverter<std::string>::toJSI(runtime, arg.saveDialogCancelText));
162
+ obj.setProperty(runtime, "saveDialogConfirmText", JSIConverter<std::string>::toJSI(runtime, arg.saveDialogConfirmText));
163
+ obj.setProperty(runtime, "trimmingText", JSIConverter<std::string>::toJSI(runtime, arg.trimmingText));
164
+ obj.setProperty(runtime, "fullScreenModalIOS", JSIConverter<bool>::toJSI(runtime, arg.fullScreenModalIOS));
165
+ obj.setProperty(runtime, "autoplay", JSIConverter<bool>::toJSI(runtime, arg.autoplay));
166
+ obj.setProperty(runtime, "jumpToPositionOnLoad", JSIConverter<double>::toJSI(runtime, arg.jumpToPositionOnLoad));
167
+ obj.setProperty(runtime, "closeWhenFinish", JSIConverter<bool>::toJSI(runtime, arg.closeWhenFinish));
168
+ obj.setProperty(runtime, "enableCancelTrimming", JSIConverter<bool>::toJSI(runtime, arg.enableCancelTrimming));
169
+ obj.setProperty(runtime, "cancelTrimmingButtonText", JSIConverter<std::string>::toJSI(runtime, arg.cancelTrimmingButtonText));
170
+ obj.setProperty(runtime, "enableCancelTrimmingDialog", JSIConverter<bool>::toJSI(runtime, arg.enableCancelTrimmingDialog));
171
+ obj.setProperty(runtime, "cancelTrimmingDialogTitle", JSIConverter<std::string>::toJSI(runtime, arg.cancelTrimmingDialogTitle));
172
+ obj.setProperty(runtime, "cancelTrimmingDialogMessage", JSIConverter<std::string>::toJSI(runtime, arg.cancelTrimmingDialogMessage));
173
+ obj.setProperty(runtime, "cancelTrimmingDialogCancelText", JSIConverter<std::string>::toJSI(runtime, arg.cancelTrimmingDialogCancelText));
174
+ obj.setProperty(runtime, "cancelTrimmingDialogConfirmText", JSIConverter<std::string>::toJSI(runtime, arg.cancelTrimmingDialogConfirmText));
175
+ obj.setProperty(runtime, "headerText", JSIConverter<std::string>::toJSI(runtime, arg.headerText));
176
+ obj.setProperty(runtime, "headerTextSize", JSIConverter<double>::toJSI(runtime, arg.headerTextSize));
177
+ obj.setProperty(runtime, "headerTextColor", JSIConverter<double>::toJSI(runtime, arg.headerTextColor));
178
+ obj.setProperty(runtime, "alertOnFailToLoad", JSIConverter<bool>::toJSI(runtime, arg.alertOnFailToLoad));
179
+ obj.setProperty(runtime, "alertOnFailTitle", JSIConverter<std::string>::toJSI(runtime, arg.alertOnFailTitle));
180
+ obj.setProperty(runtime, "alertOnFailMessage", JSIConverter<std::string>::toJSI(runtime, arg.alertOnFailMessage));
181
+ obj.setProperty(runtime, "alertOnFailCloseText", JSIConverter<std::string>::toJSI(runtime, arg.alertOnFailCloseText));
182
+ obj.setProperty(runtime, "saveToPhoto", JSIConverter<bool>::toJSI(runtime, arg.saveToPhoto));
183
+ obj.setProperty(runtime, "type", JSIConverter<std::string>::toJSI(runtime, arg.type));
184
+ obj.setProperty(runtime, "outputExt", JSIConverter<std::string>::toJSI(runtime, arg.outputExt));
185
+ obj.setProperty(runtime, "openDocumentsOnFinish", JSIConverter<bool>::toJSI(runtime, arg.openDocumentsOnFinish));
186
+ obj.setProperty(runtime, "openShareSheetOnFinish", JSIConverter<bool>::toJSI(runtime, arg.openShareSheetOnFinish));
187
+ obj.setProperty(runtime, "removeAfterSavedToPhoto", JSIConverter<bool>::toJSI(runtime, arg.removeAfterSavedToPhoto));
188
+ obj.setProperty(runtime, "removeAfterFailedToSavePhoto", JSIConverter<bool>::toJSI(runtime, arg.removeAfterFailedToSavePhoto));
189
+ obj.setProperty(runtime, "removeAfterSavedToDocuments", JSIConverter<bool>::toJSI(runtime, arg.removeAfterSavedToDocuments));
190
+ obj.setProperty(runtime, "removeAfterFailedToSaveDocuments", JSIConverter<bool>::toJSI(runtime, arg.removeAfterFailedToSaveDocuments));
191
+ obj.setProperty(runtime, "removeAfterShared", JSIConverter<bool>::toJSI(runtime, arg.removeAfterShared));
192
+ obj.setProperty(runtime, "removeAfterFailedToShare", JSIConverter<bool>::toJSI(runtime, arg.removeAfterFailedToShare));
193
+ obj.setProperty(runtime, "enableRotation", JSIConverter<bool>::toJSI(runtime, arg.enableRotation));
194
+ obj.setProperty(runtime, "rotationAngle", JSIConverter<double>::toJSI(runtime, arg.rotationAngle));
195
+ return obj;
196
+ }
197
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
198
+ if (!value.isObject()) {
199
+ return false;
200
+ }
201
+ jsi::Object obj = value.getObject(runtime);
202
+ if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, "enableHapticFeedback"))) return false;
203
+ if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "maxDuration"))) return false;
204
+ if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "minDuration"))) return false;
205
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "cancelButtonText"))) return false;
206
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "saveButtonText"))) return false;
207
+ if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, "enableCancelDialog"))) return false;
208
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "cancelDialogTitle"))) return false;
209
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "cancelDialogMessage"))) return false;
210
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "cancelDialogCancelText"))) return false;
211
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "cancelDialogConfirmText"))) return false;
212
+ if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, "enableSaveDialog"))) return false;
213
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "saveDialogTitle"))) return false;
214
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "saveDialogMessage"))) return false;
215
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "saveDialogCancelText"))) return false;
216
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "saveDialogConfirmText"))) return false;
217
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "trimmingText"))) return false;
218
+ if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, "fullScreenModalIOS"))) return false;
219
+ if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, "autoplay"))) return false;
220
+ if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "jumpToPositionOnLoad"))) return false;
221
+ if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, "closeWhenFinish"))) return false;
222
+ if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, "enableCancelTrimming"))) return false;
223
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "cancelTrimmingButtonText"))) return false;
224
+ if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, "enableCancelTrimmingDialog"))) return false;
225
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "cancelTrimmingDialogTitle"))) return false;
226
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "cancelTrimmingDialogMessage"))) return false;
227
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "cancelTrimmingDialogCancelText"))) return false;
228
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "cancelTrimmingDialogConfirmText"))) return false;
229
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "headerText"))) return false;
230
+ if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "headerTextSize"))) return false;
231
+ if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "headerTextColor"))) return false;
232
+ if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, "alertOnFailToLoad"))) return false;
233
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "alertOnFailTitle"))) return false;
234
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "alertOnFailMessage"))) return false;
235
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "alertOnFailCloseText"))) return false;
236
+ if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, "saveToPhoto"))) return false;
237
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "type"))) return false;
238
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "outputExt"))) return false;
239
+ if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, "openDocumentsOnFinish"))) return false;
240
+ if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, "openShareSheetOnFinish"))) return false;
241
+ if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, "removeAfterSavedToPhoto"))) return false;
242
+ if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, "removeAfterFailedToSavePhoto"))) return false;
243
+ if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, "removeAfterSavedToDocuments"))) return false;
244
+ if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, "removeAfterFailedToSaveDocuments"))) return false;
245
+ if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, "removeAfterShared"))) return false;
246
+ if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, "removeAfterFailedToShare"))) return false;
247
+ if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, "enableRotation"))) return false;
248
+ if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "rotationAngle"))) return false;
249
+ return true;
250
+ }
251
+ };
252
+
253
+ } // namespace margelo::nitro
@@ -0,0 +1,77 @@
1
+ ///
2
+ /// FileValidationResult.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
+ #if __has_include(<NitroModules/JSIConverter.hpp>)
11
+ #include <NitroModules/JSIConverter.hpp>
12
+ #else
13
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
14
+ #endif
15
+ #if __has_include(<NitroModules/NitroDefines.hpp>)
16
+ #include <NitroModules/NitroDefines.hpp>
17
+ #else
18
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
19
+ #endif
20
+
21
+
22
+
23
+ #include <string>
24
+
25
+ namespace margelo::nitro::videotrim {
26
+
27
+ /**
28
+ * A struct which can be represented as a JavaScript object (FileValidationResult).
29
+ */
30
+ struct FileValidationResult {
31
+ public:
32
+ bool isValid SWIFT_PRIVATE;
33
+ std::string fileType SWIFT_PRIVATE;
34
+ double duration SWIFT_PRIVATE;
35
+
36
+ public:
37
+ FileValidationResult() = default;
38
+ explicit FileValidationResult(bool isValid, std::string fileType, double duration): isValid(isValid), fileType(fileType), duration(duration) {}
39
+ };
40
+
41
+ } // namespace margelo::nitro::videotrim
42
+
43
+ namespace margelo::nitro {
44
+
45
+ using namespace margelo::nitro::videotrim;
46
+
47
+ // C++ FileValidationResult <> JS FileValidationResult (object)
48
+ template <>
49
+ struct JSIConverter<FileValidationResult> final {
50
+ static inline FileValidationResult fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
51
+ jsi::Object obj = arg.asObject(runtime);
52
+ return FileValidationResult(
53
+ JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, "isValid")),
54
+ JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "fileType")),
55
+ JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "duration"))
56
+ );
57
+ }
58
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const FileValidationResult& arg) {
59
+ jsi::Object obj(runtime);
60
+ obj.setProperty(runtime, "isValid", JSIConverter<bool>::toJSI(runtime, arg.isValid));
61
+ obj.setProperty(runtime, "fileType", JSIConverter<std::string>::toJSI(runtime, arg.fileType));
62
+ obj.setProperty(runtime, "duration", JSIConverter<double>::toJSI(runtime, arg.duration));
63
+ return obj;
64
+ }
65
+ static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
66
+ if (!value.isObject()) {
67
+ return false;
68
+ }
69
+ jsi::Object obj = value.getObject(runtime);
70
+ if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, "isValid"))) return false;
71
+ if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "fileType"))) return false;
72
+ if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "duration"))) return false;
73
+ return true;
74
+ }
75
+ };
76
+
77
+ } // namespace margelo::nitro
@@ -0,0 +1,27 @@
1
+ ///
2
+ /// HybridVideoTrimSpec.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 "HybridVideoTrimSpec.hpp"
9
+
10
+ namespace margelo::nitro::videotrim {
11
+
12
+ void HybridVideoTrimSpec::loadHybridMethods() {
13
+ // load base methods/properties
14
+ HybridObject::loadHybridMethods();
15
+ // load custom methods/properties
16
+ registerHybrids(this, [](Prototype& prototype) {
17
+ prototype.registerHybridMethod("showEditor", &HybridVideoTrimSpec::showEditor);
18
+ prototype.registerHybridMethod("listFiles", &HybridVideoTrimSpec::listFiles);
19
+ prototype.registerHybridMethod("cleanFiles", &HybridVideoTrimSpec::cleanFiles);
20
+ prototype.registerHybridMethod("deleteFile", &HybridVideoTrimSpec::deleteFile);
21
+ prototype.registerHybridMethod("closeEditor", &HybridVideoTrimSpec::closeEditor);
22
+ prototype.registerHybridMethod("isValidFile", &HybridVideoTrimSpec::isValidFile);
23
+ prototype.registerHybridMethod("trim", &HybridVideoTrimSpec::trim);
24
+ });
25
+ }
26
+
27
+ } // namespace margelo::nitro::videotrim
@@ -0,0 +1,80 @@
1
+ ///
2
+ /// HybridVideoTrimSpec.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
+ #if __has_include(<NitroModules/HybridObject.hpp>)
11
+ #include <NitroModules/HybridObject.hpp>
12
+ #else
13
+ #error NitroModules cannot be found! Are you sure you installed NitroModules properly?
14
+ #endif
15
+
16
+ // Forward declaration of `EditorConfig` to properly resolve imports.
17
+ namespace margelo::nitro::videotrim { struct EditorConfig; }
18
+ // Forward declaration of `FileValidationResult` to properly resolve imports.
19
+ namespace margelo::nitro::videotrim { struct FileValidationResult; }
20
+ // Forward declaration of `TrimOptions` to properly resolve imports.
21
+ namespace margelo::nitro::videotrim { struct TrimOptions; }
22
+
23
+ #include <string>
24
+ #include "EditorConfig.hpp"
25
+ #include <functional>
26
+ #include <unordered_map>
27
+ #include <NitroModules/Promise.hpp>
28
+ #include <vector>
29
+ #include "FileValidationResult.hpp"
30
+ #include "TrimOptions.hpp"
31
+
32
+ namespace margelo::nitro::videotrim {
33
+
34
+ using namespace margelo::nitro;
35
+
36
+ /**
37
+ * An abstract base class for `VideoTrim`
38
+ * Inherit this class to create instances of `HybridVideoTrimSpec` in C++.
39
+ * You must explicitly call `HybridObject`'s constructor yourself, because it is virtual.
40
+ * @example
41
+ * ```cpp
42
+ * class HybridVideoTrim: public HybridVideoTrimSpec {
43
+ * public:
44
+ * HybridVideoTrim(...): HybridObject(TAG) { ... }
45
+ * // ...
46
+ * };
47
+ * ```
48
+ */
49
+ class HybridVideoTrimSpec: public virtual HybridObject {
50
+ public:
51
+ // Constructor
52
+ explicit HybridVideoTrimSpec(): HybridObject(TAG) { }
53
+
54
+ // Destructor
55
+ ~HybridVideoTrimSpec() override = default;
56
+
57
+ public:
58
+ // Properties
59
+
60
+
61
+ public:
62
+ // Methods
63
+ virtual 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) = 0;
64
+ virtual std::shared_ptr<Promise<std::vector<std::string>>> listFiles() = 0;
65
+ virtual std::shared_ptr<Promise<double>> cleanFiles() = 0;
66
+ virtual std::shared_ptr<Promise<bool>> deleteFile(const std::string& filePath) = 0;
67
+ virtual void closeEditor(const std::function<void()>& onComplete) = 0;
68
+ virtual std::shared_ptr<Promise<FileValidationResult>> isValidFile(const std::string& url) = 0;
69
+ virtual std::shared_ptr<Promise<std::string>> trim(const std::string& url, const TrimOptions& options) = 0;
70
+
71
+ protected:
72
+ // Hybrid Setup
73
+ void loadHybridMethods() override;
74
+
75
+ protected:
76
+ // Tag for logging
77
+ static constexpr auto TAG = "VideoTrim";
78
+ };
79
+
80
+ } // namespace margelo::nitro::videotrim