From 9642d1b5db0073ab2ab63fd2c98a96577dadc80a Mon Sep 17 00:00:00 2001 From: sunbees Date: Thu, 31 Jul 2025 10:32:51 +0800 Subject: [PATCH] separate shape&xcomponent&video&canvas&contentslot Signed-off-by: sunbees --- api/@internal/component/ets/canvas.d.ts | 1254 ++---------- api/@internal/component/ets/circle.d.ts | 37 +- api/@internal/component/ets/content_slot.d.ts | 17 +- api/@internal/component/ets/ellipse.d.ts | 37 +- api/@internal/component/ets/line.d.ts | 79 +- api/@internal/component/ets/matrix2d.d.ts | 46 +- api/@internal/component/ets/path.d.ts | 37 +- api/@internal/component/ets/polygon.d.ts | 52 +- api/@internal/component/ets/polyline.d.ts | 52 +- api/@internal/component/ets/rect.d.ts | 91 +- api/@internal/component/ets/shape.d.ts | 106 +- api/@internal/component/ets/video.d.ts | 252 +-- api/@internal/component/ets/xcomponent.d.ts | 219 +- api/@ohos.arkui.modifier.d.ets | 57 + api/arkui/Content.d.ts | 3 +- api/arkui/Content.static.d.ets | 28 + api/arkui/LineModifier.static.d.ets | 33 + api/arkui/PathModifier.static.d.ets | 33 + api/arkui/PolygonModifier.static.d.ets | 33 + api/arkui/PolylineModifier.static.d.ets | 33 + api/arkui/RectModifier.static.d.ets | 33 + api/arkui/ShapeModifier.static.d.ets | 33 + api/arkui/VideoModifier.static.d.ets | 33 + api/arkui/component/canvas.static.d.ets | 1813 +++++++++++++++++ api/arkui/component/circle.static.d.ets | 84 + api/arkui/component/contentSlot.static.d.ets | 49 + api/arkui/component/ellipse.static.d.ets | 83 + .../{forEach.d.ets => forEach.static.d.ets} | 2 +- .../{interop.d.ets => interop.static.d.ets} | 2 +- ...ForEach.d.ets => lazyForEach.static.d.ets} | 41 - api/arkui/component/line.static.d.ets | 115 ++ api/arkui/component/matrix2d.static.d.ets | 191 ++ api/arkui/component/path.static.d.ets | 98 + api/arkui/component/polygon.static.d.ets | 94 + api/arkui/component/polyline.static.d.ets | 93 + api/arkui/component/rect.static.d.ets | 175 ++ .../{repeat.d.ets => repeat.static.d.ets} | 0 api/arkui/component/shape.static.d.ets | 222 ++ api/arkui/component/video.static.d.ets | 526 +++++ api/arkui/component/xcomponent.static.d.ets | 387 ++++ 40 files changed, 4510 insertions(+), 2063 deletions(-) create mode 100644 api/arkui/Content.static.d.ets create mode 100644 api/arkui/LineModifier.static.d.ets create mode 100644 api/arkui/PathModifier.static.d.ets create mode 100644 api/arkui/PolygonModifier.static.d.ets create mode 100644 api/arkui/PolylineModifier.static.d.ets create mode 100644 api/arkui/RectModifier.static.d.ets create mode 100644 api/arkui/ShapeModifier.static.d.ets create mode 100644 api/arkui/VideoModifier.static.d.ets create mode 100644 api/arkui/component/canvas.static.d.ets create mode 100644 api/arkui/component/circle.static.d.ets create mode 100644 api/arkui/component/contentSlot.static.d.ets create mode 100644 api/arkui/component/ellipse.static.d.ets rename api/arkui/component/{forEach.d.ets => forEach.static.d.ets} (95%) rename api/arkui/component/{interop.d.ets => interop.static.d.ets} (98%) rename api/arkui/component/{lazyForEach.d.ets => lazyForEach.static.d.ets} (93%) create mode 100644 api/arkui/component/line.static.d.ets create mode 100644 api/arkui/component/matrix2d.static.d.ets create mode 100644 api/arkui/component/path.static.d.ets create mode 100644 api/arkui/component/polygon.static.d.ets create mode 100644 api/arkui/component/polyline.static.d.ets create mode 100644 api/arkui/component/rect.static.d.ets rename api/arkui/component/{repeat.d.ets => repeat.static.d.ets} (100%) mode change 100755 => 100644 create mode 100644 api/arkui/component/shape.static.d.ets create mode 100644 api/arkui/component/video.static.d.ets create mode 100644 api/arkui/component/xcomponent.static.d.ets diff --git a/api/@internal/component/ets/canvas.d.ts b/api/@internal/component/ets/canvas.d.ts index 8ac9032823..d29464aa77 100644 --- a/api/@internal/component/ets/canvas.d.ts +++ b/api/@internal/component/ets/canvas.d.ts @@ -18,15 +18,6 @@ * @kit ArkUI */ -/*** if arkts 1.2 */ -import { CommonMethod, Callback, PixelMap } from './common'; -import { FrameNode } from '../FrameNode'; -import { ImageAIOptions, ImageAnalyzerConfig } from './imageCommon'; -import { Matrix2D } from './matrix2d'; -import { VoidCallback, LengthMetricsUnit, LengthMetrics } from './units'; -import { Size } from '../Graphics' -/*** endif */ - /** * Import the drawing canvas type object for Canvas. * @@ -82,8 +73,7 @@ declare type DrawingCanvas = import('../api/@ohos.graphics.drawing').default.Can * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ declare type CanvasFillRule = "evenodd" | "nonzero"; @@ -135,8 +125,7 @@ declare type CanvasFillRule = "evenodd" | "nonzero"; * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ declare type CanvasLineCap = "butt" | "round" | "square"; @@ -200,8 +189,7 @@ declare type CanvasLineCap = "butt" | "round" | "square"; * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ declare type CanvasLineJoin = "bevel" | "miter" | "round"; @@ -249,8 +237,7 @@ declare type CanvasLineJoin = "bevel" | "miter" | "round"; * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ declare type CanvasDirection = "inherit" | "ltr" | "rtl"; @@ -314,8 +301,7 @@ declare type CanvasDirection = "inherit" | "ltr" | "rtl"; * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ declare type CanvasTextAlign = "center" | "end" | "left" | "right" | "start"; @@ -383,8 +369,7 @@ declare type CanvasTextAlign = "center" | "end" | "left" | "right" | "start"; * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ declare type CanvasTextBaseline = "alphabetic" | "bottom" | "hanging" | "ideographic" | "middle" | "top"; @@ -432,8 +417,7 @@ declare type CanvasTextBaseline = "alphabetic" | "bottom" | "hanging" | "ideogra * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ declare type ImageSmoothingQuality = "high" | "low" | "medium"; @@ -476,8 +460,7 @@ declare type FrameNode = import('../api/arkui/FrameNode').FrameNode; * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ declare class CanvasGradient { /** @@ -520,8 +503,7 @@ declare class CanvasGradient { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ addColorStop(offset: number, color: string): void; @@ -568,8 +550,7 @@ declare class CanvasGradient { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ declare class CanvasPath { /** @@ -580,7 +561,7 @@ declare class CanvasPath { * @param { number } radius - Radius of the arc. * @param { number } startAngle - Start point of an arc, which starts to be calculated in the x-axis direction. The unit is radian. * @param { number } endAngle - The end point of the arc, in radians. - * @param { boolean } counterclockwise - If the value is true, the arc is drawn counterclockwise. Otherwise, + * @param { boolean } [counterclockwise] - If the value is true, the arc is drawn counterclockwise. Otherwise, * the arc is drawn clockwise. The default value is false. * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 8 @@ -593,7 +574,7 @@ declare class CanvasPath { * @param { number } radius - Radius of the arc. * @param { number } startAngle - Start point of an arc, which starts to be calculated in the x-axis direction. The unit is radian. * @param { number } endAngle - The end point of the arc, in radians. - * @param { boolean } counterclockwise - If the value is true, the arc is drawn counterclockwise. Otherwise, + * @param { boolean } [counterclockwise] - If the value is true, the arc is drawn counterclockwise. Otherwise, * the arc is drawn clockwise. The default value is false. * @syscap SystemCapability.ArkUI.ArkUI.Full * @form @@ -607,7 +588,7 @@ declare class CanvasPath { * @param { number } radius - Radius of the arc. * @param { number } startAngle - Start point of an arc, which starts to be calculated in the x-axis direction. The unit is radian. * @param { number } endAngle - The end point of the arc, in radians. - * @param { boolean } counterclockwise - If the value is true, the arc is drawn counterclockwise. Otherwise, + * @param { boolean } [counterclockwise] - If the value is true, the arc is drawn counterclockwise. Otherwise, * the arc is drawn clockwise. The default value is false. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform @@ -622,14 +603,13 @@ declare class CanvasPath { * @param { number } radius - Radius of the arc. * @param { number } startAngle - Start point of an arc, which starts to be calculated in the x-axis direction. The unit is radian. * @param { number } endAngle - The end point of the arc, in radians. - * @param { boolean } counterclockwise - If the value is true, the arc is drawn counterclockwise. Otherwise, + * @param { boolean } [counterclockwise] - If the value is true, the arc is drawn counterclockwise. Otherwise, * the arc is drawn clockwise. The default value is false. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, counterclockwise?: boolean): void; @@ -681,8 +661,7 @@ declare class CanvasPath { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void; @@ -738,8 +717,7 @@ declare class CanvasPath { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void; @@ -771,8 +749,7 @@ declare class CanvasPath { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ closePath(): void; @@ -844,8 +821,7 @@ declare class CanvasPath { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ ellipse( x: number, @@ -894,8 +870,7 @@ declare class CanvasPath { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ lineTo(x: number, y: number): void; @@ -935,8 +910,7 @@ declare class CanvasPath { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ moveTo(x: number, y: number): void; @@ -984,8 +958,7 @@ declare class CanvasPath { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void; @@ -1033,8 +1006,7 @@ declare class CanvasPath { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ rect(x: number, y: number, w: number, h: number): void; @@ -1045,7 +1017,7 @@ declare class CanvasPath { * @param { number } y - The y-axis coordinate of the start point of the rectangle. * @param { number } w - Width of the rectangle. * @param { number } h - Height of the rectangle. - * @param { number | Array } radii - A number or list specifying the radii of the circular arc to be used for the corners of the rectangle. The default value is 0. + * @param { number | Array } [radii] - A number or list specifying the radii of the circular arc to be used for the corners of the rectangle. The default value is 0. * @throws { BusinessError } 103701 - Parameter error. Possible causes: *
1. The param radii is a list that has zero or more than four elements. *
2. The param radii contains negative value. @@ -1090,8 +1062,7 @@ declare class CanvasPath { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ declare class Path2D extends CanvasPath { /** @@ -1130,8 +1101,7 @@ declare class Path2D extends CanvasPath { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ addPath(path: Path2D, transform?: Matrix2D): void; @@ -1163,8 +1133,7 @@ declare class Path2D extends CanvasPath { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ constructor(); @@ -1176,8 +1145,7 @@ declare class Path2D extends CanvasPath { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ constructor(unit: LengthMetricsUnit); @@ -1213,8 +1181,7 @@ declare class Path2D extends CanvasPath { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ constructor(path: Path2D); @@ -1227,8 +1194,7 @@ declare class Path2D extends CanvasPath { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ constructor(path: Path2D, unit: LengthMetricsUnit); @@ -1264,8 +1230,7 @@ declare class Path2D extends CanvasPath { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ constructor(d: string); @@ -1278,8 +1243,7 @@ declare class Path2D extends CanvasPath { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ constructor(description: string, unit: LengthMetricsUnit); } @@ -1316,8 +1280,7 @@ declare class Path2D extends CanvasPath { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ declare interface CanvasPattern { /** @@ -1352,8 +1315,7 @@ declare interface CanvasPattern { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ setTransform(transform?: Matrix2D): void; } @@ -1390,8 +1352,7 @@ declare interface CanvasPattern { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ declare interface TextMetrics { /** @@ -1434,8 +1395,7 @@ declare interface TextMetrics { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ readonly actualBoundingBoxAscent: number; @@ -1479,8 +1439,7 @@ declare interface TextMetrics { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ readonly actualBoundingBoxDescent: number; @@ -1524,8 +1483,7 @@ declare interface TextMetrics { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ readonly actualBoundingBoxLeft: number; @@ -1569,8 +1527,7 @@ declare interface TextMetrics { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ readonly actualBoundingBoxRight: number; @@ -1614,8 +1571,7 @@ declare interface TextMetrics { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ readonly alphabeticBaseline: number; @@ -1659,8 +1615,7 @@ declare interface TextMetrics { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ readonly emHeightAscent: number; @@ -1704,8 +1659,7 @@ declare interface TextMetrics { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ readonly emHeightDescent: number; @@ -1749,8 +1703,7 @@ declare interface TextMetrics { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ readonly fontBoundingBoxAscent: number; @@ -1794,8 +1747,7 @@ declare interface TextMetrics { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ readonly fontBoundingBoxDescent: number; @@ -1839,8 +1791,7 @@ declare interface TextMetrics { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ readonly hangingBaseline: number; @@ -1884,8 +1835,7 @@ declare interface TextMetrics { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ readonly ideographicBaseline: number; @@ -1925,8 +1875,7 @@ declare interface TextMetrics { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ readonly width: number; @@ -1966,8 +1915,7 @@ declare interface TextMetrics { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ readonly height: number; } @@ -2000,8 +1948,7 @@ declare interface TextMetrics { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ declare class ImageBitmap { /** @@ -2044,19 +1991,6 @@ declare class ImageBitmap { */ readonly height: number; - /** - * Indicates the height of the CSS pixel unit of ImageData. - * - * @return { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - get height(): number; - /** * Indicates the width of the CSS pixel unit of ImageData. * @@ -2097,19 +2031,6 @@ declare class ImageBitmap { */ readonly width: number; - /** - * Indicates the width of the CSS pixel unit of ImageData. - * - * @return { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - get width(): number; - /** * Releases all graphics resources associated with an ImageBitmap. * @@ -2138,8 +2059,7 @@ declare class ImageBitmap { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ close(): void; @@ -2229,19 +2149,6 @@ declare class ImageBitmap { * @since 12 */ constructor(data: PixelMap, unit: LengthMetricsUnit); - - /** - * Create an ImageBitmap object based on the transferred image path or PixelMap object. - * - * @param { PixelMap | string } src - image path or PixelMap object - * @param { LengthMetricsUnit } [unit] - the unit mode - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - constructor(src: PixelMap | string, unit?: LengthMetricsUnit); } /** @@ -2272,8 +2179,7 @@ declare class ImageBitmap { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ declare class ImageData { /** @@ -2316,19 +2222,6 @@ declare class ImageData { */ readonly data: Uint8ClampedArray; - /** - * Array containing image pixel data - * - * @return { Uint8ClampedArray } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - get data(): Uint8ClampedArray; - /** * Width of the image. * @@ -2369,19 +2262,6 @@ declare class ImageData { */ readonly height: number; - /** - * Height of the image. - * - * @return { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - get height(): number; - /** * Height of the image. * @@ -2422,19 +2302,6 @@ declare class ImageData { */ readonly width: number; - /** - * Width of the image. - * - * @return { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - get width(): number; - /** * Create an ImageData object based on the input parameters. * @@ -2490,8 +2357,7 @@ declare class ImageData { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ constructor(width: number, height: number, data?: Uint8ClampedArray, unit?: LengthMetricsUnit); } @@ -2524,8 +2390,7 @@ declare class ImageData { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ declare class RenderingContextSettings { /** @@ -2564,32 +2429,6 @@ declare class RenderingContextSettings { */ antialias?: boolean; - /** - * Get the status whether anti-aliasing is enabled for canvas. The default value is false. - * - * @return { boolean | undefined } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - get antialias(): boolean | undefined; - - /** - * Set the status whether anti-aliasing is enabled for canvas. The default value is false. - * - * @param { boolean | undefined } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - set antialias(antialias: boolean | undefined); - /** * Create an RenderingContextSettings object based on the antialias and alpha. * @@ -2622,8 +2461,7 @@ declare class RenderingContextSettings { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ constructor(antialias?: boolean); } @@ -2660,8 +2498,7 @@ declare class RenderingContextSettings { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ declare class CanvasRenderer extends CanvasPath { /** @@ -2676,30 +2513,6 @@ declare class CanvasRenderer extends CanvasPath { */ letterSpacing: LengthMetrics | string; - /** - * Get spacing for letter. - * - * @return { LengthMetrics | string } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - get letterSpacing(): LengthMetrics | string; - - /** - * Set spacing for letter. - * - * @param { LengthMetrics | string } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - set letterSpacing(letterSpacing: LengthMetrics | string); - /** * Transparency. The value ranges from 0.0 (completely transparent) to 1.0 (completely opaque). * If the value is out of range, the assignment is invalid. @@ -2744,34 +2557,6 @@ declare class CanvasRenderer extends CanvasPath { */ globalAlpha: number; - /** - * Get transparency. The value ranges from 0.0 (completely transparent) to 1.0 (completely opaque). - * If the value is out of range, the assignment is invalid. - * - * @return { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - get globalAlpha(): number; - - /** - * Set transparency. The value ranges from 0.0 (completely transparent) to 1.0 (completely opaque). - * If the value is out of range, the assignment is invalid. - * - * @param { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - set globalAlpha(globalAlpha: number); - /** * Type of composition operation applied when drawing a new shape. The following types are supported: * source-over: (Default) Draws a new drawing on top of an existing canvas context. @@ -2868,60 +2653,6 @@ declare class CanvasRenderer extends CanvasPath { */ globalCompositeOperation: string; - /** - * Get the type of composition operation applied when drawing a new shape. The following types are supported: - * source-over: (Default) Draws a new drawing on top of an existing canvas context. - * source-in: The new drawing is drawn only where the new drawing overlaps the target canvas. - * Everything else is transparent. - * source-out: Draws a new drawing where it does not overlap with the existing canvas content. - * source-atop: The new drawing is drawn only where it overlaps the content of the existing canvas. - * destination-over: Draws a new graphic behind the existing canvas content. - * destination-in: Existing canvas content remains where the new drawing overlaps the existing canvas content. - * Everything else is transparent. - * destination-out: Existing content remains where the new drawing does not overlap. - * destination-atop: The existing canvas retains only the part that overlaps with the new drawing, - * which is drawn behind the canvas content. - * lighter: The color of two overlapping shapes is determined by adding the color values. - * copy: Only new graphics are displayed. - * xor: In the image, those overlaps and other places outside of the normal drawing are transparent. - * - * @return { string } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - get globalCompositeOperation(): string; - - /** - * Set the type of composition operation applied when drawing a new shape. The following types are supported: - * source-over: (Default) Draws a new drawing on top of an existing canvas context. - * source-in: The new drawing is drawn only where the new drawing overlaps the target canvas. - * Everything else is transparent. - * source-out: Draws a new drawing where it does not overlap with the existing canvas content. - * source-atop: The new drawing is drawn only where it overlaps the content of the existing canvas. - * destination-over: Draws a new graphic behind the existing canvas content. - * destination-in: Existing canvas content remains where the new drawing overlaps the existing canvas content. - * Everything else is transparent. - * destination-out: Existing content remains where the new drawing does not overlap. - * destination-atop: The existing canvas retains only the part that overlaps with the new drawing, - * which is drawn behind the canvas content. - * lighter: The color of two overlapping shapes is determined by adding the color values. - * copy: Only new graphics are displayed. - * xor: In the image, those overlaps and other places outside of the normal drawing are transparent. - * - * @param { string } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - set globalCompositeOperation(globalCompositeOperation: string); - /** * Draw an image on a canvas * @@ -2962,8 +2693,7 @@ declare class CanvasRenderer extends CanvasPath { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ drawImage(image: ImageBitmap | PixelMap, dx: number, dy: number): void; @@ -3015,8 +2745,7 @@ declare class CanvasRenderer extends CanvasPath { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ drawImage(image: ImageBitmap | PixelMap, dx: number, dy: number, dw: number, dh: number): void; @@ -3084,8 +2813,7 @@ declare class CanvasRenderer extends CanvasPath { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ drawImage( image: ImageBitmap | PixelMap, @@ -3127,8 +2855,7 @@ declare class CanvasRenderer extends CanvasPath { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ beginPath(): void; @@ -3164,8 +2891,7 @@ declare class CanvasRenderer extends CanvasPath { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ clip(fillRule?: CanvasFillRule): void; @@ -3205,8 +2931,7 @@ declare class CanvasRenderer extends CanvasPath { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ clip(path: Path2D, fillRule?: CanvasFillRule): void; @@ -3242,8 +2967,7 @@ declare class CanvasRenderer extends CanvasPath { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ fill(fillRule?: CanvasFillRule): void; @@ -3283,8 +3007,7 @@ declare class CanvasRenderer extends CanvasPath { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ fill(path: Path2D, fillRule?: CanvasFillRule): void; @@ -3356,19 +3079,6 @@ declare class CanvasRenderer extends CanvasPath { */ stroke(path: Path2D): void; - /** - * Draws the specified path according to the current stroke style - * - * @param { Path2D } [path] - Specified stroke path object - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - stroke(path?: Path2D): void; - /** * Attributes that describe the fill color and style. The options are as follows: * color: Color String @@ -3423,40 +3133,6 @@ declare class CanvasRenderer extends CanvasPath { */ fillStyle: string | number | CanvasGradient | CanvasPattern; - /** - * Get the attributes specifie the color, gradient, or pattern to use inside shapes. The options are as follows: - * - * @return { string | number | CanvasGradient | CanvasPattern } - * string: Color String. - * number: Indicates the color with number. - * CanvasGradient: Color gradient object. For details, see {@link CanvasGradient}. - * CanvasPattern: Template object. For details, see {@link CanvasPattern}. - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - get fillStyle(): string | number | CanvasGradient | CanvasPattern; - - /** - * Set the attributes specifie the color, gradient, or pattern to use inside shapes. The options are as follows: - * - * @param { string | number | CanvasGradient | CanvasPattern } - * string: Color String. - * number: Indicates the color with number. - * CanvasGradient: Color gradient object. For details, see {@link CanvasGradient}. - * CanvasPattern: Template object. For details, see {@link CanvasPattern}. - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - set fillStyle(fillStyle: string | number | CanvasGradient | CanvasPattern); - /** * Attributes of the stroke color and style. The options are as follows: * color: Color String @@ -3512,43 +3188,7 @@ declare class CanvasRenderer extends CanvasPath { strokeStyle: string | number | CanvasGradient | CanvasPattern; /** - * Get the attributes specifie the color, gradient, or pattern to use for the strokes (outlines) around shapes. - * The options are as follows: - * - * @return { string | number | CanvasGradient | CanvasPattern } - * string: Color String. - * number: Indicates the color with number. - * CanvasGradient: Color gradient object. For details, see {@link CanvasGradient}. - * CanvasPattern: Template object. For details, see {@link CanvasPattern}. - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - get strokeStyle(): string | number | CanvasGradient | CanvasPattern; - - /** - * Set the attributes specifie the color, gradient, or pattern to use for the strokes (outlines) around shapes. - * The options are as follows: - * - * @param { string | number | CanvasGradient | CanvasPattern } - * string: Color String. - * number: Indicates the color with number. - * CanvasGradient: Color gradient object. For details, see {@link CanvasGradient}. - * CanvasPattern: Template object. For details, see {@link CanvasPattern}. - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - set strokeStyle(strokeStyle: string | number | CanvasGradient | CanvasPattern); - - /** - * Creates a linear gradient object that is specified along the parameter coordinates + * Creates a linear gradient object that is specified along the parameter coordinates * * @param { number } x0 - The x-axis coordinate of the start point. * @param { number } y0 - The y-axis coordinate of the start point. @@ -3595,8 +3235,7 @@ declare class CanvasRenderer extends CanvasPath { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ createLinearGradient(x0: number, y0: number, x1: number, y1: number): CanvasGradient; @@ -3660,8 +3299,7 @@ declare class CanvasRenderer extends CanvasPath { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ createPattern(image: ImageBitmap, repetition: string | null): CanvasPattern | null; @@ -3721,8 +3359,7 @@ declare class CanvasRenderer extends CanvasPath { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ createRadialGradient(x0: number, y0: number, r0: number, x1: number, y1: number, r1: number): CanvasGradient; @@ -3749,8 +3386,7 @@ declare class CanvasRenderer extends CanvasPath { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ createConicGradient( startAngle: number, @@ -3862,64 +3498,6 @@ declare class CanvasRenderer extends CanvasPath { */ filter: string; - /** - * Provides filter effects such as blur and grayscale. You can get the following filter effects: - * blur(): Adds a Gaussian blur effect to the drawing - * brightness(): Provides a linear multiplication for the drawing and adjusts the brightness level. - * contrast(): Adjusts the contrast of the image. When the value is 0%, the image is completely black. - * When the value is 100%, there is no change in the image. - * grayscale(): Converts the image to a gray image. When the value is 100%, the image is completely gray. - * When the value is 0%, there is no change in the image. - * hue-rotate(): Perform color rotation on an image. When the value is 0 degrees, there is no change in the image. - * invert(): Inverted image (representing the effect of a photographic negative). When the value is 100%, - * the image is completely inverted. When the value is 0%, there is no change in the image. - * opacity(): Transparency of the image. At 0%, the image is completely transparent. - * When the value is 100%, there is no change in the image. - * saturate(): Perform saturation processing on the image. At 0%, the image is completely un-saturated. - * When the value is 100%, there is no change in the image. - * sepia(): The image is sepia (nostalgic style). At 100%, the image turns completely sepia. - * When the value is 0%, there is no change in the image. - * none: Turn off filter effects - * - * @return { string } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - get filter(): string; - - /** - * Provides filter effects such as blur and grayscale. You can set the following filter effects: - * blur(): Adds a Gaussian blur effect to the drawing - * brightness(): Provides a linear multiplication for the drawing and adjusts the brightness level. - * contrast(): Adjusts the contrast of the image. When the value is 0%, the image is completely black. - * When the value is 100%, there is no change in the image. - * grayscale(): Converts the image to a gray image. When the value is 100%, the image is completely gray. - * When the value is 0%, there is no change in the image. - * hue-rotate(): Perform color rotation on an image. When the value is 0 degrees, there is no change in the image. - * invert(): Inverted image (representing the effect of a photographic negative). When the value is 100%, - * the image is completely inverted. When the value is 0%, there is no change in the image. - * opacity(): Transparency of the image. At 0%, the image is completely transparent. - * When the value is 100%, there is no change in the image. - * saturate(): Perform saturation processing on the image. At 0%, the image is completely un-saturated. - * When the value is 100%, there is no change in the image. - * sepia(): The image is sepia (nostalgic style). At 100%, the image turns completely sepia. - * When the value is 0%, there is no change in the image. - * none: Turn off filter effects - * - * @param { string } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - set filter(filter: string); - /** * Creates a new, empty ImageData object of the specified size * @@ -3960,8 +3538,7 @@ declare class CanvasRenderer extends CanvasPath { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ createImageData(sw: number, sh: number): ImageData; @@ -4005,8 +3582,7 @@ declare class CanvasRenderer extends CanvasPath { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ createImageData(imagedata: ImageData): ImageData; @@ -4058,8 +3634,7 @@ declare class CanvasRenderer extends CanvasPath { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ getImageData(sx: number, sy: number, sw: number, sh: number): ImageData; @@ -4097,8 +3672,7 @@ declare class CanvasRenderer extends CanvasPath { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ getPixelMap(sx: number, sy: number, sw: number, sh: number): PixelMap; @@ -4142,8 +3716,7 @@ declare class CanvasRenderer extends CanvasPath { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ putImageData(imagedata: ImageData, dx: number | string, dy: number | string): void; @@ -4219,8 +3792,7 @@ declare class CanvasRenderer extends CanvasPath { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ putImageData( imagedata: ImageData, @@ -4276,34 +3848,6 @@ declare class CanvasRenderer extends CanvasPath { */ imageSmoothingEnabled: boolean; - /** - * Get the status whether to smooth the image. The value true indicates that the image is smooth. - * The value false indicates that the image is not smooth. - * - * @return { boolean } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - get imageSmoothingEnabled(): boolean; - - /** - * Set the status whether to smooth the image. The value true indicates that the image is smooth. - * The value false indicates that the image is not smooth. - * - * @param { boolean } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - set imageSmoothingEnabled(imageSmoothingEnabled: boolean); - /** * Smoothness level of the current image. For details, see {@link ImageSmoothingQuality}. * @@ -4344,32 +3888,6 @@ declare class CanvasRenderer extends CanvasPath { */ imageSmoothingQuality: ImageSmoothingQuality; - /** - * Get the smoothness level of the current image. For details, see {@link ImageSmoothingQuality}. - * - * @return { ImageSmoothingQuality } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - get imageSmoothingQuality(): ImageSmoothingQuality; - - /** - * Set the smoothness level of the current image. For details, see {@link ImageSmoothingQuality}. - * - * @param { ImageSmoothingQuality } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - set imageSmoothingQuality(imageSmoothingQuality: ImageSmoothingQuality); - /** * Line segment endpoint attribute. For details, see {@link CanvasLineCap}. * @@ -4409,32 +3927,6 @@ declare class CanvasRenderer extends CanvasPath { * @since 11 */ lineCap: CanvasLineCap; - - /** - * Get the line segment endpoint attribute. For details, see {@link CanvasLineCap}. - * - * @return { CanvasLineCap } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - get lineCap(): CanvasLineCap; - - /** - * Set the line segment endpoint attribute. For details, see {@link CanvasLineCap}. - * - * @param { CanvasLineCap } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - set lineCap(lineCap: CanvasLineCap); /** * Dotted line offset attribute. @@ -4476,32 +3968,6 @@ declare class CanvasRenderer extends CanvasPath { */ lineDashOffset: number; - /** - * Get the dotted line offset attribute. - * - * @return { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - get lineDashOffset(): number; - - /** - * Set the dotted line offset attribute. - * - * @param { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - set lineDashOffset(lineDashOffset: number); - /** * Line segment connection point attribute. For details, see {@link CanvasLineJoin}. * @@ -4542,32 +4008,6 @@ declare class CanvasRenderer extends CanvasPath { */ lineJoin: CanvasLineJoin; - /** - * Get the line segment connection point attribute. For details, see {@link CanvasLineJoin}. - * - * @return { CanvasLineJoin } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - get lineJoin(): CanvasLineJoin; - - /** - * Set the line segment connection point attribute. For details, see {@link CanvasLineJoin}. - * - * @param { CanvasLineJoin } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - set lineJoin(lineJoin: CanvasLineJoin); - /** * Line thickness attribute. The value cannot be 0 or a negative number. * @@ -4608,32 +4048,6 @@ declare class CanvasRenderer extends CanvasPath { */ lineWidth: number; - /** - * Get the line thickness attribute. The value cannot be 0 or a negative number. - * - * @return { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - get lineWidth(): number; - - /** - * Set the line thickness attribute. The value cannot be 0 or a negative number. - * - * @param { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - set lineWidth(lineWidth: number); - /** * The value of this parameter cannot be 0 or a negative number. * @@ -4674,32 +4088,6 @@ declare class CanvasRenderer extends CanvasPath { */ miterLimit: number; - /** - * Get the value of this parameter cannot be 0 or a negative number. - * - * @return { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - get miterLimit(): number; - - /** - * Set the value of this parameter cannot be 0 or a negative number. - * - * @param { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - set miterLimit(miterLimit: number); - /** * Gets the current segment style. * @@ -4732,8 +4120,7 @@ declare class CanvasRenderer extends CanvasPath { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ getLineDash(): number[]; @@ -4773,8 +4160,7 @@ declare class CanvasRenderer extends CanvasPath { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ setLineDash(segments: number[]): void; @@ -4822,8 +4208,7 @@ declare class CanvasRenderer extends CanvasPath { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ clearRect(x: number, y: number, w: number, h: number): void; @@ -4871,8 +4256,7 @@ declare class CanvasRenderer extends CanvasPath { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ fillRect(x: number, y: number, w: number, h: number): void; @@ -4920,8 +4304,7 @@ declare class CanvasRenderer extends CanvasPath { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ strokeRect(x: number, y: number, w: number, h: number): void; @@ -4965,32 +4348,6 @@ declare class CanvasRenderer extends CanvasPath { */ shadowBlur: number; - /** - * Get the shadow blur radius. The value cannot be a negative number. - * - * @return { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - get shadowBlur(): number; - - /** - * Set the shadow blur radius. The value cannot be a negative number. - * - * @param { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - set shadowBlur(shadowBlur: number); - /** * Shadow color. * @@ -5031,32 +4388,6 @@ declare class CanvasRenderer extends CanvasPath { */ shadowColor: string; - /** - * Get the shadow color. - * - * @return { string } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - get shadowColor(): string; - - /** - * Set the shadow color. - * - * @param { string } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - set shadowColor(shadowColor: string); - /** * Horizontal offset distance of the shadow. * @@ -5097,32 +4428,6 @@ declare class CanvasRenderer extends CanvasPath { */ shadowOffsetX: number; - /** - * Get the horizontal offset distance of the shadow. - * - * @return { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - get shadowOffsetX(): number; - - /** - * Set the horizontal offset distance of the shadow. - * - * @param { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - set shadowOffsetX(shadowOffsetX: number); - /** * Vertical offset distance of the shadow. * @@ -5163,32 +4468,6 @@ declare class CanvasRenderer extends CanvasPath { */ shadowOffsetY: number; - /** - * Get the vertical offset distance of the shadow. - * - * @return { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - get shadowOffsetY(): number; - - /** - * Set the vertical offset distance of the shadow. - * - * @param { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - set shadowOffsetY(shadowOffsetY: number); - /** * Top of the stack pop-up state in the drawing state stack * @@ -5217,8 +4496,7 @@ declare class CanvasRenderer extends CanvasPath { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ restore(): void; @@ -5250,8 +4528,7 @@ declare class CanvasRenderer extends CanvasPath { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ save(): void; @@ -5299,8 +4576,7 @@ declare class CanvasRenderer extends CanvasPath { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ fillText(text: string, x: number, y: number, maxWidth?: number): void; @@ -5340,8 +4616,7 @@ declare class CanvasRenderer extends CanvasPath { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ measureText(text: string): TextMetrics; @@ -5389,8 +4664,7 @@ declare class CanvasRenderer extends CanvasPath { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ strokeText(text: string, x: number, y: number, maxWidth?: number): void; @@ -5434,32 +4708,6 @@ declare class CanvasRenderer extends CanvasPath { */ direction: CanvasDirection; - /** - * Get the text drawing direction. For details, see {@link CanvasDirection}. - * - * @return { CanvasDirection } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - get direction(): CanvasDirection; - - /** - * Set the text drawing direction. For details, see {@link CanvasDirection}. - * - * @param { CanvasDirection } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - set direction(direction: CanvasDirection); - /** * Font style. * @@ -5500,32 +4748,6 @@ declare class CanvasRenderer extends CanvasPath { */ font: string; - /** - * Get the font style. - * - * @return { string } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - get font(): string; - - /** - * Set the font style. - * - * @param { string } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - set font(font: string); - /** * Text alignment mode. For details, see {@link CanvasTextAlign}. * @@ -5566,32 +4788,6 @@ declare class CanvasRenderer extends CanvasPath { */ textAlign: CanvasTextAlign; - /** - * Get the text alignment mode. For details, see {@link CanvasTextAlign}. - * - * @return { CanvasTextAlign } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - get textAlign(): CanvasTextAlign; - - /** - * Set the text alignment mode. For details, see {@link CanvasTextAlign}. - * - * @param { CanvasTextAlign } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - set textAlign(textAlign: CanvasTextAlign); - /** * Text baseline. For details, see {@link CanvasTextBaseline}. * @@ -5632,32 +4828,6 @@ declare class CanvasRenderer extends CanvasPath { */ textBaseline: CanvasTextBaseline; - /** - * Get the text baseline. For details, see {@link CanvasTextBaseline}. - * - * @return { CanvasTextBaseline } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - get textBaseline(): CanvasTextBaseline; - - /** - * Set the text baseline. For details, see {@link CanvasTextBaseline}. - * - * @param { CanvasTextBaseline } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - set textBaseline(textBaseline: CanvasTextBaseline); - /** * Obtains the currently applied transformation matrix. * @@ -5690,8 +4860,7 @@ declare class CanvasRenderer extends CanvasPath { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ getTransform(): Matrix2D; @@ -5723,8 +4892,7 @@ declare class CanvasRenderer extends CanvasPath { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ resetTransform(): void; @@ -5764,8 +4932,7 @@ declare class CanvasRenderer extends CanvasPath { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ rotate(angle: number): void; @@ -5805,8 +4972,7 @@ declare class CanvasRenderer extends CanvasPath { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ scale(x: number, y: number): void; @@ -5866,8 +5032,7 @@ declare class CanvasRenderer extends CanvasPath { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ setTransform(a: number, b: number, c: number, d: number, e: number, f: number): void; @@ -5907,8 +5072,7 @@ declare class CanvasRenderer extends CanvasPath { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ setTransform(transform?: Matrix2D): void; @@ -5968,8 +5132,7 @@ declare class CanvasRenderer extends CanvasPath { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ transform(a: number, b: number, c: number, d: number, e: number, f: number): void; @@ -6009,8 +5172,7 @@ declare class CanvasRenderer extends CanvasPath { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ translate(x: number, y: number): void; @@ -6036,8 +5198,7 @@ declare class CanvasRenderer extends CanvasPath { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ setPixelMap(value?: PixelMap): void; @@ -6073,8 +5234,7 @@ declare class CanvasRenderer extends CanvasPath { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ transferFromImageBitmap(bitmap: ImageBitmap): void; @@ -6084,8 +5244,7 @@ declare class CanvasRenderer extends CanvasPath { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ saveLayer(): void; @@ -6095,8 +5254,7 @@ declare class CanvasRenderer extends CanvasPath { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ restoreLayer(): void; @@ -6106,8 +5264,7 @@ declare class CanvasRenderer extends CanvasPath { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ reset(): void; } @@ -6144,8 +5301,7 @@ declare class CanvasRenderer extends CanvasPath { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ declare class CanvasRenderingContext2D extends CanvasRenderer { /** @@ -6188,20 +5344,6 @@ declare class CanvasRenderingContext2D extends CanvasRenderer { */ readonly height: number; - /** - * The default value is 0, which is bound to the height of the specified canvas. The value is read-only. - * - * @return { number } - * @readonly - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - get height(): number; - /** * The default value is 0, which is bound to the width of the specified canvas. The value is read-only. * @@ -6242,20 +5384,6 @@ declare class CanvasRenderingContext2D extends CanvasRenderer { */ readonly width: number; - /** - * The default value is 0, which is bound to the width of the specified canvas. The value is read-only. - * - * @return { number } - * @readonly - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - get width(): number; - /** * Frame node of the canvas. The default value is null. * @@ -6268,18 +5396,6 @@ declare class CanvasRenderingContext2D extends CanvasRenderer { */ readonly canvas: FrameNode; - /** - * Frame node of the canvas. The default value is null. - * - * @return { FrameNode } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - get canvas(): FrameNode; - /** * Generate a character string in the data url format. * @@ -6328,22 +5444,6 @@ declare class CanvasRenderingContext2D extends CanvasRenderer { */ toDataURL(type?: string, quality?: any): string; - /** - * Generate a character string in the data url format. - * - * @param { string } [type] - Image format. The default value is image/png. - * @param { number } [quality] - If the image format is image/jpeg or image/webp, you can select the image quality from 0 to 1. - * If the value is out of the range, the default value 0.92 is used. - * @returns { string } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - toDataURL(type?: string, quality?: number): string; - /** * Start image analyzer. * @@ -6354,8 +5454,7 @@ declare class CanvasRenderingContext2D extends CanvasRenderer { * @throws { BusinessError } 110003 - Image analysis is stopped. * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ startImageAnalyzer(config: ImageAnalyzerConfig): Promise; @@ -6363,8 +5462,7 @@ declare class CanvasRenderingContext2D extends CanvasRenderer { * Stop image analyzer. * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ stopImageAnalyzer(): void; @@ -6413,8 +5511,7 @@ declare class CanvasRenderingContext2D extends CanvasRenderer { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ constructor(settings?: RenderingContextSettings, unit?: LengthMetricsUnit); @@ -6430,8 +5527,7 @@ declare class CanvasRenderingContext2D extends CanvasRenderer { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'13','1.2':'20'} - * @arkts 1.1&1.2 + * @since 13 */ on(type: 'onAttach', callback: Callback): void; @@ -6439,7 +5535,7 @@ declare class CanvasRenderingContext2D extends CanvasRenderer { * Unregister the listener that watches if the canvasrenderingcontext2d attached to the Canvas frameNode. * * @param { 'onAttach' } type Indicates the type of event. - * @param { Callback } callback Indicates the listener. + * @param { Callback } [callback] Indicates the listener. * @throws { BusinessError } 401 - Input parameter error. Possible causes: * 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; @@ -6447,8 +5543,7 @@ declare class CanvasRenderingContext2D extends CanvasRenderer { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'13','1.2':'20'} - * @arkts 1.1&1.2 + * @since 13 */ off(type: 'onAttach', callback?: Callback): void; @@ -6464,8 +5559,7 @@ declare class CanvasRenderingContext2D extends CanvasRenderer { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'13','1.2':'20'} - * @arkts 1.1&1.2 + * @since 13 */ on(type: 'onDetach', callback: Callback): void; @@ -6473,7 +5567,7 @@ declare class CanvasRenderingContext2D extends CanvasRenderer { * Unregister the listener that watches if the canvasrenderingcontext2d detached from the Canvas frameNode. * * @param { 'onDetach' } type Indicates the type of event. - * @param { Callback } callback Indicates the listener. + * @param { Callback } [callback] Indicates the listener. * @throws { BusinessError } 401 - Input parameter error. Possible causes: * 1. Mandatory parameters are left unspecified; * 2. Incorrect parameter types; @@ -6481,8 +5575,7 @@ declare class CanvasRenderingContext2D extends CanvasRenderer { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'13','1.2':'20'} - * @arkts 1.1&1.2 + * @since 13 */ off(type: 'onDetach', callback?: Callback): void; } @@ -6519,8 +5612,7 @@ declare class CanvasRenderingContext2D extends CanvasRenderer { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ declare class OffscreenCanvasRenderingContext2D extends CanvasRenderer { /** @@ -6571,22 +5663,6 @@ declare class OffscreenCanvasRenderingContext2D extends CanvasRenderer { */ toDataURL(type?: string, quality?: any): string; - /** - * Generate a character string in the data url format. - * - * @param { string } [type] - Image format. The default value is image/png. - * @param { number } [quality] - If the image format is image/jpeg or image/webp, you can select the image quality from 0 to 1. - * If the value is out of the range, the default value 0.92 is used. - * @returns { string } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - toDataURL(type?: string, quality?: number): string; - /** * transfer the content to ImageBitmap * @@ -6619,8 +5695,7 @@ declare class OffscreenCanvasRenderingContext2D extends CanvasRenderer { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ transferToImageBitmap(): ImageBitmap; @@ -6679,8 +5754,7 @@ declare class OffscreenCanvasRenderingContext2D extends CanvasRenderer { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ constructor(width: number, height: number, settings?: RenderingContextSettings, unit?: LengthMetricsUnit); } @@ -6716,8 +5790,7 @@ declare class OffscreenCanvasRenderingContext2D extends CanvasRenderer { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ declare class OffscreenCanvas { /** @@ -6756,32 +5829,6 @@ declare class OffscreenCanvas { */ height: number; - /** - * Get the height of the off-screen canvas. - * - * @return { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - get height(): number; - - /** - * Set the height of the off-screen canvas. - * - * @param { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - set height(height: number); - /** * Width of the off-screen canvas. * @@ -6818,32 +5865,6 @@ declare class OffscreenCanvas { */ width: number; - /** - * Get the width of the off-screen canvas. - * - * @return { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - get width(): number; - - /** - * Set the width of the off-screen canvas. - * - * @param { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - set width(width: number); - /** * Exports rendered content as an ImageBitmap object * @@ -6876,8 +5897,7 @@ declare class OffscreenCanvas { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ transferToImageBitmap(): ImageBitmap; @@ -6902,8 +5922,7 @@ declare class OffscreenCanvas { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ getContext(contextType: "2d", options?: RenderingContextSettings): OffscreenCanvasRenderingContext2D; @@ -6960,21 +5979,6 @@ declare class OffscreenCanvas { * @since 12 */ constructor(width: number, height: number, unit: LengthMetricsUnit); - - /** - * Constructor of the off-screen canvas, which is used to create an off-screen canvas object. - * - * @param { number } width - Width of the off-screen canvas. - * @param { number } height - Height of the off-screen canvas. - * @param { LengthMetricsUnit } [unit] - the unit mode - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - constructor(width: number, height: number, unit?: LengthMetricsUnit); } /** @@ -7016,8 +6020,7 @@ declare interface Size { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare class DrawingRenderingContext { @@ -7028,8 +6031,7 @@ declare class DrawingRenderingContext { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ get size(): Size; @@ -7050,8 +6052,7 @@ declare class DrawingRenderingContext { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ invalidate(): void; @@ -7062,8 +6063,7 @@ declare class DrawingRenderingContext { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ constructor(unit?: LengthMetricsUnit); } @@ -7100,8 +6100,8 @@ declare class DrawingRenderingContext { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 + * @noninterop */ interface CanvasInterface { /** @@ -7151,8 +6151,7 @@ interface CanvasInterface { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ (context?: CanvasRenderingContext2D | DrawingRenderingContext): CanvasAttribute; @@ -7164,8 +6163,7 @@ interface CanvasInterface { * @returns { CanvasAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ (context: CanvasRenderingContext2D | DrawingRenderingContext, imageAIOptions: ImageAIOptions): CanvasAttribute; } @@ -7202,8 +6200,8 @@ interface CanvasInterface { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 + * @noninterop */ declare class CanvasAttribute extends CommonMethod { /** @@ -7253,8 +6251,7 @@ declare class CanvasAttribute extends CommonMethod { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ onReady(event: VoidCallback): CanvasAttribute; @@ -7265,8 +6262,7 @@ declare class CanvasAttribute extends CommonMethod { * @returns { CanvasAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ enableAnalyzer(enable: boolean): CanvasAttribute; } diff --git a/api/@internal/component/ets/circle.d.ts b/api/@internal/component/ets/circle.d.ts index 845dd4b638..42e6cc834a 100644 --- a/api/@internal/component/ets/circle.d.ts +++ b/api/@internal/component/ets/circle.d.ts @@ -18,10 +18,6 @@ * @kit ArkUI */ -/*** if arkts 1.2 */ -import { CommonShapeMethod,CommonMethod } from './common'; -/*** endif */ - /** * Defines circle options for Circle component. * @@ -54,8 +50,7 @@ import { CommonShapeMethod,CommonMethod } from './common'; * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ declare interface CircleOptions { /** @@ -299,8 +294,7 @@ interface CircleInterface { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ declare class CircleAttribute extends CommonShapeMethod {} @@ -367,30 +361,3 @@ declare const Circle: CircleInterface; * @since 11 */ declare const CircleInstance: CircleAttribute; - -/** - * Defines circle component. - * - * @interface CircleInterface - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ -interface CircleInterface { - /** - * Set the options for circle component. - * - * @param { CircleOptions } [value] - options to create circle component. - * @returns { CircleAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - (value?: CircleOptions): CircleAttribute; -} diff --git a/api/@internal/component/ets/content_slot.d.ts b/api/@internal/component/ets/content_slot.d.ts index 79d291376e..d8e795dd24 100644 --- a/api/@internal/component/ets/content_slot.d.ts +++ b/api/@internal/component/ets/content_slot.d.ts @@ -18,10 +18,6 @@ * @kit ArkUI */ -/*** if arkts 1.2 */ -import { Content } from '../../@ohos.arkui.node'; -/*** endif */ - /** * Define Content type * @@ -39,8 +35,8 @@ declare type Content = import('../api/@ohos.arkui.node').Content; * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 + * @noninterop */ declare class ContentSlotAttribute { } @@ -52,8 +48,8 @@ declare class ContentSlotAttribute { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 + * @noninterop */ interface ContentSlotInterface { /** @@ -64,8 +60,7 @@ interface ContentSlotInterface { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ (content: Content): ContentSlotAttribute; } @@ -78,4 +73,4 @@ interface ContentSlotInterface { * @atomicservice * @since 12 */ -declare const ContentSlot: ContentSlotInterface; \ No newline at end of file +declare const ContentSlot: ContentSlotInterface; diff --git a/api/@internal/component/ets/ellipse.d.ts b/api/@internal/component/ets/ellipse.d.ts index 4f9cd5433e..678b414146 100644 --- a/api/@internal/component/ets/ellipse.d.ts +++ b/api/@internal/component/ets/ellipse.d.ts @@ -18,10 +18,6 @@ * @kit ArkUI */ -/*** if arkts 1.2 */ -import { CommonShapeMethod } from './common'; -/*** endif */ - /** * Ellipse constructor options. * @@ -30,8 +26,7 @@ import { CommonShapeMethod } from './common'; * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ interface EllipseOptions { /** @@ -313,8 +308,7 @@ interface EllipseInterface { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ declare class EllipseAttribute extends CommonShapeMethod {} @@ -381,30 +375,3 @@ declare const Ellipse: EllipseInterface; * @since 11 */ declare const EllipseInstance: EllipseAttribute; - -/** - * Ellipse drawing. - * - * @interface EllipseInterface - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ -interface EllipseInterface { - /** - * Set the value. - * - * @param { EllipseOptions } [options] - ellipse options - * @returns { EllipseAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - (options?: EllipseOptions): EllipseAttribute; -} diff --git a/api/@internal/component/ets/line.d.ts b/api/@internal/component/ets/line.d.ts index 278f936daa..52525bc39e 100644 --- a/api/@internal/component/ets/line.d.ts +++ b/api/@internal/component/ets/line.d.ts @@ -18,24 +18,6 @@ * @kit ArkUI */ -/*** if arkts 1.2 */ -import { CommonShapeMethod, CommonMethod } from './common'; -import { Length } from './units'; -/*** endif */ - -/** - * Defines the Shape Point, the first element is the x-axis offset and the second is the y-axis. - * - * @typedef { [Length, Length] } ShapePoint - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ -export type ShapePoint = [Length, Length]; - /** * Defines Line constructor options. * @@ -44,8 +26,7 @@ export type ShapePoint = [Length, Length]; * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ interface LineOptions { /** @@ -351,8 +332,7 @@ interface LineInterface { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ declare class LineAttribute extends CommonShapeMethod { /** @@ -395,20 +375,6 @@ declare class LineAttribute extends CommonShapeMethod { */ startPoint(value: Array): LineAttribute; - /** - * Coordinate of the start point of the line (relative coordinate). - * - * @param { ShapePoint } value - * @returns { LineAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - startPoint(value: ShapePoint): LineAttribute; - /** * Line end coordinates (relative coordinates). * @@ -448,20 +414,6 @@ declare class LineAttribute extends CommonShapeMethod { * @since 11 */ endPoint(value: Array): LineAttribute; - - /** - * Line end coordinates (relative coordinates). - * - * @param { ShapePoint } value - * @returns { LineAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - endPoint(value: ShapePoint): LineAttribute; } /** @@ -527,30 +479,3 @@ declare const Line: LineInterface; * @since 11 */ declare const LineInstance: LineAttribute; - -/** - * Line drawing component. - * - * @interface LineInterface - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ -interface LineInterface { - /** - * The return value of the parameter is Line. - * - * @param { LineOptions } [options] - Line options - * @returns { LineAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - (options?: LineOptions): LineAttribute; -} diff --git a/api/@internal/component/ets/matrix2d.d.ts b/api/@internal/component/ets/matrix2d.d.ts index a0378005cc..594e7dc4e9 100644 --- a/api/@internal/component/ets/matrix2d.d.ts +++ b/api/@internal/component/ets/matrix2d.d.ts @@ -18,10 +18,6 @@ * @kit ArkUI */ -/*** if arkts 1.2 */ -import { LengthMetricsUnit } from '../Graphics'; -/*** endif */ - /** * 2D transformation matrix, supporting rotation, translation, and scaling of the X-axis and Y-axis * @@ -50,8 +46,7 @@ import { LengthMetricsUnit } from '../Graphics'; * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ declare class Matrix2D { /** @@ -86,8 +81,7 @@ declare class Matrix2D { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ scaleX?: number; @@ -123,8 +117,7 @@ declare class Matrix2D { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ rotateY?: number; @@ -160,8 +153,7 @@ declare class Matrix2D { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ rotateX?: number; @@ -197,8 +189,7 @@ declare class Matrix2D { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ scaleY?: number; @@ -234,8 +225,7 @@ declare class Matrix2D { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ translateX?: number; @@ -271,8 +261,7 @@ declare class Matrix2D { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ translateY?: number; @@ -312,8 +301,7 @@ declare class Matrix2D { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ identity(): Matrix2D; @@ -353,8 +341,7 @@ declare class Matrix2D { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ invert(): Matrix2D; @@ -426,8 +413,7 @@ declare class Matrix2D { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ rotate(degree: number, rx?: number, ry?: number): Matrix2D; @@ -471,8 +457,7 @@ declare class Matrix2D { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ translate(tx?: number, ty?: number): Matrix2D; @@ -516,8 +501,7 @@ declare class Matrix2D { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ scale(sx?: number, sy?: number): Matrix2D; @@ -536,8 +520,7 @@ declare class Matrix2D { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ constructor(); @@ -549,8 +532,7 @@ declare class Matrix2D { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ constructor(unit: LengthMetricsUnit); } diff --git a/api/@internal/component/ets/path.d.ts b/api/@internal/component/ets/path.d.ts index af9beaf1e7..924c278aab 100644 --- a/api/@internal/component/ets/path.d.ts +++ b/api/@internal/component/ets/path.d.ts @@ -18,10 +18,6 @@ * @kit ArkUI */ -/*** if arkts 1.2 */ -import { CommonShapeMethod } from './common'; -/*** endif */ - /** * Define options used to construct a path. * @@ -30,8 +26,7 @@ import { CommonShapeMethod } from './common'; * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ declare interface PathOptions { /** @@ -363,8 +358,7 @@ interface PathInterface { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ declare class PathAttribute extends CommonShapeMethod { /** @@ -482,30 +476,3 @@ declare const Path: PathInterface; * @since 11 */ declare const PathInstance: PathAttribute; - -/** - * Provides the path drawing interface. - * - * @interface PathInterface - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ -interface PathInterface { - /** - * Called when drawing path. - * - * @param { PathOptions } [options] - path options - * @returns { PathAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - (options?: PathOptions): PathAttribute; -} \ No newline at end of file diff --git a/api/@internal/component/ets/polygon.d.ts b/api/@internal/component/ets/polygon.d.ts index 589a025455..2dc8c65f33 100644 --- a/api/@internal/component/ets/polygon.d.ts +++ b/api/@internal/component/ets/polygon.d.ts @@ -18,11 +18,6 @@ * @kit ArkUI */ -/*** if arkts 1.2 */ -import { CommonShapeMethod } from './common'; -import { ShapePoint } from './line'; -/*** endif */ - /** * Define options used to construct a polygon. * @@ -31,8 +26,7 @@ import { ShapePoint } from './line'; * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ declare interface PolygonOptions { /** @@ -313,8 +307,7 @@ interface PolygonInterface { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ declare class PolygonAttribute extends CommonShapeMethod { /** @@ -356,20 +349,6 @@ declare class PolygonAttribute extends CommonShapeMethod { * @since 11 */ points(value: Array): PolygonAttribute; - - /** - * Called when the vertex coordinate list of a polygon is set. - * - * @param { Array } value - * @returns { PolygonAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - points(value: Array): PolygonAttribute; } /** @@ -435,30 +414,3 @@ declare const Polygon: PolygonInterface; * @since 11 */ declare const PolygonInstance: PolygonAttribute; - -/** - * Provides the polygon drawing interface. - * - * @interface PolygonInterface - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ -interface PolygonInterface { - /** - * Called when drawing a polygon. - * - * @param { PolygonOptions } [options] - Polygon options - * @returns { PolygonAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - (options?: PolygonOptions): PolygonAttribute; -} diff --git a/api/@internal/component/ets/polyline.d.ts b/api/@internal/component/ets/polyline.d.ts index f6937400d1..d2ddef1e82 100644 --- a/api/@internal/component/ets/polyline.d.ts +++ b/api/@internal/component/ets/polyline.d.ts @@ -18,11 +18,6 @@ * @kit ArkUI */ -/*** if arkts 1.2 */ -import { CommonShapeMethod } from './common'; -import { ShapePoint } from './line'; -/*** endif */ - /** * Define options used to construct a polyline. * @@ -31,8 +26,7 @@ import { ShapePoint } from './line'; * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ declare interface PolylineOptions { /** @@ -306,8 +300,7 @@ interface PolylineInterface { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ declare class PolylineAttribute extends CommonShapeMethod { /** @@ -349,20 +342,6 @@ declare class PolylineAttribute extends CommonShapeMethod { * @since 11 */ points(value: Array): PolylineAttribute; - - /** - * Called when the polyline is set to pass through the coordinate point list. - * - * @param { Array } value - * @returns { PolylineAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - points(value: Array): PolylineAttribute; } /** @@ -428,30 +407,3 @@ declare const Polyline: PolylineInterface; * @since 11 */ declare const PolylineInstance: PolylineAttribute; - -/** - * Provides an interface for drawing polylines. - * - * @interface PolylineInterface - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ -interface PolylineInterface { - /** - * Set options for polyline component. - * - * @param { PolylineOptions } [options] - Poly line options - * @returns { PolylineAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - (options?: PolylineOptions): PolylineAttribute; -} diff --git a/api/@internal/component/ets/rect.d.ts b/api/@internal/component/ets/rect.d.ts index 84c8ecde7b..a025e7543c 100644 --- a/api/@internal/component/ets/rect.d.ts +++ b/api/@internal/component/ets/rect.d.ts @@ -18,24 +18,6 @@ * @kit ArkUI */ -/*** if arkts 1.2 */ -import { CommonShapeMethod } from './common'; -import { Length } from './units'; -/*** endif */ - -/** - * Defines the RadiusItem, the first element is the width of the rounded corner, the second is the height of the rounded corner. - * - * @typedef { [Length, Length] } RadiusItem - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ -declare type RadiusItem = [Length, Length]; - /** * Define options used to construct a rectangle. * @@ -44,8 +26,7 @@ declare type RadiusItem = [Length, Length]; * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ declare interface RectOptions { /** @@ -102,7 +83,6 @@ declare interface RectOptions { * @form * @atomicservice * @since 20 - * @arkts 1.1&1.2 */ width?: Length; @@ -160,7 +140,6 @@ declare interface RectOptions { * @form * @atomicservice * @since 20 - * @arkts 1.1&1.2 */ height?: Length; @@ -220,19 +199,6 @@ declare interface RectOptions { * @since 20 */ radius?: Length | Array; - - /** - * Corner radius of the rectangle. - * - * @type { ?(Length | Array) } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - radius?: Length | Array; } /** @@ -243,8 +209,7 @@ declare interface RectOptions { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ declare interface RoundedRectOptions { /** @@ -569,7 +534,7 @@ interface RectInterface { * Called when a rectangle is created. * * @param { {width?: number | string;height?: number | string;radius?: number | string | Array;} | - * {width?: number | string;height?: number | string;radiusWidth?: number | string;radiusHeight?: number | string;} } value + * {width?: number | string;height?: number | string;radiusWidth?: number | string;radiusHeight?: number | string;} } value * @returns { RectAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 7 @@ -578,7 +543,7 @@ interface RectInterface { * Called when a rectangle is created. * * @param { {width?: number | string;height?: number | string;radius?: number | string | Array;} | - * {width?: number | string;height?: number | string;radiusWidth?: number | string;radiusHeight?: number | string;} } value + * {width?: number | string;height?: number | string;radiusWidth?: number | string;radiusHeight?: number | string;} } value * @returns { RectAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @form @@ -656,8 +621,7 @@ interface RectInterface { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ declare class RectAttribute extends CommonShapeMethod { /** @@ -792,7 +756,7 @@ declare class RectAttribute extends CommonShapeMethod { /** * Called when the fillet size is set. * - * @param { Length | Array } value + * @param { number | string | Array } value * @returns { RectAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform @@ -812,20 +776,6 @@ declare class RectAttribute extends CommonShapeMethod { * @since 20 */ radius(value: Length | Array): RectAttribute; - - /** - * Called when the fillet size is set. - * - * @param { number | string | Array } value - * @returns { RectAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - radius(value: number | string | Array): RectAttribute; } /** @@ -884,32 +834,3 @@ declare const RectInStance: RectAttribute; * @since 11 */ declare const RectInstance: RectAttribute; - -/** - * Provides an interface for drawing rectangles. - * - * @interface RectInterface - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ -interface RectInterface { - /** - * Called when a rectangle is created. - * - * @param { RectOptions | RoundedRectOptions } [options] - Rect options - * @returns { RectAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - ( - options?: RectOptions | RoundedRectOptions, - ): RectAttribute; -} \ No newline at end of file diff --git a/api/@internal/component/ets/shape.d.ts b/api/@internal/component/ets/shape.d.ts index 8acf8b8fa9..7acbca147f 100644 --- a/api/@internal/component/ets/shape.d.ts +++ b/api/@internal/component/ets/shape.d.ts @@ -18,13 +18,6 @@ * @kit ArkUI */ -/*** if arkts 1.2 */ -import { CommonMethod, PixelMap } from './common'; -import { ResourceColor, Length } from './units'; -import { Resource } from '../../global/resource'; -import { LineCapStyle, LineJoinStyle } from './enums'; -/*** endif */ - /** * Viewport bounding box. * @@ -33,8 +26,7 @@ import { LineCapStyle, LineJoinStyle } from './enums'; * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ declare interface ViewportRect { /** @@ -91,7 +83,6 @@ declare interface ViewportRect { * @form * @atomicservice * @since 20 - * @arkts 1.1&1.2 */ x?: Length; @@ -149,7 +140,6 @@ declare interface ViewportRect { * @form * @atomicservice * @since 20 - * @arkts 1.1&1.2 */ y?: Length; @@ -207,7 +197,6 @@ declare interface ViewportRect { * @form * @atomicservice * @since 20 - * @arkts 1.1&1.2 */ width?: Length; @@ -265,7 +254,6 @@ declare interface ViewportRect { * @form * @atomicservice * @since 20 - * @arkts 1.1&1.2 */ height?: Length; } @@ -418,8 +406,7 @@ interface ShapeInterface { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ declare class ShapeAttribute extends CommonMethod { /** @@ -470,8 +457,7 @@ declare class ShapeAttribute extends CommonMethod { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ viewPort(value: ViewportRect): ShapeAttribute; @@ -511,8 +497,7 @@ declare class ShapeAttribute extends CommonMethod { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ stroke(value: ResourceColor): ShapeAttribute; @@ -552,8 +537,7 @@ declare class ShapeAttribute extends CommonMethod { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ fill(value: ResourceColor): ShapeAttribute; @@ -587,7 +571,7 @@ declare class ShapeAttribute extends CommonMethod { /** * Called when the offset of the starting point of border drawing is set. * - * @param { Length } value + * @param { number | string } value * @returns { ShapeAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform @@ -605,7 +589,6 @@ declare class ShapeAttribute extends CommonMethod { * @form * @atomicservice * @since 20 - * @arkts 1.1&1.2 */ strokeDashOffset(value: Length): ShapeAttribute; @@ -649,20 +632,6 @@ declare class ShapeAttribute extends CommonMethod { */ strokeDashArray(value: Array): ShapeAttribute; - /** - * Called when the gap of the border is set. - * - * @param { Array } value - * @returns { ShapeAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - strokeDashArray(value: Array): ShapeAttribute; - /** * Called when the path endpoint drawing style is set. * @@ -699,8 +668,7 @@ declare class ShapeAttribute extends CommonMethod { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ strokeLineCap(value: LineCapStyle): ShapeAttribute; @@ -740,8 +708,7 @@ declare class ShapeAttribute extends CommonMethod { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ strokeLineJoin(value: LineJoinStyle): ShapeAttribute; @@ -775,7 +742,7 @@ declare class ShapeAttribute extends CommonMethod { /** * Called when the limit value for drawing acute angles as oblique angles is set. * - * @param { Length } value + * @param { number | string } value * @returns { ShapeAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform @@ -793,7 +760,6 @@ declare class ShapeAttribute extends CommonMethod { * @form * @atomicservice * @since 20 - * @arkts 1.1&1.2 */ strokeMiterLimit(value: Length): ShapeAttribute; @@ -833,8 +799,7 @@ declare class ShapeAttribute extends CommonMethod { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ strokeOpacity(value: number | string | Resource): ShapeAttribute; @@ -874,8 +839,7 @@ declare class ShapeAttribute extends CommonMethod { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ fillOpacity(value: number | string | Resource): ShapeAttribute; @@ -909,7 +873,7 @@ declare class ShapeAttribute extends CommonMethod { /** * Called when the width of the border is set. * - * @param { Length } value + * @param { number | string } value * @returns { ShapeAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform @@ -927,7 +891,6 @@ declare class ShapeAttribute extends CommonMethod { * @form * @atomicservice * @since 20 - * @arkts 1.1&1.2 */ strokeWidth(value: Length): ShapeAttribute; @@ -967,8 +930,7 @@ declare class ShapeAttribute extends CommonMethod { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ antiAlias(value: boolean): ShapeAttribute; @@ -1019,22 +981,6 @@ declare class ShapeAttribute extends CommonMethod { * @since 11 */ mesh(value: Array, column: number, row: number): ShapeAttribute; - - /** - * Called when shape mesh. - * - * @param { Array } value - * @param { number } column - * @param { number } row - * @returns { ShapeAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - mesh(value: Array, column: number, row: number): ShapeAttribute; } /** @@ -1100,29 +1046,3 @@ declare const Shape: ShapeInterface; * @since 11 */ declare const ShapeInstance: ShapeAttribute; - -/** - * Provides interfaces for drawing components. - * - * @interface ShapeInterface - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ -interface ShapeInterface { - /** - * Shape component constructor. - * - * @param { PixelMap } [value] - PixelMap object to draw. - * @returns { ShapeAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - (value?: PixelMap): ShapeAttribute; -} diff --git a/api/@internal/component/ets/video.d.ts b/api/@internal/component/ets/video.d.ts index 29a25dc167..36dc4bd16b 100644 --- a/api/@internal/component/ets/video.d.ts +++ b/api/@internal/component/ets/video.d.ts @@ -18,14 +18,6 @@ * @kit ArkUI */ -/*** if arkts 1.2 */ -import { Resource } from '../../global/resource'; -import { ImageAIOptions, ImageAnalyzerConfig } from './imageCommon'; -import { ImageFit } from './enums'; -import { CommonMethod, Callback, PixelMap } from './common'; -import { VoidCallback, ColorMetrics } from './units'; -/*** endif */ - /** * Seek mode. * @@ -48,8 +40,7 @@ import { VoidCallback, ColorMetrics } from './units'; * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ declare enum SeekMode { /** @@ -71,8 +62,7 @@ declare enum SeekMode { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ PreviousKeyframe, @@ -95,8 +85,7 @@ declare enum SeekMode { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ NextKeyframe, @@ -119,8 +108,7 @@ declare enum SeekMode { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ ClosestKeyframe, @@ -143,8 +131,7 @@ declare enum SeekMode { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ Accurate, } @@ -171,8 +158,7 @@ declare enum SeekMode { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ declare enum PlaybackSpeed { /** @@ -194,8 +180,7 @@ declare enum PlaybackSpeed { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ Speed_Forward_0_75_X, @@ -218,8 +203,7 @@ declare enum PlaybackSpeed { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ Speed_Forward_1_00_X, @@ -242,8 +226,7 @@ declare enum PlaybackSpeed { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ Speed_Forward_1_25_X, @@ -266,8 +249,7 @@ declare enum PlaybackSpeed { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ Speed_Forward_1_75_X, @@ -290,8 +272,7 @@ declare enum PlaybackSpeed { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ Speed_Forward_2_00_X, } @@ -303,8 +284,7 @@ declare enum PlaybackSpeed { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ interface FullscreenInfo { /** @@ -331,8 +311,7 @@ interface FullscreenInfo { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ fullscreen: boolean; } @@ -344,8 +323,7 @@ interface FullscreenInfo { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ interface PreparedInfo { /** @@ -372,8 +350,7 @@ interface PreparedInfo { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ duration: number; } @@ -385,8 +362,7 @@ interface PreparedInfo { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ interface PlaybackInfo { /** @@ -413,8 +389,7 @@ interface PlaybackInfo { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ time: number; } @@ -425,8 +400,7 @@ interface PlaybackInfo { * @interface PosterOptions * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ declare interface PosterOptions { /** @@ -436,8 +410,7 @@ declare interface PosterOptions { * @default false * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ showFirstFrame?: boolean; } @@ -473,8 +446,7 @@ declare interface PosterOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare interface VideoOptions { /** @@ -499,8 +471,7 @@ declare interface VideoOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ src?: string | Resource; @@ -526,8 +497,7 @@ declare interface VideoOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ currentProgressRate?: number | string | PlaybackSpeed; @@ -553,8 +523,7 @@ declare interface VideoOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ previewUri?: string | PixelMap | Resource; @@ -580,8 +549,7 @@ declare interface VideoOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ controller?: VideoController; @@ -591,8 +559,7 @@ declare interface VideoOptions { * @type { ?ImageAIOptions } * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ imageAIOptions?: ImageAIOptions; @@ -602,8 +569,7 @@ declare interface VideoOptions { * @type { ?PosterOptions } * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ posterOptions?: PosterOptions; } @@ -627,8 +593,7 @@ declare interface VideoOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ declare class VideoController { /** @@ -650,8 +615,7 @@ declare class VideoController { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ constructor(); @@ -678,17 +642,6 @@ declare class VideoController { */ start(); - /** - * Provides events to play. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - start(): void; - /** * Provides a pause event for playback. * @@ -712,17 +665,6 @@ declare class VideoController { */ pause(); - /** - * Provides a pause event for playback. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - pause(): void; - /** * Provides an event to stop playback. * @@ -746,17 +688,6 @@ declare class VideoController { */ stop(); - /** - * Provides an event to stop playback. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - stop(): void; - /** * Provide the progress method of video playback. * @@ -783,18 +714,6 @@ declare class VideoController { */ setCurrentTime(value: number); - /** - * Provide the progress method of video playback. - * - * @param { number } value - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - setCurrentTime(value: number): void; - /** * Provides a full screen playback method. * @@ -821,18 +740,6 @@ declare class VideoController { */ requestFullscreen(value: boolean); - /** - * Provides a full screen playback method. - * - * @param { boolean } value - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - requestFullscreen(value: boolean): void; - /** * Provides a method to exit full screen playback. * @@ -856,17 +763,6 @@ declare class VideoController { */ exitFullscreen(); - /** - * Provides a method to exit full screen playback. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - exitFullscreen(): void; - /** * Provide the progress method of video playback. * @@ -896,26 +792,12 @@ declare class VideoController { */ setCurrentTime(value: number, seekMode: SeekMode); - /** - * Provide the progress method of video playback. - * - * @param { number } value - * @param { SeekMode } seekMode - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - setCurrentTime(value: number, seekMode: SeekMode): void; - /** * Provide the reset method of video playback. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice - * @since arkts {'1.1':'12', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ reset(): void; } @@ -942,8 +824,7 @@ declare class VideoController { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ interface VideoInterface { /** @@ -971,8 +852,7 @@ interface VideoInterface { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ (value: VideoOptions): VideoAttribute; } @@ -999,8 +879,7 @@ interface VideoInterface { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ declare class VideoAttribute extends CommonMethod { /** @@ -1028,8 +907,7 @@ declare class VideoAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ muted(value: boolean): VideoAttribute; @@ -1058,8 +936,7 @@ declare class VideoAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ autoPlay(value: boolean): VideoAttribute; @@ -1088,8 +965,7 @@ declare class VideoAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ controls(value: boolean): VideoAttribute; @@ -1118,8 +994,7 @@ declare class VideoAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ loop(value: boolean): VideoAttribute; @@ -1148,8 +1023,7 @@ declare class VideoAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ objectFit(value: ImageFit): VideoAttribute; @@ -1189,8 +1063,7 @@ declare class VideoAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ onStart(event: VoidCallback): VideoAttribute; @@ -1230,8 +1103,7 @@ declare class VideoAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ onPause(event: VoidCallback): VideoAttribute; @@ -1271,8 +1143,7 @@ declare class VideoAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ onFinish(event: VoidCallback): VideoAttribute; @@ -1312,8 +1183,7 @@ declare class VideoAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ onFullscreenChange(callback: Callback): VideoAttribute; @@ -1353,8 +1223,7 @@ declare class VideoAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ onPrepared(callback: Callback): VideoAttribute; @@ -1394,8 +1263,7 @@ declare class VideoAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ onSeeking(callback: Callback): VideoAttribute; @@ -1435,8 +1303,7 @@ declare class VideoAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ onSeeked(callback: Callback): VideoAttribute; @@ -1476,8 +1343,7 @@ declare class VideoAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ onUpdate(callback: Callback): VideoAttribute; @@ -1519,19 +1385,6 @@ declare class VideoAttribute extends CommonMethod { * @since 20 */ onError(event: VoidCallback | import('../api/@ohos.base').ErrorCallback): VideoAttribute; - - /** - * Called when playback fails. - * - * @param { function } event - * @returns { VideoAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - onError(event: () => void): VideoAttribute; /** * Called when the video is stopped. @@ -1541,8 +1394,7 @@ declare class VideoAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ onStop(event: Callback): VideoAttribute; @@ -1553,8 +1405,7 @@ declare class VideoAttribute extends CommonMethod { * @returns { VideoAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ enableAnalyzer(enable: boolean): VideoAttribute; @@ -1565,8 +1416,7 @@ declare class VideoAttribute extends CommonMethod { * @returns { VideoAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ analyzerConfig(config: ImageAnalyzerConfig): VideoAttribute; @@ -1577,8 +1427,7 @@ declare class VideoAttribute extends CommonMethod { * @returns { VideoAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @systemapi - * @since arkts {'1.1':'15','1.2':'20'} - * @arkts 1.1&1.2 + * @since 15 */ surfaceBackgroundColor(color: ColorMetrics): VideoAttribute; @@ -1593,8 +1442,7 @@ declare class VideoAttribute extends CommonMethod { * @returns { VideoAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice - * @since arkts {'1.1':'15','1.2':'20'} - * @arkts 1.1&1.2 + * @since 15 */ enableShortcutKey(enabled: boolean): VideoAttribute; } diff --git a/api/@internal/component/ets/xcomponent.d.ts b/api/@internal/component/ets/xcomponent.d.ts index 422c84bc0c..c49c461306 100644 --- a/api/@internal/component/ets/xcomponent.d.ts +++ b/api/@internal/component/ets/xcomponent.d.ts @@ -18,13 +18,6 @@ * @kit ArkUI */ -/*** if arkts 1.2 */ -import { ImageAIOptions, ImageAnalyzerConfig } from './imageCommon'; -import { CommonMethod } from './common'; -import { XComponentType } from './enums'; -import { VoidCallback } from './units'; -/*** endif */ - /** * Describes the rectangle of the surface held by the XComponent. * @@ -40,8 +33,7 @@ import { VoidCallback } from './units'; * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'20','1.2':'20'} - * @arkts 1.1&1.2 + * @since 20 */ declare interface SurfaceRect { /** @@ -61,8 +53,7 @@ declare interface SurfaceRect { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'20','1.2':'20'} - * @arkts 1.1&1.2 + * @since 20 */ offsetX?: number; @@ -83,8 +74,7 @@ declare interface SurfaceRect { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'20','1.2':'20'} - * @arkts 1.1&1.2 + * @since 20 */ offsetY?: number; @@ -104,8 +94,7 @@ declare interface SurfaceRect { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'20','1.2':'20'} - * @arkts 1.1&1.2 + * @since 20 */ surfaceWidth: number; @@ -125,8 +114,7 @@ declare interface SurfaceRect { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'20','1.2':'20'} - * @arkts 1.1&1.2 + * @since 20 */ surfaceHeight: number; } @@ -146,8 +134,7 @@ declare interface SurfaceRect { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'20','1.2':'20'} - * @arkts 1.1&1.2 + * @since 20 */ declare interface SurfaceRotationOptions { /** @@ -166,8 +153,7 @@ declare interface SurfaceRotationOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'20','1.2':'20'} - * @arkts 1.1&1.2 + * @since 20 */ lock?: boolean; } @@ -186,8 +172,7 @@ declare interface SurfaceRotationOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare class XComponentController { /** @@ -202,8 +187,7 @@ declare class XComponentController { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ constructor(); @@ -223,8 +207,7 @@ declare class XComponentController { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ getXComponentSurfaceId(): string; @@ -246,8 +229,7 @@ declare class XComponentController { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ getXComponentContext(): Object; @@ -282,8 +264,7 @@ declare class XComponentController { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'20','1.2':'20'} - * @arkts 1.1&1.2 + * @since 20 */ setXComponentSurfaceRect(rect: SurfaceRect): void; @@ -303,8 +284,7 @@ declare class XComponentController { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'20','1.2':'20'} - * @arkts 1.1&1.2 + * @since 20 */ getXComponentSurfaceRect(): SurfaceRect; @@ -324,8 +304,7 @@ declare class XComponentController { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'20','1.2':'20'} - * @arkts 1.1&1.2 + * @since 20 */ setXComponentSurfaceRotation(rotationOptions: SurfaceRotationOptions): void; @@ -345,8 +324,7 @@ declare class XComponentController { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'20','1.2':'20'} - * @arkts 1.1&1.2 + * @since 20 */ getXComponentSurfaceRotation(): Required; @@ -366,8 +344,7 @@ declare class XComponentController { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'20','1.2':'20'} - * @arkts 1.1&1.2 + * @since 20 */ onSurfaceCreated(surfaceId: string): void; @@ -389,8 +366,7 @@ declare class XComponentController { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'20','1.2':'20'} - * @arkts 1.1&1.2 + * @since 20 */ onSurfaceChanged(surfaceId: string, rect: SurfaceRect): void; @@ -410,8 +386,7 @@ declare class XComponentController { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'20','1.2':'20'} - * @arkts 1.1&1.2 + * @since 20 */ onSurfaceDestroyed(surfaceId: string): void; @@ -428,8 +403,7 @@ declare class XComponentController { * @throws { BusinessError } 110003 - Image analysis is stopped. * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ startImageAnalyzer(config: ImageAnalyzerConfig): Promise; @@ -439,8 +413,7 @@ declare class XComponentController { * * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ stopImageAnalyzer(): void; @@ -481,8 +454,7 @@ declare class XComponentController { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'20','1.2':'20'} - * @arkts 1.1&1.2 + * @since 20 */ declare interface XComponentOptions { /** @@ -500,8 +472,7 @@ declare interface XComponentOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'20','1.2':'20'} - * @arkts 1.1&1.2 + * @since 20 */ type: XComponentType; @@ -521,8 +492,7 @@ declare interface XComponentOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'20','1.2':'20'} - * @arkts 1.1&1.2 + * @since 20 */ controller: XComponentController; @@ -533,8 +503,7 @@ declare interface XComponentOptions { * @type { ?ImageAIOptions } * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ imageAIOptions?: ImageAIOptions; @@ -544,8 +513,7 @@ declare interface XComponentOptions { * @type { ?number } * @syscap SystemCapability.ArkUI.ArkUI.Full * @systemapi - * @since arkts {'1.1':'17','1.2':'20'} - * @arkts 1.1&1.2 + * @since 17 */ screenId?: number; } @@ -556,8 +524,7 @@ declare interface XComponentOptions { * @interface NativeXComponentParameters * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice - * @since arkts {'1.1':'19','1.2':'20'} - * @arkts 1.1&1.2 + * @since 19 */ declare interface NativeXComponentParameters { /** @@ -566,8 +533,7 @@ declare interface NativeXComponentParameters { * @type { XComponentType } * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice - * @since arkts {'1.1':'19','1.2':'20'} - * @arkts 1.1&1.2 + * @since 19 */ type: XComponentType; @@ -577,8 +543,7 @@ declare interface NativeXComponentParameters { * @type { ?ImageAIOptions } * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice - * @since arkts {'1.1':'19','1.2':'20'} - * @arkts 1.1&1.2 + * @since 19 */ imageAIOptions?: ImageAIOptions; } @@ -673,8 +638,7 @@ interface XComponentInterface { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ declare type OnNativeLoadCallback = (event?: object) => void; @@ -692,8 +656,7 @@ declare type OnNativeLoadCallback = (event?: object) => void; * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare class XComponentAttribute extends CommonMethod { /** @@ -723,8 +686,7 @@ declare class XComponentAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ onLoad(callback: OnNativeLoadCallback): XComponentAttribute; @@ -755,8 +717,7 @@ declare class XComponentAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ onDestroy(event: VoidCallback): XComponentAttribute; @@ -770,8 +731,7 @@ declare class XComponentAttribute extends CommonMethod { * @returns { XComponentAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ enableAnalyzer(enable: boolean): XComponentAttribute; @@ -782,8 +742,7 @@ declare class XComponentAttribute extends CommonMethod { * @returns { XComponentAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice - * @since arkts {'1.1':'13','1.2':'20'} - * @arkts 1.1&1.2 + * @since 13 */ enableSecure(isSecure: boolean): XComponentAttribute; @@ -804,7 +763,6 @@ declare class XComponentAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice * @since 20 - * @arkts 1.1&1.2 */ hdrBrightness(brightness: number): XComponentAttribute; @@ -815,8 +773,7 @@ declare class XComponentAttribute extends CommonMethod { * @returns { XComponentAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @systemapi - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ enableTransparentLayer(enabled: boolean): XComponentAttribute; } @@ -852,109 +809,3 @@ declare const XComponent: XComponentInterface; * @since 12 */ declare const XComponentInstance: XComponentAttribute; - -/** - * Defines the XComponent parameter interface. - * - * @interface XComponentParameter - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ -declare interface XComponentParameter { - /** - * The id of xcomponent - * - * @type { string } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - id: string; - /** - * The type of xcomponent - * - * @type { XComponentType } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - type: XComponentType; - /** - * The name of the dynamic library compiled and output by the native layer. - * - * @type { ?string } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - libraryname?: string; - /** - * The controller of xcomponent. - * - * @type { ?XComponentController } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - controller?: XComponentController; -} - -/** - * Defines XComponent. - * - * @interface XComponentInterface - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ -interface XComponentInterface { - /** - * Constructor parameters - * - * @param { XComponentParameter } value - Indicates the options of the xcomponent. - * @returns { XComponentAttribute } The attribute of the xcomponent. - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - (value: XComponentParameter): XComponentAttribute; - - /** - * Constructor parameters - * - * @param { XComponentOptions } options - Indicates the options of the xcomponent. - * @returns { XComponentAttribute } The attribute of the xcomponent. - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - (options: XComponentOptions): XComponentAttribute; - - /** - * Constructor parameters - * - * @param { NativeXComponentParameters } params - Indicates the constructor parameters of the xcomponent for native developing. - * @returns { XComponentAttribute } The attribute of the xcomponent. - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - (params: NativeXComponentParameters): XComponentAttribute; -} \ No newline at end of file diff --git a/api/@ohos.arkui.modifier.d.ets b/api/@ohos.arkui.modifier.d.ets index 4cdb3f34c0..8e6931998b 100644 --- a/api/@ohos.arkui.modifier.d.ets +++ b/api/@ohos.arkui.modifier.d.ets @@ -58,3 +58,60 @@ export { ButtonModifier } from './arkui/ButtonModifier'; * @since 20 */ export { SymbolGlyphModifier } from './arkui/SymbolGlyphModifier'; + + +/** + * Export AttributeUpdater, which is used to update attributes to native side. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 20 + */ +export { LineModifier } from './arkui/LineModifier'; + +/** + * Export AttributeUpdater, which is used to update attributes to native side. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 20 + */ +export { PathModifier } from './arkui/PathModifier'; + +/** + * Export AttributeUpdater, which is used to update attributes to native side. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 20 + */ +export { PolygonModifier } from './arkui/PolygonModifier'; + +/** + * Export AttributeUpdater, which is used to update attributes to native side. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 20 + */ +export { PolylineModifier } from './arkui/PolylineModifier'; + +/** + * Export AttributeUpdater, which is used to update attributes to native side. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 20 + */ +export { RectModifier } from './arkui/RectModifier'; + +/** + * Export AttributeUpdater, which is used to update attributes to native side. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 20 + */ +export { ShapeModifier } from './arkui/ShapeModifier'; + +/** + * Export AttributeUpdater, which is used to update attributes to native side. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 20 + */ +export { VideoModifier } from './arkui/VideoModifier'; diff --git a/api/arkui/Content.d.ts b/api/arkui/Content.d.ts index 69f9e3f543..8c3d951853 100644 --- a/api/arkui/Content.d.ts +++ b/api/arkui/Content.d.ts @@ -24,8 +24,7 @@ * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ export abstract class Content{ } diff --git a/api/arkui/Content.static.d.ets b/api/arkui/Content.static.d.ets new file mode 100644 index 0000000000..988a60257b --- /dev/null +++ b/api/arkui/Content.static.d.ets @@ -0,0 +1,28 @@ +/* + * 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 + * @arkts 1.2 + */ + +/** + * Defines the base class for ComponentContent and NodeContent. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export abstract class Content { +} diff --git a/api/arkui/LineModifier.static.d.ets b/api/arkui/LineModifier.static.d.ets new file mode 100644 index 0000000000..854042a4c2 --- /dev/null +++ b/api/arkui/LineModifier.static.d.ets @@ -0,0 +1,33 @@ +/* + * 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. + */ + +import { AttributeModifier } from './component/common'; +import { LineAttribute } from './component/line'; + +/** + * @file + * @kit ArkUI + * @arkts 1.2 + */ + +/** + * Defines Line Modifier + * + * @implements LineAttribute, AttributeModifier + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + * @noninterop + */ +export declare class LineModifier implements LineAttribute, AttributeModifier {} diff --git a/api/arkui/PathModifier.static.d.ets b/api/arkui/PathModifier.static.d.ets new file mode 100644 index 0000000000..85048b0bbb --- /dev/null +++ b/api/arkui/PathModifier.static.d.ets @@ -0,0 +1,33 @@ +/* + * 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. + */ + +import { AttributeModifier } from './component/common'; +import { PathAttribute } from './component/path'; + +/** + * @file + * @kit ArkUI + * @arkts 1.2 + */ + +/** + * Defines Path Modifier + * + * @implements PathAttribute, AttributeModifier + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + * @noninterop + */ +export declare class PathModifier implements PathAttribute, AttributeModifier {} diff --git a/api/arkui/PolygonModifier.static.d.ets b/api/arkui/PolygonModifier.static.d.ets new file mode 100644 index 0000000000..8e9aa860dd --- /dev/null +++ b/api/arkui/PolygonModifier.static.d.ets @@ -0,0 +1,33 @@ +/* + * 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. + */ + +import { AttributeModifier } from './component/common'; +import { PolygonAttribute } from './component/polygon'; + +/** + * @file + * @kit ArkUI + * @arkts 1.2 + */ + +/** + * Defines Polygon Modifier + * + * @implements PolygonAttribute, AttributeModifier + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + * @noninterop + */ +export declare class PolygonModifier implements PolygonAttribute, AttributeModifier {} diff --git a/api/arkui/PolylineModifier.static.d.ets b/api/arkui/PolylineModifier.static.d.ets new file mode 100644 index 0000000000..e5f89c093c --- /dev/null +++ b/api/arkui/PolylineModifier.static.d.ets @@ -0,0 +1,33 @@ +/* + * 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. + */ + +import { AttributeModifier } from './component/common'; +import { PolylineAttribute } from './component/polyline'; + +/** + * @file + * @kit ArkUI + * @arkts 1.2 + */ + +/** + * Defines Polyline Modifier + * + * @implements PolylineAttribute, AttributeModifier + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + * @noninterop + */ +export declare class PolylineModifier implements PolylineAttribute, AttributeModifier {} diff --git a/api/arkui/RectModifier.static.d.ets b/api/arkui/RectModifier.static.d.ets new file mode 100644 index 0000000000..c5a4229906 --- /dev/null +++ b/api/arkui/RectModifier.static.d.ets @@ -0,0 +1,33 @@ +/* + * 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. + */ + +import { AttributeModifier } from './component/common'; +import { RectAttribute } from './component/rect'; + +/** + * @file + * @kit ArkUI + * @arkts 1.2 + */ + +/** + * Defines Rect Modifier + * + * @implements RectAttribute, AttributeModifier + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + * @noninterop + */ +export declare class RectModifier implements RectAttribute, AttributeModifier {} diff --git a/api/arkui/ShapeModifier.static.d.ets b/api/arkui/ShapeModifier.static.d.ets new file mode 100644 index 0000000000..8ec347ce99 --- /dev/null +++ b/api/arkui/ShapeModifier.static.d.ets @@ -0,0 +1,33 @@ +/* + * 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. + */ + +import { AttributeModifier } from './component/common'; +import { ShapeAttribute } from './component/shape'; + +/** + * @file + * @kit ArkUI + * @arkts 1.2 + */ + +/** + * Defines Shape Modifier + * + * @implements ShapeAttribute, AttributeModifier + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + * @noninterop + */ +export declare class ShapeModifier implements ShapeAttribute, AttributeModifier {} diff --git a/api/arkui/VideoModifier.static.d.ets b/api/arkui/VideoModifier.static.d.ets new file mode 100644 index 0000000000..29c30bab24 --- /dev/null +++ b/api/arkui/VideoModifier.static.d.ets @@ -0,0 +1,33 @@ +/* + * 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. + */ + +import { AttributeModifier } from './component/common'; +import { VideoAttribute } from './component/video'; + +/** + * @file + * @kit ArkUI + * @arkts 1.2 + */ + +/** + * Defines Video Modifier + * + * @implements VideoAttribute, AttributeModifier + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + * @noninterop + */ +export declare class VideoModifier implements VideoAttribute, AttributeModifier {} diff --git a/api/arkui/component/canvas.static.d.ets b/api/arkui/component/canvas.static.d.ets new file mode 100644 index 0000000000..05e6d4e354 --- /dev/null +++ b/api/arkui/component/canvas.static.d.ets @@ -0,0 +1,1813 @@ +/* + * 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 + * @arkts 1.2 + */ +import { CommonMethod, Callback, PixelMap } from './common'; +import { FrameNode } from '../FrameNode'; +import { ImageAIOptions, ImageAnalyzerConfig } from './imageCommon'; +import { Matrix2D } from './matrix2d'; +import { VoidCallback, LengthMetricsUnit, LengthMetrics } from './units'; +import { Size } from '../Graphics'; +import { memo, ComponentBuilder } from './../stateManagement/runtime'; +import { AttributeModifier, CommonMethod } from './common'; + +/** + * Filling style algorithm, which determines whether a point is within or outside the path. The following + * two configurations are supported: + * 'evenodd': odd and even round rule + * 'nonzero': (Default) Non-zero Wrap Rules + * + * @typedef { 'evenodd' | 'nonzero' } CanvasFillRule + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export type CanvasFillRule = 'evenodd' | 'nonzero'; + +/** + * Specifies the attribute of drawing the end of each line segment. The following configurations are supported: + * 'butt': (Default) Segment Ends in Square + * 'round': Segment ends in a circle + * 'square': The end of the segment ends in a square, but a rectangular area is added that is the same width + * as the segment and is half the thickness of the segment. + * + * @typedef { 'butt' | 'round' | 'square' } CanvasLineCap + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export type CanvasLineCap = 'butt' | 'round' | 'square'; + +/** + * Sets the attribute of how two connected parts (line segments, arcs, and curves) whose length is not 0 + * are connected together. The following three configurations are supported: + * 'bevel': Fill the ends of the connected sections with an additional triangle-base area, + * each with its own independent rectangular corner. + * 'miter': (Default) An additional diamond region is formed by extending the outer edges of the connected portions + * so that they intersect at a point. + * 'round': Draw the shape of the corner by filling in an additional sector with the center at the end of the + * connected section. The radius of the fillet is the width of the segment. + * + * @typedef { 'bevel' | 'miter' | 'round' } CanvasLineJoin + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export type CanvasLineJoin = 'bevel' | 'miter' | 'round'; + +/** + * Indicates the attribute of the current text direction. The options are as follows: + * 'inherit': (Default) Inherit current Canvas component settings + * 'ltr': The text direction is left to right. + * 'rtl': The text direction is from right to left. + * + * @typedef { 'inherit' | 'ltr' | 'rtl' } CanvasDirection + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export type CanvasDirection = 'inherit' | 'ltr' | 'rtl'; + +/** + * Describes the alignment mode for drawing text. The options are as follows: + * 'center': The text is centered. + * 'end': Where text aligns lines end (Left alignment refers to the local from left to right, + * and right alignment refers to the local from right to left) + * 'left': (Default) The text is left-aligned. + * 'right': The text is right-aligned. + * 'start': Where the text snap line begins (Left alignment refers to the local from left to right, + * and right alignment refers to the local from right to left) + * + * @typedef { 'center' | 'end' | 'left' | 'right' | 'start' } CanvasTextAlign + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export type CanvasTextAlign = 'center' | 'end' | 'left' | 'right' | 'start'; + +/** + * Text baseline, which supports the following configurations: + * 'alphabetic': (Default) The text baseline is the standard letter baseline. + * 'bottom': The text baseline is at the bottom of the text block. The difference between the ideographic baseline + * and the ideographic baseline is that the ideographic baseline does not need to consider downlink letters. + * 'hanging': The text baseline is a hanging baseline. + * 'ideographic': The text baseline is the ideographic baseline; If the character itself exceeds the alphabetic + * baseline, the ideographic baseline is at the bottom of the character itself. + * 'middle': The text baseline is in the middle of the text block. + * 'top': The text baseline is at the top of the text block. + * + * @typedef { 'alphabetic' | 'bottom' | 'hanging' | 'ideographic' | 'middle' | 'top' } CanvasTextBaseline + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export type CanvasTextBaseline = 'alphabetic' | 'bottom' | 'hanging' | 'ideographic' | 'middle' | 'top'; + +/** + * Sets the image smoothness attribute. The options are as follows: + * 'high': height + * 'low': (default)low + * 'medium': medium + * + * @typedef { 'high' | 'low' | 'medium' } ImageSmoothingQuality + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export type ImageSmoothingQuality = 'high' | 'low' | 'medium'; + +/** + * Opaque objects that describe gradients, created by createLinearGradient() or createRadialGradient() + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare class CanvasGradient { + /** + * Add a breakpoint defined by offset and color to the gradient + * + * @param { number } offset - Value between 0 and 1, out of range throws INDEX_SIZE_ERR error + * @param { string } color - Set the gradient color. + * a SYNTAX_ERR error is thrown. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + addColorStop(offset: number, color: string): void; +} + +/** + * Path object, which provides basic methods for drawing paths. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare class CanvasPath { + /** + * Draw an arc path + * + * @param { number } x - The x-axis coordinate of the center (center of the circle) of the arc. + * @param { number } y - The y-axis coordinate of the center (center of the circle) of the arc. + * @param { number } radius - Radius of the arc. + * @param { number } startAngle - Start point of an arc, which starts to be calculated in the x-axis direction. + * The unit is radian. + * @param { number } endAngle - The end point of the arc, in radians. + * @param { boolean } [counterclockwise] - If the value is true, the arc is drawn counterclockwise. Otherwise, + * the arc is drawn clockwise. The default value is false. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, counterclockwise?: boolean): void; + /** + * Draw arc paths based on control points and radius + * + * @param { number } x1 - The x-axis coordinate of the first control point. + * @param { number } y1 - The y-axis coordinate of the first control point. + * @param { number } x2 - The x-axis coordinate of the second control point. + * @param { number } y2 - The y-axis coordinate of the second control point. + * @param { number } radius - Radius of the arc. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void; + /** + * Drawing Cubic Bessel Curve Paths + * + * @param { number } cp1x - The x-axis coordinate of the first control point. + * @param { number } cp1y - The y-axis coordinate of the first control point. + * @param { number } cp2x - The x-axis coordinate of the second control point. + * @param { number } cp2y - The y-axis coordinate of the second control point. + * @param { number } x - x-axis coordinate of the end point. + * @param { number } y - y-axis coordinate of the end point. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void; + /** + * Returns the pen point to the start point of the current sub-path + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + closePath(): void; + /** + * Draw an Elliptic Path + * + * @param { number } x - x-axis coordinate of the center of the ellipse. + * @param { number } y - y-axis coordinate of the center of the ellipse. + * @param { number } radiusX - Radius of the major axis of the ellipse. + * @param { number } radiusY - Radius of the minor axis of the ellipse. + * @param { number } rotation - The rotation angle of the ellipse, in radians (not angular degrees). + * @param { number } startAngle - The angle of the starting point to be drawn, measured from the x-axis in radians + * (not angular degrees). + * @param { number } endAngle - The angle, in radians, at which the ellipse is to be drawn (not angular degrees). + * @param { boolean } [counterclockwise] - If the value is true, the ellipse is drawn counterclockwise. Otherwise, + * the ellipse is drawn clockwise. The default value is false. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + ellipse(x: number, y: number, radiusX: number, radiusY: number, rotation: number, startAngle: number, + endAngle: number, counterclockwise?: boolean): void; + /** + * Connect sub-path using straight lines + * + * @param { number } x - The x-axis coordinate of the end point of the line. + * @param { number } y - The y-axis coordinate of the end point of the line. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + lineTo(x: number, y: number): void; + /** + * Moves the start point of a new sub-path to the (x, y) coordinate. + * + * @param { number } x - The x-axis coordinate of the point. + * @param { number } y - The y-axis coordinate of the point. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + moveTo(x: number, y: number): void; + /** + * Draw quadratic Bezier curve paths + * + * @param { number } cpx - The x-axis coordinate of the control point. + * @param { number } cpy - The y-axis coordinate of the control point. + * @param { number } x - x-axis coordinate of the end point. + * @param { number } y - y-axis coordinate of the end point. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void; + /** + * Draw Rectangular Paths + * + * @param { number } x - The x-axis coordinate of the start point of the rectangle. + * @param { number } y - The y-axis coordinate of the start point of the rectangle. + * @param { number } w - Width of the rectangle. + * @param { number } h - Height of the rectangle. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + rect(x: number, y: number, w: number, h: number): void; +} + +/** + * 2D path object for path drawing + * + * @extends CanvasPath + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare class Path2D extends CanvasPath { + /** + * Adds a path according to the specified path variable. + * + * @param { Path2D } path - Indicates the path object to be added. + * @param { Matrix2D } [transform] - Transformation matrix of the new trail. The default value is null. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + addPath(path: Path2D, transform?: Matrix2D): void; + /** + * Create an empty path object. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + constructor(); + /** + * Create an empty path object. + * + * @param { LengthMetricsUnit } unit - the unit mode + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + constructor(unit: LengthMetricsUnit); + /** + * Create a copy of a path object + * + * @param { Path2D } path - Path object to be copied + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + constructor(path: Path2D); + /** + * Create a copy of a path object + * + * @param { Path2D } path - Path object to be copied + * @param { LengthMetricsUnit } unit - the unit mode + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + constructor(path: Path2D, unit: LengthMetricsUnit); + /** + * Create a new path according to the description. + * + * @param { string } d - Indicates the path string that compiles with the SVG path description specifications. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + constructor(d: string); + /** + * Create a new path according to the description. + * + * @param { string } description - Indicates the path string that compiles with + * the SVG path description specifications. + * @param { LengthMetricsUnit } unit - the unit mode + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + constructor(description: string, unit: LengthMetricsUnit); +} + +/** + * Describes an opaque object of a template, which is created using the createPattern() method. + * + * @interface CanvasPattern + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface CanvasPattern { + /** + * Adds the matrix transformation effect to the current template. + * + * @param { Matrix2D } [transform] - transformation matrix. The default value is null. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + setTransform(transform?: Matrix2D): void; +} + +/** + * Size information of the text + * + * @interface TextMetrics + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface TextMetrics { + /** + * Double, the distance from the horizontal line indicated by the textBaseline property to the top of + * the rectangular boundary of the rendered text. + * + * @type { number } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + readonly actualBoundingBoxAscent: number; + /** + * Double, the distance from the horizontal line indicated by the textBaseline property to the bottom of + * the rectangular boundary of the rendered text. + * + * @type { number } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + readonly actualBoundingBoxDescent: number; + /** + * Double, parallel to the baseline, distance from the alignment point determined by the textAlign property to + * the left of the text rectangle boundary. + * + * @type { number } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + readonly actualBoundingBoxLeft: number; + /** + * Double, parallel to the baseline, distance from the alignment point determined by the textAlign property to + * the right of the text rectangle boundary. + * + * @type { number } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + readonly actualBoundingBoxRight: number; + /** + * Double, the distance from the horizontal line indicated by the textBaseline property to the alphabetic baseline of + * the wireframe. + * + * @type { number } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + readonly alphabeticBaseline: number; + /** + * Double, the distance from the horizontal line indicated by the textBaseline property to the top of the + * em square in the wireframe. + * + * @type { number } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + readonly emHeightAscent: number; + /** + * Double, distance from the horizontal line indicated by the textBaseline property to the bottom of the + * em box in the wireframe. + * + * @type { number } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + readonly emHeightDescent: number; + /** + * Double, distance from the horizontal line indicated by the textBaseline property to the top of the + * highest rectangle boundary of all fonts rendering text. + * + * @type { number } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + readonly fontBoundingBoxAscent: number; + /** + * Double, distance from the horizontal line indicated by the textBaseline property to the bottom of the + * rectangular boundary of all fonts rendering text. + * + * @type { number } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + readonly fontBoundingBoxDescent: number; + /** + * Double, distance from the horizontal line indicated by the textBaseline property to + * the hanging baseline of the wireframe. + * + * @type { number } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + readonly hangingBaseline: number; + /** + * Double, distance from the horizontal line indicated by the textBaseline property to + * the ideographic baseline of the wireframe. + * + * @type { number } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + readonly ideographicBaseline: number; + /** + * Indicates the width of a character string. The value is of the double type. + * + * @type { number } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + readonly width: number; + /** + * Indicates the height of a character string. The value is of the double type. + * + * @type { number } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + readonly height: number; +} + +/** + * Bitmap image object that can be drawn onto the current Canvas + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare class ImageBitmap { + /** + * Indicates the height of the CSS pixel unit of ImageData. + * + * @return { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + get height(): number; + /** + * Indicates the width of the CSS pixel unit of ImageData. + * + * @return { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + get width(): number; + /** + * Releases all graphics resources associated with an ImageBitmap. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + close(): void; + /** + * Create an ImageBitmap object based on the transferred image path or PixelMap object. + * + * @param { PixelMap | string } src - image path or PixelMap object + * @param { LengthMetricsUnit } [unit] - the unit mode + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + constructor(src: PixelMap | string, unit?: LengthMetricsUnit); +} + +/** + * Image data object + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare class ImageData { + /** + * Array containing image pixel data + * + * @return { Uint8ClampedArray } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + get data(): Uint8ClampedArray; + /** + * Height of the image. + * + * @return { int } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + get height(): int; + /** + * Width of the image. + * + * @return { int } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + get width(): int; + /** + * Create an ImageData object based on the input parameters. + * + * @param { number } width - Width of the image. + * @param { number } height - Height of the image. + * @param { Uint8ClampedArray } [data] - Data of the image. + * If this parameter is not specified, the default value is a black rectangular image. + * @param { LengthMetricsUnit } [unit] - the unit mode + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + constructor(width: number, height: number, data?: Uint8ClampedArray, unit?: LengthMetricsUnit); +} + +/** + * This object allows you to set properties when creating a rendering context + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare class RenderingContextSettings { + /** + * Get the status whether anti-aliasing is enabled for canvas. The default value is false. + * + * @return { boolean | undefined } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + get antialias(): boolean | undefined; + /** + * Set the status whether anti-aliasing is enabled for canvas. The default value is false. + * + * @param { boolean | undefined } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + set antialias(antialias: boolean | undefined); + /** + * Create an RenderingContextSettings object based on the antialias and alpha. + * + * @param { boolean } [antialias] - Indicates whether anti-aliasing is enabled for canvas + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + constructor(antialias?: boolean); +} + +/** + * Canvas renderer for drawing shapes, text, images and other objects + * + * @extends CanvasPath + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare class CanvasRenderer extends CanvasPath { + /** + * Get spacing for letter. + * + * @return { LengthMetrics | string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + get letterSpacing(): LengthMetrics | string; + /** + * Set spacing for letter. + * + * @param { LengthMetrics | string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + set letterSpacing(letterSpacing: LengthMetrics | string); + /** + * Get transparency. The value ranges from 0.0 (completely transparent) to 1.0 (completely opaque). + * If the value is out of range, the assignment is invalid. + * + * @return { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + get globalAlpha(): number; + /** + * Set transparency. The value ranges from 0.0 (completely transparent) to 1.0 (completely opaque). + * If the value is out of range, the assignment is invalid. + * + * @param { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + set globalAlpha(globalAlpha: number); + /** + * Get the type of composition operation applied when drawing a new shape. The following types are supported: + * source-over: (Default) Draws a new drawing on top of an existing canvas context. + * source-in: The new drawing is drawn only where the new drawing overlaps the target canvas. + * Everything else is transparent. + * source-out: Draws a new drawing where it does not overlap with the existing canvas content. + * source-atop: The new drawing is drawn only where it overlaps the content of the existing canvas. + * destination-over: Draws a new graphic behind the existing canvas content. + * destination-in: Existing canvas content remains where the new drawing overlaps the existing canvas content. + * Everything else is transparent. + * destination-out: Existing content remains where the new drawing does not overlap. + * destination-atop: The existing canvas retains only the part that overlaps with the new drawing, + * which is drawn behind the canvas content. + * lighter: The color of two overlapping shapes is determined by adding the color values. + * copy: Only new graphics are displayed. + * xor: In the image, those overlaps and other places outside of the normal drawing are transparent. + * + * @return { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + get globalCompositeOperation(): string; + /** + * Set the type of composition operation applied when drawing a new shape. The following types are supported: + * source-over: (Default) Draws a new drawing on top of an existing canvas context. + * source-in: The new drawing is drawn only where the new drawing overlaps the target canvas. + * Everything else is transparent. + * source-out: Draws a new drawing where it does not overlap with the existing canvas content. + * source-atop: The new drawing is drawn only where it overlaps the content of the existing canvas. + * destination-over: Draws a new graphic behind the existing canvas content. + * destination-in: Existing canvas content remains where the new drawing overlaps the existing canvas content. + * Everything else is transparent. + * destination-out: Existing content remains where the new drawing does not overlap. + * destination-atop: The existing canvas retains only the part that overlaps with the new drawing, + * which is drawn behind the canvas content. + * lighter: The color of two overlapping shapes is determined by adding the color values. + * copy: Only new graphics are displayed. + * xor: In the image, those overlaps and other places outside of the normal drawing are transparent. + * + * @param { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + set globalCompositeOperation(globalCompositeOperation: string); + /** + * Draw an image on a canvas + * + * @param { ImageBitmap | PixelMap } image - Picture objects drawn to the canvas. + * @param { number } dx - x-axis coordinate of the upper left corner of the image on the target canvas. + * @param { number } dy - y-axis coordinate of the upper left corner of the image on the target canvas. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + drawImage(image: ImageBitmap | PixelMap, dx: number, dy: number): void; + /** + * Draw an image on a canvas + * + * @param { ImageBitmap | PixelMap } image - Picture objects drawn to the canvas. + * @param { number } dx - x-axis coordinate of the upper left corner of the image on the target canvas. + * @param { number } dy - y-axis coordinate of the upper left corner of the image on the target canvas. + * @param { number } dw - Specifies the drawing width of the image on the target canvas. + * The width of the drawn image will be scaled. + * @param { number } dh - Specifies the drawing height of the image on the target canvas. + * The height of the drawn image will be scaled. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + drawImage(image: ImageBitmap | PixelMap, dx: number, dy: number, dw: number, dh: number): void; + /** + *Draw an image on a canvas + * + * @param { ImageBitmap | PixelMap } image - Picture objects drawn to the canvas. + * @param { number } sx - x coordinate of the upper left corner of + * the rectangle (cropping) selection box of the image. + * @param { number } sy - y coordinate of the upper left corner of + * the rectangle (cropping) selection box of the image. + * @param { number } sw - Width of the rectangle (cropping) selection box of the image. + * @param { number } sh - Height of the rectangle (cropping) selection box of the image. + * @param { number } dx - x-axis coordinate of the upper left corner of the image on the target canvas. + * @param { number } dy - y-axis coordinate of the upper left corner of the image on the target canvas. + * @param { number } dw - Specifies the drawing width of the image on the target canvas. + * The width of the drawn image will be scaled. + * @param { number } dh - Specifies the drawing height of the image on the target canvas. + * The height of the drawn image will be scaled. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + drawImage(image: ImageBitmap | PixelMap, sx: number, sy: number, sw: number, sh: number, dx: number, dy: number, + dw: number, dh: number): void; + /** + * Clear the sub-path list and start a new path. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + beginPath(): void; + /** + * Sets the currently created path as the current clipping path + * + * @param { CanvasFillRule } [fillRule] - Algorithm rule. For details, see {@link CanvasFillRule}. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + clip(fillRule?: CanvasFillRule): void; + /** + * Tailoring according to the specified path + * + * @param { Path2D } path - Path to be cut. + * @param { CanvasFillRule } [fillRule] - Algorithm rule. For details, see {@link CanvasFillRule}. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + clip(path: Path2D, fillRule?: CanvasFillRule): void; + /** + * Fills existing paths according to the current fill style. + * + * @param { CanvasFillRule } [fillRule] - Algorithm rule. For details, see {@link CanvasFillRule}. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + fill(fillRule?: CanvasFillRule): void; + /** + * Fills the specified path according to the current fill style + * + * @param { Path2D } path - Path to be filled. + * @param { CanvasFillRule } [fillRule] - Algorithm rule. For details, see {@link CanvasFillRule}. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + fill(path: Path2D, fillRule?: CanvasFillRule): void; + /** + * Draws the specified path according to the current stroke style + * + * @param { Path2D } [path] - Specified stroke path object + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + stroke(path?: Path2D): void; + /** + * Get the attributes specifie the color, gradient, or pattern to use inside shapes. The options are as follows: + * + * @return { string | int | CanvasGradient | CanvasPattern } + * string: Color String. + * int: Indicates the color with number. + * CanvasGradient: Color gradient object. For details, see {@link CanvasGradient}. + * CanvasPattern: Template object. For details, see {@link CanvasPattern}. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + get fillStyle(): string | int | CanvasGradient | CanvasPattern; + /** + * Set the attributes specifie the color, gradient, or pattern to use inside shapes. The options are as follows: + * + * @param { string | int | CanvasGradient | CanvasPattern } + * string: Color String. + * int: Indicates the color with number. + * CanvasGradient: Color gradient object. For details, see {@link CanvasGradient}. + * CanvasPattern: Template object. For details, see {@link CanvasPattern}. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + set fillStyle(fillStyle: string | int | CanvasGradient | CanvasPattern); + /** + * Get the attributes specifie the color, gradient, or pattern to use for the strokes (outlines) around shapes. + * The options are as follows: + * + * @return { string | int | CanvasGradient | CanvasPattern } + * string: Color String. + * int: Indicates the color with number. + * CanvasGradient: Color gradient object. For details, see {@link CanvasGradient}. + * CanvasPattern: Template object. For details, see {@link CanvasPattern}. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + get strokeStyle(): string | int | CanvasGradient | CanvasPattern; + /** + * Set the attributes specifie the color, gradient, or pattern to use for the strokes (outlines) around shapes. + * The options are as follows: + * + * @param { string | int | CanvasGradient | CanvasPattern } + * string: Color String. + * int: Indicates the color with number. + * CanvasGradient: Color gradient object. For details, see {@link CanvasGradient}. + * CanvasPattern: Template object. For details, see {@link CanvasPattern}. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + set strokeStyle(strokeStyle: string | int | CanvasGradient | CanvasPattern); + /** + * Creates a linear gradient object that is specified along the parameter coordinates + * + * @param { number } x0 - The x-axis coordinate of the start point. + * @param { number } y0 - The y-axis coordinate of the start point. + * @param { number } x1 - x-axis coordinate of the end point. + * @param { number } y1 - y-axis coordinate of the end point. + * @returns { CanvasGradient } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + createLinearGradient(x0: number, y0: number, x1: number, y1: number): CanvasGradient; + /** + * Creates a template object using the specified image + * + * @param { ImageBitmap } image - Objects as duplicate image sources + * @param { string | null } repetition - Specifies how to repeat images. The following four modes are supported: + * "repeat": Repeated images in both X and Y directions + * "repeat-x": Repeated images in the X-axis direction but not in the Y-axis direction + * "repeat-y": Repeated images in the Y axis direction, but not in the X axis direction. + * "no-repeat": Non-repeating images in both X and Y directions + * "clamp": Replicate the edge color if the shader draws outside of its original bounds. + * "mirror": Repeat the shader's image horizontally and vertically, + * alternating mirror images so that adjacent images always seam. + * @returns { CanvasPattern | null } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + createPattern(image: ImageBitmap, repetition: string | null): CanvasPattern | null; + /** + * Creates a radioactive gradient object based on parameters that determine the coordinates of two circles + * + * @param { number } x0 - The x-axis coordinate of the start circle. + * @param { number } y0 - The y-axis coordinate of the start circle. + * @param { number } r0 - Radius of the starting circle. + * @param { number } x1 - The x-axis coordinate of the end circle. + * @param { number } y1 - The y-axis coordinate of the end circle. + * @param { number } r1 - Radius of the end circle. + * @returns { CanvasGradient } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + createRadialGradient(x0: number, y0: number, r0: number, x1: number, y1: number, r1: number): CanvasGradient; + /** + * Creates a gradient around a point with given coordinates. + * + * @param { number } startAngle - The angle at which to begin the gradient, in radians. + * Angle measurements start horizontally the right of the center and move around clockwise. + * @param { number } x - The x-axis coordinate of the center of the gradient. + * @param { number } y - The y-axis coordinate of the center of the gradient. + * @returns { CanvasGradient } A CanvasGradient object that draws a conic gradient around the given coordinates. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + createConicGradient(startAngle: number, x: number, y: number): CanvasGradient; + /** + * Provides filter effects such as blur and grayscale. You can get the following filter effects: + * blur(): Adds a Gaussian blur effect to the drawing + * brightness(): Provides a linear multiplication for the drawing and adjusts the brightness level. + * contrast(): Adjusts the contrast of the image. + * When the value is 0%, the image is completely black. + * When the value is 100%, there is no change in the image. + * grayscale(): Converts the image to a gray image. + * When the value is 100%, the image is completely gray. + * When the value is 0%, there is no change in the image. + * hue-rotate(): Perform color rotation on an image. + * When the value is 0 degrees, there is no change in the image. + * invert(): Inverted image (representing the effect of a photographic negative). + * When the value is 100%,the image is completely inverted. + * When the value is 0%, there is no change in the image. + * opacity(): Transparency of the image. + * When the value is 0%, the image is completely transparent. + * When the value is 100%, there is no change in the image. + * saturate(): Perform saturation processing on the image. + * When the value is 0%, the image is completely un-saturated. + * When the value is 100%, there is no change in the image. + * sepia(): The image is sepia (nostalgic style). + * When the value is 100%, the image turns completely sepia. + * When the value is 0%, there is no change in the image. + * none: Turn off filter effects. + * + * @return { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + get filter(): string; + /** + * Provides filter effects such as blur and grayscale. You can set the following filter effects: + * blur(): Adds a Gaussian blur effect to the drawing + * brightness(): Provides a linear multiplication for the drawing and adjusts the brightness level. + * contrast(): Adjusts the contrast of the image. When the value is 0%, the image is completely black. + * When the value is 100%, there is no change in the image. + * grayscale(): Converts the image to a gray image. + * When the value is 100%, the image is completely gray. + * When the value is 0%, there is no change in the image. + * hue-rotate(): Perform color rotation on an image. + * When the value is 0 degrees, there is no change in the image. + * invert(): Inverted image (representing the effect of a photographic negative). + * When the value is 100%, the image is completely inverted. + * When the value is 0%, there is no change in the image. + * opacity(): Transparency of the image. At 0%, the image is completely transparent. + * When the value is 100%, there is no change in the image. + * saturate(): Perform saturation processing on the image. At 0%, the image is completely un-saturated. + * When the value is 100%, there is no change in the image. + * sepia(): The image is sepia (nostalgic style). At 100%, the image turns completely sepia. + * When the value is 0%, there is no change in the image. + * none: Turn off filter effects + * + * @param { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + set filter(filter: string); + /** + * Creates a new, empty ImageData object of the specified size + * + * @param { number } sw - Width of the ImageData object. + * @param { number } sh - Height of the ImageData object. + * @returns { ImageData } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + createImageData(sw: number, sh: number): ImageData; + /** + * From an existing ImageData object, copy an object with the same width and height as the image. + * The image content is not copied. + * + * @param { ImageData } imagedata - ImageData object to be copied. + * @returns { ImageData } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + createImageData(imagedata: ImageData): ImageData; + /** + * Obtains the pixel data of a specified area on the current canvas. + * + * @param { number } sx - x coordinate of the upper left corner of the rectangular area + * of the image data to be extracted. + * @param { number } sy - y coordinate of the upper left corner of the rectangular area + * of the image data to be extracted. + * @param { number } sw - The width of the rectangular area of the image data to be extracted. + * @param { number } sh - The height of the rectangular area of the image data to be extracted. + * @returns { ImageData } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + getImageData(sx: number, sy: number, sw: number, sh: number): ImageData; + /** + * Obtains the PixelMap of a specified area on the current canvas. + * + * @param { number } sx - x coordinate of the upper left corner of the rectangular area of the PixelMap + * to be extracted. + * @param { number } sy - y coordinate of the upper left corner of the rectangular area of the PixelMap + * to be extracted. + * @param { number } sw - The width of the rectangular area of the PixelMap to be extracted. + * @param { number } sh - The height of the rectangular area of the PixelMap to be extracted. + * @returns { PixelMap } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + getPixelMap(sx: number, sy: number, sw: number, sh: number): PixelMap; + /** + * Draws the specified ImageData object onto the canvas + * + * @param { ImageData } imagedata - ImageData object to be drawn. + * @param { number | string } dx - Position offset of the source image data + * in the target canvas (the offset in the x-axis direction). + * @param { number | string } dy - Position offset of the source image data + * in the target canvas (the offset in the y-axis direction). + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + putImageData(imagedata: ImageData, dx: number | string, dy: number | string): void; + /** + * Draws the specified ImageData object onto the canvas + * + * @param { ImageData } imagedata - ImageData object to be drawn. + * @param { number | string } dx - Position offset of the source image data + * in the target canvas (the offset in the x-axis direction). + * @param { number | string } dy - Position offset of the source image data + * in the target canvas (the offset in the y-axis direction). + * @param { number | string } dirtyX - Position of the upper left corner of the rectangular area + * in the source image data. + * The default is the upper left corner (x coordinate) of the entire image data. + * @param { number | string } dirtyY - Position of the upper left corner of the rectangular area + * in the source image data. + * The default is the upper left corner (y coordinate) of the entire image data. + * @param { number | string } dirtyWidth - Width of the rectangular area in the source image data. + * The default is the width of the image data. + * @param { number | string } dirtyHeight - Height of the rectangular area in the source image data. + * The default is the height of the image data. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + putImageData(imagedata: ImageData, dx: number | string, dy: number | string, dirtyX: number | string, + dirtyY: number | string, dirtyWidth: number | string, dirtyHeight: number | string): void; + /** + * Get the status whether to smooth the image. The value true indicates that the image is smooth. + * The value false indicates that the image is not smooth. + * + * @return { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + get imageSmoothingEnabled(): boolean; + /** + * Set the status whether to smooth the image. The value true indicates that the image is smooth. + * The value false indicates that the image is not smooth. + * + * @param { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + set imageSmoothingEnabled(imageSmoothingEnabled: boolean); + /** + * Get the smoothness level of the current image. For details, see {@link ImageSmoothingQuality}. + * + * @return { ImageSmoothingQuality } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + get imageSmoothingQuality(): ImageSmoothingQuality; + /** + * Set the smoothness level of the current image. For details, see {@link ImageSmoothingQuality}. + * + * @param { ImageSmoothingQuality } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + set imageSmoothingQuality(imageSmoothingQuality: ImageSmoothingQuality); + /** + * Get the line segment endpoint attribute. For details, see {@link CanvasLineCap}. + * + * @return { CanvasLineCap } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + get lineCap(): CanvasLineCap; + /** + * Set the line segment endpoint attribute. For details, see {@link CanvasLineCap}. + * + * @param { CanvasLineCap } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + set lineCap(lineCap: CanvasLineCap); + /** + * Get the dotted line offset attribute. + * + * @return { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + get lineDashOffset(): number; + /** + * Set the dotted line offset attribute. + * + * @param { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + set lineDashOffset(lineDashOffset: number); + /** + * Get the line segment connection point attribute. For details, see {@link CanvasLineJoin}. + * + * @return { CanvasLineJoin } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + get lineJoin(): CanvasLineJoin; + /** + * Set the line segment connection point attribute. For details, see {@link CanvasLineJoin}. + * + * @param { CanvasLineJoin } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + set lineJoin(lineJoin: CanvasLineJoin); + /** + * Get the line thickness attribute. The value cannot be 0 or a negative number. + * + * @return { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + get lineWidth(): number; + /** + * Set the line thickness attribute. The value cannot be 0 or a negative number. + * + * @param { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + set lineWidth(lineWidth: number); + /** + * Get the value of this parameter cannot be 0 or a negative number. + * + * @return { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + get miterLimit(): number; + /** + * Set the value of this parameter cannot be 0 or a negative number. + * + * @param { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + set miterLimit(miterLimit: number); + /** + * Gets the current segment style. + * + * @returns { number[] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + getLineDash(): number[]; + /** + * Sets the dashed line mode for line drawing. + * + * @param { number[] } segments - A set of numbers that describe the length of alternating drawn lines segments and + * spacing (coordinate space units). + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + setLineDash(segments: number[]): void; + /** + * Clears the drawing content of a rectangular area. + * + * @param { number } x - The x-axis coordinate of the start point of the rectangle. + * @param { number } y - The y-axis coordinate of the start point of the rectangle. + * @param { number } w - Width of the rectangle. + * @param { number } h - Height of the rectangle. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + clearRect(x: number, y: number, w: number, h: number): void; + /** + * Fills a specified rectangular area + * + * @param { number } x - The x-axis coordinate of the start point of the rectangle. + * @param { number } y - The y-axis coordinate of the start point of the rectangle. + * @param { number } w - Width of the rectangle. + * @param { number } h - Height of the rectangle. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + fillRect(x: number, y: number, w: number, h: number): void; + /** + * Stroke Specify Rectangular Area + * + * @param { number } x - The x-axis coordinate of the start point of the rectangle. + * @param { number } y - The y-axis coordinate of the start point of the rectangle. + * @param { number } w - Width of the rectangle. + * @param { number } h - Height of the rectangle. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + strokeRect(x: number, y: number, w: number, h: number): void; + /** + * Get the shadow blur radius. The value cannot be a negative number. + * + * @return { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + get shadowBlur(): number; + /** + * Set the shadow blur radius. The value cannot be a negative number. + * + * @param { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + set shadowBlur(shadowBlur: number); + /** + * Get the shadow color. + * + * @return { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + get shadowColor(): string; + /** + * Set the shadow color. + * + * @param { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + set shadowColor(shadowColor: string); + /** + * Get the horizontal offset distance of the shadow. + * + * @return { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + get shadowOffsetX(): number; + /** + * Set the horizontal offset distance of the shadow. + * + * @param { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + set shadowOffsetX(shadowOffsetX: number); + /** + * Get the vertical offset distance of the shadow. + * + * @return { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + get shadowOffsetY(): number; + /** + * Set the vertical offset distance of the shadow. + * + * @param { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + set shadowOffsetY(shadowOffsetY: number); + /** + * Top of the stack pop-up state in the drawing state stack + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + restore(): void; + /** + * Saves the current drawing state to the drawing state stack + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + save(): void; + /** + * Fills the specified text at the specified location + * + * @param { string } text - Text string to be drawn. + * @param { number } x - The x-axis coordinate of the start point of the text. + * @param { number } y - The y-axis coordinate of the start point of the text. + * @param { number } [maxWidth] - Maximum width of the drawing. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + fillText(text: string, x: number, y: number, maxWidth?: number): void; + /** + * Measure the size of a specified text. For details about the return value, see {@link TextMetrics}. + * + * @param { string } text - Text string to be measured. + * @returns { TextMetrics } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + measureText(text: string): TextMetrics; + /** + * Stroke specified text at specified position + * + * @param { string } text - Text string to be stroked. + * @param { number } x - The x-axis coordinate of the start point of the text. + * @param { number } y - The y-axis-axis coordinate of the start point of the text. + * @param { number } [maxWidth] - Maximum width of the stroke. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + strokeText(text: string, x: number, y: number, maxWidth?: number): void; + /** + * Get the text drawing direction. For details, see {@link CanvasDirection}. + * + * @return { CanvasDirection } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + get direction(): CanvasDirection; + /** + * Set the text drawing direction. For details, see {@link CanvasDirection}. + * + * @param { CanvasDirection } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + set direction(direction: CanvasDirection); + /** + * Get the font style. + * + * @return { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + get font(): string; + /** + * Set the font style. + * + * @param { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + set font(font: string); + /** + * Get the text alignment mode. For details, see {@link CanvasTextAlign}. + * + * @return { CanvasTextAlign } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + get textAlign(): CanvasTextAlign; + /** + * Set the text alignment mode. For details, see {@link CanvasTextAlign}. + * + * @param { CanvasTextAlign } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + set textAlign(textAlign: CanvasTextAlign); + /** + * Get the text baseline. For details, see {@link CanvasTextBaseline}. + * + * @return { CanvasTextBaseline } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + get textBaseline(): CanvasTextBaseline; + /** + * Set the text baseline. For details, see {@link CanvasTextBaseline}. + * + * @param { CanvasTextBaseline } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + set textBaseline(textBaseline: CanvasTextBaseline); + /** + * Obtains the currently applied transformation matrix. + * + * @returns { Matrix2D } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + getTransform(): Matrix2D; + /** + * Resets the current transformation matrix using the identity matrix + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + resetTransform(): void; + /** + * Adds the effect of a rotation + * + * @param { number } angle - The radian of clockwise rotation, + * which can be converted to an angle value using the formula: degree * Math.PI / 180. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + rotate(angle: number): void; + /** + * Increases the scaling effect of the X and Y axes. + * + * @param { number } x - Horizontal scaling factor + * @param { number } y - Vertical scaling factor + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + scale(x: number, y: number): void; + /** + * Adds 2D transformation effects, including rotation, translation, and scaling. + * The current transformation matrix will not be overwritten. Multiple transformations will be superimposed. + * + * @param { number } a - Horizontal Zoom + * @param { number } b - Vertical Tilt + * @param { number } c - Horizontal Tilt + * @param { number } d - Vertical Zoom + * @param { number } e - Horizontal movement + * @param { number } f - Vertical movement + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + setTransform(a: number, b: number, c: number, d: number, e: number, f: number): void; + /** + * The 2D transformation effect is added. The current transformation matrix is not overwritten and + * the transformations are superimposed for multiple times. + * + * @param { Matrix2D } [transform] - 2D transformation matrix. For details, see {@link Matrix2D}. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + setTransform(transform?: Matrix2D): void; + /** + * Adds the 2D transformation effect, including rotation, translation, and scaling, + * and overwrites the current transformation matrix. + * + * @param { number } a - Horizontal Zoom + * @param { number } b - Vertical Tilt + * @param { number } c - Horizontal Tilt + * @param { number } d - Vertical Zoom + * @param { number } e - Horizontal movement + * @param { number } f - Vertical movement + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + transform(a: number, b: number, c: number, d: number, e: number, f: number): void; + /** + * Increases the translation effect of the X and Y axes + * + * @param { number } x - Horizontal movement distance + * @param { number } y - Vertical travel distance + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + translate(x: number, y: number): void; + /** + * Set a PixelMap to the current context. The drawing content is synchronized to the PixelMap. + * + * @param { PixelMap } [value] - PixelMap object + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + setPixelMap(value?: PixelMap): void; + /** + * transfer ImageBitmap to content. + * + * @param { ImageBitmap } bitmap + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + transferFromImageBitmap(bitmap: ImageBitmap): void; + /** + * Allocate a layer for subsequent drawing. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + saveLayer(): void; + /** + * Remove changes to transform and clip since saveLayer was last called and draw the layer on canvas. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + restoreLayer(): void; + /** + * Clear the backing buffer, drawing state stack, any defined paths, and styles. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + reset(): void; +} + +/** + * Draw context object for the Canvas component. + * + * @extends CanvasRenderer + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare class CanvasRenderingContext2D extends CanvasRenderer { + /** + * The default value is 0, which is bound to the height of the specified canvas. The value is read-only. + * + * @return { number } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + get height(): number; + /** + * The default value is 0, which is bound to the width of the specified canvas. The value is read-only. + * + * @return { number } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + get width(): number; + /** + * Frame node of the canvas. The default value is null. + * + * @return { FrameNode } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + get canvas(): FrameNode; + /** + * Generate a character string in the data url format. + * + * @param { string } [type] - Image format. The default value is image/png. + * @param { number } [quality] - If the image format is image/jpeg or image/webp, + * you can select the image quality from 0 to 1. + * If the value is out of the range, the default value 0.92 is used. + * @returns { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + toDataURL(type?: string, quality?: number): string; + /** + * Start image analyzer. + * + * @param { ImageAnalyzerConfig } config - Image analyzer config. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 110001 - Image analysis feature is not supported. + * @throws { BusinessError } 110002 - Image analysis is currently being executed. + * @throws { BusinessError } 110003 - Image analysis is stopped. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + startImageAnalyzer(config: ImageAnalyzerConfig): Promise; + /** + * Stop image analyzer. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + stopImageAnalyzer(): void; + /** + * Constructor of the canvas drawing context object, which is used to create a drawing context object. + * + * @param { RenderingContextSettings } [settings] - Drawing attribute. + * For details, see {@link RenderingContextSettings}. + * @param { LengthMetricsUnit } [unit] - the unit mode + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + constructor(settings?: RenderingContextSettings, unit?: LengthMetricsUnit); + /** + * Register the listener that watches if the canvasrenderingcontext2d attached to the Canvas frameNode. + * + * @param { 'onAttach' } type Indicates the type of event. + * @param { Callback } callback Indicates the listener. + * @throws { BusinessError } 401 - Input parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; + * 3. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + on(type: 'onAttach', callback: Callback): void; + /** + * Unregister the listener that watches if the canvasrenderingcontext2d attached to the Canvas frameNode. + * + * @param { 'onAttach' } type Indicates the type of event. + * @param { Callback } [callback] Indicates the listener. + * @throws { BusinessError } 401 - Input parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; + * 3. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + off(type: 'onAttach', callback?: Callback): void; + /** + * Register the listener that watches if the canvasrenderingcontext2d detached from the Canvas frameNode. + * + * @param { 'onDetach' } type Indicates the type of event. + * @param { Callback } callback Indicates the listener. + * @throws { BusinessError } 401 - Input parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; + * 3. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + on(type: 'onDetach', callback: Callback): void; + /** + * Unregister the listener that watches if the canvasrenderingcontext2d detached from the Canvas frameNode. + * + * @param { 'onDetach' } type Indicates the type of event. + * @param { Callback } [callback] Indicates the listener. + * @throws { BusinessError } 401 - Input parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types; + * 3. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + off(type: 'onDetach', callback?: Callback): void; +} + +/** + * Draw context object for the OffscreenCanvas component. + * + * @extends CanvasRenderer + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare class OffscreenCanvasRenderingContext2D extends CanvasRenderer { + /** + * Generate a character string in the data url format. + * + * @param { string } [type] - Image format. The default value is image/png. + * @param { number } [quality] - If the image format is image/jpeg or image/webp, + * you can select the image quality from 0 to 1. + * If the value is out of the range, the default value 0.92 is used. + * @returns { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + toDataURL(type?: string, quality?: number): string; + /** + * transfer the content to ImageBitmap + * + * @returns { ImageBitmap } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + transferToImageBitmap(): ImageBitmap; + /** + * Constructor of the canvas drawing context object, which is used to create a drawing context object. + * + * @param { number } width - the width of the OffscreenCanvas + * @param { number } height - the height of the OffscreenCanvas + * @param { RenderingContextSettings } [settings] - Drawing attribute. + * For details, see {@link RenderingContextSettings}. + * @param { LengthMetricsUnit } [unit] - the unit mode + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + constructor(width: number, height: number, settings?: RenderingContextSettings, unit?: LengthMetricsUnit); +} +/** + * Draw an object off the screen. The drawing content is not directly displayed on the screen. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare class OffscreenCanvas { + /** + * Get the height of the off-screen canvas. + * + * @return { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + get height(): number; + /** + * Set the height of the off-screen canvas. + * + * @param { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + set height(height: number); + /** + * Get the width of the off-screen canvas. + * + * @return { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + get width(): number; + /** + * Set the width of the off-screen canvas. + * + * @param { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + set width(width: number); + /** + * Exports rendered content as an ImageBitmap object + * + * @returns { ImageBitmap } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + transferToImageBitmap(): ImageBitmap; + /** + * Creates the context from the current OffscreenCanvas. + * + * @param { '2d' } contextType - The context type, only '2d' be supported now. + * '2d': Creates a {@link OffscreenCanvasRenderingContext2D} object representing + * a two-dimensional rendering context. + * @param { RenderingContextSettings } [options] - Drawing attribute. + * For details, see {@link RenderingContextSettings}. + * @returns { OffscreenCanvasRenderingContext2D } The rendering context of offscreen canvas, + * see {@link OffscreenCanvasRenderingContext2D}. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + getContext(contextType: '2d', options?: RenderingContextSettings): OffscreenCanvasRenderingContext2D; + /** + * Constructor of the off-screen canvas, which is used to create an off-screen canvas object. + * + * @param { number } width - Width of the off-screen canvas. + * @param { number } height - Height of the off-screen canvas. + * @param { LengthMetricsUnit } [unit] - the unit mode + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + constructor(width: number, height: number, unit?: LengthMetricsUnit); +} + +/** + * Defines DrawingRenderingContext. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare class DrawingRenderingContext { + /** + * Get size of the DrawingRenderingContext. + * + * @returns { Size } The size of the DrawingRenderingContext. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + get size(): Size; + /** + * Invalidate the component, which will cause a re-render of the component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + invalidate(): void; + /** + * Create DrawingRenderingContext with setting LengthMetricsUnit. + * + * @param { LengthMetricsUnit } [unit] - the unit mode + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + constructor(unit?: LengthMetricsUnit); +} + +/** + * Provides attribute for Canvas. + * + * @extends CommonMethod + * @interface CanvasAttribute + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface CanvasAttribute extends CommonMethod { + /** + * Event notification after the canvas component is constructed. You can draw the canvas at this time. + * + * @param { VoidCallback | undefined } event + * @returns { CanvasAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + onReady(event: VoidCallback | undefined): this; + /** + * Enable image analyzer for Canvas. + * + * @param { boolean | undefined } enable - If enable image analyzer for Canvas. The default value is false. + * @returns { CanvasAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + enableAnalyzer(enable: boolean | undefined): this; + /** + * Call attributeModifier. + * + * @param { AttributeModifier | AttributeModifier | undefined } modifier + * @returns { CanvasAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + attributeModifier(modifier: AttributeModifier | AttributeModifier | undefined): this; +} + +/** + * Canvas is returned when the parameter is transferred. + * + * @param { CanvasRenderingContext2D | DrawingRenderingContext } [context] - Canvas context object. + * @param { ImageAIOptions } [imageAIOptions] - Options for AI analyzer. + * @param { function } [content_] + * @returns { CanvasAttribute } The attribute of the Canvas. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +@memo +@ComponentBuilder +export declare function Canvas( + context?: CanvasRenderingContext2D | DrawingRenderingContext, imageAIOptions?: ImageAIOptions, + @memo + content_?: () => void, +): CanvasAttribute diff --git a/api/arkui/component/circle.static.d.ets b/api/arkui/component/circle.static.d.ets new file mode 100644 index 0000000000..586cfb3944 --- /dev/null +++ b/api/arkui/component/circle.static.d.ets @@ -0,0 +1,84 @@ +/* + * 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 + * @arkts 1.2 + */ +import { CommonShapeMethod, CommonMethod, AttributeModifier } from "./common"; +import { memo, ComponentBuilder } from "./../stateManagement/runtime"; + +/** + * Defines circle options for Circle component. + * + * @interface CircleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface CircleOptions { + /** + * Defines the width property. + * + * @type { ?(string | double) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + width?: string | double; + /** + * Defines the height property. + * + * @type { ?(string | double) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + height?: string | double; +} + +/** + * Circle drawing component attribute functions. + * + * @extends CommonShapeMethod + * @interface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface CircleAttribute extends CommonShapeMethod { + /** + * Call attributeModifier. + * + * @param { AttributeModifier | AttributeModifier | undefined } modifier + * @returns { CircleAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default attributeModifier(modifier: AttributeModifier | AttributeModifier | undefined): this; +} + +/** + * Circle is returned when the parameter is transferred. + * + * @param { CircleOptions } [options] - The options to create a Circle + * @param { function } [content_] + * @returns { CircleAttribute } The attribute of the Circle. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +@memo +@ComponentBuilder +export declare function Circle( + options?: CircleOptions, + @memo + content_?: () => void, +): CircleAttribute diff --git a/api/arkui/component/contentSlot.static.d.ets b/api/arkui/component/contentSlot.static.d.ets new file mode 100644 index 0000000000..f8d5152c3f --- /dev/null +++ b/api/arkui/component/contentSlot.static.d.ets @@ -0,0 +1,49 @@ +/* + * 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 + * @arkts 1.2 + */ +import { Content } from '../../@ohos.arkui.node'; +import { memo, ComponentBuilder } from './../stateManagement/runtime'; +import { AttributeModifier, CommonMethod } from './common'; + +/** + * Define ContentSlot attribute, to prevent improper recursive usage of ContentSlot + * + * @interface ContentSlotAttribute + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface ContentSlotAttribute { +} + +/** + * ContentSlot is returned when the parameter is transferred. + * + * @param { Content } content - Indicates the class object of NodeContent. + * @param { function } [content_] + * @returns { ContentSlotAttribute } The attribute of the ContentSlot. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +@memo +@ComponentBuilder +export declare function ContentSlot( + content: Content, + @memo + content_?: () => void, +): ContentSlotAttribute diff --git a/api/arkui/component/ellipse.static.d.ets b/api/arkui/component/ellipse.static.d.ets new file mode 100644 index 0000000000..8f14bd31f4 --- /dev/null +++ b/api/arkui/component/ellipse.static.d.ets @@ -0,0 +1,83 @@ +/* + * 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 + * @arkts 1.2 + */ +import { CommonShapeMethod, AttributeModifier, CommonMethod } from "./common"; +import { memo, ComponentBuilder } from "./../stateManagement/runtime"; + +/** + * Ellipse constructor options. + * + * @interface EllipseOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export interface EllipseOptions { + /** + * Set width. + * + * @type { ?(string | double) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + width?: string | double; + /** + * Set height. + * + * @type { ?(string | double) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + height?: string | double; +} + +/** + * Provides attribute for Ellipse. + * @extends CommonShapeMethod + * @interface EllipseAttribute + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface EllipseAttribute extends CommonShapeMethod { + /** + * Call attributeModifier. + * + * @param { AttributeModifier | AttributeModifier | undefined } modifier + * @returns { EllipseAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default attributeModifier(modifier: AttributeModifier | AttributeModifier | undefined): this; +} + +/** + * Ellipse is returned when the parameter is transferred. + * + * @param { EllipseOptions } [options] - The options to create an Ellipse + * @param { function } [content_] + * @returns { EllipseAttribute } The attribute of the Ellipse. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +@memo +@ComponentBuilder +export declare function Ellipse( + options?: EllipseOptions, + @memo + content_?: () => void, +): EllipseAttribute diff --git a/api/arkui/component/forEach.d.ets b/api/arkui/component/forEach.static.d.ets similarity index 95% rename from api/arkui/component/forEach.d.ets rename to api/arkui/component/forEach.static.d.ets index 209838adb9..216ebba2d4 100644 --- a/api/arkui/component/forEach.d.ets +++ b/api/arkui/component/forEach.static.d.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024-2025 Huawei Device Co., Ltd. + * 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 diff --git a/api/arkui/component/interop.d.ets b/api/arkui/component/interop.static.d.ets similarity index 98% rename from api/arkui/component/interop.d.ets rename to api/arkui/component/interop.static.d.ets index 088d78dc9d..f03275f6d8 100644 --- a/api/arkui/component/interop.d.ets +++ b/api/arkui/component/interop.static.d.ets @@ -114,4 +114,4 @@ export declare function compatibleWrappedBuilder(builder: Any, ...args: FixedArr * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 20 */ -export declare function transferCompatibleBuilder(@Builder builder: T): ESValue; \ No newline at end of file +export declare function transferCompatibleBuilder(@Builder builder: T): ESValue; diff --git a/api/arkui/component/lazyForEach.d.ets b/api/arkui/component/lazyForEach.static.d.ets similarity index 93% rename from api/arkui/component/lazyForEach.d.ets rename to api/arkui/component/lazyForEach.static.d.ets index c454f744d4..cf3cbdb46b 100644 --- a/api/arkui/component/lazyForEach.d.ets +++ b/api/arkui/component/lazyForEach.static.d.ets @@ -464,16 +464,6 @@ export interface DataChangeListener { * @since 20 */ onDataReloaded(): void - /** - * Data added. - * - * @param { number } index - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 20 - * @deprecated since 8 - * @useinstead onDataAdd - */ - onDataAdded(index: number): void /** * Data added. * @@ -484,17 +474,6 @@ export interface DataChangeListener { * @since 20 */ onDataAdd(index: number): void - /** - * Data moved. - * - * @param { number } from - * @param { number } to - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 20 - * @deprecated since 8 - * @useinstead onDataMove - */ - onDataMoved(from: number, to: number): void /** * Data moved. * @@ -506,16 +485,6 @@ export interface DataChangeListener { * @since 20 */ onDataMove(from: number, to: number): void - /** - * Data deleted. - * - * @param { number } index - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 20 - * @deprecated since 8 - * @useinstead onDataDelete - */ - onDataDeleted(index: number): void /** * Data deleted. * @@ -526,16 +495,6 @@ export interface DataChangeListener { * @since 20 */ onDataDelete(index: number): void - /** - * Call when has data change. - * - * @param { number } index - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 20 - * @deprecated since 8 - * @useinstead onDataChange - */ - onDataChanged(index: number): void /** * Call when has data change. * diff --git a/api/arkui/component/line.static.d.ets b/api/arkui/component/line.static.d.ets new file mode 100644 index 0000000000..e108fdefc0 --- /dev/null +++ b/api/arkui/component/line.static.d.ets @@ -0,0 +1,115 @@ +/* + * 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 + * @arkts 1.2 + */ +import { CommonShapeMethod, CommonMethod, AttributeModifier } from "./common"; +import { Length } from "./units"; +import { memo, ComponentBuilder } from "./../stateManagement/runtime"; + +/** + * Defines the Shape Point, the first element is the x-axis offset and the second is the y-axis. + * + * @typedef { [Length, Length] } ShapePoint + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export type ShapePoint = [ + Length, + Length +]; + +/** + * Defines Line constructor options. + * + * @interface LineOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export interface LineOptions { + /** + * Width of the rectangle where the line resides. + * + * @type { ?(string | double) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + width?: string | double; + /** + * Height of the rectangle where the line resides. + * + * @type { ?(string | double) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + height?: string | double; +} + +/** + * Provides attribute for Line. + * + * @extends CommonShapeMethod + * @interface LineAttribute + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface LineAttribute extends CommonShapeMethod { + /** + * Coordinate of the start point of the line (relative coordinate). + * + * @param { ShapePoint | undefined } value + * @returns { LineAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default startPoint(value: ShapePoint | undefined): this; + /** + * Line end coordinates (relative coordinates). + * + * @param { ShapePoint | undefined } value + * @returns { LineAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default endPoint(value: ShapePoint | undefined): this; + /** + * Call attributeModifier. + * + * @param { AttributeModifier | AttributeModifier | undefined } modifier + * @returns { LineAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default attributeModifier(modifier: AttributeModifier | AttributeModifier | undefined): this; +} + +/** + * Line is returned when the parameter is transferred. + * + * @param { LineOptions } [options] - The options to create a Line + * @param { function } [content_] + * @returns { LineAttribute } The attribute of the Line. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +@memo +@ComponentBuilder +export declare function Line( + options?: LineOptions, + @memo + content_?: () => void, +): LineAttribute diff --git a/api/arkui/component/matrix2d.static.d.ets b/api/arkui/component/matrix2d.static.d.ets new file mode 100644 index 0000000000..be1cfe80cf --- /dev/null +++ b/api/arkui/component/matrix2d.static.d.ets @@ -0,0 +1,191 @@ +/* + * 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 + * @arkts 1.2 + */ +import { LengthMetricsUnit } from '../Graphics'; +import { memo, ComponentBuilder } from './../stateManagement/runtime'; +import { AttributeModifier, CommonMethod } from './common'; + +/** + * 2D transformation matrix, supporting rotation, translation, and scaling of the X-axis and Y-axis + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare class Matrix2D { + /** + * Get the horizontal zoom. + * + * @return { number | undefined } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + get scaleX(): number | undefined; + /** + * Set the horizontal zoom. + * + * @param { number | undefined } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + set scaleX(scaleX: number | undefined); + /** + * Get the vertical zoom. + * + * @return { number | undefined } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + get scaleY(): number | undefined; + /** + * Set the vertical zoom. + * + * @param { number | undefined } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + set scaleY(scaleY: number | undefined); + /** + * Get the horizontal tilt. + * + * @return { number | undefined } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + get rotateX(): number | undefined; + /** + * Set the horizontal tilt. + * + * @param { number | undefined } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + set rotateX(rotateX: number | undefined); + /** + * Get the vertical tilt. + * + * @return { number | undefined } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + get rotateY(): number | undefined; + /** + * Set the vertical tilt. + * + * @param { number | undefined } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + set rotateY(rotateY: number | undefined); + /** + * Get the horizontal movement. + * + * @return { number | undefined } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + get translateX(): number | undefined; + /** + * Set the horizontal movement. + * + * @param { number | undefined } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + set translateX(translateX: number | undefined); + /** + * Get the vertical movement. + * + * @return { number | undefined } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + get translateY(): number | undefined; + /** + * Set the vertical movement. + * + * @param { number | undefined } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + set translateY(translateY: number | undefined); + /** + * Transforms the current 2D matrix back to the identity matrix (i.e., without any rotational + * translation scaling effect) + * + * @returns { Matrix2D } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + identity(): Matrix2D; + /** + * Transform the current 2D matrix into an inverse matrix (that is, the transformation effect + * is the opposite effect of the original) + * + * @returns { Matrix2D } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + invert(): Matrix2D; + /** + * Adds the rotation effect of the X and Y axes to the current matrix. + * + * @param { number } degree - The rotation angle, clockwise in radians. + * @param { number } [rx] - Rotation effect of the X-axis + * @param { number } [ry] - Rotation effect of the Y-axis + * @returns { Matrix2D } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + rotate(degree: number, rx?: number, ry?: number): Matrix2D; + /** + * Adds the translation effect of the X and Y axes to the current matrix. + * + * @param { number } [tx] - X-axis translation effect + * @param { number } [ty] - Y-axis translation effect + * @returns { Matrix2D } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + translate(tx?: number, ty?: number): Matrix2D; + /** + * Adds the scaling effect of the X and Y axes to the current matrix. + * + * @param { number } [sx] - X-axis scaling effect + * @param { number } [sy] - Y-axis scaling effect + * @returns { Matrix2D } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + scale(sx?: number, sy?: number): Matrix2D; + /** + * Constructs a 2D change matrix object. The default value is the unit matrix. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + constructor(); + /** + * Constructs a 2D change matrix object. The default value is the unit matrix. + * + * @param { LengthMetricsUnit } unit - the unit mode + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + constructor(unit: LengthMetricsUnit); +} diff --git a/api/arkui/component/path.static.d.ets b/api/arkui/component/path.static.d.ets new file mode 100644 index 0000000000..7fdc33f56d --- /dev/null +++ b/api/arkui/component/path.static.d.ets @@ -0,0 +1,98 @@ +/* + * 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 + * @arkts 1.2 + */ +import { CommonShapeMethod, AttributeModifier, CommonMethod } from "./common"; +import { memo, ComponentBuilder } from "./../stateManagement/runtime"; + +/** + * Define options used to construct a path. + * + * @interface PathOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface PathOptions { + /** + * Width option. + * @type { ?(double | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + width?: double | string; + /** + * Height option. + * @type { ?(double | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + height?: double | string; + /** + * Commands option. + * @type { ?string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + commands?: string; +} + +/** + * Provides methods for attribute path component. + * + * @extends CommonShapeMethod + * @interface PathAttribute + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface PathAttribute extends CommonShapeMethod { + /** + * Called when the command string drawn by the path is set. + * + * @param { string | undefined } value + * @returns { PathAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default commands(value: string | undefined): this; + /** + * Call attributeModifier. + * + * @param { AttributeModifier | AttributeModifier | undefined } modifier + * @returns { PathAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default attributeModifier(modifier: AttributeModifier | AttributeModifier | undefined): this; +} + +/** + * Path is returned when the parameter is transferred. + * + * @param { PathOptions } [options] - The options to create a Path + * @param { function } [content_] + * @returns { PathAttribute } The attribute of the Path. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +@memo +@ComponentBuilder +export declare function Path( + options?: PathOptions, + @memo + content_?: () => void, +): PathAttribute diff --git a/api/arkui/component/polygon.static.d.ets b/api/arkui/component/polygon.static.d.ets new file mode 100644 index 0000000000..3f1425aba9 --- /dev/null +++ b/api/arkui/component/polygon.static.d.ets @@ -0,0 +1,94 @@ +/* + * 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 + * @arkts 1.2 + */ +import { CommonShapeMethod, AttributeModifier, CommonMethod } from "./common"; +import { ShapePoint } from "./line"; +import { memo, ComponentBuilder } from "./../stateManagement/runtime"; + +/** + * Define options used to construct a polygon. + * + * @interface PolygonOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface PolygonOptions { + /** + * Polygon width. + * + * @type { ?(string | double) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + width?: string | double; + /** + * Polygon height. + * + * @type { ?(string | double) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + height?: string | double; +} + +/** + * Provides attribute for Polygon. + * + * @extends CommonShapeMethod + * @interface PolygonAttribute + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface PolygonAttribute extends CommonShapeMethod { + /** + * Called when the vertex coordinate list of a polygon is set. + * + * @param { Array | undefined } value + * @returns { PolygonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default points(value: Array | undefined): this; + /** + * Call attributeModifier. + * + * @param { AttributeModifier | AttributeModifier | undefined } modifier + * @returns { PolygonAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default attributeModifier(modifier: AttributeModifier | AttributeModifier | undefined): this; +} + +/** + * Polygon is returned when the parameter is transferred. + * + * @param { PolygonOptions } [options] - The options to create a Polygon + * @param { function } [content_] + * @returns { PolygonAttribute } The attribute of the Polygon. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +@memo +@ComponentBuilder +export declare function Polygon( + options?: PolygonOptions, + @memo + content_?: () => void, +): PolygonAttribute diff --git a/api/arkui/component/polyline.static.d.ets b/api/arkui/component/polyline.static.d.ets new file mode 100644 index 0000000000..6e02fd58f3 --- /dev/null +++ b/api/arkui/component/polyline.static.d.ets @@ -0,0 +1,93 @@ +/* + * 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 + * @arkts 1.2 + */ +import { CommonShapeMethod, AttributeModifier, CommonMethod } from "./common"; +import { ShapePoint } from "./line"; +import { memo, ComponentBuilder } from "./../stateManagement/runtime"; + +/** + * Define options used to construct a polyline. + * + * @interface PolylineOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface PolylineOptions { + /** + * Polyline width. + * + * @type { ?(string | double) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + width?: string | double; + /** + * Polyline height. + * + * @type { ?(string | double) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + height?: string | double; +} + +/** + * Defines Polyline attribute + * @extends CommonShapeMethod + * @interface PolylineAttribute + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface PolylineAttribute extends CommonShapeMethod { + /** + * Called when the polyline is set to pass through the coordinate point list. + * + * @param { Array | undefined } value + * @returns { PolylineAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default points(value: Array | undefined): this; + /** + * Call attributeModifier. + * + * @param { AttributeModifier | AttributeModifier | undefined } modifier + * @returns { PolylineAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default attributeModifier(modifier: AttributeModifier | AttributeModifier | undefined): this; +} + +/** + * Polyline is returned when the parameter is transferred. + * + * @param { PolylineOptions } [options] - The options to create a Polyline + * @param { function } [content_] + * @returns { PolylineAttribute } The attribute of the Polyline. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +@memo +@ComponentBuilder +export declare function Polyline( + options?: PolylineOptions, + @memo + content_?: () => void, +): PolylineAttribute diff --git a/api/arkui/component/rect.static.d.ets b/api/arkui/component/rect.static.d.ets new file mode 100644 index 0000000000..a4360d3f50 --- /dev/null +++ b/api/arkui/component/rect.static.d.ets @@ -0,0 +1,175 @@ +/* + * 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 + * @arkts 1.2 + */ +import { CommonShapeMethod, AttributeModifier, CommonMethod } from "./common"; +import { Length } from "./units"; +import { memo, ComponentBuilder } from "./../stateManagement/runtime"; + +/** + * Defines the RadiusItem. + * The first element is the width of the rounded corner, the second is the height of the rounded corner. + * + * @typedef { [Length, Length] } RadiusItem + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export type RadiusItem = [ + Length, + Length +]; + +/** + * Define options used to construct a rectangle. + * + * @interface RectOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface RectOptions { + /** + * Rectangle width. + * + * @type { ?(double | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + width?: double | string; + /** + * Rectangle height. + * + * @type { ?(double | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + height?: double | string; + /** + * Corner radius of the rectangle. + * + * @type { ?(Length | Array) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + radius?: Length | Array; +} + +/** + * Define options used to construct a rectangle with rounded corners. + * + * @interface RoundedRectOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface RoundedRectOptions { + /** + * Rectangle width. + * + * @type { ?(double | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + width?: double | string; + /** + * Rectangle height. + * + * @type { ?(double | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + height?: double | string; + /** + * Width of the corner radius. + * + * @type { ?(double | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + radiusWidth?: double | string; + /** + * Height of the corner radius. + * + * @type { ?(double | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + radiusHeight?: double | string; +} + +/** + * rect attribute declaration. + * + * @extends CommonShapeMethod + * @interface RectAttribute + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface RectAttribute extends CommonShapeMethod { + /** + * Called when the fillet width is set. + * + * @param { double | string | undefined } value + * @returns { RectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default radiusWidth(value: double | string | undefined): this; + /** + * Called when the fillet height is set. + * + * @param { double | string | undefined } value + * @returns { RectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default radiusHeight(value: double | string | undefined): this; + /** + * Called when the fillet size is set. + * + * @param { Length | Array | undefined } value + * @returns { RectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default radius(value: Length | Array | undefined): this; + /** + * Call attributeModifier. + * + * @param { AttributeModifier | AttributeModifier | undefined } modifier + * @returns { RectAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default attributeModifier(modifier: AttributeModifier | AttributeModifier | undefined): this; +} + +/** + * Rect is returned when the parameter is transferred. + * + * @param { RectOptions | RoundedRectOptions } [options] - The options to create a Rect + * @param { function } [content_] + * @returns { RectAttribute } The attribute of the Rect + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +@memo +@ComponentBuilder +export declare function Rect( + options?: RectOptions | RoundedRectOptions, + @memo + content_?: () => void, +): RectAttribute diff --git a/api/arkui/component/repeat.d.ets b/api/arkui/component/repeat.static.d.ets old mode 100755 new mode 100644 similarity index 100% rename from api/arkui/component/repeat.d.ets rename to api/arkui/component/repeat.static.d.ets diff --git a/api/arkui/component/shape.static.d.ets b/api/arkui/component/shape.static.d.ets new file mode 100644 index 0000000000..585e10f261 --- /dev/null +++ b/api/arkui/component/shape.static.d.ets @@ -0,0 +1,222 @@ +/* + * 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 + * @arkts 1.2 + */ +import { CommonMethod, PixelMap, AttributeModifier } from "./common"; +import { ResourceColor, Length } from "./units"; +import { Resource } from '../../global/resource'; +import { LineCapStyle, LineJoinStyle } from "./enums"; +import { memo, ComponentBuilder } from "./../stateManagement/runtime"; + +/** + * Viewport bounding box. + * + * @interface ViewportRect + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface ViewportRect { + + /** + * Viewport X coordinate. + * + * @type { ?(double | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + x?: double | string; + /** + * Viewport Y coordinate. + * + * @type { ?(double | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + y?: double | string; + /** + * Viewport width. + * + * @type { ?(double | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + width?: double | string; + /** + * Viewport height. + * + * @type { ?(double | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + height?: double | string; +} + +/** + * Provides attribute for Shape. + * @extends CommonMethod + * @interface ShapeAttribute + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface ShapeAttribute extends CommonMethod { + /** + * Viewport of shape + * + * @param { ViewportRect | undefined } value + * @returns { ShapeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default viewPort(value: ViewportRect | undefined): this; + /** + * Called when the border color is set. + * + * @param { ResourceColor | undefined } value + * @returns { ShapeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default stroke(value: ResourceColor | undefined): this; + /** + * Called when the fill color is set. + * + * @param { ResourceColor | undefined } value + * @returns { ShapeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default fill(value: ResourceColor | undefined): this; + /** + * Called when the offset of the starting point of border drawing is set. + * + * @param { double | string | undefined } value + * @returns { ShapeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default strokeDashOffset(value: double | string | undefined): this; + /** + * Called when the gap of the border is set. + * + * @param { Array | undefined } value + * @returns { ShapeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default strokeDashArray(value: Array | undefined): this; + /** + * Called when the path endpoint drawing style is set. + * + * @param { LineCapStyle | undefined } value + * @returns { ShapeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default strokeLineCap(value: LineCapStyle | undefined): this; + /** + * Called when the border corner drawing style is set. + * + * @param { LineJoinStyle | undefined } value + * @returns { ShapeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default strokeLineJoin(value: LineJoinStyle | undefined): this; + /** + * Called when the limit value for drawing acute angles as oblique angles is set. + * + * @param { double | string | undefined } value + * @returns { ShapeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default strokeMiterLimit(value: double | string | undefined): this; + /** + * Called when the opacity of the border is set. + * + * @param { double | string | Resource | undefined } value + * @returns { ShapeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default strokeOpacity(value: double | string | Resource | undefined): this; + /** + * Called when the transparency of the border is set. + * + * @param { double | string | Resource | undefined } value + * @returns { ShapeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default fillOpacity(value: double | string | Resource | undefined): this; + /** + * Called when the width of the border is set. + * + * @param { double | string | undefined } value + * @returns { ShapeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default strokeWidth(value: double | string | undefined): this; + /** + * Called when setting whether anti aliasing is on. + * + * @param { boolean | undefined } value + * @returns { ShapeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default antiAlias(value: boolean | undefined): this; + /** + * Called when shape mesh. + * + * @param { Array | undefined } value + * @param { int | undefined } column + * @param { int | undefined } row + * @returns { ShapeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default mesh(value: Array | undefined, column: int | undefined, row: int | undefined): this; + /** + * Call attributeModifier. + * + * @param { AttributeModifier | AttributeModifier | undefined } modifier + * @returns { ShapeAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default attributeModifier(modifier: AttributeModifier | AttributeModifier | undefined): this; +} + +/** + * Shape is returned when the parameter is transferred. + * + * @param { PixelMap } [value] - A pixelMap can be drawn in the area of shape. + * @param { function } [content_] + * @returns { ShapeAttribute } The attribute of the Shape. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +@memo +@ComponentBuilder +export declare function Shape( + value?: PixelMap, + @memo + content_?: () => void, +): ShapeAttribute diff --git a/api/arkui/component/video.static.d.ets b/api/arkui/component/video.static.d.ets new file mode 100644 index 0000000000..64f2168a90 --- /dev/null +++ b/api/arkui/component/video.static.d.ets @@ -0,0 +1,526 @@ +/* + * 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 + * @arkts 1.2 + */ +import { Resource } from '../../global/resource'; +import { ImageAIOptions, ImageAnalyzerConfig } from "./imageCommon"; +import { ImageFit } from "./enums"; +import { CommonMethod, Callback, PixelMap, AttributeModifier } from "./common"; +import { VoidCallback } from "./units"; +import { memo, ComponentBuilder } from "./../stateManagement/runtime"; + +/** + * Seek mode. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare enum SeekMode { + /** + * Sync to keyframes before the time point. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + PreviousKeyframe, + /** + * Sync to keyframes after the time point. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + NextKeyframe, + /** + * Sync to closest keyframes. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + ClosestKeyframe, + /** + * Seek to frames closest the time point. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + Accurate +} + +/** + * playback speed. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare enum PlaybackSpeed { + /** + * 0.75x speed playback. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + Speed_Forward_0_75_X, + /** + * 1.00x speed playback. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + Speed_Forward_1_00_X, + /** + * 1.25x speed playback. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + Speed_Forward_1_25_X, + /** + * 1.75x speed playback. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + Speed_Forward_1_75_X, + /** + * 2.00x speed playback. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + Speed_Forward_2_00_X +} + +/** + * Fullscreen information of the video. + * + * @typedef FullscreenInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export interface FullscreenInfo { + /** + * The flag whether play in full screen. + * + * @type { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + fullscreen: boolean; +} + +/** + * Prepared information of the video. + * + * @typedef PreparedInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export interface PreparedInfo { + /** + * The duration of the current video, in seconds. + * + * @type { int } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + duration: int; +} + +/** + * Playback information of the video. + * + * @typedef PlaybackInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export interface PlaybackInfo { + /** + * The current video playback progress, expressed in seconds. + * + * @type { int } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + time: int; +} + +/** + * Defines the video poster options. + * + * @interface PosterOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface PosterOptions { + /** + * Whether to display the first frame of video on prepared status of AVPlayer. + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + showFirstFrame?: boolean; +} + +/** + * Defines the video options. + * + * @interface VideoOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface VideoOptions { + /** + * src of video. + * + * @type { ?(string | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + src?: string | Resource; + /** + * playback rate of video. + * + * @type { ?(double | string | PlaybackSpeed) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + currentProgressRate?: double | string | PlaybackSpeed; + /** + * preview uri of video. + * + * @type { ?(string | PixelMap | Resource) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + previewUri?: string | PixelMap | Resource; + /** + * controller of video. + * + * @type { ?VideoController } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + controller?: VideoController; + /** + * image ai options of video. + * + * @type { ?ImageAIOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + imageAIOptions?: ImageAIOptions; + /** + * poster options of video. + * + * @type { ?PosterOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + posterOptions?: PosterOptions; +} + +/** + * Defines the video controller. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare class VideoController { + /** + * constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + constructor(); + /** + * Provides events to play. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + start(): void; + /** + * Provides a pause event for playback. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + pause(): void; + /** + * Provides an event to stop playback. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + stop(): void; + /** + * Provides a full screen playback method. + * + * @param { boolean } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + requestFullscreen(value: boolean): void; + /** + * Provides a method to exit full screen playback. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + exitFullscreen(): void; + /** + * Provide the progress method of video playback without SeekMode. + * + * @param { double } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + setCurrentTimeDefault(value: double): void; + /** + * Provide the progress method of video playback with SeekMode. + * + * @param { double } value + * @param { SeekMode } seekMode + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + setCurrentTimeWithMode(value: double, seekMode: SeekMode): void; + /** + * Provide the progress method of video playback. + * + * @overload { setCurrentTimeDefault, setCurrentTimeWithMode } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + overload setCurrentTime { setCurrentTimeDefault, setCurrentTimeWithMode }; + /** + * Provide the reset method of video playback. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + reset(): void; +} + +/** + * Defines the Video attribute. + * + * @extends CommonMethod + * @interface VideoAttribute + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface VideoAttribute extends CommonMethod { + /** + * Called when judging whether the video is muted. + * + * @param { boolean | undefined } value + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default muted(value: boolean | undefined): this; + /** + * Called when judging whether the video is played automatically. + * + * @param { boolean | undefined } value + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default autoPlay(value: boolean | undefined): this; + /** + * Called when judging whether the control bar is displayed. + * + * @param { boolean | undefined } value + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default controls(value: boolean | undefined): this; + /** + * Called when judging whether the video is played circular. + * + * @param { boolean | undefined } value + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default loop(value: boolean | undefined): this; + /** + * Called when determining the zoom type of the video source. + * + * @param { ImageFit | undefined } value + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default objectFit(value: ImageFit | undefined): this; + /** + * Called when the video is played. + * + * @param { VoidCallback | undefined } event + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default onStart(event: VoidCallback | undefined): this; + /** + * Called when the video is paused. + * + * @param { VoidCallback | undefined } event + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default onPause(event: VoidCallback | undefined): this; + /** + * Called when the video playback ends. + * + * @param { VoidCallback | undefined } event + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default onFinish(event: VoidCallback | undefined): this; + /** + * Called when the video enters and exits the full screen. + * + * @param { Callback | undefined } callback + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default onFullscreenChange(callback: Callback | undefined): this; + /** + * Called when the video preparation is complete. + * + * @param { Callback | undefined } callback + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default onPrepared(callback: Callback | undefined): this; + /** + * Called when the time information is reported when the progress bar process is operated. + * + * @param { Callback | undefined } callback + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default onSeeking(callback: Callback | undefined): this; + /** + * Called when the playback time information is reported after the operation progress bar is completed. + * + * @param { Callback | undefined } callback + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default onSeeked(callback: Callback | undefined): this; + /** + * Called when the playback progress changes. + * + * @param { Callback | undefined } callback + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default onUpdate(callback: Callback | undefined): this; + /** + * Called when playback fails. + * + * @param { (() => void) | undefined } event + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default onError(event: (() => void) | undefined): this; + /** + * Called when the video is stopped. + * + * @param { VoidCallback | undefined } event + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default onStop(event: VoidCallback | undefined): this; + /** + * Enable image analyzer. + * + * @param { boolean | undefined } enable + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default enableAnalyzer(enable: boolean | undefined): this; + /** + * Set image analyzer with config. + * + * @param { ImageAnalyzerConfig | undefined } config + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default analyzerConfig(config: ImageAnalyzerConfig | undefined): this; + /** + * Indicates whether to response shortcut key. The default value is false. + * If the value is true, video will respond to the shortcut keys as follows: + * Space key: play/pause the video. + * Up/Down arrow key: turn up/down volume of the video. + * Right/Left arrow key: fast forward/backward the video. + * + * @param { boolean | undefined } enabled + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default enableShortcutKey(enabled: boolean | undefined): this; + /** + * Call attributeModifier. + * + * @param { AttributeModifier | AttributeModifier | undefined } modifier + * @returns { VideoAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default attributeModifier(modifier: AttributeModifier | AttributeModifier | undefined): this; +} + +/** + * Video is returned when the parameter is transferred. + * + * @param { VideoOptions } value - The options to create a Video + * @param { function } [content_] + * @returns { VideoAttribute } The attribute of the Video + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +@memo +@ComponentBuilder +export declare function Video( + value: VideoOptions, + @memo + content_?: () => void, +): VideoAttribute diff --git a/api/arkui/component/xcomponent.static.d.ets b/api/arkui/component/xcomponent.static.d.ets new file mode 100644 index 0000000000..99703af1d8 --- /dev/null +++ b/api/arkui/component/xcomponent.static.d.ets @@ -0,0 +1,387 @@ +/* + * 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 + * @arkts 1.2 + */ +import { ImageAIOptions, ImageAnalyzerConfig } from "./imageCommon"; +import { CommonMethod, AttributeModifier, Callback } from "./common"; +import { XComponentType } from "./enums"; +import { VoidCallback } from "./units"; +import { memo, ComponentBuilder } from "./../stateManagement/runtime"; + +/** + * Surface Rectangle information. + * + * @interface SurfaceRect + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface SurfaceRect { + /** + * The horizontal offset of the surface relative to XComponent. + * + * @type { ?double } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + offsetX?: double; + /** + * The vertical offset of the surface relative to XComponent. + * + * @type { ?double } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + offsetY?: double; + /** + * The width of the surface created by XComponent + * + * @type { double } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + surfaceWidth: double; + /** + * The height of the surface created by XComponent + * + * @type { double } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + surfaceHeight: double; +} + +/** + * Defines the NativeXComponent Pointer type. + * + * @typedef { long } NativeXComponentPointer + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export type NativeXComponentPointer = long; + +/** + * Surface rotation options. + * + * @interface SurfaceRotationOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface SurfaceRotationOptions { + /** + * Lock property of the surface rotation. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + lock?: boolean; +} + +/** + * Defines XComponentController + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare class XComponentController { + /** + * Constructor. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + constructor(); + /** + * Get the id of surface created by XComponent. + * + * @returns { string } The id of surface created by XComponent. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + getXComponentSurfaceId(): string; + /** + * Set the rectangle information of surface created by XComponent. + * + * @param { SurfaceRect } rect - The surface rectangle information. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + setXComponentSurfaceRect(rect: SurfaceRect): void; + /** + * Get the rectangle information of Surface created by XComponent. + * + * @returns { SurfaceRect } The surface rectangle information. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + getXComponentSurfaceRect(): SurfaceRect; + /** + * Set the rotation options of the Surface created by XComponent. + * + * @param { SurfaceRotationOptions } rotationOptions - The surface rotation options. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + setXComponentSurfaceRotation(rotationOptions: SurfaceRotationOptions): void; + /** + * Get the rotation options result of the Surface created by XComponent. + * + * @returns { Required } The surface rotation options result. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + getXComponentSurfaceRotation(): Required; + /** + * Called after the surface is first created. + * + * @param { string } surfaceId - The id of the surface created by XComponent. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + onSurfaceCreated(surfaceId: string): void; + /** + * Called after the surface rectangle information is changed. + * + * @param { string } surfaceId - The id of the surface created by XComponent. + * @param { SurfaceRect } rect - The rectangle information of the surface created by XComponent. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + onSurfaceChanged(surfaceId: string, rect: SurfaceRect): void; + /** + * Called when the surface is about to be destroyed. + * + * @param { string } surfaceId - The id of the surface created by XComponent. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + onSurfaceDestroyed(surfaceId: string): void; + /** + * Start image analyzer. + * + * @param { ImageAnalyzerConfig } config - Image analyzer config. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 110001 - Image analysis feature is unsupported. + * @throws { BusinessError } 110002 - Image analysis is currently being executed. + * @throws { BusinessError } 110003 - Image analysis is stopped. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + startImageAnalyzer(config: ImageAnalyzerConfig): Promise; + /** + * Stop image analyzer. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + stopImageAnalyzer(): void; +} + +/** + * Defines the xcomponent options. + * + * @interface XComponentOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface XComponentOptions { + /** + * The type of xcomponent + * + * @type { XComponentType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + type: XComponentType; + /** + * The controller of xcomponent. + * + * @type { XComponentController } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + controller: XComponentController; + /** + * Image ai options. + * + * @type { ?ImageAIOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + imageAIOptions?: ImageAIOptions; + /** + * Identifier of a screen. + * + * @type { ?long } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 20 + */ + screenId?: long; +} + +/** + * Defines the native xcomponent parameters. + * + * @interface NativeXComponentParameters + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface NativeXComponentParameters { + /** + * The type of xcomponent + * + * @type { XComponentType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + type: XComponentType; + /** + * Image ai options. + * + * @type { ?ImageAIOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + imageAIOptions?: ImageAIOptions; +} + +/** + * Defines the XComponent attribute. + * + * @extends CommonMethod + * @interface XComponentAttribute + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface XComponentAttribute extends CommonMethod { + /** + * Called when judging whether the xcomponent surface is created. + * + * @param { VoidCallback | undefined } callback - Called when judging whether the xcomponent surface is created. + * @returns { XComponentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default onLoad(callback: VoidCallback | undefined): this; + /** + * Called when judging whether the xcomponent is destroyed. + * + * @param { VoidCallback | undefined } event - Called when judging whether the xcomponent is destroyed. + * @returns { XComponentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default onDestroy(event: VoidCallback | undefined): this; + /** + * Enable image analyzer for XComponent. + * + * @param { boolean | undefined } enable + * @returns { XComponentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default enableAnalyzer(enable: boolean | undefined): this; + /** + * Enable privacy protection for XComponent. + * + * @param { boolean | undefined } isSecure + * @returns { XComponentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default enableSecure(isSecure: boolean | undefined): this; + /** + * Set hdrBrightness for XComponent. + * + * @param { double | undefined } brightness - control the brightness of HDR video + * @returns { XComponentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default hdrBrightness(brightness: double | undefined): this; + /** + * Call attributeModifier. + * + * @param { AttributeModifier | AttributeModifier | undefined } modifier + * @returns { XComponentAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default attributeModifier(modifier: AttributeModifier | AttributeModifier | undefined): this; +} + +/** + * Defines the XComponent parameter interface. + * + * @interface XComponentParameters + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface XComponentParameters { + /** + * The id of xcomponent + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + id: string; + /** + * The type of xcomponent + * + * @type { XComponentType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + type: XComponentType; + /** + * The callback to handle NativeXComponent Pointer. + * + * @type { Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + nativeXComponentHandler: Callback; + /** + * The controller of xcomponent. + * + * @type { ?XComponentController } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + controller?: XComponentController; +} + +/** + * XComponent is returned when the parameter is transferred. + * + * @param { XComponentParameters | XComponentOptions | NativeXComponentParameters } params - + * The options to create an XComponent + * @param { function } [content_] + * @returns { XComponentAttribute } The attribute of the XComponent + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +@memo +@ComponentBuilder +export declare function XComponent( + params: XComponentParameters | XComponentOptions | NativeXComponentParameters, + @memo + content_?: () => void, +): XComponentAttribute -- Gitee