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
@@ -1,266 +1,257 @@
1
- import { type ColorValue } from 'react-native';
2
- export interface EditorConfig {
1
+ import type { HybridObject } from 'react-native-nitro-modules';
2
+ export interface BaseOptions {
3
3
  /**
4
- * Enable haptic feedback
5
- * @default true
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
- enableHapticFeedback?: boolean;
7
+ saveToPhoto: boolean;
8
8
  /**
9
- * 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.
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
- saveToPhoto?: boolean;
13
- maxDuration?: number;
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?: number;
81
+ minDuration: number;
19
82
  /**
20
83
  * Cancel button text
21
84
  * @default "Cancel"
22
85
  */
23
- cancelButtonText?: string;
86
+ cancelButtonText: string;
24
87
  /**
25
88
  * Save button text
26
89
  * @default "Save"
27
90
  */
28
- saveButtonText?: string;
91
+ saveButtonText: string;
29
92
  /**
30
93
  * Enable cancel dialog
31
94
  * @default true
32
95
  */
33
- enableCancelDialog?: boolean;
96
+ enableCancelDialog: boolean;
34
97
  /**
35
98
  * Cancel dialog title
36
99
  * @default "Warning!"
37
100
  */
38
- cancelDialogTitle?: string;
101
+ cancelDialogTitle: string;
39
102
  /**
40
103
  * Cancel dialog message
41
104
  * @default "Are you sure want to cancel?"
42
105
  */
43
- cancelDialogMessage?: string;
106
+ cancelDialogMessage: string;
44
107
  /**
45
108
  * Cancel dialog cancel text
46
109
  * @default "Close"
47
110
  */
48
- cancelDialogCancelText?: string;
111
+ cancelDialogCancelText: string;
49
112
  /**
50
113
  * Cancel dialog confirm text
51
114
  * @default "Proceed"
52
115
  */
53
- cancelDialogConfirmText?: string;
116
+ cancelDialogConfirmText: string;
54
117
  /**
55
118
  * Enable save dialog
56
119
  * @default true
57
120
  */
58
- enableSaveDialog?: boolean;
121
+ enableSaveDialog: boolean;
59
122
  /**
60
123
  * Save dialog title
61
124
  * @default "Confirmation!"
62
125
  */
63
- saveDialogTitle?: string;
126
+ saveDialogTitle: string;
64
127
  /**
65
128
  * Save dialog message
66
129
  * @default "Are you sure want to save?"
67
130
  */
68
- saveDialogMessage?: string;
131
+ saveDialogMessage: string;
69
132
  /**
70
133
  * Save dialog cancel text
71
134
  * @default "Close"
72
135
  */
73
- saveDialogCancelText?: string;
136
+ saveDialogCancelText: string;
74
137
  /**
75
138
  * Save dialog confirm text
76
139
  * @default "Proceed"
77
140
  */
78
- saveDialogConfirmText?: string;
141
+ saveDialogConfirmText: string;
79
142
  /**
80
143
  * Trimming text
81
144
  * @default "Trimming video..."
82
145
  */
83
- trimmingText?: string;
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?: boolean;
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?: boolean;
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?: number;
160
+ jumpToPositionOnLoad: number;
149
161
  /**
150
162
  * Whether to close the editor when finish editing
151
163
  * @default true
152
164
  */
153
- closeWhenFinish?: boolean;
165
+ closeWhenFinish: boolean;
154
166
  /**
155
167
  * Enable cancel trimming
156
168
  * @default true
157
169
  */
158
- enableCancelTrimming?: boolean;
170
+ enableCancelTrimming: boolean;
159
171
  /**
160
172
  * Cancel trimming button text
161
173
  * @default "Cancel"
162
174
  */
163
- cancelTrimmingButtonText?: string;
175
+ cancelTrimmingButtonText: string;
164
176
  /**
165
177
  * Enable cancel trimming dialog
166
178
  * @default true
167
179
  */
168
- enableCancelTrimmingDialog?: boolean;
180
+ enableCancelTrimmingDialog: boolean;
169
181
  /**
170
182
  * Cancel trimming dialog title
171
183
  * @default "Warning!"
172
184
  */
173
- cancelTrimmingDialogTitle?: string;
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?: string;
190
+ cancelTrimmingDialogMessage: string;
179
191
  /**
180
192
  * Cancel trimming dialog cancel text
181
193
  * @default "Close"
182
194
  */
183
- cancelTrimmingDialogCancelText?: string;
195
+ cancelTrimmingDialogCancelText: string;
184
196
  /**
185
197
  * Cancel trimming dialog confirm text
186
198
  * @default "Proceed"
187
199
  */
188
- cancelTrimmingDialogConfirmText?: string;
200
+ cancelTrimmingDialogConfirmText: string;
189
201
  /**
190
202
  * Header text
191
203
  */
192
- headerText?: string;
204
+ headerText: string;
193
205
  /**
194
206
  * Header text size
195
207
  * @default 16
196
208
  */
197
- headerTextSize?: number;
209
+ headerTextSize: number;
198
210
  /**
199
211
  * Header text color
200
212
  * @default white
201
213
  */
202
- headerTextColor?: ColorValue;
214
+ headerTextColor: number;
203
215
  /**
204
216
  * Alert on fail to load media
205
217
  * @default true
206
218
  */
207
- alertOnFailToLoad?: boolean;
219
+ alertOnFailToLoad: boolean;
208
220
  /**
209
221
  * Alert on fail to load media title
210
222
  * @default "Error"
211
223
  */
212
- alertOnFailTitle?: string;
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?: string;
229
+ alertOnFailMessage: string;
218
230
  /**
219
231
  * Alert on fail to load media close text
220
232
  * @default "Close"
221
233
  */
222
- alertOnFailCloseText?: string;
223
- /**
224
- * Progress update interval in seconds
225
- * @default 0.1
226
- */
227
- progressUpdateInterval?: number;
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,MAA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AQ,YAAY,CAAC;IAAE,GAAG,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,QAAQ,CAAA;CAAE,CAAC;IACzD,UAAU,CACR,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,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"}