diff --git a/api/@internal/component/ets/text_common.d.ts b/api/@internal/component/ets/text_common.d.ts index 3a06c41ef122809dcea7b589e9bcf8cd929fe7e5..4f75e5b57c836c9c5d7f38065ec50c5071632a86 100644 --- a/api/@internal/component/ets/text_common.d.ts +++ b/api/@internal/component/ets/text_common.d.ts @@ -2130,4 +2130,22 @@ declare interface IMEClient { * @since 20 */ nodeId: number; +} + +/** + * Defines text layout options. Use this to set constraints for measure text. + * + * @interface TextLayoutOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +declare interface TextLayoutOptions { + /** + * Text display area of width. + * + * @type { ?LengthMetrics } constraintWidth + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + constraintWidth?: LengthMetrics; } \ No newline at end of file diff --git a/api/@ohos.arkui.UIContext.d.ts b/api/@ohos.arkui.UIContext.d.ts index c4a1bba7a90d72700fd302caf4f7688f811e1a8d..db397035df33c1fa452029df7705c1ae3548d916 100755 --- a/api/@ohos.arkui.UIContext.d.ts +++ b/api/@ohos.arkui.UIContext.d.ts @@ -3049,6 +3049,17 @@ export class MeasureUtils { * @since 12 */ measureTextSize(options: MeasureOptions): SizeOptions; + + /** + * Get layout info of the styled string. + * + * @param { StyledString } styledString - The styled string value. + * @param { TextLayoutOptions } [options] - The layout options. + * @returns { Array } paragraph result + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + getParagraphs(styledString: StyledString, options?: TextLayoutOptions): Array; } /**