diff --git a/types/expo/expo-tests.tsx b/types/expo/expo-tests.tsx index fa329ea8e3..4f51cb0050 100644 --- a/types/expo/expo-tests.tsx +++ b/types/expo/expo-tests.tsx @@ -373,9 +373,9 @@ async () => { }; async () => { - const result = await ImageManipulator.manipulate('url', { + const result = await ImageManipulator.manipulate('url', [{ rotate: 90 - }, { + }], { compress: 0.75 }); diff --git a/types/expo/index.d.ts b/types/expo/index.d.ts index dd7057b007..3e86549492 100644 --- a/types/expo/index.d.ts +++ b/types/expo/index.d.ts @@ -1513,6 +1513,27 @@ export namespace Gyroscope { * ImageManipulator */ export namespace ImageManipulator { + type Action = Resize | Rotate | Flip | Crop; + + interface Resize { + resize: { width: number, height: number }; + } + + interface Rotate { + rotate: number; + } + + interface Flip { + flip?: { vertical?: boolean; horizontal?: boolean }; + } + + interface Crop { + originX: number; + originY: number; + width: number; + height: number; + } + interface ImageResult { uri: string; width: number; @@ -1527,21 +1548,7 @@ export namespace ImageManipulator { format?: 'jpeg' | 'png'; } - interface CropParameters { - originX: number; - originY: number; - width: number; - height: number; - } - - interface ImageManipulationOptions { - resize?: { width?: number; height?: number }; - rotate?: number; - flip?: { vertical?: boolean; horizontal?: boolean }; - crop?: CropParameters; - } - - function manipulate(uri: string, actions: ImageManipulationOptions, saveOptions?: SaveOptions): Promise; + function manipulate(uri: string, actions: Action[], saveOptions?: SaveOptions): Promise; } /**