From c196ef7d5195a7e4281bbdcdeb6903f6d0e4d920 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 2b0b4ee144..7f498aacce 100644 --- a/api/@internal/component/ets/text.d.ts +++ b/api/@internal/component/ets/text.d.ts @@ -749,6 +749,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 3428691ecb..2f6b2461ae 100644 --- a/api/@internal/component/ets/text_common.d.ts +++ b/api/@internal/component/ets/text_common.d.ts @@ -2314,6 +2314,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 input method client. * -- Gitee