1
1
declare module "react-native-image-picker" {
2
2
3
- interface Response {
3
+ interface ImagePickerResponse {
4
4
customButton : string ;
5
5
didCancel : boolean ;
6
6
error : string ;
@@ -19,17 +19,17 @@ declare module "react-native-image-picker" {
19
19
timestamp ?: string ;
20
20
}
21
21
22
- interface CustomButtonOptions {
22
+ interface ImagePickerCustomButtonOptions {
23
23
name ?: string ;
24
24
title ?: string ;
25
25
}
26
26
27
- interface Options {
27
+ interface ImagePickerOptions {
28
28
title ?: string ;
29
29
cancelButtonTitle ?: string ;
30
30
takePhotoButtonTitle ?: string ;
31
31
chooseFromLibraryButtonTitle ?: string ;
32
- customButtons ?: Array < CustomButtonOptions > ;
32
+ customButtons ?: Array < ImagePickerCustomButtonOptions > ;
33
33
cameraType ?: 'front' | 'back' ;
34
34
mediaType ?: 'photo' | 'video' | 'mixed' ;
35
35
maxWidth ?: number ;
@@ -40,23 +40,21 @@ declare module "react-native-image-picker" {
40
40
rotation ?: number ;
41
41
allowsEditing ?: boolean ;
42
42
noData ?: boolean ;
43
- storageOptions ?: StorageOptions ;
43
+ storageOptions ?: ImagePickerStorageOptions ;
44
44
}
45
45
46
- interface StorageOptions {
46
+ interface ImagePickerStorageOptions {
47
47
skipBackup ?: boolean ;
48
48
path ?: string ;
49
49
cameraRoll ?: boolean ;
50
50
waitUntilSaved ?: boolean ;
51
51
}
52
52
53
53
54
- class ImagePicker {
55
- static showImagePicker ( options : Options , callback : ( response : Response ) => void ) : void ;
56
- static launchCamera ( options : Options , callback : ( response : Response ) => void ) : void ;
57
- static launchImageLibrary ( options : Options , callback : ( response : Response ) => void ) : void ;
54
+ export default class ImagePicker {
55
+ static showImagePicker ( options : ImagePickerOptions , callback : ( response : ImagePickerResponse ) => void ) : void ;
56
+ static launchCamera ( options : ImagePickerOptions , callback : ( response : ImagePickerResponse ) => void ) : void ;
57
+ static launchImageLibrary ( options : ImagePickerOptions , callback : ( response : ImagePickerResponse ) => void ) : void ;
58
58
}
59
59
60
- export = ImagePicker ;
61
-
62
60
}
0 commit comments