From c64729a68e19b6735047e68bf7fccba6f0e50c77 Mon Sep 17 00:00:00 2001 From: liuyongkai2 Date: Mon, 8 Sep 2025 10:27:09 +0800 Subject: [PATCH] =?UTF-8?q?text=E5=B1=9E=E6=80=A7=E5=AD=97=E7=AC=A6?= =?UTF-8?q?=E4=B8=B2=E6=94=AF=E6=8C=81=E5=88=97=E8=A1=A8=E6=AE=B5=E8=90=BD?= =?UTF-8?q?=E7=BC=A9=E8=BF=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liuyongkai2 --- .../component/ets/styled_string.d.ts | 96 +++++++++++++++++++ 1 file changed, 96 insertions(+) diff --git a/api/@internal/component/ets/styled_string.d.ts b/api/@internal/component/ets/styled_string.d.ts index 45b24924e6..0cb19daf8f 100644 --- a/api/@internal/component/ets/styled_string.d.ts +++ b/api/@internal/component/ets/styled_string.d.ts @@ -903,6 +903,68 @@ declare class TextShadowStyle { * @arkts 1.1&1.2 */ readonly textShadow: Array; +}} + +/** + * Defines CustomSpan. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 21 + */ +declare abstract class LeadingMarginSpan { + /** + * Draw the custom span. + * + * @param { DrawContext } context + * @param { LeadingMarginSpanDrawInfo } drawInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 21 + */ + abstract onDraw(context: DrawContext, drawInfo: LeadingMarginSpanDrawInfo): void; + /** + * Get the literal content of the StyledString. + * + * @returns { LengthMetrics } - the literal content of the StyledString + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 21 + */ + abstract getLeadingMargin(): LengthMetrics; +} + +/** + * Defines leadingMargin text direction. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ +declare enum LeadingMarginTextDirection { + /** + * Left to right. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 21 + */ + Ltr, + /** + * Right to left. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 21 + */ + Rtl } /** @@ -1049,6 +1111,29 @@ declare class ParagraphStyle { */ readonly textAlign?: TextAlign; + /** + * Get the leading margin of the StyledString. + * + * @type { ?(number | LeadingMarginPlaceholder) } - the leading margin of the StyledString or undefined + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + readonly leadingMargin?: number | LeadingMarginPlaceholder; + /** + * Get the leading margin of the StyledString. + * + * @type { ?(number | LeadingMarginPlaceholder | LeadingMarginSpan) } - the leading margin of the StyledString or undefined + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 21 + */ + readonly leadingMargin?: LeadingMarginSpan; + /** * Get the text vertical alignment of the StyledString. * @@ -1236,6 +1321,17 @@ declare interface ParagraphStyleInterface { */ leadingMargin?: LengthMetrics | LeadingMarginPlaceholder; + /** + * Leading margin. + * + * @type { ?(LengthMetrics | LeadingMarginPlaceholder | LeadingMarginSpan) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 21 + */ + leadingMargin?: LeadingMarginSpan; + /** * Set the paragraph spacing of the StyledString. * -- Gitee