From ee9cf0ae1409830ffede2570ba8d81589a4037d7 Mon Sep 17 00:00:00 2001 From: xiangyuan6 Date: Tue, 19 Aug 2025 11:21:12 +0800 Subject: [PATCH] TextContentAlign interface Signed-off-by: xiangyuan6 Signed-off-by: xiangyuan6 --- 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 d19c84bd3f..88805fc804 100644 --- a/api/@internal/component/ets/text_common.d.ts +++ b/api/@internal/component/ets/text_common.d.ts @@ -2313,6 +2313,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