mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-06-04 19:42:46 +08:00
Included result.type, base64, exif in ImageLibrary API as per docs
This commit is contained in:
@@ -289,14 +289,37 @@ async () => {
|
||||
};
|
||||
|
||||
async () => {
|
||||
// Video test
|
||||
const result = await ImagePicker.launchImageLibraryAsync({
|
||||
mediaTypes: ImagePicker.MediaTypeOptions.Videos
|
||||
mediaTypes: ImagePicker.MediaTypeOptions.Videos,
|
||||
});
|
||||
|
||||
if (!result.cancelled) {
|
||||
result.uri;
|
||||
result.width;
|
||||
result.height;
|
||||
result.duration;
|
||||
result.type;
|
||||
}
|
||||
};
|
||||
|
||||
async () => {
|
||||
// Image test
|
||||
const result = await ImagePicker.launchImageLibraryAsync({
|
||||
mediaTypes: ImagePicker.MediaTypeOptions.Images,
|
||||
base64: true,
|
||||
aspect: [4, 3],
|
||||
quality: 1,
|
||||
exif: true,
|
||||
});
|
||||
|
||||
if (!result.cancelled) {
|
||||
result.uri;
|
||||
result.width;
|
||||
result.height;
|
||||
result.exif;
|
||||
result.base64;
|
||||
result.type;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
6
types/expo/index.d.ts
vendored
6
types/expo/index.d.ts
vendored
@@ -1418,6 +1418,10 @@ export namespace ImagePicker {
|
||||
uri: string;
|
||||
width: number;
|
||||
height: number;
|
||||
type: 'video' | 'image';
|
||||
base64?: string;
|
||||
exif?: object;
|
||||
duration?: number;
|
||||
}
|
||||
|
||||
type ImageResult = { cancelled: true } | ({ cancelled: false } & ImageInfo);
|
||||
@@ -1434,6 +1438,8 @@ export namespace ImagePicker {
|
||||
allowsEditing?: boolean;
|
||||
aspect?: [number, number];
|
||||
quality?: number;
|
||||
base64?: boolean;
|
||||
exif?: boolean;
|
||||
mediaTypes?: keyof _MediaTypeOptions;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user