From 26eb5d587883e0eef275fe459f10d6f300a71b38 Mon Sep 17 00:00:00 2001 From: Jesper Madsen Date: Thu, 15 Mar 2018 11:49:19 +0100 Subject: [PATCH] Included result.type, base64, exif in ImageLibrary API as per docs --- types/expo/expo-tests.tsx | 25 ++++++++++++++++++++++++- types/expo/index.d.ts | 6 ++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/types/expo/expo-tests.tsx b/types/expo/expo-tests.tsx index aead720f5b..d1b543c591 100644 --- a/types/expo/expo-tests.tsx +++ b/types/expo/expo-tests.tsx @@ -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; } }; diff --git a/types/expo/index.d.ts b/types/expo/index.d.ts index 8f0463bf0d..8661cac727 100644 --- a/types/expo/index.d.ts +++ b/types/expo/index.d.ts @@ -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; }