mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 06:47:03 +00:00
Merge pull request #26923 from AdrianoRuberto/master
[expo] Fix ImageManipulator actions
This commit is contained in:
@@ -373,9 +373,9 @@ async () => {
|
||||
};
|
||||
|
||||
async () => {
|
||||
const result = await ImageManipulator.manipulate('url', {
|
||||
const result = await ImageManipulator.manipulate('url', [{
|
||||
rotate: 90
|
||||
}, {
|
||||
}], {
|
||||
compress: 0.75
|
||||
});
|
||||
|
||||
|
||||
Vendored
+22
-15
@@ -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>;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user