161847f8eSopenharmony_ci/* 261847f8eSopenharmony_ci * Copyright (C) 2024 Huawei Device Co., Ltd. 361847f8eSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 461847f8eSopenharmony_ci * you may not use this file except in compliance with the License. 561847f8eSopenharmony_ci * You may obtain a copy of the License at 661847f8eSopenharmony_ci * 761847f8eSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 861847f8eSopenharmony_ci * 961847f8eSopenharmony_ci * Unless required by applicable law or agreed to in writing, software 1061847f8eSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 1161847f8eSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1261847f8eSopenharmony_ci * See the License for the specific language governing permissions and 1361847f8eSopenharmony_ci * limitations under the License. 1461847f8eSopenharmony_ci */ 1561847f8eSopenharmony_ci 1661847f8eSopenharmony_ci/** 1761847f8eSopenharmony_ci * @file 1861847f8eSopenharmony_ci * @kit ArkUI 1961847f8eSopenharmony_ci */ 2061847f8eSopenharmony_ci 2161847f8eSopenharmony_ci 2261847f8eSopenharmony_ci 2361847f8eSopenharmony_ci/** 2461847f8eSopenharmony_ci * Interface for shape size properties. 2561847f8eSopenharmony_ci * 2661847f8eSopenharmony_ci * @interface ShapeSize 2761847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 2861847f8eSopenharmony_ci * @crossplatform 2961847f8eSopenharmony_ci * @form 3061847f8eSopenharmony_ci * @atomicservice 3161847f8eSopenharmony_ci * @since 12 3261847f8eSopenharmony_ci */ 3361847f8eSopenharmony_ciinterface ShapeSize { 3461847f8eSopenharmony_ci /** 3561847f8eSopenharmony_ci * Defines the width of Shape. 3661847f8eSopenharmony_ci * @type { ? (number | string) } 3761847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 3861847f8eSopenharmony_ci * @form 3961847f8eSopenharmony_ci * @atomicservice 4061847f8eSopenharmony_ci * @since 12 4161847f8eSopenharmony_ci */ 4261847f8eSopenharmony_ci width?: number | string; 4361847f8eSopenharmony_ci 4461847f8eSopenharmony_ci /** 4561847f8eSopenharmony_ci * Defines the height of Shape. 4661847f8eSopenharmony_ci * @type { ? (number | string) } 4761847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 4861847f8eSopenharmony_ci * @form 4961847f8eSopenharmony_ci * @atomicservice 5061847f8eSopenharmony_ci * @since 12 5161847f8eSopenharmony_ci */ 5261847f8eSopenharmony_ci height?: number | string; 5361847f8eSopenharmony_ci} 5461847f8eSopenharmony_ci 5561847f8eSopenharmony_ci/** 5661847f8eSopenharmony_ci * Interface for RectShape constructor parameters. 5761847f8eSopenharmony_ci * 5861847f8eSopenharmony_ci * @interface RectShapeOptions 5961847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 6061847f8eSopenharmony_ci * @crossplatform 6161847f8eSopenharmony_ci * @form 6261847f8eSopenharmony_ci * @atomicservice 6361847f8eSopenharmony_ci * @since 12 6461847f8eSopenharmony_ci */ 6561847f8eSopenharmony_ciinterface RectShapeOptions extends ShapeSize { 6661847f8eSopenharmony_ci /** 6761847f8eSopenharmony_ci * Defines the corner radius of the RectShape. 6861847f8eSopenharmony_ci * @type { ? (number | string | Array<number | string>) } 6961847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 7061847f8eSopenharmony_ci * @form 7161847f8eSopenharmony_ci * @atomicservice 7261847f8eSopenharmony_ci * @since 12 7361847f8eSopenharmony_ci */ 7461847f8eSopenharmony_ci radius?: number | string | Array<number | string>; 7561847f8eSopenharmony_ci} 7661847f8eSopenharmony_ci 7761847f8eSopenharmony_ci/** 7861847f8eSopenharmony_ci * Interface for RectShape constructor parameters with separate radius values. 7961847f8eSopenharmony_ci * 8061847f8eSopenharmony_ci * @interface RoundRectShapeOptions 8161847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 8261847f8eSopenharmony_ci * @crossplatform 8361847f8eSopenharmony_ci * @form 8461847f8eSopenharmony_ci * @atomicservice 8561847f8eSopenharmony_ci * @since 12 8661847f8eSopenharmony_ci */ 8761847f8eSopenharmony_ciinterface RoundRectShapeOptions extends ShapeSize { 8861847f8eSopenharmony_ci /** 8961847f8eSopenharmony_ci * Defines the width of the corner radius for RectShape. 9061847f8eSopenharmony_ci * @type { ? (number | string) } 9161847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 9261847f8eSopenharmony_ci * @form 9361847f8eSopenharmony_ci * @atomicservice 9461847f8eSopenharmony_ci * @since 12 9561847f8eSopenharmony_ci */ 9661847f8eSopenharmony_ci radiusWidth?: number | string; 9761847f8eSopenharmony_ci 9861847f8eSopenharmony_ci /** 9961847f8eSopenharmony_ci * Defines the height of the corner radius for RectShape. 10061847f8eSopenharmony_ci * @type { ? (number | string) } 10161847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 10261847f8eSopenharmony_ci * @form 10361847f8eSopenharmony_ci * @atomicservice 10461847f8eSopenharmony_ci * @since 12 10561847f8eSopenharmony_ci */ 10661847f8eSopenharmony_ci radiusHeight?: number | string; 10761847f8eSopenharmony_ci} 10861847f8eSopenharmony_ci 10961847f8eSopenharmony_ci/** 11061847f8eSopenharmony_ci * Interface for PathShape constructor parameters. 11161847f8eSopenharmony_ci * 11261847f8eSopenharmony_ci * @interface PathShapeOptions 11361847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 11461847f8eSopenharmony_ci * @crossplatform 11561847f8eSopenharmony_ci * @form 11661847f8eSopenharmony_ci * @atomicservice 11761847f8eSopenharmony_ci * @since 12 11861847f8eSopenharmony_ci */ 11961847f8eSopenharmony_ciinterface PathShapeOptions { 12061847f8eSopenharmony_ci /** 12161847f8eSopenharmony_ci * Defines the commands for drawing the PathShape. 12261847f8eSopenharmony_ci * @type { ?string } 12361847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 12461847f8eSopenharmony_ci * @form 12561847f8eSopenharmony_ci * @atomicservice 12661847f8eSopenharmony_ci * @since 12 12761847f8eSopenharmony_ci */ 12861847f8eSopenharmony_ci commands?: string; 12961847f8eSopenharmony_ci} 13061847f8eSopenharmony_ci 13161847f8eSopenharmony_ci/** 13261847f8eSopenharmony_ci * Common shape method class 13361847f8eSopenharmony_ci * 13461847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 13561847f8eSopenharmony_ci * @crossplatform 13661847f8eSopenharmony_ci * @form 13761847f8eSopenharmony_ci * @atomicservice 13861847f8eSopenharmony_ci * @since 12 13961847f8eSopenharmony_ci */ 14061847f8eSopenharmony_cideclare class CommonShapeMethod<T> { 14161847f8eSopenharmony_ci /** 14261847f8eSopenharmony_ci * Sets coordinate offset relative to the layout completion position. 14361847f8eSopenharmony_ci * 14461847f8eSopenharmony_ci * @param { Position } offset 14561847f8eSopenharmony_ci * @returns { T } 14661847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 14761847f8eSopenharmony_ci * @crossplatform 14861847f8eSopenharmony_ci * @form 14961847f8eSopenharmony_ci * @atomicservice 15061847f8eSopenharmony_ci * @since 12 15161847f8eSopenharmony_ci */ 15261847f8eSopenharmony_ci offset(offset: Position): T; 15361847f8eSopenharmony_ci 15461847f8eSopenharmony_ci /** 15561847f8eSopenharmony_ci * Sets the fill color of the shape. 15661847f8eSopenharmony_ci * 15761847f8eSopenharmony_ci * @param { ResourceColor } color 15861847f8eSopenharmony_ci * @returns { T } 15961847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 16061847f8eSopenharmony_ci * @crossplatform 16161847f8eSopenharmony_ci * @form 16261847f8eSopenharmony_ci * @atomicservice 16361847f8eSopenharmony_ci * @since 12 16461847f8eSopenharmony_ci */ 16561847f8eSopenharmony_ci fill(color: ResourceColor): T; 16661847f8eSopenharmony_ci 16761847f8eSopenharmony_ci /** 16861847f8eSopenharmony_ci * Sets the position of the shape. 16961847f8eSopenharmony_ci * 17061847f8eSopenharmony_ci * @param { Position } position 17161847f8eSopenharmony_ci * @returns { T } 17261847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 17361847f8eSopenharmony_ci * @crossplatform 17461847f8eSopenharmony_ci * @form 17561847f8eSopenharmony_ci * @atomicservice 17661847f8eSopenharmony_ci * @since 12 17761847f8eSopenharmony_ci */ 17861847f8eSopenharmony_ci position(position: Position): T; 17961847f8eSopenharmony_ci} 18061847f8eSopenharmony_ci 18161847f8eSopenharmony_ci/** 18261847f8eSopenharmony_ci * Base shape class 18361847f8eSopenharmony_ci * 18461847f8eSopenharmony_ci * @extends CommonShapeMethod<T> 18561847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 18661847f8eSopenharmony_ci * @crossplatform 18761847f8eSopenharmony_ci * @form 18861847f8eSopenharmony_ci * @atomicservice 18961847f8eSopenharmony_ci * @since 12 19061847f8eSopenharmony_ci */ 19161847f8eSopenharmony_cideclare class BaseShape<T> extends CommonShapeMethod<T> { 19261847f8eSopenharmony_ci /** 19361847f8eSopenharmony_ci * Sets the width of the shape. 19461847f8eSopenharmony_ci * 19561847f8eSopenharmony_ci * @param { Length } width 19661847f8eSopenharmony_ci * @returns { T } 19761847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 19861847f8eSopenharmony_ci * @crossplatform 19961847f8eSopenharmony_ci * @form 20061847f8eSopenharmony_ci * @atomicservice 20161847f8eSopenharmony_ci * @since 12 20261847f8eSopenharmony_ci */ 20361847f8eSopenharmony_ci width(width: Length): T; 20461847f8eSopenharmony_ci 20561847f8eSopenharmony_ci /** 20661847f8eSopenharmony_ci * Sets the height of the shape. 20761847f8eSopenharmony_ci * 20861847f8eSopenharmony_ci * @param { Length } height 20961847f8eSopenharmony_ci * @returns { T } 21061847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 21161847f8eSopenharmony_ci * @crossplatform 21261847f8eSopenharmony_ci * @form 21361847f8eSopenharmony_ci * @atomicservice 21461847f8eSopenharmony_ci * @since 12 21561847f8eSopenharmony_ci */ 21661847f8eSopenharmony_ci height(height: Length): T; 21761847f8eSopenharmony_ci 21861847f8eSopenharmony_ci /** 21961847f8eSopenharmony_ci * Sets the size of the shape. 22061847f8eSopenharmony_ci * 22161847f8eSopenharmony_ci * @param { SizeOptions } size 22261847f8eSopenharmony_ci * @returns { T } 22361847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 22461847f8eSopenharmony_ci * @crossplatform 22561847f8eSopenharmony_ci * @form 22661847f8eSopenharmony_ci * @atomicservice 22761847f8eSopenharmony_ci * @since 12 22861847f8eSopenharmony_ci */ 22961847f8eSopenharmony_ci size(size: SizeOptions): T; 23061847f8eSopenharmony_ci} 23161847f8eSopenharmony_ci 23261847f8eSopenharmony_ci/** 23361847f8eSopenharmony_ci * Defines a rect drawing class. 23461847f8eSopenharmony_ci * 23561847f8eSopenharmony_ci * @extends BaseShape<RectShape> 23661847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 23761847f8eSopenharmony_ci * @crossplatform 23861847f8eSopenharmony_ci * @form 23961847f8eSopenharmony_ci * @atomicservice 24061847f8eSopenharmony_ci * @since 12 24161847f8eSopenharmony_ci */ 24261847f8eSopenharmony_ciexport declare class RectShape extends BaseShape<RectShape> { 24361847f8eSopenharmony_ci /** 24461847f8eSopenharmony_ci * Constructor. 24561847f8eSopenharmony_ci * 24661847f8eSopenharmony_ci * @param { RectShapeOptions | RoundRectShapeOptions } options 24761847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 24861847f8eSopenharmony_ci * @crossplatform 24961847f8eSopenharmony_ci * @form 25061847f8eSopenharmony_ci * @atomicservice 25161847f8eSopenharmony_ci * @since 12 25261847f8eSopenharmony_ci */ 25361847f8eSopenharmony_ci constructor(options?: RectShapeOptions | RoundRectShapeOptions); 25461847f8eSopenharmony_ci 25561847f8eSopenharmony_ci /** 25661847f8eSopenharmony_ci * Sets the width of the corner radius for RectShape. 25761847f8eSopenharmony_ci * 25861847f8eSopenharmony_ci * @param { number | string } rWidth 25961847f8eSopenharmony_ci * @returns { RectShape } 26061847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 26161847f8eSopenharmony_ci * @crossplatform 26261847f8eSopenharmony_ci * @form 26361847f8eSopenharmony_ci * @atomicservice 26461847f8eSopenharmony_ci * @since 12 26561847f8eSopenharmony_ci */ 26661847f8eSopenharmony_ci radiusWidth(rWidth: number | string): RectShape; 26761847f8eSopenharmony_ci 26861847f8eSopenharmony_ci /** 26961847f8eSopenharmony_ci * Sets the height of the corner radius for RectShape. 27061847f8eSopenharmony_ci * 27161847f8eSopenharmony_ci * @param { number | string } rHeight 27261847f8eSopenharmony_ci * @returns { RectShape } 27361847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 27461847f8eSopenharmony_ci * @crossplatform 27561847f8eSopenharmony_ci * @form 27661847f8eSopenharmony_ci * @atomicservice 27761847f8eSopenharmony_ci * @since 12 27861847f8eSopenharmony_ci */ 27961847f8eSopenharmony_ci radiusHeight(rHeight: number | string): RectShape; 28061847f8eSopenharmony_ci 28161847f8eSopenharmony_ci /** 28261847f8eSopenharmony_ci * Sets the corner radius for RectShape. 28361847f8eSopenharmony_ci * 28461847f8eSopenharmony_ci * @param { number | string | Array<number | string> } radius 28561847f8eSopenharmony_ci * @returns { RectShape } 28661847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 28761847f8eSopenharmony_ci * @crossplatform 28861847f8eSopenharmony_ci * @form 28961847f8eSopenharmony_ci * @atomicservice 29061847f8eSopenharmony_ci * @since 12 29161847f8eSopenharmony_ci */ 29261847f8eSopenharmony_ci radius(radius: number | string | Array<number | string>): RectShape; 29361847f8eSopenharmony_ci} 29461847f8eSopenharmony_ci 29561847f8eSopenharmony_ci/** 29661847f8eSopenharmony_ci * Defines a circle drawing class. 29761847f8eSopenharmony_ci * 29861847f8eSopenharmony_ci * @extends BaseShape<CircleShape> 29961847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 30061847f8eSopenharmony_ci * @crossplatform 30161847f8eSopenharmony_ci * @form 30261847f8eSopenharmony_ci * @atomicservice 30361847f8eSopenharmony_ci * @since 12 30461847f8eSopenharmony_ci */ 30561847f8eSopenharmony_ciexport declare class CircleShape extends BaseShape<CircleShape> { 30661847f8eSopenharmony_ci /** 30761847f8eSopenharmony_ci * Constructor. 30861847f8eSopenharmony_ci * 30961847f8eSopenharmony_ci * @param { ShapeSize } options 31061847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 31161847f8eSopenharmony_ci * @crossplatform 31261847f8eSopenharmony_ci * @form 31361847f8eSopenharmony_ci * @atomicservice 31461847f8eSopenharmony_ci * @since 12 31561847f8eSopenharmony_ci */ 31661847f8eSopenharmony_ci constructor(options?: ShapeSize); 31761847f8eSopenharmony_ci} 31861847f8eSopenharmony_ci 31961847f8eSopenharmony_ci/** 32061847f8eSopenharmony_ci * Defines an ellipse drawing class. 32161847f8eSopenharmony_ci * 32261847f8eSopenharmony_ci * @extends BaseShape<EllipseShape> 32361847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 32461847f8eSopenharmony_ci * @crossplatform 32561847f8eSopenharmony_ci * @form 32661847f8eSopenharmony_ci * @atomicservice 32761847f8eSopenharmony_ci * @since 12 32861847f8eSopenharmony_ci */ 32961847f8eSopenharmony_ciexport declare class EllipseShape extends BaseShape<EllipseShape> { 33061847f8eSopenharmony_ci /** 33161847f8eSopenharmony_ci * Constructor. 33261847f8eSopenharmony_ci * 33361847f8eSopenharmony_ci * @param { ShapeSize } options 33461847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 33561847f8eSopenharmony_ci * @crossplatform 33661847f8eSopenharmony_ci * @form 33761847f8eSopenharmony_ci * @atomicservice 33861847f8eSopenharmony_ci * @since 12 33961847f8eSopenharmony_ci */ 34061847f8eSopenharmony_ci constructor(options?: ShapeSize); 34161847f8eSopenharmony_ci} 34261847f8eSopenharmony_ci 34361847f8eSopenharmony_ci/** 34461847f8eSopenharmony_ci * Defines a path drawing class. 34561847f8eSopenharmony_ci * 34661847f8eSopenharmony_ci * @extends CommonShapeMethod<PathShape> 34761847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 34861847f8eSopenharmony_ci * @crossplatform 34961847f8eSopenharmony_ci * @form 35061847f8eSopenharmony_ci * @atomicservice 35161847f8eSopenharmony_ci * @since 12 35261847f8eSopenharmony_ci */ 35361847f8eSopenharmony_ciexport declare class PathShape extends CommonShapeMethod<PathShape> { 35461847f8eSopenharmony_ci /** 35561847f8eSopenharmony_ci * Constructor. 35661847f8eSopenharmony_ci * 35761847f8eSopenharmony_ci * @param { PathShapeOptions } options 35861847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 35961847f8eSopenharmony_ci * @crossplatform 36061847f8eSopenharmony_ci * @form 36161847f8eSopenharmony_ci * @atomicservice 36261847f8eSopenharmony_ci * @since 12 36361847f8eSopenharmony_ci */ 36461847f8eSopenharmony_ci constructor(options?: PathShapeOptions); 36561847f8eSopenharmony_ci 36661847f8eSopenharmony_ci /** 36761847f8eSopenharmony_ci * Sets the commands for drawing the PathShape. 36861847f8eSopenharmony_ci * 36961847f8eSopenharmony_ci * @param { string } commands 37061847f8eSopenharmony_ci * @returns { PathShape } 37161847f8eSopenharmony_ci * @syscap SystemCapability.ArkUI.ArkUI.Full 37261847f8eSopenharmony_ci * @crossplatform 37361847f8eSopenharmony_ci * @form 37461847f8eSopenharmony_ci * @atomicservice 37561847f8eSopenharmony_ci * @since 12 37661847f8eSopenharmony_ci */ 37761847f8eSopenharmony_ci commands(commands: string): PathShape; 37861847f8eSopenharmony_ci}