forked from bitlab-code/react-native-image-manipulator
-
Notifications
You must be signed in to change notification settings - Fork 8
/
index.ts
32 lines (30 loc) · 743 Bytes
/
index.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
import RNImageManipulator from './fabric/NativeImageManipulatorModule';
export type RNImageManipulatorResult = {
uri: string;
width: number;
height: number;
base64?: string;
};
export default {
manipulate(
uri: string,
actions: Array<{
resize?: {width?: number; height?: number};
rotate?: number;
flip?: {vertical?: boolean; horizontal?: boolean};
crop?: {
originX?: number;
originY?: number;
width?: number;
height?: number;
};
}>,
saveOptions: {
compress?: number;
format?: 'jpeg' | 'png';
base64?: boolean;
},
): Promise<RNImageManipulatorResult> {
return RNImageManipulator.manipulate(uri, actions, saveOptions);
},
};