react-native-video-trim 4.0.0 → 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/README.md +36 -8
- package/VideoTrim.podspec +1 -1
- package/android/build.gradle +9 -1
- package/android/gradle.properties +2 -0
- package/android/src/main/java/com/margelo/nitro/videotrim/VideoTrim.kt +138 -121
- package/android/src/main/java/com/margelo/nitro/videotrim/utils/VideoTrimmerUtil.java +29 -21
- package/android/src/main/java/com/margelo/nitro/videotrim/widgets/VideoTrimmerView.java +10 -6
- package/ios/VideoTrim.swift +7 -0
- package/ios/VideoTrimImpl.swift +221 -124
- package/lib/module/index.js +38 -11
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/VideoTrim.nitro.d.ts +74 -57
- package/lib/typescript/src/VideoTrim.nitro.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +9 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/nitrogen/generated/android/c++/JEditorConfig.hpp +54 -46
- package/nitrogen/generated/android/c++/JHybridVideoTrimSpec.cpp +20 -0
- package/nitrogen/generated/android/c++/JHybridVideoTrimSpec.hpp +1 -0
- package/nitrogen/generated/android/c++/JTrimOptions.hpp +109 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/videotrim/EditorConfig.kt +14 -12
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/videotrim/HybridVideoTrimSpec.kt +4 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/videotrim/TrimOptions.kt +40 -0
- package/nitrogen/generated/ios/VideoTrim-Swift-Cxx-Bridge.cpp +8 -0
- package/nitrogen/generated/ios/VideoTrim-Swift-Cxx-Bridge.hpp +43 -0
- package/nitrogen/generated/ios/VideoTrim-Swift-Cxx-Umbrella.hpp +3 -0
- package/nitrogen/generated/ios/c++/HybridVideoTrimSpecSwift.hpp +11 -0
- package/nitrogen/generated/ios/swift/EditorConfig.swift +116 -94
- package/nitrogen/generated/ios/swift/Func_void_std__string.swift +46 -0
- package/nitrogen/generated/ios/swift/HybridVideoTrimSpec.swift +1 -0
- package/nitrogen/generated/ios/swift/HybridVideoTrimSpec_cxx.swift +19 -0
- package/nitrogen/generated/ios/swift/TrimOptions.swift +189 -0
- package/nitrogen/generated/shared/c++/EditorConfig.hpp +54 -46
- package/nitrogen/generated/shared/c++/HybridVideoTrimSpec.cpp +1 -0
- package/nitrogen/generated/shared/c++/HybridVideoTrimSpec.hpp +4 -0
- package/nitrogen/generated/shared/c++/TrimOptions.hpp +125 -0
- package/package.json +1 -1
- package/src/VideoTrim.nitro.ts +76 -57
- package/src/index.tsx +45 -11
|
@@ -18,8 +18,8 @@ public extension EditorConfig {
|
|
|
18
18
|
/**
|
|
19
19
|
* Create a new instance of `EditorConfig`.
|
|
20
20
|
*/
|
|
21
|
-
init(enableHapticFeedback: Bool,
|
|
22
|
-
self.init(enableHapticFeedback,
|
|
21
|
+
init(enableHapticFeedback: Bool, maxDuration: Double, minDuration: Double, cancelButtonText: String, saveButtonText: String, enableCancelDialog: Bool, cancelDialogTitle: String, cancelDialogMessage: String, cancelDialogCancelText: String, cancelDialogConfirmText: String, enableSaveDialog: Bool, saveDialogTitle: String, saveDialogMessage: String, saveDialogCancelText: String, saveDialogConfirmText: String, trimmingText: String, fullScreenModalIOS: Bool, autoplay: Bool, jumpToPositionOnLoad: Double, closeWhenFinish: Bool, enableCancelTrimming: Bool, cancelTrimmingButtonText: String, enableCancelTrimmingDialog: Bool, cancelTrimmingDialogTitle: String, cancelTrimmingDialogMessage: String, cancelTrimmingDialogCancelText: String, cancelTrimmingDialogConfirmText: String, headerText: String, headerTextSize: Double, headerTextColor: Double, alertOnFailToLoad: Bool, alertOnFailTitle: String, alertOnFailMessage: String, alertOnFailCloseText: String, 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(enableHapticFeedback, maxDuration, minDuration, std.string(cancelButtonText), std.string(saveButtonText), enableCancelDialog, std.string(cancelDialogTitle), std.string(cancelDialogMessage), std.string(cancelDialogCancelText), std.string(cancelDialogConfirmText), enableSaveDialog, std.string(saveDialogTitle), std.string(saveDialogMessage), std.string(saveDialogCancelText), std.string(saveDialogConfirmText), std.string(trimmingText), fullScreenModalIOS, autoplay, jumpToPositionOnLoad, closeWhenFinish, enableCancelTrimming, std.string(cancelTrimmingButtonText), enableCancelTrimmingDialog, std.string(cancelTrimmingDialogTitle), std.string(cancelTrimmingDialogMessage), std.string(cancelTrimmingDialogCancelText), std.string(cancelTrimmingDialogConfirmText), std.string(headerText), headerTextSize, headerTextColor, alertOnFailToLoad, std.string(alertOnFailTitle), std.string(alertOnFailMessage), std.string(alertOnFailCloseText), saveToPhoto, std.string(type), std.string(outputExt), openDocumentsOnFinish, openShareSheetOnFinish, removeAfterSavedToPhoto, removeAfterFailedToSavePhoto, removeAfterSavedToDocuments, removeAfterFailedToSaveDocuments, removeAfterShared, removeAfterFailedToShare, enableRotation, rotationAngle)
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
var enableHapticFeedback: Bool {
|
|
@@ -33,17 +33,6 @@ public extension EditorConfig {
|
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
var saveToPhoto: Bool {
|
|
37
|
-
@inline(__always)
|
|
38
|
-
get {
|
|
39
|
-
return self.__saveToPhoto
|
|
40
|
-
}
|
|
41
|
-
@inline(__always)
|
|
42
|
-
set {
|
|
43
|
-
self.__saveToPhoto = newValue
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
36
|
var maxDuration: Double {
|
|
48
37
|
@inline(__always)
|
|
49
38
|
get {
|
|
@@ -220,300 +209,333 @@ public extension EditorConfig {
|
|
|
220
209
|
}
|
|
221
210
|
}
|
|
222
211
|
|
|
223
|
-
var
|
|
212
|
+
var autoplay: Bool {
|
|
224
213
|
@inline(__always)
|
|
225
214
|
get {
|
|
226
|
-
return
|
|
215
|
+
return self.__autoplay
|
|
227
216
|
}
|
|
228
217
|
@inline(__always)
|
|
229
218
|
set {
|
|
230
|
-
self.
|
|
219
|
+
self.__autoplay = newValue
|
|
231
220
|
}
|
|
232
221
|
}
|
|
233
222
|
|
|
234
|
-
var
|
|
223
|
+
var jumpToPositionOnLoad: Double {
|
|
235
224
|
@inline(__always)
|
|
236
225
|
get {
|
|
237
|
-
return
|
|
226
|
+
return self.__jumpToPositionOnLoad
|
|
238
227
|
}
|
|
239
228
|
@inline(__always)
|
|
240
229
|
set {
|
|
241
|
-
self.
|
|
230
|
+
self.__jumpToPositionOnLoad = newValue
|
|
242
231
|
}
|
|
243
232
|
}
|
|
244
233
|
|
|
245
|
-
var
|
|
234
|
+
var closeWhenFinish: Bool {
|
|
246
235
|
@inline(__always)
|
|
247
236
|
get {
|
|
248
|
-
return self.
|
|
237
|
+
return self.__closeWhenFinish
|
|
249
238
|
}
|
|
250
239
|
@inline(__always)
|
|
251
240
|
set {
|
|
252
|
-
self.
|
|
241
|
+
self.__closeWhenFinish = newValue
|
|
253
242
|
}
|
|
254
243
|
}
|
|
255
244
|
|
|
256
|
-
var
|
|
245
|
+
var enableCancelTrimming: Bool {
|
|
257
246
|
@inline(__always)
|
|
258
247
|
get {
|
|
259
|
-
return self.
|
|
248
|
+
return self.__enableCancelTrimming
|
|
260
249
|
}
|
|
261
250
|
@inline(__always)
|
|
262
251
|
set {
|
|
263
|
-
self.
|
|
252
|
+
self.__enableCancelTrimming = newValue
|
|
264
253
|
}
|
|
265
254
|
}
|
|
266
255
|
|
|
267
|
-
var
|
|
256
|
+
var cancelTrimmingButtonText: String {
|
|
268
257
|
@inline(__always)
|
|
269
258
|
get {
|
|
270
|
-
return self.
|
|
259
|
+
return String(self.__cancelTrimmingButtonText)
|
|
271
260
|
}
|
|
272
261
|
@inline(__always)
|
|
273
262
|
set {
|
|
274
|
-
self.
|
|
263
|
+
self.__cancelTrimmingButtonText = std.string(newValue)
|
|
275
264
|
}
|
|
276
265
|
}
|
|
277
266
|
|
|
278
|
-
var
|
|
267
|
+
var enableCancelTrimmingDialog: Bool {
|
|
279
268
|
@inline(__always)
|
|
280
269
|
get {
|
|
281
|
-
return self.
|
|
270
|
+
return self.__enableCancelTrimmingDialog
|
|
282
271
|
}
|
|
283
272
|
@inline(__always)
|
|
284
273
|
set {
|
|
285
|
-
self.
|
|
274
|
+
self.__enableCancelTrimmingDialog = newValue
|
|
286
275
|
}
|
|
287
276
|
}
|
|
288
277
|
|
|
289
|
-
var
|
|
278
|
+
var cancelTrimmingDialogTitle: String {
|
|
290
279
|
@inline(__always)
|
|
291
280
|
get {
|
|
292
|
-
return self.
|
|
281
|
+
return String(self.__cancelTrimmingDialogTitle)
|
|
293
282
|
}
|
|
294
283
|
@inline(__always)
|
|
295
284
|
set {
|
|
296
|
-
self.
|
|
285
|
+
self.__cancelTrimmingDialogTitle = std.string(newValue)
|
|
297
286
|
}
|
|
298
287
|
}
|
|
299
288
|
|
|
300
|
-
var
|
|
289
|
+
var cancelTrimmingDialogMessage: String {
|
|
301
290
|
@inline(__always)
|
|
302
291
|
get {
|
|
303
|
-
return self.
|
|
292
|
+
return String(self.__cancelTrimmingDialogMessage)
|
|
304
293
|
}
|
|
305
294
|
@inline(__always)
|
|
306
295
|
set {
|
|
307
|
-
self.
|
|
296
|
+
self.__cancelTrimmingDialogMessage = std.string(newValue)
|
|
308
297
|
}
|
|
309
298
|
}
|
|
310
299
|
|
|
311
|
-
var
|
|
300
|
+
var cancelTrimmingDialogCancelText: String {
|
|
312
301
|
@inline(__always)
|
|
313
302
|
get {
|
|
314
|
-
return self.
|
|
303
|
+
return String(self.__cancelTrimmingDialogCancelText)
|
|
315
304
|
}
|
|
316
305
|
@inline(__always)
|
|
317
306
|
set {
|
|
318
|
-
self.
|
|
307
|
+
self.__cancelTrimmingDialogCancelText = std.string(newValue)
|
|
319
308
|
}
|
|
320
309
|
}
|
|
321
310
|
|
|
322
|
-
var
|
|
311
|
+
var cancelTrimmingDialogConfirmText: String {
|
|
323
312
|
@inline(__always)
|
|
324
313
|
get {
|
|
325
|
-
return self.
|
|
314
|
+
return String(self.__cancelTrimmingDialogConfirmText)
|
|
326
315
|
}
|
|
327
316
|
@inline(__always)
|
|
328
317
|
set {
|
|
329
|
-
self.
|
|
318
|
+
self.__cancelTrimmingDialogConfirmText = std.string(newValue)
|
|
330
319
|
}
|
|
331
320
|
}
|
|
332
321
|
|
|
333
|
-
var
|
|
322
|
+
var headerText: String {
|
|
334
323
|
@inline(__always)
|
|
335
324
|
get {
|
|
336
|
-
return self.
|
|
325
|
+
return String(self.__headerText)
|
|
337
326
|
}
|
|
338
327
|
@inline(__always)
|
|
339
328
|
set {
|
|
340
|
-
self.
|
|
329
|
+
self.__headerText = std.string(newValue)
|
|
341
330
|
}
|
|
342
331
|
}
|
|
343
332
|
|
|
344
|
-
var
|
|
333
|
+
var headerTextSize: Double {
|
|
345
334
|
@inline(__always)
|
|
346
335
|
get {
|
|
347
|
-
return self.
|
|
336
|
+
return self.__headerTextSize
|
|
348
337
|
}
|
|
349
338
|
@inline(__always)
|
|
350
339
|
set {
|
|
351
|
-
self.
|
|
340
|
+
self.__headerTextSize = newValue
|
|
352
341
|
}
|
|
353
342
|
}
|
|
354
343
|
|
|
355
|
-
var
|
|
344
|
+
var headerTextColor: Double {
|
|
356
345
|
@inline(__always)
|
|
357
346
|
get {
|
|
358
|
-
return self.
|
|
347
|
+
return self.__headerTextColor
|
|
359
348
|
}
|
|
360
349
|
@inline(__always)
|
|
361
350
|
set {
|
|
362
|
-
self.
|
|
351
|
+
self.__headerTextColor = newValue
|
|
363
352
|
}
|
|
364
353
|
}
|
|
365
354
|
|
|
366
|
-
var
|
|
355
|
+
var alertOnFailToLoad: Bool {
|
|
367
356
|
@inline(__always)
|
|
368
357
|
get {
|
|
369
|
-
return self.
|
|
358
|
+
return self.__alertOnFailToLoad
|
|
370
359
|
}
|
|
371
360
|
@inline(__always)
|
|
372
361
|
set {
|
|
373
|
-
self.
|
|
362
|
+
self.__alertOnFailToLoad = newValue
|
|
374
363
|
}
|
|
375
364
|
}
|
|
376
365
|
|
|
377
|
-
var
|
|
366
|
+
var alertOnFailTitle: String {
|
|
378
367
|
@inline(__always)
|
|
379
368
|
get {
|
|
380
|
-
return String(self.
|
|
369
|
+
return String(self.__alertOnFailTitle)
|
|
381
370
|
}
|
|
382
371
|
@inline(__always)
|
|
383
372
|
set {
|
|
384
|
-
self.
|
|
373
|
+
self.__alertOnFailTitle = std.string(newValue)
|
|
385
374
|
}
|
|
386
375
|
}
|
|
387
376
|
|
|
388
|
-
var
|
|
377
|
+
var alertOnFailMessage: String {
|
|
389
378
|
@inline(__always)
|
|
390
379
|
get {
|
|
391
|
-
return self.
|
|
380
|
+
return String(self.__alertOnFailMessage)
|
|
392
381
|
}
|
|
393
382
|
@inline(__always)
|
|
394
383
|
set {
|
|
395
|
-
self.
|
|
384
|
+
self.__alertOnFailMessage = std.string(newValue)
|
|
396
385
|
}
|
|
397
386
|
}
|
|
398
387
|
|
|
399
|
-
var
|
|
388
|
+
var alertOnFailCloseText: String {
|
|
400
389
|
@inline(__always)
|
|
401
390
|
get {
|
|
402
|
-
return String(self.
|
|
391
|
+
return String(self.__alertOnFailCloseText)
|
|
403
392
|
}
|
|
404
393
|
@inline(__always)
|
|
405
394
|
set {
|
|
406
|
-
self.
|
|
395
|
+
self.__alertOnFailCloseText = std.string(newValue)
|
|
407
396
|
}
|
|
408
397
|
}
|
|
409
398
|
|
|
410
|
-
var
|
|
399
|
+
var saveToPhoto: Bool {
|
|
411
400
|
@inline(__always)
|
|
412
401
|
get {
|
|
413
|
-
return
|
|
402
|
+
return self.__saveToPhoto
|
|
414
403
|
}
|
|
415
404
|
@inline(__always)
|
|
416
405
|
set {
|
|
417
|
-
self.
|
|
406
|
+
self.__saveToPhoto = newValue
|
|
418
407
|
}
|
|
419
408
|
}
|
|
420
409
|
|
|
421
|
-
var
|
|
410
|
+
var type: String {
|
|
422
411
|
@inline(__always)
|
|
423
412
|
get {
|
|
424
|
-
return String(self.
|
|
413
|
+
return String(self.__type)
|
|
425
414
|
}
|
|
426
415
|
@inline(__always)
|
|
427
416
|
set {
|
|
428
|
-
self.
|
|
417
|
+
self.__type = std.string(newValue)
|
|
429
418
|
}
|
|
430
419
|
}
|
|
431
420
|
|
|
432
|
-
var
|
|
421
|
+
var outputExt: String {
|
|
433
422
|
@inline(__always)
|
|
434
423
|
get {
|
|
435
|
-
return String(self.
|
|
424
|
+
return String(self.__outputExt)
|
|
436
425
|
}
|
|
437
426
|
@inline(__always)
|
|
438
427
|
set {
|
|
439
|
-
self.
|
|
428
|
+
self.__outputExt = std.string(newValue)
|
|
440
429
|
}
|
|
441
430
|
}
|
|
442
431
|
|
|
443
|
-
var
|
|
432
|
+
var openDocumentsOnFinish: Bool {
|
|
444
433
|
@inline(__always)
|
|
445
434
|
get {
|
|
446
|
-
return
|
|
435
|
+
return self.__openDocumentsOnFinish
|
|
447
436
|
}
|
|
448
437
|
@inline(__always)
|
|
449
438
|
set {
|
|
450
|
-
self.
|
|
439
|
+
self.__openDocumentsOnFinish = newValue
|
|
451
440
|
}
|
|
452
441
|
}
|
|
453
442
|
|
|
454
|
-
var
|
|
443
|
+
var openShareSheetOnFinish: Bool {
|
|
455
444
|
@inline(__always)
|
|
456
445
|
get {
|
|
457
|
-
return self.
|
|
446
|
+
return self.__openShareSheetOnFinish
|
|
458
447
|
}
|
|
459
448
|
@inline(__always)
|
|
460
449
|
set {
|
|
461
|
-
self.
|
|
450
|
+
self.__openShareSheetOnFinish = newValue
|
|
462
451
|
}
|
|
463
452
|
}
|
|
464
453
|
|
|
465
|
-
var
|
|
454
|
+
var removeAfterSavedToPhoto: Bool {
|
|
466
455
|
@inline(__always)
|
|
467
456
|
get {
|
|
468
|
-
return self.
|
|
457
|
+
return self.__removeAfterSavedToPhoto
|
|
469
458
|
}
|
|
470
459
|
@inline(__always)
|
|
471
460
|
set {
|
|
472
|
-
self.
|
|
461
|
+
self.__removeAfterSavedToPhoto = newValue
|
|
473
462
|
}
|
|
474
463
|
}
|
|
475
464
|
|
|
476
|
-
var
|
|
465
|
+
var removeAfterFailedToSavePhoto: Bool {
|
|
477
466
|
@inline(__always)
|
|
478
467
|
get {
|
|
479
|
-
return self.
|
|
468
|
+
return self.__removeAfterFailedToSavePhoto
|
|
480
469
|
}
|
|
481
470
|
@inline(__always)
|
|
482
471
|
set {
|
|
483
|
-
self.
|
|
472
|
+
self.__removeAfterFailedToSavePhoto = newValue
|
|
484
473
|
}
|
|
485
474
|
}
|
|
486
475
|
|
|
487
|
-
var
|
|
476
|
+
var removeAfterSavedToDocuments: Bool {
|
|
488
477
|
@inline(__always)
|
|
489
478
|
get {
|
|
490
|
-
return
|
|
479
|
+
return self.__removeAfterSavedToDocuments
|
|
491
480
|
}
|
|
492
481
|
@inline(__always)
|
|
493
482
|
set {
|
|
494
|
-
self.
|
|
483
|
+
self.__removeAfterSavedToDocuments = newValue
|
|
495
484
|
}
|
|
496
485
|
}
|
|
497
486
|
|
|
498
|
-
var
|
|
487
|
+
var removeAfterFailedToSaveDocuments: Bool {
|
|
499
488
|
@inline(__always)
|
|
500
489
|
get {
|
|
501
|
-
return
|
|
490
|
+
return self.__removeAfterFailedToSaveDocuments
|
|
502
491
|
}
|
|
503
492
|
@inline(__always)
|
|
504
493
|
set {
|
|
505
|
-
self.
|
|
494
|
+
self.__removeAfterFailedToSaveDocuments = newValue
|
|
506
495
|
}
|
|
507
496
|
}
|
|
508
497
|
|
|
509
|
-
var
|
|
498
|
+
var removeAfterShared: Bool {
|
|
510
499
|
@inline(__always)
|
|
511
500
|
get {
|
|
512
|
-
return
|
|
501
|
+
return self.__removeAfterShared
|
|
513
502
|
}
|
|
514
503
|
@inline(__always)
|
|
515
504
|
set {
|
|
516
|
-
self.
|
|
505
|
+
self.__removeAfterShared = newValue
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
var removeAfterFailedToShare: Bool {
|
|
510
|
+
@inline(__always)
|
|
511
|
+
get {
|
|
512
|
+
return self.__removeAfterFailedToShare
|
|
513
|
+
}
|
|
514
|
+
@inline(__always)
|
|
515
|
+
set {
|
|
516
|
+
self.__removeAfterFailedToShare = newValue
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
var enableRotation: Bool {
|
|
521
|
+
@inline(__always)
|
|
522
|
+
get {
|
|
523
|
+
return self.__enableRotation
|
|
524
|
+
}
|
|
525
|
+
@inline(__always)
|
|
526
|
+
set {
|
|
527
|
+
self.__enableRotation = newValue
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
var rotationAngle: Double {
|
|
532
|
+
@inline(__always)
|
|
533
|
+
get {
|
|
534
|
+
return self.__rotationAngle
|
|
535
|
+
}
|
|
536
|
+
@inline(__always)
|
|
537
|
+
set {
|
|
538
|
+
self.__rotationAngle = newValue
|
|
517
539
|
}
|
|
518
540
|
}
|
|
519
541
|
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// Func_void_std__string.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
|
+
* Wraps a Swift `(_ value: String) -> Void` as a class.
|
|
12
|
+
* This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
|
|
13
|
+
*/
|
|
14
|
+
public final class Func_void_std__string {
|
|
15
|
+
public typealias bridge = margelo.nitro.videotrim.bridge.swift
|
|
16
|
+
|
|
17
|
+
private let closure: (_ value: String) -> Void
|
|
18
|
+
|
|
19
|
+
public init(_ closure: @escaping (_ value: String) -> Void) {
|
|
20
|
+
self.closure = closure
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@inline(__always)
|
|
24
|
+
public func call(value: std.string) -> Void {
|
|
25
|
+
self.closure(String(value))
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Casts this instance to a retained unsafe raw pointer.
|
|
30
|
+
* This acquires one additional strong reference on the object!
|
|
31
|
+
*/
|
|
32
|
+
@inline(__always)
|
|
33
|
+
public func toUnsafe() -> UnsafeMutableRawPointer {
|
|
34
|
+
return Unmanaged.passRetained(self).toOpaque()
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Casts an unsafe pointer to a `Func_void_std__string`.
|
|
39
|
+
* The pointer has to be a retained opaque `Unmanaged<Func_void_std__string>`.
|
|
40
|
+
* This removes one strong reference from the object!
|
|
41
|
+
*/
|
|
42
|
+
@inline(__always)
|
|
43
|
+
public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_std__string {
|
|
44
|
+
return Unmanaged<Func_void_std__string>.fromOpaque(pointer).takeRetainedValue()
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -20,6 +20,7 @@ public protocol HybridVideoTrimSpec_protocol: HybridObject {
|
|
|
20
20
|
func deleteFile(filePath: String) throws -> Promise<Bool>
|
|
21
21
|
func closeEditor(onComplete: @escaping () -> Void) throws -> Void
|
|
22
22
|
func isValidFile(url: String) throws -> Promise<FileValidationResult>
|
|
23
|
+
func trim(url: String, options: TrimOptions) throws -> Promise<String>
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
/// See ``HybridVideoTrimSpec``
|
|
@@ -219,4 +219,23 @@ public class HybridVideoTrimSpec_cxx {
|
|
|
219
219
|
return bridge.create_Result_std__shared_ptr_Promise_FileValidationResult___(__exceptionPtr)
|
|
220
220
|
}
|
|
221
221
|
}
|
|
222
|
+
|
|
223
|
+
@inline(__always)
|
|
224
|
+
public final func trim(url: std.string, options: TrimOptions) -> bridge.Result_std__shared_ptr_Promise_std__string___ {
|
|
225
|
+
do {
|
|
226
|
+
let __result = try self.__implementation.trim(url: String(url), options: options)
|
|
227
|
+
let __resultCpp = { () -> bridge.std__shared_ptr_Promise_std__string__ in
|
|
228
|
+
let __promise = bridge.create_std__shared_ptr_Promise_std__string__()
|
|
229
|
+
let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_std__string__(__promise)
|
|
230
|
+
__result
|
|
231
|
+
.then({ __result in __promiseHolder.resolve(std.string(__result)) })
|
|
232
|
+
.catch({ __error in __promiseHolder.reject(__error.toCpp()) })
|
|
233
|
+
return __promise
|
|
234
|
+
}()
|
|
235
|
+
return bridge.create_Result_std__shared_ptr_Promise_std__string___(__resultCpp)
|
|
236
|
+
} catch (let __error) {
|
|
237
|
+
let __exceptionPtr = __error.toCpp()
|
|
238
|
+
return bridge.create_Result_std__shared_ptr_Promise_std__string___(__exceptionPtr)
|
|
239
|
+
}
|
|
240
|
+
}
|
|
222
241
|
}
|