-
Notifications
You must be signed in to change notification settings - Fork 1
/
definitions.ts
117 lines (98 loc) · 2.29 KB
/
definitions.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
import type { PermissionState } from '@capacitor/core';
export interface VideoEditorPlugin {
getVideos(options: VideoOptions): Promise<ReturnVideos>;
checkPermissions(): Promise<PermissionStatus>;
requestPermissions(
permissions?: VideoEditorPluginPermissions,
): Promise<PermissionStatus>;
trim(options: TrimOptions): Promise<Video>;
concatVideos(paths: ConcatOptions): Promise<Video>;
}
export type CameraPermissionState = PermissionState | 'limited';
export type CameraPermissionType = 'camera' | 'videos';
export interface TrimOptions {
/* start and end in format HH:MM:SS eg.: 00:00:02 for 2seconds */
start: string;
end: string;
path: string;
extension: string;
}
/**
* The path will contain a full,
* platform-specific file URL that can be read later using the Filsystem API.
*
* @since 1.0.0
*/
export interface ConcatOptions {
videos: ConcatItem[];
audio?: string;
amountThumbnails: number;
}
export interface ConcatItem {
/*start and duration in seconds*/
/*duration actually is end -> will refactor later*/
path: string;
start: string;
duration: string;
}
export interface PermissionStatus {
camera: CameraPermissionState;
videos: CameraPermissionState;
}
export interface VideoEditorPluginPermissions {
permissions: CameraPermissionType[];
}
export interface VideoOptions {
/* 0 equals to unlimited?!*/
maxVideos?: number;
amountThumbnails?: number
}
export interface ReturnVideos {
videos: Video[];
}
export interface Video {
/**
* The path will contain a full,
* platform-specific file URL that can be read later using the Filsystem API.
*
* @since 1.0.0
*/
path: string;
/**
* webPath returns a path that can be used to set the src attribute of an video element for efficient
* loading and rendering.
*
* @since 1.0.0
*/
webPath: string;
/**
* Exif data, if any, retrieved from the video
*
* @since 1.0.0
*/
exif?: any;
/**
* format of the video
*
* @since 1.0.0
*/
extension: string;
/**
* The webpaths to the generated thumbnails
*
* @since 1.0.0
*/
thumbnails: [string];
/**
* The duration of the video in seconds
*
* @since 1.0.0
*/
duration: string;
/**
* The size of the video in bytes
*
* @since 1.0.0
*/
size: string;
}