Skip to content

Commit ab4eea8

Browse files
authored
Merge pull request #29 from rxdsrex/main
Added better coverage of types.
2 parents d67d700 + e1d2bca commit ab4eea8

File tree

2 files changed

+46
-31
lines changed

2 files changed

+46
-31
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "react-native-multiple-image-picker enables application to pick images and videos from multiple smart album in iOS/Android, similar to the current facebook app.",
55
"main": "lib/commonjs/index",
66
"module": "lib/module/index",
7-
"types": "lib/typescript/src/index.d.ts",
7+
"types": "src/index.d.ts",
88
"react-native": "src/index",
99
"source": "src/index",
1010
"files": [

src/index.d.ts

Lines changed: 45 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,55 @@
11
import { NativeModules, Image } from 'react-native';
22

3+
export type Results = {
4+
path: string;
5+
filename: string;
6+
localIdentifier: string;
7+
width: number;
8+
height: number;
9+
mime: string;
10+
type: string;
11+
thumbnail?: string;
12+
creationDate?: string;
13+
}
14+
315
export type Options = {
4-
tapHereToChange: string;
5-
cancelTitle: string;
6-
doneTitle: string;
7-
emptyMessage: string;
8-
emptyImage: Image;
9-
usedCameraButton: boolean;
10-
usedPrefetch: boolean;
11-
previewAtForceTouch: boolean;
12-
allowedLivePhotos: boolean;
13-
allowedVideo: boolean;
14-
allowedAlbumCloudShared: boolean;
15-
allowedPhotograph: boolean; // for camera : allow this option when you want to take a photos
16-
allowedVideoRecording: boolean; //for camera : allow this option when you want to recording video.
17-
maxVideoDuration: Number; //for camera : max video recording duration
18-
autoPlay: boolean;
19-
muteAudio: boolean;
20-
preventAutomaticLimitedAccessAlert: boolean; // newest iOS 14
21-
mediaType: string;
22-
numberOfColumn: number;
23-
maxSelectedAssets: number;
24-
fetchOption: Object;
25-
fetchCollectionOption: Object;
26-
singleSelectedMode: boolean;
27-
maximumMessageTitle: string;
28-
maximumMessage: string;
29-
messageTitleButton: string;
16+
isPreview?: boolean;
17+
selectedColor?: string;
18+
selectedAssets?: Results[];
19+
tapHereToChange?: string;
20+
cancelTitle?: string;
21+
doneTitle?: string;
22+
emptyMessage?: string;
23+
emptyImage?: Image;
24+
usedCameraButton?: boolean;
25+
usedPrefetch?: boolean;
26+
previewAtForceTouch?: boolean;
27+
allowedLivePhotos?: boolean;
28+
allowedVideo?: boolean;
29+
allowedAlbumCloudShared?: boolean;
30+
allowedPhotograph?: boolean; // for camera ?: allow this option when you want to take a photos
31+
allowedVideoRecording?: boolean; //for camera ?: allow this option when you want to recording video.
32+
maxVideoDuration?: Number; //for camera ?: max video recording duration
33+
autoPlay?: boolean;
34+
muteAudio?: boolean;
35+
preventAutomaticLimitedAccessAlert?: boolean; // newest iOS 14
36+
mediaType?: string;
37+
numberOfColumn?: number;
38+
maxSelectedAssets?: number;
39+
fetchOption?: Object;
40+
fetchCollectionOption?: Object;
41+
singleSelectedMode?: boolean;
42+
maximumMessageTitle?: string;
43+
maximumMessage?: string;
44+
messageTitleButton?: string;
3045
//resize thumbnail
31-
thumbnailWidth: number;
32-
thumbnailHeight: number;
33-
haveThumbnail: boolean;
46+
thumbnailWidth?: number;
47+
thumbnailHeight?: number;
48+
haveThumbnail?: boolean;
3449
};
3550

3651
type MultipleImagePickerType = {
37-
openPicker(options: Options, callback: Object): Promise<any>;
52+
openPicker(options: Options): Promise<Results[]>;
3853
};
3954

4055
const { MultipleImagePicker } = NativeModules;

0 commit comments

Comments
 (0)