From fce90ee2e436a6384397922cb18e8fff6dcaa620 Mon Sep 17 00:00:00 2001 From: guanzengkun Date: Thu, 14 Aug 2025 19:28:50 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0image=20modifier=20Signed-off?= =?UTF-8?q?-by:guanzengkun=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/@internal/component/ets/image.d.ts | 4728 +++++++++++------------- api/arkui/ImageModifier.d.ts | 26 +- api/arkui/ImageModifier.static.d.ets | 32 + api/arkui/component/image.d.ets | 142 - api/arkui/component/image.static.d.ets | 3 + 5 files changed, 2270 insertions(+), 2661 deletions(-) create mode 100644 api/arkui/ImageModifier.static.d.ets delete mode 100644 api/arkui/component/image.d.ets diff --git a/api/@internal/component/ets/image.d.ts b/api/@internal/component/ets/image.d.ts index 24d63a95eb..011e31b035 100644 --- a/api/@internal/component/ets/image.d.ts +++ b/api/@internal/component/ets/image.d.ts @@ -18,19 +18,6 @@ * @kit ArkUI */ -/*** if arkts 1.2 */ -import image from '../../@ohos.multimedia.image'; -import drawing from '../../@ohos.graphics.drawing'; -import matrix4 from '../../@ohos.matrix4' -import { BusinessError } from '../../@ohos.base'; -import { DrawableDescriptor } from '../../@ohos.arkui.drawableDescriptor'; -import { ImageAIOptions, ImageAnalyzerConfig } from './imageCommon'; -import { ResourceStr, ResourceColor, ColorFilter, EdgeWidths, ColorMetrics } from './units'; -import { ImageFit, ImageRepeat, CopyOptions } from './enums'; -import { Resource } from '../../global/resource'; -import { CommonMethod, PointLightStyle, PixelMap } from './common' -/*** endif */ - /** * Use the DrawableDescriptor class to get drawable image. * @@ -45,2508 +32,2237 @@ import { CommonMethod, PointLightStyle, PixelMap } from './common' * @atomicservice * @since 11 */ -declare type DrawableDescriptor = import ('../api/@ohos.arkui.drawableDescriptor').DrawableDescriptor; - -/** - * Import the DrawingColorFilter type object for image color filter setting. - * - * @typedef { import('../api/@ohos.graphics.drawing').default.ColorFilter } DrawingColorFilter - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 12 - */ -declare type DrawingColorFilter = import('../api/@ohos.graphics.drawing').default.ColorFilter; - -/** - * Import the DrawingColorFilter type object for image color filter setting. - * - * @typedef { drawing.ColorFilter } DrawingColorFilter - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ -declare type DrawingColorFilter = drawing.ColorFilter; - -/** - * Enumerates all the levels available for the image resolution quality. - * - * @typedef {import('../api/@ohos.multimedia.image').default.ResolutionQuality} ResolutionQuality - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @systemapi - * @since 12 - */ -declare type ResolutionQuality = import('../api/@ohos.multimedia.image').default.ResolutionQuality; - -/** - * Enumerates all the levels available for the image resolution quality. - * - * @typedef { image.ResolutionQuality } ResolutionQuality - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @systemapi - * @since 20 - * @arkts 1.2 - */ -declare type ResolutionQuality = image.ResolutionQuality; - -/** - * Lattice for dividing an image into grids. - * - * @typedef { import('../api/@ohos.graphics.drawing').default.Lattice } Lattice - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 12 - */ -declare type DrawingLattice = import('../api/@ohos.graphics.drawing').default.Lattice; - -/** - * Lattice for dividing an image into grids. - * - * @typedef { drawing.Lattice } DrawingLattice - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ -declare type DrawingLattice = drawing.Lattice; - -/** - * Object matrix used for setting image transformations. - * - * @typedef { import('../api/@ohos.matrix4').default.Matrix4Transit } Matrix4Transit - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 15 - */ -declare type ImageMatrix = import ('../api/@ohos.matrix4').default.Matrix4Transit; - -/** - * Object matrix used for setting image transformations. - * - * @typedef { matrix4.Matrix4Transit } Matrix4Transit - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ -declare type ImageMatrix = matrix4.Matrix4Transit; + declare type DrawableDescriptor = import ('../api/@ohos.arkui.drawableDescriptor').DrawableDescriptor; -/** - * Business error in onError callback. + /** + * Import the DrawingColorFilter type object for image color filter setting. * - * @typedef { import('../api/@ohos.base').BusinessError } BusinessError + * @typedef { import('../api/@ohos.graphics.drawing').default.ColorFilter } DrawingColorFilter * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform - * @form * @atomicservice - * @since 20 + * @since 12 */ -declare type BusinessError = import('../api/@ohos.base').BusinessError; - -/** - * @enum { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 7 - */ -/** - * @enum { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @form - * @since 9 - */ -/** - * @enum { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @since 10 - */ -/** - * @enum { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 - */ -declare enum ImageRenderMode { - /** - * Render according to the original image, including colors. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 7 - */ - /** - * Render according to the original image, including colors. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @form - * @since 9 - */ - /** - * Render according to the original image, including colors. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @since 10 - */ - /** - * Render according to the original image, including colors. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 - */ - Original, - - /** - * Render the image as a template image, ignoring the color information of the image. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 7 - */ - /** - * Render the image as a template image, ignoring the color information of the image. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @form - * @since 9 - */ - /** - * Render the image as a template image, ignoring the color information of the image. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @since 10 - */ - /** - * Render the image as a template image, ignoring the color information of the image. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 - */ - Template, -} - -/** - * Specify image's content. - * - * @enum { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 - */ -declare enum ImageContent { - /** - * Make image empty. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 - */ - EMPTY = 0, -} - -/** - * @enum { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 - */ -declare enum DynamicRangeMode { - /** - * Allow image content to use an unrestricted extended range. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 - */ - HIGH = 0, - - /** - * Allow image content to use some extended range. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 - */ - CONSTRAINT = 1, - - /** - * Restrict the image content dynamic range to the standard range. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 - */ - STANDARD = 2, -} - -/** - * @enum { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 7 - */ -/** - * @enum { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @form - * @since 9 - */ -/** - * @enum { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @since 10 - */ -/** - * @enum { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 - */ -declare enum ImageInterpolation { - /** - * Do not use interpolated image data. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 7 - */ - /** - * Do not use interpolated image data. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @form - * @since 9 - */ - /** - * Do not use interpolated image data. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @since 10 - */ - /** - * Do not use interpolated image data. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 - */ - None, - - /** - * Low usage of interpolated image data. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 7 - */ - /** - * Low usage of interpolated image data. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @form - * @since 9 - */ - /** - * Low usage of interpolated image data. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @since 10 - */ - /** - * Low usage of interpolated image data. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 - */ - Low, - - /** - * Interpolated image data is used moderately. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 7 - */ - /** - * Interpolated image data is used moderately. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @form - * @since 9 - */ - /** - * Interpolated image data is used moderately. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @since 10 - */ - /** - * Interpolated image data is used moderately. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 - */ - Medium, - - /** - * High usage of interpolated image data may affect the speed of image rendering. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 7 - */ - /** - * High usage of interpolated image data may affect the speed of image rendering. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @form - * @since 9 - */ - /** - * High usage of interpolated image data may affect the speed of image rendering. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @since 10 - */ - /** - * High usage of interpolated image data may affect the speed of image rendering. + declare type DrawingColorFilter = import('../api/@ohos.graphics.drawing').default.ColorFilter; + + /** + * Enumerates all the levels available for the image resolution quality. + * + * @typedef {import('../api/@ohos.multimedia.image').default.ResolutionQuality} ResolutionQuality + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 12 + */ + declare type ResolutionQuality = import('../api/@ohos.multimedia.image').default.ResolutionQuality; + + /** + * Lattice for dividing an image into grids. + * + * @typedef { import('../api/@ohos.graphics.drawing').default.Lattice } Lattice + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + declare type DrawingLattice = import('../api/@ohos.graphics.drawing').default.Lattice; + + /** + * Object matrix used for setting image transformations. + * + * @typedef { import('../api/@ohos.matrix4').default.Matrix4Transit } Matrix4Transit + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 15 + */ + declare type ImageMatrix = import ('../api/@ohos.matrix4').default.Matrix4Transit; + + /** + * Business error in onError callback. * + * @typedef { import('../api/@ohos.base').BusinessError } BusinessError * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 - */ - High, -} - -/** - * @enum { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since arkts {'1.1':'14','1.2':'20'} - * @arkts 1.1&1.2 - */ -declare enum ImageRotateOrientation { - /** - * Rotate according to the image rotation - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since arkts {'1.1':'14','1.2':'20'} - * @arkts 1.1&1.2 - */ - AUTO = 0, - - /** - * Ignore the rotation of the image - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since arkts {'1.1':'14','1.2':'20'} - * @arkts 1.1&1.2 - */ - UP = 1, - - /** - * Based on image rotation, rotate clockwise 90 degrees - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since arkts {'1.1':'14','1.2':'20'} - * @arkts 1.1&1.2 + * @since 20 */ - RIGHT = 2, - - /** - * Based on image rotation, rotate clockwise 180 degrees - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since arkts {'1.1':'14','1.2':'20'} - * @arkts 1.1&1.2 - */ - DOWN = 3, - - /** - * Based on image rotation, rotate clockwise 270 degrees - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since arkts {'1.1':'14','1.2':'20'} - * @arkts 1.1&1.2 - */ - LEFT = 4, - - /** - * Flip the orignial image horizontally - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.1&1.2 - */ - UP_MIRRORED = 5, - - /** - * Flip the orignial image horizontally and rotate clockwise 90 degrees - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.1&1.2 - */ - RIGHT_MIRRORED = 6, - - /** - * Flip the orignial image vertically - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.1&1.2 - */ - DOWN_MIRRORED = 7, - - /** - * Flip the orignial image horizontally and rotate clockwise 270 degrees - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.1&1.2 - */ - LEFT_MIRRORED = 8, -} - -/** - * ImageCompleteEvent - * - * @interface ImageCompleteEvent - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ -export interface ImageCompleteEvent { - /** - * The width of the image source. - * - * @type { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - width: number; - /** - * The height of the image source. - * - * @type { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - height: number; - /** - * The width of the component source. - * - * @type { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - componentWidth: number; - /** - * The height of the component source. - * - * @type { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - componentHeight: number; - /** - * The value of the status of the image being loaded successfully. - * If the returned status value is 0, the image data is successfully loaded. - * If the returned status value is 1, the image is successfully decoded. - * - * @type { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - loadingStatus: number; - /** - * The width of the picture that is actually drawn. - * - * @type { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - contentWidth: number; - /** - * The height of the picture that is actually drawn. - * - * @type { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - contentHeight: number; - /** - * The actual draw is offset from the x-axis of the component itself. - * - * @type { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - contentOffsetX: number; - /** - * The actual draw is offset from the y-axis of the component itself. - * - * @type { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - contentOffsetY: number; -} - -/** - * @interface ImageInterface - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 7 - */ -/** - * @interface ImageInterface - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @form - * @since 9 - */ -/** - * @interface ImageInterface - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @since 10 - */ -/** - * @interface ImageInterface - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 - * @noninterop - */ -interface ImageInterface { - /** - * Set src to obtain images. - * - * @param { PixelMap | ResourceStr | DrawableDescriptor } src - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 7 - */ - /** - * Set src to obtain images - * - * @param { PixelMap | ResourceStr | DrawableDescriptor } src - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @form - * @since 9 - */ - /** - * Set src to obtain images - * - * @param { PixelMap | ResourceStr | DrawableDescriptor } src - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @since 10 - */ - /** - * Set src to obtain images - * - * @param { PixelMap | ResourceStr | DrawableDescriptor } src - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 11 - */ - (src: PixelMap | ResourceStr | DrawableDescriptor): ImageAttribute; - - /** - * Set src to obtain images - * - * @param { PixelMap | ResourceStr | DrawableDescriptor | ImageContent } src - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 - */ - (src: PixelMap | ResourceStr | DrawableDescriptor | ImageContent): ImageAttribute; - - /** - * Set src and ai options to obtain images - * - * @param { PixelMap | ResourceStr | DrawableDescriptor } src - * @param { ImageAIOptions } imageAIOptions - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 - */ - (src: PixelMap | ResourceStr | DrawableDescriptor, imageAIOptions: ImageAIOptions): ImageAttribute; -} - -/** - * Defines source size of image. - * - * @interface ImageSourceSize - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 - */ - -interface ImageSourceSize { - /** - * Set width. - * - * @type { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 7 - */ - /** - * Set width. - * - * @type { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @form - * @since 9 - */ - /** - * Set width. - * - * @type { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @since 10 - */ - /** - * Set width. - * - * @type { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 11 - */ - /** - * Set width. - * Anonymous Object Rectification. - * - * @type { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 - */ - width: number; - - /** - * Set height. - * - * @type { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 7 - */ - /** - * Set height. - * - * @type { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @form - * @since 9 - */ - /** - * Set height. - * - * @type { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @since 10 - */ - /** - * Set height. - * - * @type { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 11 - */ - /** - * Set height. - * Anonymous Object Rectification. - * - * @type { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 - */ - height: number; -} - -/** - * Defines the ColorContent. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since arkts {'1.1':'15','1.2':'20'} - * @arkts 1.1&1.2 - */ -declare class ColorContent { - /** - * Indicates the ColorContent to original value. - * - * @type { ColorContent } - * @readonly - * @static - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since arkts {'1.1':'15','1.2':'20'} - * @arkts 1.1&1.2 - */ - static readonly ORIGIN: ColorContent; -} - -/** - * @extends CommonMethod - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 7 - */ -/** - * @extends CommonMethod - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @form - * @since 9 - */ -/** - * @extends CommonMethod - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @since 10 - */ -/** - * @extends CommonMethod - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 - * @noninterop - */ -declare class ImageAttribute extends CommonMethod { - /** - * Placeholder displayed on load - * - * @param { string | Resource } value - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 7 - */ - /** - * Placeholder displayed on load - * - * @param { string | Resource } value - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @form - * @since 9 - */ - /** - * Placeholder displayed on load - * - * @param { string | Resource } value - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @since 10 - */ - /** - * Placeholder displayed on load - * - * @param { string | Resource } value - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 11 - */ - /** - * Sets the placeholder image displayed during loading. - * - *

NOTE: - *
This attribute does not take effect when the parameter type of the component is AnimatedDrawableDescriptor. - *

- * - * @param { string | Resource | PixelMap } value - Placeholder image displayed during loading, Default value is null. - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 - */ - alt(value: string | Resource | PixelMap): ImageAttribute; - - /** - * match Text Direction - * - * @param { boolean } value - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 7 - */ - /** - * match Text Direction - * - * @param { boolean } value - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @form - * @since 9 - */ - /** - * match Text Direction - * - * @param { boolean } value - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @since 10 - */ - /** - * Specifies whether to display the image in the system language direction. - * - *

NOTE: - *
This attribute does not take effect when the parameter type of the component is AnimatedDrawableDescriptor. - *

- * - * @param { boolean } value - Whether to display the image in the system language direction, Default value is false. - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 - */ - matchTextDirection(value: boolean): ImageAttribute; - - /** - * Sets whether the display size of the image follows the source size. - * - * @param { boolean } value - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 7 - */ - /** - * Sets whether the display size of the image follows the source size. - * - * @param { boolean } value - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @form - * @since 9 - */ - /** - * Sets whether the display size of the image follows the source size. - * - * @param { boolean } value - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @since 10 - */ - /** - * Sets whether the display size of the image follows the source size. - * - *

NOTE: - *
This attribute does not take effect when the parameter type of the component is AnimatedDrawableDescriptor. - *

- * - * @param { boolean } value - Whether to fit the image to the size of the image source, Default value is false. - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 - */ - fitOriginalSize(value: boolean): ImageAttribute; - - /** - * fill Color - * - * @param { ResourceColor } value - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 7 - */ - /** - * fill Color - * - * @param { ResourceColor } value - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @form - * @since 9 - */ - /** - * fill Color - * - * @param { ResourceColor } value - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @since 10 - */ - /** - * Sets the fill color to be superimposed on the image. - * By default, no fill color is applied. If an invalid value is passed, the system uses the default theme color: - * black in light mode and white in dark mode. - * - *

NOTE: - *
This attribute applies only to SVG images. - *
This attribute does not take effect when the parameter type of the component is AnimatedDrawableDescriptor. - *

- * - * @param { ResourceColor } value - Fill color to be superimposed on the image. - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 11 - */ - fillColor(value: ResourceColor): ImageAttribute; - - /** - * Sets the fill color to be superimposed on the image. - * By default, no fill color is applied. If an invalid value is passed, the system uses the default theme color: - * black in light mode and white in dark mode. - * - *

NOTE: - *
This attribute applies only to SVG images. - *
This attribute does not take effect when the parameter type of the component is AnimatedDrawableDescriptor. - *

- * - * @param { ResourceColor | ColorContent } color - Fill color to be superimposed on the image. - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 15 - */ - fillColor(color: ResourceColor | ColorContent): ImageAttribute; - - /** - * Sets the fill color to be superimposed on the image. - * By default, no fill color is applied. If an invalid value is passed, the system uses the default theme color: - * black in light mode and white in dark mode. - * - *

NOTE: - *
This attribute applies only to SVG images. - *
This attribute does not take effect when the parameter type of the component is AnimatedDrawableDescriptor. - *

- * - * @param { ResourceColor | ColorContent | ColorMetrics } color - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.1&1.2 - */ - fillColor(color: ResourceColor | ColorContent | ColorMetrics): ImageAttribute; - - /** - * Sets the zoom type of an image. - * - * @param { ImageFit } value - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 7 - */ - /** - * Sets the zoom type of an image. - * - * @param { ImageFit } value - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @form - * @since 9 - */ - /** - * Sets the zoom type of an image. - * - * @param { ImageFit } value - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @since 10 - */ - /** - * Sets how the image is resized to fit its container. - * - * @param { ImageFit } value - How the image is resized to fit its container, Default value is ImageFit.Cover. - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 - */ - objectFit(value: ImageFit): ImageAttribute; - - /** - * Sets the transformation matrix of the image. - * - * @param { ImageMatrix } matrix - Transformation matrix of the image. - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since arkts {'1.1':'15','1.2':'20'} - * @arkts 1.1&1.2 - */ - imageMatrix(matrix: ImageMatrix): ImageAttribute; - - /** - * Set the repeat style of the picture - * - * @param { ImageRepeat } value - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 7 - */ - /** - * Set the repeat style of the picture - * - * @param { ImageRepeat } value - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @form - * @since 9 - */ - /** - * Set the repeat style of the picture - * - * @param { ImageRepeat } value - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @since 10 - */ - /** - * Set the repeat style of the picture - * - *

NOTE: - *
This attribute is not applicable to SVG images. - *
This attribute does not take effect when the parameter type of the component is AnimatedDrawableDescriptor. - *

- * - * @param { ImageRepeat } value - How the image is repeated, Default value is ImageRepeat.NoRepeat. - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 - */ - objectRepeat(value: ImageRepeat): ImageAttribute; - - /** - * Set the auto style of the picture - * - * @param { boolean } value - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 7 - */ - /** - * Set the auto style of the picture - * - * @param { boolean } value - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @form - * @since 9 - */ - /** - * Set the auto style of the picture - * - * @param { boolean } value - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @since 10 - */ - /** - * Specifies whether to resize the image source based on the size of the display area during image decoding. - * - *

NOTE: - *
This attribute does not take effect when the parameter type of the component is AnimatedDrawableDescriptor - * or SVG. - *

- * - * @param { boolean } value - Whether to resize the image source based on the size of the display area - * during image decoding, Default value is false. - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 - */ - autoResize(value: boolean): ImageAttribute; - - /** - * Sets the image rendering mode. - * - * @param { ImageRenderMode } value - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 7 - */ - /** - * Sets the image rendering mode. - * - * @param { ImageRenderMode } value - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @form - * @since 9 - */ - /** - * Sets the image rendering mode. - * - * @param { ImageRenderMode } value - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @since 10 - */ - /** - * Sets the rendering mode of the image. - * - *

NOTE: - *
This attribute is not applicable to SVG images. - *
When ColorFilter is set, this attribute is not effective. - *
This attribute does not take effect when the parameter type of the component is AnimatedDrawableDescriptor. - *

- * - * @param { ImageRenderMode } value - Rendering mode of the image, Default value is ImageRenderMode.Original. - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 - */ - renderMode(value: ImageRenderMode): ImageAttribute; - - /** - * Sets the dynamic range of the image to be displayed. - * - *

NOTE: - *
This attribute is not applicable to SVG images. - *

- * - * @param { DynamicRangeMode } value - Dynamic range of the image. - * @returns { ImageAttribute } Returns the instance of the ImageAttribute, Default value is - * dynamicRangeMode.Standard. - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 - */ - dynamicRangeMode(value: DynamicRangeMode): ImageAttribute; - - /** - * Set hdrBrightness for Image. - * - * @param { number } brightness - Control the brightness of HDR Image, Default value is 1.0. - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @atomicservice - * @since 19 - */ - hdrBrightness(brightness: number): ImageAttribute; - - /** - * Sets the interpolation effect of an image. The interpolation effect is only magnified for the image. - * - * @param { ImageInterpolation } value - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 7 - */ - /** - * Sets the interpolation effect of an image. The interpolation effect is only magnified for the image. - * - * @param { ImageInterpolation } value - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @form - * @since 9 - */ - /** - * Sets the interpolation effect of an image. The interpolation effect is only magnified for the image. - * - * @param { ImageInterpolation } value - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @since 10 - */ - /** - * Sets the interpolation effect of the image, which can alleviate aliasing that occurs when the image is zoomed. - * - *

NOTE: - *
This attribute is not applicable to SVG images. - *
This attribute does not take effect when the parameter type of the component is AnimatedDrawableDescriptor. - *

- * - * @param { ImageInterpolation } value - Interpolation effect of the image, Default value is ImageInterpolation.Low. - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 - */ - interpolation(value: ImageInterpolation): ImageAttribute; - - /** - * Specifies the picture decoding size. - * The original picture is decoded into a picture of a specified size. The unit of the number type is px. - * - * @param { object } value - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 7 - */ - /** - * Specifies the picture decoding size. - * The original picture is decoded into a picture of a specified size. The unit of the number type is px. - * - * @param { object } value - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @form - * @since 9 - */ - /** - * Specifies the picture decoding size. - * The original picture is decoded into a picture of a specified size. The unit of the number type is px. - * - * @param { object } value - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @since 10 - */ - /** - * Specifies the picture decoding size. - * The original picture is decoded into a picture of a specified size. The unit of the number type is px. - * - * @param { object } value - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 11 - */ - /** - * Sets the decoding size of the image. - * The original picture is decoded into a picture of a specified size. The unit of the number type is px. - * Anonymous Object Rectification. - * - *

NOTE: - *
This attribute works only when the target size is smaller than the source size. - *
This attribute is not applicable to SVG images or PixelMap objects. - *
This attribute does not take effect when the parameter type of the component is AnimatedDrawableDescriptor. - *

- * - * @param { ImageSourceSize } value - Decoding size of the image. - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 - */ - sourceSize(value: ImageSourceSize): ImageAttribute; - - /** - * Sets the synchronous or asynchronous mode for image loading. - * The default parameter type is bool, and the default value is false. - * - * @param { boolean } value - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 8 - */ - /** - * Sets the synchronous or asynchronous mode for image loading. - * The default parameter type is bool, and the default value is false. - * - * @param { boolean } value - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @form - * @since 9 - */ - /** - * Sets the synchronous or asynchronous mode for image loading. - * The default parameter type is bool, and the default value is false. - * - * @param { boolean } value - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @since 10 - */ - /** - * Specifies whether to load the image synchronously. - * - *

NOTE: - *
This attribute does not take effect when the parameter type of the component is AnimatedDrawableDescriptor. - *

- * - * @param { boolean } value - Whether to load the image synchronously, Default value is false. - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 - */ - syncLoad(value: boolean): ImageAttribute; - - /** - * Sets the color filter effect on the image. - * - * @param { ColorFilter } value ColorFilter object. - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @form - * @since 9 - */ - /** - * Sets the color filter effect on the image. - * - * @param { ColorFilter } value ColorFilter object. - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @since 10 - */ - /** - * Sets the color filter effect on the image. - * - * @param { ColorFilter } value ColorFilter object. - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 11 - */ - /** - * Sets the color filter for the image. - * - *

NOTE: - *
When this attribute is set, renderMode is not effective. - *

- * - * @param { ColorFilter | DrawingColorFilter } value - Color filter of the image. - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 - */ - colorFilter(value: ColorFilter | DrawingColorFilter): ImageAttribute; - - /** - * Allow replication. - * - * @param { CopyOptions } value - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @form - * @since 9 - */ - /** - * Allow replication. - * - * @param { CopyOptions } value - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @since 10 - */ - /** - * Whether the image can be copied. - * - * NOTE: - *
SVG images cannot be copied. - *
This attribute does not take effect when the parameter type of the component is AnimatedDrawableDescriptor. - *

- * - * @param { CopyOptions } value - Specifies whether the image can be copied, Default value is CopyOptions.None. - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 - */ - copyOption(value: CopyOptions): ImageAttribute; - - /** - * Enable image dragging. - * Default value is false. - * - * @param { boolean } value - Whether the image is draggable, Default value is false. - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 9 - */ - /** - * Enable image dragging. - * Default value is true. - * - * @param { boolean } value - Whether the image is draggable, Default value is true. - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @atomicservice - * @since 11 - */ - /** - * Specifies whether the image is draggable. - * - *

NOTE: - *
This attribute cannot be used together with the onDragStart event. - *

- * - * @param { boolean } value - Whether the image is draggable, Default value is true. - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 - */ - draggable(value: boolean): ImageAttribute; - - /** - * Defines the PointLight - * - * @param { PointLightStyle } value - The point light style. - * @returns { ImageAttribute } The attribute of the image. - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @systemapi - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 - */ - pointLight(value: PointLightStyle): ImageAttribute; - - /** - * SVG anti-aliasing. - * The range of the parameter values is (0.333, 1.333]. - * Default value is 0.0. - * - * @param { number } value - The degree of anti-aliasing. - * @returns { ImageAttribute } The attribute of the image. - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @systemapi - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 - */ - edgeAntialiasing(value: number): ImageAttribute; - - /** - * This callback is triggered when an image is successfully loaded. - * The size of the image source that is successfully loaded is returned, in pixels. - * - * @param { function } callback - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 7 - */ - /** - * This callback is triggered when an image is successfully loaded. - * The size of the image source that is successfully loaded is returned, in pixels. - * - * @param { function } callback - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @form - * @since 9 - */ - /** - * This callback is triggered when an image is successfully loaded. - * The size of the image source that is successfully loaded is returned, in pixels. - * - * @param { function } callback - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @since 10 - */ - /** - * Triggered when an image is successfully loaded or decoded. - * The size of the image source that is successfully loaded is returned, in pixels. - * - *

NOTE: - *
This event is not triggered if the parameter type of the component is AnimatedDrawableDescriptor. - *

- * - * @param { function } callback - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 11 - */ - onComplete( - callback: (event?: { - /** - * The width of the image source. - * - * @type { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 7 - */ - /** - * The width of the image source. - * - * @type { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 9 - * @form - */ - /** - * The width of the image source. - * - * @type { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @since 10 - * @form - */ - /** - * The width of the image source. - * - * @type { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 11 - * @form - */ - width: number; - /** - * The height of the image source. - * - * @type { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 7 - */ - /** - * The height of the image source. - * - * @type { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 9 - * @form - */ - /** - * The height of the image source. - * - * @type { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @since 10 - * @form - */ - /** - * The height of the image source. - * - * @type { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 11 - * @form - */ - height: number; - /** - * The width of the component source. - * - * @type { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 7 - */ - /** - * The width of the component source. - * - * @type { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 9 - * @form - */ - /** - * The width of the component source. - * - * @type { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @since 10 - * @form - */ - /** - * The width of the component source. - * - * @type { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 11 - * @form - */ - componentWidth: number; - /** - * The height of the component source. - * - * @type { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 7 - */ - /** - * The height of the component source. - * - * @type { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 9 - * @form - */ - /** - * The height of the component source. - * - * @type { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @since 10 - * @form - */ - /** - * The height of the component source. - * - * @type { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 11 - * @form - */ - componentHeight: number; - /** - * The value of the status of the image being loaded successfully. - * If the returned status value is 0, the image data is successfully loaded. - * If the returned status value is 1, the image is successfully decoded. - * - * @type { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 7 - */ - /** - * The value of the status of the image being loaded successfully. - * If the returned status value is 0, the image data is successfully loaded. - * If the returned status value is 1, the image is successfully decoded. - * - * @type { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 9 - * @form - */ - /** - * The value of the status of the image being loaded successfully. - * If the returned status value is 0, the image data is successfully loaded. - * If the returned status value is 1, the image is successfully decoded. - * - * @type { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @since 10 - * @form - */ - /** - * The value of the status of the image being loaded successfully. - * If the returned status value is 0, the image data is successfully loaded. - * If the returned status value is 1, the image is successfully decoded. - * - * @type { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 11 - * @form - */ - loadingStatus: number; - /** - * The width of the picture that is actually drawn. - * - * @type { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @since 10 - * @form - */ - /** - * The width of the picture that is actually drawn. - * - * @type { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 11 - * @form - */ - contentWidth: number; - /** - * The height of the picture that is actually drawn. - * - * @type { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @since 10 - * @form - */ - /** - * The height of the picture that is actually drawn. - * - * @type { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 11 - * @form - */ - contentHeight: number; - /** - * The actual draw is offset from the x-axis of the component itself. - * - * @type { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @since 10 - * @form - */ - /** - * The actual draw is offset from the x-axis of the component itself. - * - * @type { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 11 - * @form - */ - contentOffsetX: number; - /** - * The actual draw is offset from the y-axis of the component itself. - * - * @type { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @since 10 - * @form - */ - /** - * The actual draw is offset from the y-axis of the component itself. - * - * @type { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 11 - * @form - */ - contentOffsetY: number; - }) => void, - ): ImageAttribute; - - /** - * This callback is triggered when an image is successfully loaded. - * The size of the image source that is successfully loaded is returned, in pixels. - * - * @param { ImageOnCompleteCallback } callback - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - onComplete(callback: ImageOnCompleteCallback): ImageAttribute; - - /** - * This callback is triggered when an exception occurs during image loading. - * The field of "message" carries the detailed information of failed image loading. - * - * @param { function } callback - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @form - * @since 9 - */ - /** - * This callback is triggered when an exception occurs during image loading. - * The field of "message" carries the detailed information of failed image loading. - * - * @param { function } callback - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @since 10 - */ - /** - * Triggered when an error occurs during image loading. - * The field of "message" carries the detailed information of failed image loading. - * - *

NOTE: - *
This event is not triggered if the parameter type of the component is AnimatedDrawableDescriptor. - *

- * - * @param { ImageErrorCallback } callback - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 - */ - onError(callback: ImageErrorCallback): ImageAttribute; - - /** - * When the loaded source file is a svg image, this callback is triggered when the playback of the svg image is complete. - * If the svg image is a wireless loop image, this callback is not triggered. - * - * @param { function } event - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 7 - */ - /** - * When the loaded source file is a svg image, this callback is triggered when the playback of the svg image is complete. - * If the svg image is a wireless loop image, this callback is not triggered. - * - * @param { function } event - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @form - * @since 9 - */ - /** - * When the loaded source file is a svg image, this callback is triggered when the playback of the svg image is complete. - * If the svg image is a wireless loop image, this callback is not triggered. - * - * @param { function } event - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @since 10 - */ - /** - * When the loaded source file is a svg image, this callback is triggered when the playback of the svg image is complete. - * If the svg image is a wireless loop image, this callback is not triggered. - * - *

NOTE: - *
Only SVG images are supported. - *
This event is not triggered if the parameter type of the component is AnimatedDrawableDescriptor. - *

- * - * @param { function } event - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 - */ - onFinish(event: () => void): ImageAttribute; - - /** - * Enable image analyzer. - * - * @param { boolean} enable - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 11 - */ - /** - * Sets whether to enable the AI analyzer - * - *

NOTE: - *
This attribute cannot be used together with the overlay attribute. If they are set at the same time, - * the CustomBuilder attribute in overlay has no effect. This attribute depends on device capabilities. - *
Images to be analyzed must be static, non-vector images. That is, SVG and GIF images cannot be analyzed. - * Pixel maps in RGBA_8888 format can be passed in for analysis. - *
The placeholder images (specified by alt) cannot be analyzed. An image can be analyzed only when - * objectRepeat is set to ImageRepeat.NoRepeat and obscured is disabled. - *
Analysis is performed based on the complete original image. If the clip, margin, borderRadius, - * position, or objectFit attribute is set, the image is not displayed completely. - * If renderMode is used to apply a mask, analysis is still performed based on the complete original image. - * The copyOption attribute does not affect the AI analyzer. - *
This attribute does not take effect when the parameter type of the component is AnimatedDrawableDescriptor. - *
The ohos.permission.INTERNET permission must be declared. - *

- * - * @param { boolean} enable - Whether to enable the AI analyzer, Default value is false. - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 - */ - enableAnalyzer(enable: boolean): ImageAttribute; - - /** - * Set image analyzer with config. - * - * @param { ImageAnalyzerConfig } config - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @systemapi - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 - */ - analyzerConfig(config: ImageAnalyzerConfig): ImageAttribute; - - /** - * Set image resizable options. - * - * @param { ResizableOptions } value - Indicates the resizable options. - * @returns { ImageAttribute } Returns the instance of the ImageAttribute. - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @since 11 - */ - /** - * Sets the resizable image options. - * - *

NOTE: - *
Resizing is effective for drag previews and placeholder images. - *
When ResizableOptions is set to a valid value, the objectRepeat attribute does not take effect. - *
When the sum of the values of top and bottom is greater than the source image height, - * or the sum of the values of left and right is greater than the source image width, - * the ResizableOptions attribute does not take effect. - *
This attribute does not take effect when the parameter type of the component is AnimatedDrawableDescriptor - * or SVG. - *

- * - * @param { ResizableOptions } value - Resizable image options. - * @returns { ImageAttribute } Returns the instance of the ImageAttribute. - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 - */ - resizable(value: ResizableOptions): ImageAttribute; - - /** - * Sets whether to secure sensitive information on widgets. - * - *

NOTE: - *
Obscuring requires widget framework support. - *

- * - * @param { boolean } supported - Whether to secure sensitive information on widgets, Default value is false. - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @form - * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 - */ - privacySensitive(supported: boolean): ImageAttribute; - - /** - * Set the quality enhancement level of image. - * - * @param { ResolutionQuality } imageQuality - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @systemapi - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 - */ - enhancedImageQuality(imageQuality: ResolutionQuality): ImageAttribute; - - /** - * Sets the display orientation of the image content. - * - * @param { ImageRotateOrientation } orientation - Display orientation of the image content, Default value - * is ImageRotateOrientation.UP. - * @returns { ImageAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since arkts {'1.1':'14','1.2':'20'} - * @arkts 1.1&1.2 - */ - orientation(orientation: ImageRotateOrientation) : ImageAttribute; -} - -/** - * Defines Image Component. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 7 - */ -/** - * Defines Image Component. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @form - * @since 9 - */ -/** - * Defines Image Component. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @since 10 - */ -/** - * Defines Image Component. - * - *

If flickering occurs during image loading, set syncLoad to true. - * For details, see [Concurrency Optimization]{@link - * https://developer.huawei.com/consumer/en/doc/best-practices/bpta-click-to-click-response-optimization}

- * - *

If white blocks persist during image loading, follow the steps in [Solution to White Image Blocks]{@link - * https://developer.huawei.com/consumer/en/doc/best-practices/bpta-image-white-lump-solution}

- * - *

If image loading takes a long time, follow the steps in [Reducing the Loading Time of Preset Images]{@link - * https://developer.huawei.com/consumer/en/doc/best-practices/bpta-texture-compression-improve-performance}

- * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 11 - * @noninterop - */ -declare const Image: ImageInterface; - -/** - * Defines Image Component instance. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 7 - */ -/** - * Defines Image Component instance. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @form - * @since 9 - */ -/** - * Defines Image Component instance. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @since 10 - */ -/** - * Defines Image Component instance. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 11 - * @noninterop - */ -declare const ImageInstance: ImageAttribute; - -/** - * @type ImageErrorCallback - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @form - * @since 9 - */ -/** - * @type ImageErrorCallback - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @since 10 - */ -/** - * @typedef { function } ImageErrorCallback - * @param { ImageError } error - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 - */ -type ImageErrorCallback = (error: ImageError) => void; - -/** - * ImageOnCompleteCallback - * - * @typedef { function } ImageOnCompleteCallback - * @param { ImageCompleteEvent } loadEvent - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ -type ImageOnCompleteCallback = (loadEvent?: ImageCompleteEvent) => void; - -/** - * @interface ImageError - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @form - * @since 9 - */ -/** - * @interface ImageError - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @since 10 - */ -/** - * @interface ImageError - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 - */ -declare interface ImageError { - /** - * Component width. - * - * @type { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @form - * @since 9 - */ - /** - * Component width. - * - * @type { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @since 10 - */ - /** - * Component width. - * - * @type { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 - */ - componentWidth: number; - - /** - * Component height. - * - * @type { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @form - * @since 9 - */ - /** - * Component height. - * - * @type { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @since 10 - */ - /** - * Component height. - * - * @type { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 - */ - componentHeight: number; - - /** - * Message. - * - * @type { string } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @since 10 - */ - /** - * Message. - * - * @type { string } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 - */ - message: string - - /** - * Business Error. - * - * @type { ?BusinessError } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.1&1.2 - */ - error?: BusinessError; -} - -/** - * Image resizable options - * - * @interface ResizableOptions - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @since 11 - */ -/** - * Image resizable options - * - * @interface ResizableOptions - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 - */ -declare interface ResizableOptions { - /** - * Image slice widths. - * - * @type { ?EdgeWidths } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @since 11 - */ - /** - * Image slice widths. - * - * @type { ?EdgeWidths } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 - */ - slice?: EdgeWidths; - - /** - * Image lattice. - * - * @type { ?DrawingLattice } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 - */ - lattice?: DrawingLattice; -} + declare type BusinessError = import('../api/@ohos.base').BusinessError; + + /** + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + declare enum ImageRenderMode { + /** + * Render according to the original image, including colors. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Render according to the original image, including colors. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Render according to the original image, including colors. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Render according to the original image, including colors. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Original, + + /** + * Render the image as a template image, ignoring the color information of the image. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Render the image as a template image, ignoring the color information of the image. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Render the image as a template image, ignoring the color information of the image. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Render the image as a template image, ignoring the color information of the image. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Template, + } + + /** + * Specify image's content. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + declare enum ImageContent { + /** + * Make image empty. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + EMPTY = 0, + } + + /** + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + declare enum DynamicRangeMode { + /** + * Allow image content to use an unrestricted extended range. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + HIGH = 0, + + /** + * Allow image content to use some extended range. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + CONSTRAINT = 1, + + /** + * Restrict the image content dynamic range to the standard range. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + STANDARD = 2, + } + + /** + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + declare enum ImageInterpolation { + /** + * Do not use interpolated image data. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Do not use interpolated image data. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Do not use interpolated image data. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Do not use interpolated image data. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + None, + + /** + * Low usage of interpolated image data. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Low usage of interpolated image data. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Low usage of interpolated image data. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Low usage of interpolated image data. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Low, + + /** + * Interpolated image data is used moderately. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Interpolated image data is used moderately. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Interpolated image data is used moderately. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Interpolated image data is used moderately. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + Medium, + + /** + * High usage of interpolated image data may affect the speed of image rendering. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * High usage of interpolated image data may affect the speed of image rendering. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * High usage of interpolated image data may affect the speed of image rendering. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * High usage of interpolated image data may affect the speed of image rendering. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + High, + } + + /** + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + declare enum ImageRotateOrientation { + /** + * Rotate according to the image rotation + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + AUTO = 0, + + /** + * Ignore the rotation of the image + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + UP = 1, + + /** + * Based on image rotation, rotate clockwise 90 degrees + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + RIGHT = 2, + + /** + * Based on image rotation, rotate clockwise 180 degrees + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + DOWN = 3, + + /** + * Based on image rotation, rotate clockwise 270 degrees + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + LEFT = 4, + + /** + * Flip the orignial image horizontally + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + UP_MIRRORED = 5, + + /** + * Flip the orignial image horizontally and rotate clockwise 90 degrees + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + RIGHT_MIRRORED = 6, + + /** + * Flip the orignial image vertically + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + DOWN_MIRRORED = 7, + + /** + * Flip the orignial image horizontally and rotate clockwise 270 degrees + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + LEFT_MIRRORED = 8, + } + + /** + * @interface ImageInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * @interface ImageInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * @interface ImageInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * @interface ImageInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + interface ImageInterface { + /** + * Set src to obtain images. + * + * @param { PixelMap | ResourceStr | DrawableDescriptor } src + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set src to obtain images + * + * @param { PixelMap | ResourceStr | DrawableDescriptor } src + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set src to obtain images + * + * @param { PixelMap | ResourceStr | DrawableDescriptor } src + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set src to obtain images + * + * @param { PixelMap | ResourceStr | DrawableDescriptor } src + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + (src: PixelMap | ResourceStr | DrawableDescriptor): ImageAttribute; + + /** + * Set src to obtain images + * + * @param { PixelMap | ResourceStr | DrawableDescriptor | ImageContent } src + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + (src: PixelMap | ResourceStr | DrawableDescriptor | ImageContent): ImageAttribute; + + /** + * Set src and ai options to obtain images + * + * @param { PixelMap | ResourceStr | DrawableDescriptor } src + * @param { ImageAIOptions } imageAIOptions + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + (src: PixelMap | ResourceStr | DrawableDescriptor, imageAIOptions: ImageAIOptions): ImageAttribute; + } + + /** + * Defines source size of image. + * + * @interface ImageSourceSize + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 18 + */ + + interface ImageSourceSize { + /** + * Set width. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set width. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set width. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set width. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Set width. + * Anonymous Object Rectification. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 18 + */ + width: number; + + /** + * Set height. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set height. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set height. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set height. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Set height. + * Anonymous Object Rectification. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 18 + */ + height: number; + } + + /** + * Defines the ColorContent. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 15 + */ + declare class ColorContent { + /** + * Indicates the ColorContent to original value. + * + * @type { ColorContent } + * @readonly + * @static + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 15 + */ + static readonly ORIGIN: ColorContent; + } + + /** + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * @extends CommonMethod + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + declare class ImageAttribute extends CommonMethod { + /** + * Placeholder displayed on load + * + * @param { string | Resource } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Placeholder displayed on load + * + * @param { string | Resource } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Placeholder displayed on load + * + * @param { string | Resource } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Placeholder displayed on load + * + * @param { string | Resource } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Sets the placeholder image displayed during loading. + * + *

NOTE: + *
This attribute does not take effect when the parameter type of the component is AnimatedDrawableDescriptor. + *

+ * + * @param { string | Resource | PixelMap } value - Placeholder image displayed during loading, Default value is null. + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + alt(value: string | Resource | PixelMap): ImageAttribute; + + /** + * match Text Direction + * + * @param { boolean } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * match Text Direction + * + * @param { boolean } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * match Text Direction + * + * @param { boolean } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Specifies whether to display the image in the system language direction. + * + *

NOTE: + *
This attribute does not take effect when the parameter type of the component is AnimatedDrawableDescriptor. + *

+ * + * @param { boolean } value - Whether to display the image in the system language direction, Default value is false. + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + matchTextDirection(value: boolean): ImageAttribute; + + /** + * Sets whether the display size of the image follows the source size. + * + * @param { boolean } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sets whether the display size of the image follows the source size. + * + * @param { boolean } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets whether the display size of the image follows the source size. + * + * @param { boolean } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets whether the display size of the image follows the source size. + * + *

NOTE: + *
This attribute does not take effect when the parameter type of the component is AnimatedDrawableDescriptor. + *

+ * + * @param { boolean } value - Whether to fit the image to the size of the image source, Default value is false. + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + fitOriginalSize(value: boolean): ImageAttribute; + + /** + * fill Color + * + * @param { ResourceColor } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * fill Color + * + * @param { ResourceColor } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * fill Color + * + * @param { ResourceColor } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the fill color to be superimposed on the image. + * By default, no fill color is applied. If an invalid value is passed, the system uses the default theme color: + * black in light mode and white in dark mode. + * + *

NOTE: + *
This attribute applies only to SVG images. + *
This attribute does not take effect when the parameter type of the component is AnimatedDrawableDescriptor. + *

+ * + * @param { ResourceColor } value - Fill color to be superimposed on the image. + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + fillColor(value: ResourceColor): ImageAttribute; + + /** + * Sets the fill color to be superimposed on the image. + * By default, no fill color is applied. If an invalid value is passed, the system uses the default theme color: + * black in light mode and white in dark mode. + * + *

NOTE: + *
This attribute applies only to SVG images. + *
This attribute does not take effect when the parameter type of the component is AnimatedDrawableDescriptor. + *

+ * + * @param { ResourceColor | ColorContent } color - Fill color to be superimposed on the image. + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 15 + */ + fillColor(color: ResourceColor | ColorContent): ImageAttribute; + + /** + * Sets the fill color to be superimposed on the image. + * By default, no fill color is applied. If an invalid value is passed, the system uses the default theme color: + * black in light mode and white in dark mode. + * + *

NOTE: + *
This attribute applies only to SVG images. + *
This attribute does not take effect when the parameter type of the component is AnimatedDrawableDescriptor. + *

+ * + * @param { ResourceColor | ColorContent | ColorMetrics } color + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + fillColor(color: ResourceColor | ColorContent | ColorMetrics): ImageAttribute; + + /** + * Sets the zoom type of an image. + * + * @param { ImageFit } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sets the zoom type of an image. + * + * @param { ImageFit } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the zoom type of an image. + * + * @param { ImageFit } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets how the image is resized to fit its container. + * + * @param { ImageFit } value - How the image is resized to fit its container, Default value is ImageFit.Cover. + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + objectFit(value: ImageFit): ImageAttribute; + + /** + * Sets the transformation matrix of the image. + * + * @param { ImageMatrix } matrix - Transformation matrix of the image. + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 15 + */ + imageMatrix(matrix: ImageMatrix): ImageAttribute; + + /** + * Set the repeat style of the picture + * + * @param { ImageRepeat } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set the repeat style of the picture + * + * @param { ImageRepeat } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set the repeat style of the picture + * + * @param { ImageRepeat } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Set the repeat style of the picture + * + *

NOTE: + *
This attribute is not applicable to SVG images. + *
This attribute does not take effect when the parameter type of the component is AnimatedDrawableDescriptor. + *

+ * + * @param { ImageRepeat } value - How the image is repeated, Default value is ImageRepeat.NoRepeat. + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + objectRepeat(value: ImageRepeat): ImageAttribute; + + /** + * Set the auto style of the picture + * + * @param { boolean } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Set the auto style of the picture + * + * @param { boolean } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Set the auto style of the picture + * + * @param { boolean } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Specifies whether to resize the image source based on the size of the display area during image decoding. + * + *

NOTE: + *
This attribute does not take effect when the parameter type of the component is AnimatedDrawableDescriptor + * or SVG. + *

+ * + * @param { boolean } value - Whether to resize the image source based on the size of the display area + * during image decoding, Default value is false. + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + autoResize(value: boolean): ImageAttribute; + + /** + * Sets the image rendering mode. + * + * @param { ImageRenderMode } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sets the image rendering mode. + * + * @param { ImageRenderMode } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the image rendering mode. + * + * @param { ImageRenderMode } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the rendering mode of the image. + * + *

NOTE: + *
This attribute is not applicable to SVG images. + *
When ColorFilter is set, this attribute is not effective. + *
This attribute does not take effect when the parameter type of the component is AnimatedDrawableDescriptor. + *

+ * + * @param { ImageRenderMode } value - Rendering mode of the image, Default value is ImageRenderMode.Original. + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + renderMode(value: ImageRenderMode): ImageAttribute; + + /** + * Sets the dynamic range of the image to be displayed. + * + *

NOTE: + *
This attribute is not applicable to SVG images. + *

+ * + * @param { DynamicRangeMode } value - Dynamic range of the image. + * @returns { ImageAttribute } Returns the instance of the ImageAttribute, Default value is + * dynamicRangeMode.Standard. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + dynamicRangeMode(value: DynamicRangeMode): ImageAttribute; + + /** + * Set hdrBrightness for Image. + * + * @param { number } brightness - Control the brightness of HDR Image, Default value is 1.0. + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 19 + */ + hdrBrightness(brightness: number): ImageAttribute; + + /** + * Sets the interpolation effect of an image. The interpolation effect is only magnified for the image. + * + * @param { ImageInterpolation } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Sets the interpolation effect of an image. The interpolation effect is only magnified for the image. + * + * @param { ImageInterpolation } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the interpolation effect of an image. The interpolation effect is only magnified for the image. + * + * @param { ImageInterpolation } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the interpolation effect of the image, which can alleviate aliasing that occurs when the image is zoomed. + * + *

NOTE: + *
This attribute is not applicable to SVG images. + *
This attribute does not take effect when the parameter type of the component is AnimatedDrawableDescriptor. + *

+ * + * @param { ImageInterpolation } value - Interpolation effect of the image, Default value is ImageInterpolation.Low. + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + interpolation(value: ImageInterpolation): ImageAttribute; + + /** + * Specifies the picture decoding size. + * The original picture is decoded into a picture of a specified size. The unit of the number type is px. + * + * @param { object } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Specifies the picture decoding size. + * The original picture is decoded into a picture of a specified size. The unit of the number type is px. + * + * @param { object } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Specifies the picture decoding size. + * The original picture is decoded into a picture of a specified size. The unit of the number type is px. + * + * @param { object } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Specifies the picture decoding size. + * The original picture is decoded into a picture of a specified size. The unit of the number type is px. + * + * @param { object } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Sets the decoding size of the image. + * The original picture is decoded into a picture of a specified size. The unit of the number type is px. + * Anonymous Object Rectification. + * + *

NOTE: + *
This attribute works only when the target size is smaller than the source size. + *
This attribute is not applicable to SVG images or PixelMap objects. + *
This attribute does not take effect when the parameter type of the component is AnimatedDrawableDescriptor. + *

+ * + * @param { ImageSourceSize } value - Decoding size of the image. + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 18 + */ + sourceSize(value: ImageSourceSize): ImageAttribute; + + /** + * Sets the synchronous or asynchronous mode for image loading. + * The default parameter type is bool, and the default value is false. + * + * @param { boolean } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 8 + */ + /** + * Sets the synchronous or asynchronous mode for image loading. + * The default parameter type is bool, and the default value is false. + * + * @param { boolean } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the synchronous or asynchronous mode for image loading. + * The default parameter type is bool, and the default value is false. + * + * @param { boolean } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Specifies whether to load the image synchronously. + * + *

NOTE: + *
This attribute does not take effect when the parameter type of the component is AnimatedDrawableDescriptor. + *

+ * + * @param { boolean } value - Whether to load the image synchronously, Default value is false. + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + syncLoad(value: boolean): ImageAttribute; + + /** + * Sets the color filter effect on the image. + * + * @param { ColorFilter } value ColorFilter object. + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Sets the color filter effect on the image. + * + * @param { ColorFilter } value ColorFilter object. + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Sets the color filter effect on the image. + * + * @param { ColorFilter } value ColorFilter object. + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + /** + * Sets the color filter for the image. + * + *

NOTE: + *
When this attribute is set, renderMode is not effective. + *

+ * + * @param { ColorFilter | DrawingColorFilter } value - Color filter of the image. + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 12 + */ + colorFilter(value: ColorFilter | DrawingColorFilter): ImageAttribute; + + /** + * Allow replication. + * + * @param { CopyOptions } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Allow replication. + * + * @param { CopyOptions } value + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Whether the image can be copied. + * + * NOTE: + *
SVG images cannot be copied. + *
This attribute does not take effect when the parameter type of the component is AnimatedDrawableDescriptor. + *

+ * + * @param { CopyOptions } value - Specifies whether the image can be copied, Default value is CopyOptions.None. + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + copyOption(value: CopyOptions): ImageAttribute; + + /** + * Enable image dragging. + * Default value is false. + * + * @param { boolean } value - Whether the image is draggable, Default value is false. + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + */ + /** + * Enable image dragging. + * Default value is true. + * + * @param { boolean } value - Whether the image is draggable, Default value is true. + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 11 + */ + /** + * Specifies whether the image is draggable. + * + *

NOTE: + *
This attribute cannot be used together with the onDragStart event. + *

+ * + * @param { boolean } value - Whether the image is draggable, Default value is true. + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 18 + */ + draggable(value: boolean): ImageAttribute; + + /** + * Defines the PointLight + * + * @param { PointLightStyle } value - The point light style. + * @returns { ImageAttribute } The attribute of the image. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 11 + */ + pointLight(value: PointLightStyle): ImageAttribute; + + /** + * SVG anti-aliasing. + * The range of the parameter values is (0.333, 1.333]. + * Default value is 0.0. + * + * @param { number } value - The degree of anti-aliasing. + * @returns { ImageAttribute } The attribute of the image. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 11 + */ + edgeAntialiasing(value: number): ImageAttribute; + + /** + * This callback is triggered when an image is successfully loaded. + * The size of the image source that is successfully loaded is returned, in pixels. + * + * @param { function } callback + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * This callback is triggered when an image is successfully loaded. + * The size of the image source that is successfully loaded is returned, in pixels. + * + * @param { function } callback + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * This callback is triggered when an image is successfully loaded. + * The size of the image source that is successfully loaded is returned, in pixels. + * + * @param { function } callback + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Triggered when an image is successfully loaded or decoded. + * The size of the image source that is successfully loaded is returned, in pixels. + * + *

NOTE: + *
This event is not triggered if the parameter type of the component is AnimatedDrawableDescriptor. + *

+ * + * @param { function } callback + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + onComplete( + callback: (event?: { + /** + * The width of the image source. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The width of the image source. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + * @form + */ + /** + * The width of the image source. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + * @form + */ + /** + * The width of the image source. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @form + */ + width: number; + /** + * The height of the image source. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The height of the image source. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + * @form + */ + /** + * The height of the image source. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + * @form + */ + /** + * The height of the image source. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @form + */ + height: number; + /** + * The width of the component source. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The width of the component source. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + * @form + */ + /** + * The width of the component source. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + * @form + */ + /** + * The width of the component source. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @form + */ + componentWidth: number; + /** + * The height of the component source. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The height of the component source. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + * @form + */ + /** + * The height of the component source. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + * @form + */ + /** + * The height of the component source. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @form + */ + componentHeight: number; + /** + * The value of the status of the image being loaded successfully. + * If the returned status value is 0, the image data is successfully loaded. + * If the returned status value is 1, the image is successfully decoded. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * The value of the status of the image being loaded successfully. + * If the returned status value is 0, the image data is successfully loaded. + * If the returned status value is 1, the image is successfully decoded. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + * @form + */ + /** + * The value of the status of the image being loaded successfully. + * If the returned status value is 0, the image data is successfully loaded. + * If the returned status value is 1, the image is successfully decoded. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + * @form + */ + /** + * The value of the status of the image being loaded successfully. + * If the returned status value is 0, the image data is successfully loaded. + * If the returned status value is 1, the image is successfully decoded. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @form + */ + loadingStatus: number; + /** + * The width of the picture that is actually drawn. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + * @form + */ + /** + * The width of the picture that is actually drawn. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @form + */ + contentWidth: number; + /** + * The height of the picture that is actually drawn. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + * @form + */ + /** + * The height of the picture that is actually drawn. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @form + */ + contentHeight: number; + /** + * The actual draw is offset from the x-axis of the component itself. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + * @form + */ + /** + * The actual draw is offset from the x-axis of the component itself. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @form + */ + contentOffsetX: number; + /** + * The actual draw is offset from the y-axis of the component itself. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 10 + * @form + */ + /** + * The actual draw is offset from the y-axis of the component itself. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 11 + * @form + */ + contentOffsetY: number; + }) => void, + ): ImageAttribute; + + /** + * This callback is triggered when an exception occurs during image loading. + * The field of "message" carries the detailed information of failed image loading. + * + * @param { function } callback + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * This callback is triggered when an exception occurs during image loading. + * The field of "message" carries the detailed information of failed image loading. + * + * @param { function } callback + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Triggered when an error occurs during image loading. + * The field of "message" carries the detailed information of failed image loading. + * + *

NOTE: + *
This event is not triggered if the parameter type of the component is AnimatedDrawableDescriptor. + *

+ * + * @param { ImageErrorCallback } callback + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + onError(callback: ImageErrorCallback): ImageAttribute; + + /** + * When the loaded source file is a svg image, this callback is triggered when the playback of the svg image is complete. + * If the svg image is a wireless loop image, this callback is not triggered. + * + * @param { function } event + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * When the loaded source file is a svg image, this callback is triggered when the playback of the svg image is complete. + * If the svg image is a wireless loop image, this callback is not triggered. + * + * @param { function } event + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * When the loaded source file is a svg image, this callback is triggered when the playback of the svg image is complete. + * If the svg image is a wireless loop image, this callback is not triggered. + * + * @param { function } event + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * When the loaded source file is a svg image, this callback is triggered when the playback of the svg image is complete. + * If the svg image is a wireless loop image, this callback is not triggered. + * + *

NOTE: + *
Only SVG images are supported. + *
This event is not triggered if the parameter type of the component is AnimatedDrawableDescriptor. + *

+ * + * @param { function } event + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + onFinish(event: () => void): ImageAttribute; + + /** + * Enable image analyzer. + * + * @param { boolean} enable + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 11 + */ + /** + * Sets whether to enable the AI analyzer + * + *

NOTE: + *
This attribute cannot be used together with the overlay attribute. If they are set at the same time, + * the CustomBuilder attribute in overlay has no effect. This attribute depends on device capabilities. + *
Images to be analyzed must be static, non-vector images. That is, SVG and GIF images cannot be analyzed. + * Pixel maps in RGBA_8888 format can be passed in for analysis. + *
The placeholder images (specified by alt) cannot be analyzed. An image can be analyzed only when + * objectRepeat is set to ImageRepeat.NoRepeat and obscured is disabled. + *
Analysis is performed based on the complete original image. If the clip, margin, borderRadius, + * position, or objectFit attribute is set, the image is not displayed completely. + * If renderMode is used to apply a mask, analysis is still performed based on the complete original image. + * The copyOption attribute does not affect the AI analyzer. + *
This attribute does not take effect when the parameter type of the component is AnimatedDrawableDescriptor. + *
The ohos.permission.INTERNET permission must be declared. + *

+ * + * @param { boolean} enable - Whether to enable the AI analyzer, Default value is false. + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 12 + */ + enableAnalyzer(enable: boolean): ImageAttribute; + + /** + * Set image analyzer with config. + * + * @param { ImageAnalyzerConfig } config + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 11 + */ + analyzerConfig(config: ImageAnalyzerConfig): ImageAttribute; + + /** + * Set image resizable options. + * + * @param { ResizableOptions } value - Indicates the resizable options. + * @returns { ImageAttribute } Returns the instance of the ImageAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Sets the resizable image options. + * + *

NOTE: + *
Resizing is effective for drag previews and placeholder images. + *
When ResizableOptions is set to a valid value, the objectRepeat attribute does not take effect. + *
When the sum of the values of top and bottom is greater than the source image height, + * or the sum of the values of left and right is greater than the source image width, + * the ResizableOptions attribute does not take effect. + *
This attribute does not take effect when the parameter type of the component is AnimatedDrawableDescriptor + * or SVG. + *

+ * + * @param { ResizableOptions } value - Resizable image options. + * @returns { ImageAttribute } Returns the instance of the ImageAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + resizable(value: ResizableOptions): ImageAttribute; + + /** + * Set the quality enhancement level of image. + * + * @param { ResolutionQuality } imageQuality + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 12 + */ + enhancedImageQuality(imageQuality: ResolutionQuality): ImageAttribute; + + /** + * Sets whether to secure sensitive information on widgets. + * + *

NOTE: + *
Obscuring requires widget framework support. + *

+ * + * @param { boolean } supported - Whether to secure sensitive information on widgets, Default value is false. + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @atomicservice + * @since 12 + */ + privacySensitive(supported: boolean): ImageAttribute; + + /** + * Sets the display orientation of the image content. + * + * @param { ImageRotateOrientation } orientation - Display orientation of the image content, Default value + * is ImageRotateOrientation.UP. + * @returns { ImageAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + orientation(orientation: ImageRotateOrientation) : ImageAttribute; + } + + /** + * Defines Image Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Defines Image Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Defines Image Component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines Image Component. + * + *

If flickering occurs during image loading, set syncLoad to true. + * For details, see [Concurrency Optimization]{@link + * https://developer.huawei.com/consumer/en/doc/best-practices/bpta-click-to-click-response-optimization}

+ * + *

If white blocks persist during image loading, follow the steps in [Solution to White Image Blocks]{@link + * https://developer.huawei.com/consumer/en/doc/best-practices/bpta-image-white-lump-solution}

+ * + *

If image loading takes a long time, follow the steps in [Reducing the Loading Time of Preset Images]{@link + * https://developer.huawei.com/consumer/en/doc/best-practices/bpta-texture-compression-improve-performance}

+ * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + declare const Image: ImageInterface; + + /** + * Defines Image Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 7 + */ + /** + * Defines Image Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Defines Image Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Defines Image Component instance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + declare const ImageInstance: ImageAttribute; + + /** + * @type ImageErrorCallback + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * @type ImageErrorCallback + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * @typedef { function } ImageErrorCallback + * @param { ImageError } error + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + type ImageErrorCallback = (error: ImageError) => void; + + /** + * @interface ImageError + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * @interface ImageError + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * @interface ImageError + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + declare interface ImageError { + /** + * Component width. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Component width. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Component width. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + componentWidth: number; + + /** + * Component height. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 9 + */ + /** + * Component height. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Component height. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + componentHeight: number; + + /** + * Message. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @since 10 + */ + /** + * Message. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 11 + */ + message: string + + /** + * Business Error. + * + * @type { ?BusinessError } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @form + * @atomicservice + * @since 20 + */ + error?: BusinessError; + } + + /** + * Image resizable options + * + * @interface ResizableOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Image resizable options + * + * @interface ResizableOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + declare interface ResizableOptions { + /** + * Image slice widths. + * + * @type { ?EdgeWidths } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 11 + */ + /** + * Image slice widths. + * + * @type { ?EdgeWidths } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + slice?: EdgeWidths; + + /** + * Image lattice. + * + * @type { ?DrawingLattice } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + lattice?: DrawingLattice; + } + \ No newline at end of file diff --git a/api/arkui/ImageModifier.d.ts b/api/arkui/ImageModifier.d.ts index 16696dcb9d..4acf35c68c 100755 --- a/api/arkui/ImageModifier.d.ts +++ b/api/arkui/ImageModifier.d.ts @@ -38,18 +38,18 @@ * @crossplatform * @atomicservice * @since 20 - * @noninterop */ -export declare class ImageModifier extends ImageAttribute implements AttributeModifier { + export declare class ImageModifier extends ImageAttribute implements AttributeModifier { - /** - * Defines the normal update attribute function. - * - * @param { ImageAttribute } instance - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 12 - */ - applyNormalAttribute?(instance: ImageAttribute): void; -} + /** + * Defines the normal update attribute function. + * + * @param { ImageAttribute } instance + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + applyNormalAttribute?(instance: ImageAttribute): void; + } + \ No newline at end of file diff --git a/api/arkui/ImageModifier.static.d.ets b/api/arkui/ImageModifier.static.d.ets new file mode 100644 index 0000000000..8e4537e9e0 --- /dev/null +++ b/api/arkui/ImageModifier.static.d.ets @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"), + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * @kit ArkUI + */ + +import { AttributeModifier } from './component/common'; +import { ImageAttribute } from './component/image'; + +/** + * Defines Image Modifier + * + * @extends ImageAttribute + * @implements { AttributeModifier } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare class ImageModifier extends ImageAttribute implements AttributeModifier {} diff --git a/api/arkui/component/image.d.ets b/api/arkui/component/image.d.ets deleted file mode 100644 index 494fb9af4c..0000000000 --- a/api/arkui/component/image.d.ets +++ /dev/null @@ -1,142 +0,0 @@ -/* - * Copyright (c) 2024-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * @file - * @kit ArkUI - * @arkts 1.2 - */ - - -// WARNING! THIS FILE IS AUTO-GENERATED, DO NOT MAKE CHANGES, THEY WILL BE LOST ON NEXT GENERATION! - -import { DrawableDescriptor } from './../../../api/@ohos.arkui.drawableDescriptor' -import { memo, ComponentBuilder, __memo_context_type, __memo_id_type } from './../stateManagement/runtime' -import { ResolutionQuality, PixelMap, ResourceStr, VisualEffect, Filter, UniformDataType, Blender, Length, SizeOptions, ConstraintSizeOptions, ChainWeightOptions, Padding, LocalizedPadding, Margin, LocalizedMargin, ResourceColor, Position, BorderOptions, EdgeStyles, EdgeWidths, LocalizedEdgeWidths, EdgeColors, LocalizedEdgeColors, BorderRadiuses, LocalizedBorderRadiuses, OutlineOptions, EdgeOutlineStyles, Dimension, EdgeOutlineWidths, OutlineRadiuses, Area, Edges, LocalizedEdges, LocalizedPosition, AccessibilityOptions, ColorFilter } from './units' -import { ImageAIOptions, ImageAnalyzerConfig } from './imageCommon' -import { CommonMethod, DrawModifier, Rectangle, Callback_Array_TouchTestInfo_TouchResult, TouchTestInfo, TouchResult, PixelRoundPolicy, BackgroundEffectOptions, ForegroundEffectOptions, BorderImageOption, OutlineStyle, Callback_ClickEvent_Void, ClickEvent, Callback_Boolean_HoverEvent_Void, HoverEvent, AccessibilityCallback, Callback_MouseEvent_Void, MouseEvent, Callback_TouchEvent_Void, TouchEvent, Callback_KeyEvent_Void, KeyEvent, Callback_KeyEvent_Boolean, AnimateParam, TransitionOptions, TransitionEffect, MotionBlurOptions, InvertOptions, TranslateOptions, ScaleOptions, RotateOptions, Callback_Area_Area_Void, Literal_Union_Number_Literal_Number_offset_span_lg_md_sm_xs, Literal_Number_offset_span, AlignRuleOption, LocalizedAlignRuleOptions, ClickEffect, Callback_DragEvent_String_Union_CustomBuilder_DragItemInfo, DragEvent, CustomBuilder, DragItemInfo, Callback_DragEvent_String_Void, Callback_PreDragStatus_Void, PreDragStatus, Type_CommonMethod_linearGradient_value, Tuple_ResourceColor_Number, Type_CommonMethod_sweepGradient_value, Tuple_Length_Length, Type_CommonMethod_radialGradient_value, MotionPathOptions, ShadowOptions, ShadowStyle, ProgressMask, StateStyles, PixelStretchEffectOptions, AttributeModifier, GestureModifier, BackgroundBrightnessOptions, Callback_GestureInfo_BaseGestureEvent_GestureJudgeResult, GestureRecognizerJudgeBeginCallback, ShouldBuiltInRecognizerParallelWithCallback, Callback_TouchEvent_HitTestMode, SizeChangeCallback, SafeAreaType, SafeAreaEdge, Literal_Alignment_align, BlurStyle, BackgroundBlurStyleOptions, ForegroundBlurStyleOptions, TransitionFinishCallback, BlurOptions, LinearGradientBlurOptions, EffectType, sharedTransitionOptions, ChainStyle, DragPreviewOptions, DragInteractionOptions, OverlayOptions, BlendMode, BlendApplyType, GeometryTransitionOptions, PopupOptions, CustomPopupOptions, MenuElement, MenuOptions, ContextMenuOptions, ModalTransition, ContentCoverOptions, SheetOptions, VisibleAreaChangeCallback, PointLightStyle } from './common' -import { HitTestMode, ImageSize, Alignment, BorderStyle, ColoringStrategy, HoverEffect, Color, Visibility, ItemAlign, Direction, GradientDirection, ObscuredReasons, RenderFit, ImageRepeat, Axis, ResponseType, FunctionKey, ModifierKey, ImageFit, CopyOptions } from './enums' -import { Resource } from './../../../api/global/resource' - -export enum ImageRenderMode { - ORIGINAL = 0, - Original = 0, - TEMPLATE = 1, - Template = 1 -} -export enum ImageContent { - EMPTY = 0 -} -export enum DynamicRangeMode { - HIGH = 0, - CONSTRAINT = 1, - STANDARD = 2 -} -export enum ImageInterpolation { - NONE = 0, - None = 0, - LOW = 1, - Low = 1, - MEDIUM = 2, - Medium = 2, - HIGH = 3, - High = 3 -} -export interface ImageInterface { - invoke(src: PixelMap | ResourceStr | DrawableDescriptor): ImageAttribute; - - -} -export interface ImageSourceSize { - width: number; - height: number; -} -export interface Type_ImageAttribute_onComplete_callback_event { - width: number; - height: number; - componentWidth: number; - componentHeight: number; - loadingStatus: number; - contentWidth: number; - contentHeight: number; - contentOffsetX: number; - contentOffsetY: number; -} -export type Callback_Type_ImageAttribute_onComplete_callback_event_Void = (event?: Type_ImageAttribute_onComplete_callback_event) => void; -export interface ImageAttribute extends CommonMethod { - @memo - alt(value: string | Resource | PixelMap): this; - @memo - matchTextDirection(value: boolean): this; - @memo - fitOriginalSize(value: boolean): this; - @memo - fillColor(value: ResourceColor): this; - @memo - objectFit(value: ImageFit): this; - @memo - objectRepeat(value: ImageRepeat): this; - @memo - autoResize(value: boolean): this; - @memo - renderMode(value: ImageRenderMode): this; - @memo - dynamicRangeMode(value: DynamicRangeMode): this; - @memo - interpolation(value: ImageInterpolation): this; - @memo - sourceSize(value: ImageSourceSize): this; - @memo - syncLoad(value: boolean): this; - @memo - copyOption(value: CopyOptions): this; - @memo - draggable(value: boolean): this; - @memo - pointLight(value: PointLightStyle): this; - @memo - edgeAntialiasing(value: number): this; - @memo - onComplete(value: ((event?: Type_ImageAttribute_onComplete_callback_event) => void)): this; - @memo - onError(value: ImageErrorCallback): this; - @memo - onFinish(value: (() => void)): this; - @memo - enableAnalyzer(value: boolean): this; - @memo - analyzerConfig(value: ImageAnalyzerConfig): this; - @memo - resizable(value: ResizableOptions): this; - @memo - privacySensitive(value: boolean): this; - @memo - enhancedImageQuality(value: ResolutionQuality): this; -} -export type ImageErrorCallback = (error: ImageError) => void; -export interface ImageError { - componentWidth: number; - componentHeight: number; - message: string; -} -export interface ResizableOptions { - slice?: EdgeWidths; -} -@memo -@ComponentBuilder -export declare function Image( - src: PixelMap | ResourceStr | DrawableDescriptor | PixelMap | ResourceStr | DrawableDescriptor | ImageContent, imageAIOptions?: ImageAIOptions | undefined, - @memo - content_?: () => void, -): ImageAttribute diff --git a/api/arkui/component/image.static.d.ets b/api/arkui/component/image.static.d.ets index dddfb7a9c2..170f77e9bb 100644 --- a/api/arkui/component/image.static.d.ets +++ b/api/arkui/component/image.static.d.ets @@ -807,6 +807,9 @@ export declare interface ResizableOptions { */ lattice?: DrawingLattice; } + +@memo +@ComponentBuilder export declare function Image(src: PixelMap | ResourceStr | DrawableDescriptor | ImageContent | PixelMap | ResourceStr | DrawableDescriptor, imageAIOptions?: ImageAIOptions, @memo content_?: () => void): ImageAttribute; -- Gitee