1
- import { Configuration } from './configuration' ;
1
+ import { Component } from 'react' ;
2
+ import { Configuration } from './configuration' ;
2
3
3
4
declare class VESDK {
4
5
/**
@@ -8,7 +9,7 @@ declare class VESDK {
8
9
* loading videos with `require('./video.mp4')` for debug builds static video assets will be
9
10
* resolved to remote URLs served by the development packager.
10
11
*
11
- * @param {string | {uri: string} | number } videoSource The source of the video to be edited.
12
+ * @param {string | {uri: string} | number } video The source of the video to be edited.
12
13
* Can be either an URI (local only), an object with a member `uri`, or an asset reference
13
14
* which can be optained by, e.g., `require('./video.mp4')` as `number`.
14
15
* @param {Configuration } configuration The configuration used to initialize the editor.
@@ -23,7 +24,7 @@ declare class VESDK {
23
24
* `null` is returned instead.
24
25
*/
25
26
static openEditor (
26
- videoSource : string | { uri : string } | number ,
27
+ video : string | { uri : string } | number ,
27
28
configuration : Configuration ,
28
29
serialization : object
29
30
) : Promise < { image : string , hasChanges : boolean , serialization : object } >
@@ -50,5 +51,74 @@ declare class VESDK {
50
51
) : Configuration
51
52
}
52
53
53
- export { VESDK } ;
54
+ /**
55
+ * Props for the `VideoEditorModal` component.
56
+ */
57
+ interface VideoEditorModalProps {
58
+ /**
59
+ * This prop determines whether your modal is visible.
60
+ */
61
+ visible : boolean ;
62
+
63
+ /**
64
+ * This prop determines the source of the video to be edited.
65
+ * Can be either an URI (local only), an object with a member `uri`, or an asset reference
66
+ * which can be optained by, e.g., `require('./video.mp4')` as `number`.
67
+ *
68
+ * @note Edited videos from remote resources can be previewed in the editor but their export will
69
+ * fail! Remote video resources are currently supported for debugging purposes only, e.g., when
70
+ * loading videos with `require('./video.mp4')` for debug builds static video assets will be
71
+ * resolved to remote URLs served by the development packager.
72
+ */
73
+ video : string | { uri : string } | number ;
74
+
75
+ /**
76
+ * This prop determines the configuration used to initialize the editor.
77
+ */
78
+ configuration ?: Configuration ;
79
+
80
+ /**
81
+ * This prop determines the serialization used to initialize the editor. This
82
+ * restores a previous state of the editor by re-applying all modifications to the loaded
83
+ * video.
84
+ */
85
+ serialization ?: object ;
86
+
87
+ /**
88
+ * This prop determines the callback function that will be called when the user exported a video.
89
+ *
90
+ * The object passed to this callback includes the edited `video`, an indicator (`hasChanges`) whether
91
+ * the input video was modified at all, and all modifications (`serialization`) applied to the input video
92
+ * if `export.serialization.enabled` of the `configuration` prop was set.
93
+ */
94
+ onExport : ( { video : string , hasChanges : boolean , serialization : object } ) => void ;
95
+
96
+ /**
97
+ * This prop determines the callback function that will be called when the user dissmisses the editor without
98
+ * exporting a video.
99
+ */
100
+ onCancel ?: ( ) => void ;
101
+
102
+ /**
103
+ * This prop determines the callback function that will be called when an error occurs.
104
+ */
105
+ onError ?: ( error : Error ) => void ;
106
+ }
107
+
108
+ /**
109
+ * State for the `VideoEditorModal` component.
110
+ */
111
+ interface VideoEditorModalState {
112
+ /**
113
+ * This state determines whether the modal is visible.
114
+ */
115
+ visible : boolean ;
116
+ }
117
+
118
+ /**
119
+ * A component that wraps the `VESDK.openEditor` function to modally present a video editor.
120
+ */
121
+ declare class VideoEditorModal extends Component < VideoEditorModalProps , VideoEditorModalState > { }
122
+
123
+ export { VESDK , VideoEditorModal } ;
54
124
export * from './configuration' ;
0 commit comments