diff --git a/api/@internal/component/ets/styled_string.d.ts b/api/@internal/component/ets/styled_string.d.ts index 45b24924e6438a393e4488cffbdc635ad2c0f80c..0cb19daf8f2d7e09619d6788a5721f4083332767 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. *