From 542577d33c582e6da41e2e5d56e293681a4c7baf Mon Sep 17 00:00:00 2001 From: chenjiafeng10 Date: Fri, 29 Aug 2025 10:31:16 +0800 Subject: [PATCH] TextContentAlign interface Signed-off-by: chenjiafeng10 --- api/@internal/component/ets/text.d.ts | 13 +++++++ api/@internal/component/ets/text_common.d.ts | 41 ++++++++++++++++++++ 2 files changed, 54 insertions(+) diff --git a/api/@internal/component/ets/text.d.ts b/api/@internal/component/ets/text.d.ts index c39a69db6e..89bdc43f2e 100644 --- a/api/@internal/component/ets/text.d.ts +++ b/api/@internal/component/ets/text.d.ts @@ -711,6 +711,19 @@ declare class TextAttribute extends CommonMethod { */ textVerticalAlign(textVerticalAlign: Optional): TextAttribute; + + /** + * Set the vertical align of the whole text content. + * + * @param { Optional } textContentAlign - The default value is TOP. + * @returns { TextAttribute } returns the instance of the TextAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 21 + */ + textContentAlign(textContentAlign: Optional): TextAttribute; + /** * Called when the vertical center mode of the font is set. * diff --git a/api/@internal/component/ets/text_common.d.ts b/api/@internal/component/ets/text_common.d.ts index 4f75e5b57c..bd2701b043 100644 --- a/api/@internal/component/ets/text_common.d.ts +++ b/api/@internal/component/ets/text_common.d.ts @@ -1972,6 +1972,47 @@ declare enum TextVerticalAlign { TOP = 3, } +/** + * Alignment of text. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 21 + */ +declare enum TextContentAlign { + /** + * Top the text. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 21 + */ + TOP = 0, + + /** + * Center alignment. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 21 + */ + CENTER = 1, + + /** + * Bottom alignment. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 21 + */ + BOTTOM = 2 +} + /** * Defines the options of max lines. * @interface MaxLinesOptions -- Gitee