-
Notifications
You must be signed in to change notification settings - Fork 87
/
index.d.ts
65 lines (60 loc) · 2.05 KB
/
index.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
declare module "react-native-photo-upload" {
import { StyleProp, ViewStyle } from "react-native";
interface ImagePickerResponse {
customButton: string;
didCancel: boolean;
error: string;
data: string;
uri: string;
origURL?: string;
isVertical: boolean;
width: number;
height: number;
fileSize: number;
type?: string;
fileName?: string;
path?: string;
latitude?: number;
longitude?: number;
timestamp?: string;
}
interface ImageResizerResponse {
path: string;
uri: string;
size?: number;
name?: string;
}
interface PhotoUploadProps {
/** Style object for the image container */
containerStyle?: StyleProp<ViewStyle>;
/** Title for the image picker prompt, default is 'Select Photo' */
photoPickerTitle?: string;
/** the resized image height, default is 300 */
height?: number;
/** the resized image width, default is 300 */
width?: number;
/** The format desired of the resized image, 'JPEG' or 'PNG' default is 'JPEG' */
format?: "JPEG" | "PNG";
/** The quality of the resized image indicated by a number between 1 and 100, default is 80 */
quality?: number;
/** function which takes the base64 string of the new image as parameter */
onPhotoSelect?: (base64: string) => void;
/** fires if any error occur with response */
onError?: (err: Error) => void;
/** fires on tap custom button */
onTapCustomButton?: (customButton: string) => void;
/** fires when user starts (useful for loading, etc) */
onStart?: () => void;
/** fires when user cancel */
onCancel?: (reason: string) => void;
/** fires on response exists */
onResponse?: (response: ImagePickerResponse) => void;
/** fires after render */
onRender?: () => void;
/** fires when image resized is ready */
onResizedImageUri?: (response: ImageResizerResponse) => void;
/** react-native-image-picker props */
imagePickerProps?: object;
}
export default class PhotoUpload extends React.Component<PhotoUploadProps> {}
}