From 44c57a8bf032b6d8a71bf07ea217fc1fcae1029d Mon Sep 17 00:00:00 2001 From: bixuefeng Date: Tue, 14 Jun 2022 09:57:20 +0800 Subject: [PATCH] fixed f74d228 from https://gitee.com/catpoison/interface_sdk-js/pulls/1945 Feature: border setting for each edge/radius Signed-off-by: bixuefeng Change-Id: I0155b523179a7c69f201f60cbb4198828813c6ca --- api/@internal/component/ets/common.d.ts | 24 ++++ api/@internal/component/ets/units.d.ts | 152 +++++++++++++++++++++++- 2 files changed, 172 insertions(+), 4 deletions(-) diff --git a/api/@internal/component/ets/common.d.ts b/api/@internal/component/ets/common.d.ts index 23b05409b7..97ba986f7a 100644 --- a/api/@internal/component/ets/common.d.ts +++ b/api/@internal/component/ets/common.d.ts @@ -1139,24 +1139,48 @@ declare class CommonMethod { */ borderStyle(value: BorderStyle): T; + /** + * Border style + * @since 9 + */ + borderStyle(value: EdgeStyles): T; + /** * Border width * @since 7 */ borderWidth(value: Length): T; + /** + * Border width + * @since 9 + */ + borderWidth(value: EdgeWidths): T; + /** * Border color * @since 7 */ borderColor(value: ResourceColor): T; + /** + * Border color + * @since 9 + */ + borderColor(value: EdgeColors): T; + /** * Border radius * @since 7 */ borderRadius(value: Length): T; + /** + * Border radius + * @since 9 + */ + borderRadius(value: BorderRadiuses): T; + /** * Trigger a click event when a click is clicked. * @since 7 diff --git a/api/@internal/component/ets/units.d.ts b/api/@internal/component/ets/units.d.ts index 1eeb8aeadf..96020765ab 100644 --- a/api/@internal/component/ets/units.d.ts +++ b/api/@internal/component/ets/units.d.ts @@ -81,6 +81,126 @@ declare type Padding = { */ declare type Margin = Padding; +/** + * Defines the border width property. + * @since 9 + */ + declare type EdgeWidths = { + /** + * top property. + * @since 9 + */ + top?: Length; + + /** + * right property. + * @since 9 + */ + right?: Length; + + /** + * bottom property. + * @since 9 + */ + bottom?: Length; + + /** + * left property. + * @since 9 + */ + left?: Length; +}; + +/** + * Defines the border radius property. + * @since 9 + */ +declare type BorderRadiuses = { + /** + * top-left property. + * @since 9 + */ + topLeft?: Length; + + /** + * top-right property. + * @since 9 + */ + topRight?: Length; + + /** + * bottom-left property. + * @since 9 + */ + bottomLeft?: Length; + + /** + * bottom-right property. + * @since 9 + */ + bottomRight?: Length; +}; + +/** + * Defines the border color property. + * @since 9 + */ +declare type EdgeColors = { + /** + * top property. + * @since 9 + */ + top?: ResourceColor; + + /** + * right property. + * @since 9 + */ + right?: ResourceColor; + + /** + * bottom property. + * @since 9 + */ + bottom?: ResourceColor; + + /** + * left property. + * @since 9 + */ + left?: ResourceColor; +}; + +/** + * Defines the border style property. + * @since 9 + */ +declare type EdgeStyles = { + /** + * top property. + * @since 9 + */ + top?: BorderStyle; + + /** + * right property. + * @since 9 + */ + right?: BorderStyle; + + /** + * bottom property. + * @since 9 + */ + bottom?: BorderStyle; + + /** + * left property. + * @since 9 + */ + left?: BorderStyle; +}; + /** * Defines the offset property. * @since 7 @@ -227,22 +347,46 @@ declare interface SizeOptions { declare interface BorderOptions { /** * Defines the border width. + * @type { Length } * @since 7 */ - width?: Length; + /** + * Defines the border width. + * @type { EdgeWidths | Length } + * @since 9 + */ + width?: EdgeWidths | Length; /** * Defines the border color. + * @type { ResourceColor } * @since 7 */ - color?: ResourceColor; + /** + * Defines the border color. + * @type { EdgeColors | ResourceColor } + * @since 9 + */ + color?: EdgeColors | ResourceColor; /** * Defines the border radius. + * @type { Length } * @since 7 */ - radius?: Length; + /** + * Defines the border radius. + * @type { BorderRadiuses | Length } + * @since 9 + */ + radius?: BorderRadiuses | Length; /** * Defines the border style. + * @type { BorderStyle } * @since 7 */ - style?: BorderStyle; + /** + * Defines the border style. + * @type { EdgeStyles | BorderStyle } + * @since 9 + */ + style?: EdgeStyles | BorderStyle; } -- Gitee