1+ type $Maybe < T > = T | null | undefined ;
2+
3+ export type ImageCropData = {
4+ /**
5+ * The top-left corner of the cropped image, specified in the original
6+ * image's coordinate space.
7+ */
8+ offset : {
9+ x : number ,
10+ y : number ,
11+ } ,
12+ /**
13+ * The size (dimensions) of the cropped image, specified in the original
14+ * image's coordinate space.
15+ */
16+ size : {
17+ width : number ,
18+ height : number ,
19+ } ,
20+ /**
21+ * (Optional) size to scale the cropped image to.
22+ */
23+ displaySize ?: $Maybe < {
24+ width : number ,
25+ height : number ,
26+ } > ,
27+ /**
28+ * (Optional) the resizing mode to use when scaling the image. If the
29+ * `displaySize` param is not specified, this has no effect.
30+ */
31+ resizeMode ?: $Maybe < {
32+ contain : string ,
33+ cover : string ,
34+ stretch : string ,
35+ } > ,
36+ } ;
37+
38+ declare class ImageEditor {
39+ /**
40+ * Crop the image specified by the URI param. If URI points to a remote
41+ * image, it will be downloaded automatically. If the image cannot be
42+ * loaded/downloaded, the failure callback will be called. On Android, a
43+ * downloaded image may be cached in external storage, a publicly accessible
44+ * location, if it has more available space than internal storage.
45+ *
46+ * If the cropping process is successful, the resultant cropped image
47+ * will be stored in the ImageStore, and the URI returned in the success
48+ * callback will point to the image in the store. Remember to delete the
49+ * cropped image from the ImageStore when you are done with it.
50+ */
51+ static cropImage : (
52+ uri : string ,
53+ cropData : ImageCropData ,
54+ success : ( uri : string ) => void ,
55+ failure : ( error : Object ) => void ,
56+ ) => void
57+ }
58+
59+ export default ImageEditor
0 commit comments