From f2b6c010d2628e3826527e32ecb69930008559c1 Mon Sep 17 00:00:00 2001 From: levan basharuli Date: Wed, 21 Nov 2018 02:07:57 +0400 Subject: [PATCH] added expo/ImageManipulator.manipulateAsync --- types/expo/expo-tests.tsx | 15 +++++++++++++++ types/expo/index.d.ts | 3 +++ 2 files changed, 18 insertions(+) diff --git a/types/expo/expo-tests.tsx b/types/expo/expo-tests.tsx index 61467bd5d1..5bb6b5abc4 100644 --- a/types/expo/expo-tests.tsx +++ b/types/expo/expo-tests.tsx @@ -413,6 +413,21 @@ async () => { result.width; }; +async () => { + const result = await ImageManipulator.manipulateAsync('url', [ + { rotate: 360 }, + { resize: { width: 300 } }, + { resize: { height: 300 } }, + { resize: { height: 300, width: 300 } }, + ], { + compress: 0.75 + }); + + result.height; + result.uri; + result.width; +}; + FaceDetector.Constants.Mode.fast; FaceDetector.Constants.Mode.accurate; FaceDetector.Constants.Landmarks.all; diff --git a/types/expo/index.d.ts b/types/expo/index.d.ts index d5891bad2d..45f20d6d10 100644 --- a/types/expo/index.d.ts +++ b/types/expo/index.d.ts @@ -11,6 +11,7 @@ // Tina Roh // Nathan Phillip Brink // Martin Olsson +// Levan Basharuli // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -1559,6 +1560,8 @@ export namespace ImageManipulator { } function manipulate(uri: string, actions: Action[], saveOptions?: SaveOptions): Promise; + + function manipulateAsync(uri: string, actions: Action[], saveOptions?: SaveOptions): Promise; } /**