Merge pull request #26923 from AdrianoRuberto/master

[expo] Fix ImageManipulator actions
This commit is contained in:
Paul van Brenk
2018-06-28 13:33:28 -07:00
committed by GitHub
2 changed files with 24 additions and 17 deletions
+2 -2
View File
@@ -373,9 +373,9 @@ async () => {
};
async () => {
const result = await ImageManipulator.manipulate('url', {
const result = await ImageManipulator.manipulate('url', [{
rotate: 90
}, {
}], {
compress: 0.75
});
+22 -15
View File
@@ -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<ImageResult>;
function manipulate(uri: string, actions: Action[], saveOptions?: SaveOptions): Promise<ImageResult>;
}
/**