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.
- package/LICENSE +1 -1
- package/README.md +80 -63
- package/VideoTrim.podspec +24 -0
- package/android/CMakeLists.txt +24 -0
- package/android/build.gradle +82 -49
- package/android/gradle.properties +7 -5
- package/android/src/main/AndroidManifest.xml +4 -2
- package/android/src/main/cpp/cpp-adapter.cpp +6 -0
- package/android/src/main/java/com/margelo/nitro/videotrim/VideoTrim.kt +646 -0
- package/android/src/main/java/com/margelo/nitro/videotrim/VideoTrimPackage.kt +22 -0
- package/android/src/main/java/com/{videotrim → margelo/nitro/videotrim}/enums/ErrorCode.java +1 -1
- package/android/src/main/java/com/{videotrim → margelo/nitro/videotrim}/interfaces/IVideoTrimmerView.java +1 -1
- package/android/src/main/java/com/{videotrim → margelo/nitro/videotrim}/interfaces/VideoTrimListener.java +6 -5
- package/android/src/main/java/com/{videotrim → margelo/nitro/videotrim}/utils/MediaMetadataUtil.java +1 -1
- package/android/src/main/java/com/{videotrim → margelo/nitro/videotrim}/utils/StorageUtil.java +3 -1
- package/android/src/main/java/com/{videotrim → margelo/nitro/videotrim}/utils/VideoTrimmerUtil.java +51 -41
- package/android/src/main/java/com/{videotrim → margelo/nitro/videotrim}/widgets/VideoTrimmerView.java +45 -69
- package/ios/AssetLoader.swift +2 -2
- package/ios/ErrorCode.swift +2 -2
- package/ios/ProgressAlertController.swift +2 -2
- package/ios/VideoTrim.swift +52 -835
- package/ios/VideoTrimImpl.swift +957 -0
- package/ios/VideoTrimmer.swift +2 -3
- package/ios/VideoTrimmerThumb.swift +33 -26
- package/ios/VideoTrimmerViewController.swift +47 -28
- package/lib/module/VideoTrim.nitro.js +4 -0
- package/lib/module/VideoTrim.nitro.js.map +1 -0
- package/lib/module/index.js +98 -22
- package/lib/module/index.js.map +1 -1
- package/lib/module/package.json +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/{index.d.ts → src/VideoTrim.nitro.d.ts} +125 -134
- package/lib/typescript/src/VideoTrim.nitro.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +49 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/nitrogen/generated/android/c++/JEditorConfig.hpp +237 -0
- package/nitrogen/generated/android/c++/JFileValidationResult.hpp +61 -0
- package/nitrogen/generated/android/c++/JFunc_void.hpp +74 -0
- package/nitrogen/generated/android/c++/JFunc_void_std__string_std__unordered_map_std__string__std__string_.hpp +89 -0
- package/nitrogen/generated/android/c++/JHybridVideoTrimSpec.cpp +151 -0
- package/nitrogen/generated/android/c++/JHybridVideoTrimSpec.hpp +68 -0
- package/nitrogen/generated/android/c++/JTrimOptions.hpp +109 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/videotrim/EditorConfig.kt +72 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/videotrim/FileValidationResult.kt +28 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/videotrim/Func_void.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/videotrim/Func_void_std__string_std__unordered_map_std__string__std__string_.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/videotrim/HybridVideoTrimSpec.kt +86 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/videotrim/TrimOptions.kt +40 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/videotrim/videotrimOnLoad.kt +35 -0
- package/nitrogen/generated/android/videotrim+autolinking.cmake +78 -0
- package/nitrogen/generated/android/videotrim+autolinking.gradle +27 -0
- package/nitrogen/generated/android/videotrimOnLoad.cpp +50 -0
- package/nitrogen/generated/android/videotrimOnLoad.hpp +25 -0
- package/nitrogen/generated/ios/VideoTrim+autolinking.rb +60 -0
- package/nitrogen/generated/ios/VideoTrim-Swift-Cxx-Bridge.cpp +96 -0
- package/nitrogen/generated/ios/VideoTrim-Swift-Cxx-Bridge.hpp +374 -0
- package/nitrogen/generated/ios/VideoTrim-Swift-Cxx-Umbrella.hpp +56 -0
- package/nitrogen/generated/ios/VideoTrimAutolinking.mm +33 -0
- package/nitrogen/generated/ios/VideoTrimAutolinking.swift +25 -0
- package/nitrogen/generated/ios/c++/HybridVideoTrimSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridVideoTrimSpecSwift.hpp +127 -0
- package/nitrogen/generated/ios/swift/EditorConfig.swift +541 -0
- package/nitrogen/generated/ios/swift/FileValidationResult.swift +57 -0
- package/nitrogen/generated/ios/swift/Func_void.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_FileValidationResult.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_bool.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_double.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__string.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__string_std__unordered_map_std__string__std__string_.swift +54 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_std__string_.swift +46 -0
- package/nitrogen/generated/ios/swift/HybridVideoTrimSpec.swift +54 -0
- package/nitrogen/generated/ios/swift/HybridVideoTrimSpec_cxx.swift +241 -0
- package/nitrogen/generated/ios/swift/TrimOptions.swift +189 -0
- package/nitrogen/generated/shared/c++/EditorConfig.hpp +253 -0
- package/nitrogen/generated/shared/c++/FileValidationResult.hpp +77 -0
- package/nitrogen/generated/shared/c++/HybridVideoTrimSpec.cpp +27 -0
- package/nitrogen/generated/shared/c++/HybridVideoTrimSpec.hpp +80 -0
- package/nitrogen/generated/shared/c++/TrimOptions.hpp +125 -0
- package/package.json +75 -71
- package/src/VideoTrim.nitro.ts +263 -0
- package/src/index.tsx +120 -257
- package/android/src/main/AndroidManifestDeprecated.xml +0 -3
- package/android/src/main/java/com/videotrim/VideoTrimModule.java +0 -603
- package/android/src/main/java/com/videotrim/VideoTrimPackage.java +0 -28
- package/ios/VideoTrim-Bridging-Header.h +0 -2
- package/ios/VideoTrim.mm +0 -17
- package/ios/VideoTrim.xcodeproj/project.pbxproj +0 -283
- package/lib/commonjs/index.js +0 -87
- package/lib/commonjs/index.js.map +0 -1
- package/lib/typescript/index.d.ts.map +0 -1
- package/react-native-video-trim.podspec +0 -43
|
@@ -1,266 +1,257 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export interface
|
|
1
|
+
import type { HybridObject } from 'react-native-nitro-modules';
|
|
2
|
+
export interface BaseOptions {
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
* @default
|
|
4
|
+
* Save the output file to Photos Library. Only video is supported. Note that you have to make sure you have permission to save to Photos Library.
|
|
5
|
+
* @default false
|
|
6
6
|
*/
|
|
7
|
-
|
|
7
|
+
saveToPhoto: boolean;
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* Type of the file to edit. If video file, recommend to use `video`. If audio file, recommend to use `audio`.
|
|
10
|
+
* @default "video"
|
|
11
|
+
*/
|
|
12
|
+
type: string;
|
|
13
|
+
/**
|
|
14
|
+
* Output file extension. If video file, recommend to use `mp4` or `mov`. If audio file, recommend to use `wav` or `m4a`.
|
|
15
|
+
* @default "mp4"
|
|
16
|
+
* @example "mp4", "mov", "wav", "m4a", "3gp", "avi", "mkv", "flv", "wmv", "webm"
|
|
17
|
+
*/
|
|
18
|
+
outputExt: string;
|
|
19
|
+
/**
|
|
20
|
+
* Whether to open Documents app after finish editing
|
|
21
|
+
* @default false
|
|
22
|
+
*/
|
|
23
|
+
openDocumentsOnFinish: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Whether to open Share Sheet after finish editing
|
|
26
|
+
* @default false
|
|
27
|
+
*/
|
|
28
|
+
openShareSheetOnFinish: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Remove the file after saved to Photos Library
|
|
31
|
+
* @default false
|
|
32
|
+
*/
|
|
33
|
+
removeAfterSavedToPhoto: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Remove the file after failed to save to Photos Library
|
|
10
36
|
* @default false
|
|
11
37
|
*/
|
|
12
|
-
|
|
13
|
-
|
|
38
|
+
removeAfterFailedToSavePhoto: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Remove the file after saved to Documents app
|
|
41
|
+
* @default false
|
|
42
|
+
*/
|
|
43
|
+
removeAfterSavedToDocuments: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Remove the file after failed to save to Documents app
|
|
46
|
+
* @default false
|
|
47
|
+
*/
|
|
48
|
+
removeAfterFailedToSaveDocuments: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Remove the file after shared to other apps. Currently only support iOS, on Android there's no way to detect if the file is shared or not.
|
|
51
|
+
* @default false
|
|
52
|
+
*/
|
|
53
|
+
removeAfterShared: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Remove the file after failed to share to other apps. Currently only support iOS, on Android there's no way to detect if the file is shared or not.
|
|
56
|
+
* @default false
|
|
57
|
+
*/
|
|
58
|
+
removeAfterFailedToShare: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Enable rotation
|
|
61
|
+
* @default false
|
|
62
|
+
*/
|
|
63
|
+
enableRotation: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Rotation angle in degrees
|
|
66
|
+
* @default 0
|
|
67
|
+
*/
|
|
68
|
+
rotationAngle: number;
|
|
69
|
+
}
|
|
70
|
+
export interface EditorConfig extends BaseOptions {
|
|
71
|
+
/**
|
|
72
|
+
* Enable haptic feedback
|
|
73
|
+
* @default true
|
|
74
|
+
*/
|
|
75
|
+
enableHapticFeedback: boolean;
|
|
76
|
+
maxDuration: number;
|
|
14
77
|
/**
|
|
15
78
|
* Minimum duration for trimmer
|
|
16
79
|
* @default 1000
|
|
17
80
|
*/
|
|
18
|
-
minDuration
|
|
81
|
+
minDuration: number;
|
|
19
82
|
/**
|
|
20
83
|
* Cancel button text
|
|
21
84
|
* @default "Cancel"
|
|
22
85
|
*/
|
|
23
|
-
cancelButtonText
|
|
86
|
+
cancelButtonText: string;
|
|
24
87
|
/**
|
|
25
88
|
* Save button text
|
|
26
89
|
* @default "Save"
|
|
27
90
|
*/
|
|
28
|
-
saveButtonText
|
|
91
|
+
saveButtonText: string;
|
|
29
92
|
/**
|
|
30
93
|
* Enable cancel dialog
|
|
31
94
|
* @default true
|
|
32
95
|
*/
|
|
33
|
-
enableCancelDialog
|
|
96
|
+
enableCancelDialog: boolean;
|
|
34
97
|
/**
|
|
35
98
|
* Cancel dialog title
|
|
36
99
|
* @default "Warning!"
|
|
37
100
|
*/
|
|
38
|
-
cancelDialogTitle
|
|
101
|
+
cancelDialogTitle: string;
|
|
39
102
|
/**
|
|
40
103
|
* Cancel dialog message
|
|
41
104
|
* @default "Are you sure want to cancel?"
|
|
42
105
|
*/
|
|
43
|
-
cancelDialogMessage
|
|
106
|
+
cancelDialogMessage: string;
|
|
44
107
|
/**
|
|
45
108
|
* Cancel dialog cancel text
|
|
46
109
|
* @default "Close"
|
|
47
110
|
*/
|
|
48
|
-
cancelDialogCancelText
|
|
111
|
+
cancelDialogCancelText: string;
|
|
49
112
|
/**
|
|
50
113
|
* Cancel dialog confirm text
|
|
51
114
|
* @default "Proceed"
|
|
52
115
|
*/
|
|
53
|
-
cancelDialogConfirmText
|
|
116
|
+
cancelDialogConfirmText: string;
|
|
54
117
|
/**
|
|
55
118
|
* Enable save dialog
|
|
56
119
|
* @default true
|
|
57
120
|
*/
|
|
58
|
-
enableSaveDialog
|
|
121
|
+
enableSaveDialog: boolean;
|
|
59
122
|
/**
|
|
60
123
|
* Save dialog title
|
|
61
124
|
* @default "Confirmation!"
|
|
62
125
|
*/
|
|
63
|
-
saveDialogTitle
|
|
126
|
+
saveDialogTitle: string;
|
|
64
127
|
/**
|
|
65
128
|
* Save dialog message
|
|
66
129
|
* @default "Are you sure want to save?"
|
|
67
130
|
*/
|
|
68
|
-
saveDialogMessage
|
|
131
|
+
saveDialogMessage: string;
|
|
69
132
|
/**
|
|
70
133
|
* Save dialog cancel text
|
|
71
134
|
* @default "Close"
|
|
72
135
|
*/
|
|
73
|
-
saveDialogCancelText
|
|
136
|
+
saveDialogCancelText: string;
|
|
74
137
|
/**
|
|
75
138
|
* Save dialog confirm text
|
|
76
139
|
* @default "Proceed"
|
|
77
140
|
*/
|
|
78
|
-
saveDialogConfirmText
|
|
141
|
+
saveDialogConfirmText: string;
|
|
79
142
|
/**
|
|
80
143
|
* Trimming text
|
|
81
144
|
* @default "Trimming video..."
|
|
82
145
|
*/
|
|
83
|
-
trimmingText
|
|
146
|
+
trimmingText: string;
|
|
84
147
|
/**
|
|
85
148
|
* By default, on iOS the editor will be presented as a modal. If you want to present it as a full screen modal, set this to `true`.
|
|
86
149
|
* @default false
|
|
87
150
|
*/
|
|
88
|
-
fullScreenModalIOS
|
|
89
|
-
/**
|
|
90
|
-
* Type of the file to edit. If video file, recommend to use `video`. If audio file, recommend to use `audio`.
|
|
91
|
-
* @default "video"
|
|
92
|
-
*/
|
|
93
|
-
type?: 'video' | 'audio';
|
|
94
|
-
/**
|
|
95
|
-
* Output file extension. If video file, recommend to use `mp4` or `mov`. If audio file, recommend to use `wav` or `m4a`.
|
|
96
|
-
* @default "mp4"
|
|
97
|
-
* @example "mp4", "mov", "wav", "m4a", "3gp", "avi", "mkv", "flv", "wmv", "webm"
|
|
98
|
-
*/
|
|
99
|
-
outputExt?: string;
|
|
100
|
-
/**
|
|
101
|
-
* Whether to open Documents app after finish editing
|
|
102
|
-
* @default false
|
|
103
|
-
*/
|
|
104
|
-
openDocumentsOnFinish?: boolean;
|
|
105
|
-
/**
|
|
106
|
-
* Whether to open Share Sheet after finish editing
|
|
107
|
-
* @default false
|
|
108
|
-
*/
|
|
109
|
-
openShareSheetOnFinish?: boolean;
|
|
110
|
-
/**
|
|
111
|
-
* Remove the file after saved to Photos Library
|
|
112
|
-
* @default false
|
|
113
|
-
*/
|
|
114
|
-
removeAfterSavedToPhoto?: boolean;
|
|
115
|
-
/**
|
|
116
|
-
* Remove the file after failed to save to Photos Library
|
|
117
|
-
* @default false
|
|
118
|
-
*/
|
|
119
|
-
removeAfterFailedToSavePhoto?: boolean;
|
|
120
|
-
/**
|
|
121
|
-
* Remove the file after saved to Documents app
|
|
122
|
-
* @default false
|
|
123
|
-
*/
|
|
124
|
-
removeAfterSavedToDocuments?: boolean;
|
|
125
|
-
/**
|
|
126
|
-
* Remove the file after failed to save to Documents app
|
|
127
|
-
* @default false
|
|
128
|
-
*/
|
|
129
|
-
removeAfterFailedToSaveDocuments?: boolean;
|
|
130
|
-
/**
|
|
131
|
-
* Remove the file after shared to other apps. Currently only support iOS, on Android there's no way to detect if the file is shared or not.
|
|
132
|
-
* @default false
|
|
133
|
-
*/
|
|
134
|
-
removeAfterShared?: boolean;
|
|
135
|
-
/**
|
|
136
|
-
* Remove the file after failed to share to other apps. Currently only support iOS, on Android there's no way to detect if the file is shared or not.
|
|
137
|
-
* @default false
|
|
138
|
-
*/
|
|
139
|
-
removeAfterFailedToShare?: boolean;
|
|
151
|
+
fullScreenModalIOS: boolean;
|
|
140
152
|
/**
|
|
141
153
|
* Whether to enable autoplay on load
|
|
142
154
|
*/
|
|
143
|
-
autoplay
|
|
155
|
+
autoplay: boolean;
|
|
144
156
|
/**
|
|
145
157
|
* Jump to position on load in milliseconds
|
|
146
158
|
* @default `undefined` (beginning of the video)
|
|
147
159
|
*/
|
|
148
|
-
jumpToPositionOnLoad
|
|
160
|
+
jumpToPositionOnLoad: number;
|
|
149
161
|
/**
|
|
150
162
|
* Whether to close the editor when finish editing
|
|
151
163
|
* @default true
|
|
152
164
|
*/
|
|
153
|
-
closeWhenFinish
|
|
165
|
+
closeWhenFinish: boolean;
|
|
154
166
|
/**
|
|
155
167
|
* Enable cancel trimming
|
|
156
168
|
* @default true
|
|
157
169
|
*/
|
|
158
|
-
enableCancelTrimming
|
|
170
|
+
enableCancelTrimming: boolean;
|
|
159
171
|
/**
|
|
160
172
|
* Cancel trimming button text
|
|
161
173
|
* @default "Cancel"
|
|
162
174
|
*/
|
|
163
|
-
cancelTrimmingButtonText
|
|
175
|
+
cancelTrimmingButtonText: string;
|
|
164
176
|
/**
|
|
165
177
|
* Enable cancel trimming dialog
|
|
166
178
|
* @default true
|
|
167
179
|
*/
|
|
168
|
-
enableCancelTrimmingDialog
|
|
180
|
+
enableCancelTrimmingDialog: boolean;
|
|
169
181
|
/**
|
|
170
182
|
* Cancel trimming dialog title
|
|
171
183
|
* @default "Warning!"
|
|
172
184
|
*/
|
|
173
|
-
cancelTrimmingDialogTitle
|
|
185
|
+
cancelTrimmingDialogTitle: string;
|
|
174
186
|
/**
|
|
175
187
|
* Cancel trimming dialog message
|
|
176
188
|
* @default "Are you sure want to cancel trimming?"
|
|
177
189
|
*/
|
|
178
|
-
cancelTrimmingDialogMessage
|
|
190
|
+
cancelTrimmingDialogMessage: string;
|
|
179
191
|
/**
|
|
180
192
|
* Cancel trimming dialog cancel text
|
|
181
193
|
* @default "Close"
|
|
182
194
|
*/
|
|
183
|
-
cancelTrimmingDialogCancelText
|
|
195
|
+
cancelTrimmingDialogCancelText: string;
|
|
184
196
|
/**
|
|
185
197
|
* Cancel trimming dialog confirm text
|
|
186
198
|
* @default "Proceed"
|
|
187
199
|
*/
|
|
188
|
-
cancelTrimmingDialogConfirmText
|
|
200
|
+
cancelTrimmingDialogConfirmText: string;
|
|
189
201
|
/**
|
|
190
202
|
* Header text
|
|
191
203
|
*/
|
|
192
|
-
headerText
|
|
204
|
+
headerText: string;
|
|
193
205
|
/**
|
|
194
206
|
* Header text size
|
|
195
207
|
* @default 16
|
|
196
208
|
*/
|
|
197
|
-
headerTextSize
|
|
209
|
+
headerTextSize: number;
|
|
198
210
|
/**
|
|
199
211
|
* Header text color
|
|
200
212
|
* @default white
|
|
201
213
|
*/
|
|
202
|
-
headerTextColor
|
|
214
|
+
headerTextColor: number;
|
|
203
215
|
/**
|
|
204
216
|
* Alert on fail to load media
|
|
205
217
|
* @default true
|
|
206
218
|
*/
|
|
207
|
-
alertOnFailToLoad
|
|
219
|
+
alertOnFailToLoad: boolean;
|
|
208
220
|
/**
|
|
209
221
|
* Alert on fail to load media title
|
|
210
222
|
* @default "Error"
|
|
211
223
|
*/
|
|
212
|
-
alertOnFailTitle
|
|
224
|
+
alertOnFailTitle: string;
|
|
213
225
|
/**
|
|
214
226
|
* Alert on fail to load media message
|
|
215
227
|
* @default "Fail to load media. Possibly invalid file or no network connection"
|
|
216
228
|
*/
|
|
217
|
-
alertOnFailMessage
|
|
229
|
+
alertOnFailMessage: string;
|
|
218
230
|
/**
|
|
219
231
|
* Alert on fail to load media close text
|
|
220
232
|
* @default "Close"
|
|
221
233
|
*/
|
|
222
|
-
alertOnFailCloseText
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
234
|
+
alertOnFailCloseText: string;
|
|
235
|
+
}
|
|
236
|
+
export interface TrimOptions extends BaseOptions {
|
|
237
|
+
startTime: number;
|
|
238
|
+
endTime: number;
|
|
239
|
+
}
|
|
240
|
+
export interface FileValidationResult {
|
|
241
|
+
isValid: boolean;
|
|
242
|
+
fileType: string;
|
|
243
|
+
duration: number;
|
|
244
|
+
}
|
|
245
|
+
export interface VideoTrim extends HybridObject<{
|
|
246
|
+
ios: 'swift';
|
|
247
|
+
android: 'kotlin';
|
|
248
|
+
}> {
|
|
249
|
+
showEditor(filePath: string, config: EditorConfig, onEvent: (eventName: string, payload: Record<string, string>) => void): void;
|
|
250
|
+
listFiles(): Promise<string[]>;
|
|
251
|
+
cleanFiles(): Promise<number>;
|
|
252
|
+
deleteFile(filePath: string): Promise<boolean>;
|
|
253
|
+
closeEditor(onComplete: () => void): void;
|
|
254
|
+
isValidFile(url: string): Promise<FileValidationResult>;
|
|
255
|
+
trim(url: string, options: TrimOptions): Promise<string>;
|
|
228
256
|
}
|
|
229
|
-
|
|
230
|
-
* Delete a file
|
|
231
|
-
*
|
|
232
|
-
* @param {string} videoPath: absolute non-empty file path to edit
|
|
233
|
-
* @param {EditorConfig} config: editor configuration
|
|
234
|
-
* @returns {void} A **Promise** which resolves `void`
|
|
235
|
-
*/
|
|
236
|
-
export declare function showEditor(filePath: string, config?: EditorConfig): void;
|
|
237
|
-
/**
|
|
238
|
-
* Clean output files generated at all time
|
|
239
|
-
*
|
|
240
|
-
* @returns {Promise<string[]>} A **Promise** which resolves to array of files
|
|
241
|
-
*/
|
|
242
|
-
export declare function listFiles(): Promise<string[]>;
|
|
243
|
-
/**
|
|
244
|
-
* Clean output files generated at all time
|
|
245
|
-
*
|
|
246
|
-
* @returns {Promise} A **Promise** which resolves to number of deleted files
|
|
247
|
-
*/
|
|
248
|
-
export declare function cleanFiles(): Promise<number>;
|
|
249
|
-
/**
|
|
250
|
-
* Delete a file
|
|
251
|
-
*
|
|
252
|
-
* @param {string} filePath: absolute non-empty file path to delete
|
|
253
|
-
* @returns {Promise} A **Promise** which resolves `true` if successful
|
|
254
|
-
*/
|
|
255
|
-
export declare function deleteFile(filePath: string): Promise<boolean>;
|
|
256
|
-
/**
|
|
257
|
-
* Close editor
|
|
258
|
-
*/
|
|
259
|
-
export declare function closeEditor(): void;
|
|
260
|
-
/**
|
|
261
|
-
* Check if a file is valid audio or video file
|
|
262
|
-
*
|
|
263
|
-
* @returns {Promise} A **Promise** which resolves file info if successful
|
|
264
|
-
*/
|
|
265
|
-
export declare function isValidFile(url: string): Promise<boolean>;
|
|
266
|
-
//# sourceMappingURL=index.d.ts.map
|
|
257
|
+
//# sourceMappingURL=VideoTrim.nitro.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VideoTrim.nitro.d.ts","sourceRoot":"","sources":["../../../src/VideoTrim.nitro.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE/D,MAAM,WAAW,WAAW;IAC1B;;;OAGG;IACH,WAAW,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;;;OAIG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,YAAY,EACpB,OAAO,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,IAAI,GACpE,IAAI,CAAC;IACR,SAAS,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAC/B,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAC9B,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC/C,WAAW,CAAC,UAAU,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC;IAC1C,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;IACxD,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAC1D"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { EditorConfig, FileValidationResult, TrimOptions } from './VideoTrim.nitro';
|
|
2
|
+
/**
|
|
3
|
+
* Delete a file
|
|
4
|
+
*
|
|
5
|
+
* @param {string} videoPath: absolute non-empty file path to edit
|
|
6
|
+
* @param {EditorConfig} config: editor configuration
|
|
7
|
+
* @returns {void} A **Promise** which resolves `void`
|
|
8
|
+
*/
|
|
9
|
+
export declare function showEditor(filePath: string, config: Partial<Omit<EditorConfig, 'headerTextColor'>> & {
|
|
10
|
+
headerTextColor?: string;
|
|
11
|
+
}, onEvent?: (eventName: string, payload: Record<string, string>) => void): void;
|
|
12
|
+
/**
|
|
13
|
+
* Clean output files generated at all time
|
|
14
|
+
*
|
|
15
|
+
* @returns {Promise<string[]>} A **Promise** which resolves to array of files
|
|
16
|
+
*/
|
|
17
|
+
export declare function listFiles(): Promise<string[]>;
|
|
18
|
+
/**
|
|
19
|
+
* Clean output files generated at all time
|
|
20
|
+
*
|
|
21
|
+
* @returns {Promise} A **Promise** which resolves to number of deleted files
|
|
22
|
+
*/
|
|
23
|
+
export declare function cleanFiles(): Promise<number>;
|
|
24
|
+
/**
|
|
25
|
+
* Delete a file
|
|
26
|
+
*
|
|
27
|
+
* @param {string} filePath: absolute non-empty file path to delete
|
|
28
|
+
* @returns {Promise} A **Promise** which resolves `true` if successful
|
|
29
|
+
*/
|
|
30
|
+
export declare function deleteFile(filePath: string): Promise<boolean>;
|
|
31
|
+
/**
|
|
32
|
+
* Close editor
|
|
33
|
+
*/
|
|
34
|
+
export declare function closeEditor(onComplete?: () => void): void;
|
|
35
|
+
/**
|
|
36
|
+
* Check if a file is valid audio or video file
|
|
37
|
+
*
|
|
38
|
+
* @returns {Promise} A **Promise** which resolves file info if successful
|
|
39
|
+
*/
|
|
40
|
+
export declare function isValidFile(url: string): Promise<FileValidationResult>;
|
|
41
|
+
/**
|
|
42
|
+
* Trim a video file
|
|
43
|
+
*
|
|
44
|
+
* @param {string} url: absolute non-empty file path to edit
|
|
45
|
+
* @param {TrimOptions} options: trim options
|
|
46
|
+
* @returns {Promise<string>} A **Promise** which resolves to the trimmed file path
|
|
47
|
+
*/
|
|
48
|
+
export declare function trim(url: string, options: Partial<TrimOptions>): Promise<string>;
|
|
49
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,YAAY,EACZ,oBAAoB,EACpB,WAAW,EAEZ,MAAM,mBAAmB,CAAC;AAgF3B;;;;;;GAMG;AACH,wBAAgB,UAAU,CACxB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,YAAY,EAAE,iBAAiB,CAAC,CAAC,GAAG;IACvD,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,EACD,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,IAAI,GACrE,IAAI,CAYN;AAED;;;;GAIG;AACH,wBAAgB,SAAS,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAE7C;AAED;;;;GAIG;AACH,wBAAgB,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,CAE5C;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAK7D;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,UAAU,CAAC,EAAE,MAAM,IAAI,GAAG,IAAI,CAEzD;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAEtE;AAED;;;;;;GAMG;AACH,wBAAgB,IAAI,CAClB,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,OAAO,CAAC,WAAW,CAAC,GAC5B,OAAO,CAAC,MAAM,CAAC,CAEjB"}
|