From e7c108990ad7b49e06b883007ffe508c083963a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=B0=B8=E5=87=AF?= Date: Tue, 2 Sep 2025 10:33:36 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=9A=E7=94=A8=E5=91=8A=E8=AD=A6=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 刘永凯 --- .../component/ets/styled_string.d.ts | 4 ++- api/arkui/component/styledString.static.d.ets | 27 +++++++++++-------- api/arkui/component/textCommon.static.d.ets | 16 ++++++----- 3 files changed, 28 insertions(+), 19 deletions(-) diff --git a/api/@internal/component/ets/styled_string.d.ts b/api/@internal/component/ets/styled_string.d.ts index 6aa3b2c4b1..54f25c771a 100644 --- a/api/@internal/component/ets/styled_string.d.ts +++ b/api/@internal/component/ets/styled_string.d.ts @@ -1155,7 +1155,9 @@ declare class UrlStyle { * @atomicservice * @since 14 */ -declare type StyledStringValue = TextStyle | DecorationStyle | BaselineOffsetStyle | LetterSpacingStyle | TextShadowStyle | GestureStyle | ImageAttachment | ParagraphStyle | LineHeightStyle | UrlStyle | CustomSpan | UserDataSpan | BackgroundColorStyle; +declare type StyledStringValue = TextStyle | DecorationStyle | BaselineOffsetStyle | LetterSpacingStyle | + TextShadowStyle | GestureStyle | ImageAttachment | ParagraphStyle | + LineHeightStyle | UrlStyle | CustomSpan | UserDataSpan | BackgroundColorStyle; /** * MutableStyledString * diff --git a/api/arkui/component/styledString.static.d.ets b/api/arkui/component/styledString.static.d.ets index 519302f58f..09dd921feb 100644 --- a/api/arkui/component/styledString.static.d.ets +++ b/api/arkui/component/styledString.static.d.ets @@ -20,16 +20,16 @@ */ import { Callback, ShadowOptions, ClickEvent, Optional, PixelMap, AttributeModifier, CommonMethod } from './common'; -import { TextAlign, FontStyle, FontWeight, TextDecorationType, TextDecorationStyle, WordBreak, TextOverflow, ImageFit, ImageSpanAlignment } from "./enums"; -import { ResourceStr, ResourceColor, LengthMetrics, SizeOptions, Margin, Padding, BorderRadiuses, ColorFilter } from "./units"; -import { TextBackgroundStyle } from "./span"; -import { GestureEvent } from "./gesture"; -import { DrawingColorFilter } from "./image"; -import { LeadingMarginPlaceholder } from "./richEditor"; +import { TextAlign, FontStyle, FontWeight, TextDecorationType, TextDecorationStyle, WordBreak, TextOverflow, ImageFit, ImageSpanAlignment } from './enums'; +import { ResourceStr, ResourceColor, LengthMetrics, SizeOptions, Margin, Padding, BorderRadiuses, ColorFilter } from './units'; +import { TextBackgroundStyle } from './span'; +import { GestureEvent } from './gesture'; +import { DrawingColorFilter } from './image'; +import { LeadingMarginPlaceholder } from './richEditor'; import image from '../../@ohos.multimedia.image'; import drawing from '../../@ohos.graphics.drawing'; import { DrawContext } from '../../arkui/Graphics'; -import { memo, ComponentBuilder } from "./../stateManagement/runtime"; +import { memo, ComponentBuilder } from './../stateManagement/runtime'; /** * Defines the StyledStringMarshallingValue Type. @@ -166,7 +166,8 @@ export declare class StyledString { * Returns ArrayBuffer from the serialized styled string. * * @param { StyledString } styledString - StyledString parameter. - * @param { StyledStringMarshallCallback } callback - When marshalling StyledStringMarshingValue, will trigger this callback to get ArrayBuffer + * @param { StyledStringMarshallCallback } callback - When marshalling StyledStringMarshingValue, + * will trigger this callback to get ArrayBuffer * @returns { ArrayBuffer } * @static * @syscap SystemCapability.ArkUI.ArkUI.Full @@ -178,7 +179,8 @@ export declare class StyledString { * Returns StyledString from the deserialized ArrayBuffer. * * @param { ArrayBuffer } buffer - The buffer will be deserialized to a StyledString. - * @param { StyledStringUnmarshallCallback } callback - When unmarshalling ArrayBuffer, will trigger this callback to get StyledStringMarshingValue + * @param { StyledStringUnmarshallCallback } callback - When unmarshalling ArrayBuffer, + * will trigger this callback to get StyledStringMarshingValue * @returns { Promise } * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. @@ -838,7 +840,9 @@ export declare class UrlStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 20 */ -export type StyledStringValue = TextStyle | DecorationStyle | BaselineOffsetStyle | LetterSpacingStyle | TextShadowStyle | GestureStyle | ImageAttachment | ParagraphStyle | LineHeightStyle | UrlStyle | CustomSpan | UserDataSpan | BackgroundColorStyle; +export type StyledStringValue = TextStyle | DecorationStyle | BaselineOffsetStyle | LetterSpacingStyle | + TextShadowStyle | GestureStyle | ImageAttachment | ParagraphStyle | + LineHeightStyle | UrlStyle | CustomSpan | UserDataSpan | BackgroundColorStyle; /** * MutableStyledString * @@ -850,7 +854,8 @@ export declare class MutableStyledString extends StyledString { /** * constructor. * - * @param { string | ImageAttachment | CustomSpan } value - indicates the current object value of the MutableStyledString. + * @param { string | ImageAttachment | CustomSpan } value + * - indicates the current object value of the MutableStyledString. * @param { Array } [styles] - indicates the SpanStyle objects. * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 20 diff --git a/api/arkui/component/textCommon.static.d.ets b/api/arkui/component/textCommon.static.d.ets index dd08c7621b..3769535dcb 100644 --- a/api/arkui/component/textCommon.static.d.ets +++ b/api/arkui/component/textCommon.static.d.ets @@ -17,12 +17,12 @@ * @kit ArkUI * @arkts 1.2 */ -import { ResourceColor, ResourceStr, Length } from "./units"; -import { DecorationStyleInterface, MutableStyledString, StyledString } from "./styledString"; +import { ResourceColor, ResourceStr, Length } from './units'; +import { DecorationStyleInterface, MutableStyledString, StyledString } from './styledString'; import { SelectionOptions, Callback } from './common'; -import { TextDecorationType, TextDecorationStyle } from "./enums"; -import { memo, ComponentBuilder } from "./../stateManagement/runtime"; -import { AttributeModifier, CommonMethod } from "./common"; +import { TextDecorationType, TextDecorationStyle } from './enums'; +import { memo, ComponentBuilder } from './../stateManagement/runtime'; +import { AttributeModifier, CommonMethod } from './common'; /** * Defines the text data detector type. * @@ -292,11 +292,13 @@ export type OnDidChangeCallback = (rangeBefore: TextRange, rangeAfter: TextRange * @typedef { function } EditableTextOnChangeCallback * @param { string } value - Value of body text, without previewText value. * @param { PreviewText } [previewText] - info of previewText, contains previewText value and start index. - * @param { TextChangeOptions } [options] - contains the selection range before and after the change, as well as the old content. + * @param { TextChangeOptions } [options] - contains the selection range before and after the change, + * as well as the old content. * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 20 */ -export type EditableTextOnChangeCallback = (value: string, previewText?: PreviewText, options?: TextChangeOptions) => void; +export type EditableTextOnChangeCallback = + (value: string, previewText?: PreviewText, options?: TextChangeOptions) => void; /** * Define the text selection controller. * -- Gitee