import { View } from "../ui/view"; import { Color } from "../util/color"; import { BridgeContext } from "../runtime/global"; import { Resource } from "../util/resource"; export declare enum ScaleType { ScaleToFill = 0, ScaleAspectFit = 1, ScaleAspectFill = 2, Tile = 3 } export declare class Image extends View { /** * Set pixels for image directly */ imagePixels?: { width: number; height: number; pixels: ArrayBuffer; }; /** * This could be loaded by customized resource loader */ image?: Resource; imageUrl?: string; /** * Read image from local file system. */ imageFilePath?: string; /** * Read image from local path * For android,it based on assets dir. * For iOS,it based on main bundle dir. */ imagePath?: string; /** * Read image from resource * For android,it will try to read from drawable. * For iOS,it will try to read from Image.Assets. */ imageRes?: string; imageBase64?: string; scaleType?: ScaleType; isBlur?: boolean; /** * Display while image is loading * Local file name */ placeHolderImage?: string; placeHolderImageBase64?: string; /** * Display while image is loading * Color * This priority is lower than placeHolderImage */ placeHolderColor?: Color; /** * Display while image is failed to load * It can be file name in local path */ errorImage?: string; errorImageBase64?: string; /** * Display while image is failed to load * Color * This priority is lower than errorImage */ errorColor?: Color; loadCallback?: (image: { width: number; height: number; animated: boolean; } | undefined) => void; /** * Default is Environment.screenScale. */ imageScale?: number; /** * Unit in pixel */ stretchInset?: { left: number; top: number; right: number; bottom: number; }; /** * Called if loaded image is animated and played end. */ onAnimationEnd?: () => void; isAnimating(context: BridgeContext): Promise; startAnimating(context: BridgeContext): Promise; stopAnimating(context: BridgeContext): Promise; getImageInfo(context: BridgeContext): Promise<{ width: number; height: number; mimeType: string; }>; getImagePixels(context: BridgeContext): Promise; setImagePixels(context: BridgeContext, image: { width: number; height: number; pixels: ArrayBuffer; }): Promise; } export declare function image(config: Partial): Image;