UNPKG

expo-image-manipulator

Version:

Provides functions that let you manipulation images on the local file system, eg: resize, crop.

28 lines (27 loc) • 1.09 kB
import { SharedObject } from 'expo'; import type { ActionCrop, ActionExtent, FlipType } from '../ImageManipulator.types'; import ImageManipulatorImageRef from './ImageManipulatorImageRef.web'; type ContextLoader = () => HTMLCanvasElement | Promise<HTMLCanvasElement>; export default class ImageManipulatorContext extends SharedObject { private loader; private isReleased; private _currentTask; get currentTask(): Promise<HTMLCanvasElement>; set currentTask(task: Promise<HTMLCanvasElement>); constructor(loader?: ContextLoader); resize(size: { width: number; height: number; }): ImageManipulatorContext; rotate(degrees: number): ImageManipulatorContext; flip(flipType: FlipType): ImageManipulatorContext; crop(rect: ActionCrop['crop']): ImageManipulatorContext; extent(options: ActionExtent['extent']): ImageManipulatorContext; reset(): ImageManipulatorContext; release(): void; renderAsync(): Promise<ImageManipulatorImageRef>; private addTask; private ensureNotReleased; private releaseTask; } export {};