-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathPinturaEditor.d.ts
91 lines (82 loc) · 2.84 KB
/
PinturaEditor.d.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
import * as React from 'react';
import { StyleProp, ViewStyle } from 'react-native/types';
import {
PinturaEditorDefaultOptions,
PinturaReadState,
PinturaWriteState,
PinturaImageState,
PinturaEditor as PinturaEditorInstance,
Shape,
Vector,
Size,
} from '@pqina/pintura';
interface PinturaComponentEvents {
onInit?: (detail: PinturaEditorInstance) => void;
onLoadstart?: () => void;
onLoadabort?: (detail: PinturaReadState) => void;
onLoaderror?: (detail: PinturaReadState) => void;
onLoadprogress?: (detail: PinturaReadState) => void;
onLoad?: (detail: { size: Size }) => void;
onProcessstart?: () => void;
onProcessabort?: (detail: PinturaWriteState) => void;
onProcesserror?: (detail: PinturaWriteState) => void;
onProcessprogress?: (detail: PinturaWriteState) => void;
onProcess?: (detail: {
/** Base64 encoded DataURL */
dest: string;
imageState: PinturaImageState;
}) => void;
onLoadpreview?: (detail: ImageData | ImageBitmap) => void;
onReady?: () => void;
onUpdate?: (detail: PinturaImageState) => void;
onUndo?: (detail: number) => void;
onRedo?: (detail: number) => void;
onRevert?: () => void;
onWritehistory?: () => void;
onClose?: () => void;
onDestroy?: () => void;
onAddshape?: (detail: Shape) => void;
onSelectshape?: (detail: Shape) => void;
onUpdateshape?: (detail: Shape) => void;
onRemoveshape?: (detail: Shape) => void;
onMarkuptap?: (detail: { target?: Shape; position: Vector }) => void;
onMarkupzoom?: (detail: number) => void;
onMarkuppan?: (detail: Vector) => void;
onZoom?: (detail: number) => void;
onPan?: (detail: Vector) => void;
onSelectstyle?: (detail: { [key: string]: unknown }) => void;
onSelectutil?: (detail: string) => void;
onSelectcontrol?: (detail: string) => void;
}
class PinturaEditor extends React.Component<
{
/** React Native styles assigned to <View> wrapping the editor */
style?: StyleProp<ViewStyle>;
/** CSS styles passed to editor webview */
styleRules?: string;
/** videoWriter options */
videoWriter?: {
muxerEncoder?: {
videoBitrate?: number;
audioBitrate?: number;
log?: boolean;
};
mediaStreamEncoder?: {
framesPerSecond?: number;
videoBitrate?: number;
audioBitrate?: number;
log?: boolean;
};
};
// readonly ref?: MutableRefObject<PinturaEditorRef>;
} & PinturaEditorDefaultOptions &
PinturaComponentEvents,
any
> {
editor: PinturaEditorInstance;
}
export default PinturaEditor;
/**
* @deprecated The method should not be used
*/
export const localFileToDataURL: (url: string) => Promise<string>;