diff --git a/api/@internal/component/ets/styled_string.d.ts b/api/@internal/component/ets/styled_string.d.ts index 78895aa8a46502aa794bb901c00d6555f7865d35..6aa3b2c4b1901f13fbc9e37c2fa4c5985c79cd4b 100644 --- a/api/@internal/component/ets/styled_string.d.ts +++ b/api/@internal/component/ets/styled_string.d.ts @@ -12,25 +12,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - /** * @file * @kit ArkUI */ - -/*** if arkts 1.2 */ -import { Callback, ShadowOptions, ClickEvent, Optional, PixelMap } 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 image from '../../@ohos.multimedia.image'; -import drawing from '../../@ohos.graphics.drawing'; -import { DrawContext } from '../../arkui/Graphics'; -/*** endif */ - /** * Defines the StyledStringMarshallingValue Type. * @@ -39,12 +24,9 @@ import { DrawContext } from '../../arkui/Graphics'; * @systemapi * @crossplatform * @atomicservice - * @since arkts {'1.1':'19','1.2':'20'} - * @arkts 1.1&1.2 + * @since 19 */ declare type StyledStringMarshallingValue = UserDataSpan; - - /** * Defines the callback type used in marshalling. * @@ -55,11 +37,9 @@ declare type StyledStringMarshallingValue = UserDataSpan; * @systemapi * @crossplatform * @atomicservice - * @since arkts {'1.1':'19','1.2':'20'} - * @arkts 1.1&1.2 + * @since 19 */ declare type StyledStringMarshallCallback = (marshallableVal: StyledStringMarshallingValue) => ArrayBuffer; - /** * Defines the callback type used in unmarshalling. * @@ -70,19 +50,16 @@ declare type StyledStringMarshallCallback = (marshallableVal: StyledStringMarsha * @systemapi * @crossplatform * @atomicservice - * @since arkts {'1.1':'19','1.2':'20'} - * @arkts 1.1&1.2 + * @since 19 */ declare type StyledStringUnmarshallCallback = (buf: ArrayBuffer) => StyledStringMarshallingValue; - /** * StyledString * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare class StyledString { /** @@ -93,11 +70,9 @@ declare class StyledString { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ constructor(value: string | ImageAttachment | CustomSpan, styles?: Array); - /** * Get the length of the StyledString's characters. * @@ -106,11 +81,9 @@ declare class StyledString { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ readonly length: number; - /** * Get the literal content of the StyledString. * @@ -118,11 +91,9 @@ declare class StyledString { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ getString(): string; - /** * Get the attribute objects of the subStyledString. * @@ -130,18 +101,16 @@ declare class StyledString { * @param { number } length - the length of the subStyledString's characters. * @param { StyledStringKey } [styledKey] - the specified type. * @returns { Array } - * @throws { BusinessError } 401 - Parameter error. Possible causes: + * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ getStyles(start: number, length: number, styledKey?: StyledStringKey): Array; - /** * Judge if two attribute strings are equal. * @@ -150,63 +119,55 @@ declare class StyledString { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ equals(other: StyledString): boolean; - /** * Get the substring of the StyledString. * * @param { number } start - the start position of the subStyledString. * @param { number } [length] - the length of the subStyledString's characters. * @returns { StyledString } - * @throws { BusinessError } 401 - Parameter error. Possible causes: + * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ subStyledString(start: number, length?: number): StyledString; - /** * Returns StyledString from the provided HTML string. * * @param { string } html - the html text will be converted to a StyledString. * @returns { Promise } - * @throws { BusinessError } 401 - Parameter error. Possible causes: + * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 170001 - Convert Error. * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ static fromHtml(html: string): Promise; - /** * Returns HTML string from the provided StyledString. * * @param { StyledString } styledString - the StyledString will be converted to a HTML string. * @returns { string } Returns the HTML string converted from the provided StyledString. - * @throws { BusinessError } 401 - Parameter error. Possible causes: + * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'14','1.2':'20'} - * @arkts 1.1&1.2 + * @since 14 */ static toHtml(styledString: StyledString): string; - /** * Returns ArrayBuffer from the serialized styled string. * @@ -215,11 +176,9 @@ declare class StyledString { * @returns { ArrayBuffer } * @syscap SystemCapability.ArkUI.ArkUI.Full * @systemapi - * @since arkts {'1.1':'19','1.2':'20'} - * @arkts 1.1&1.2 + * @since 19 */ static marshalling(styledString: StyledString, callback: StyledStringMarshallCallback): ArrayBuffer; - /** * Returns StyledString from the deserialized ArrayBuffer. * @@ -233,11 +192,9 @@ declare class StyledString { * @throws { BusinessError } 170002 - Styled string decode error. * @syscap SystemCapability.ArkUI.ArkUI.Full * @systemapi - * @since arkts {'1.1':'19','1.2':'20'} - * @arkts 1.1&1.2 + * @since 19 */ static unmarshalling(buffer: ArrayBuffer, callback: StyledStringUnmarshallCallback): Promise; - /** * Returns ArrayBuffer from the serialized styled string. * @@ -245,29 +202,25 @@ declare class StyledString { * @returns { ArrayBuffer } * @syscap SystemCapability.ArkUI.ArkUI.Full * @systemapi - * @since arkts {'1.1':'13','1.2':'20'} - * @arkts 1.1&1.2 + * @since 13 */ static marshalling(styledString: StyledString): ArrayBuffer; - /** * Returns StyledString from the deserialized ArrayBuffer. * * @param { ArrayBuffer } buffer - The buffer will be deserialized to a StyledString. * @returns { Promise } - * @throws { BusinessError } 401 - Parameter error. Possible causes: + * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @throws { BusinessError } 170002 - Styled string decode error. * @syscap SystemCapability.ArkUI.ArkUI.Full * @systemapi - * @since arkts {'1.1':'13','1.2':'20'} - * @arkts 1.1&1.2 + * @since 13 */ static unmarshalling(buffer: ArrayBuffer): Promise; } - /** * StyleOptions * @@ -275,34 +228,29 @@ declare class StyledString { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare interface StyleOptions { /** * The start position of the StyleOptions. * - * @type { ?int } + * @type { ?number } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ - start?: int; - + start?: number; /** * The length of the modifiedStyledString's characters. * - * @type { ?int } + * @type { ?number } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ - length?: int; - + length?: number; /** * The attribute key of the StyleOptions. * @@ -310,11 +258,9 @@ declare interface StyleOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ styledKey: StyledStringKey; - /** * The attribute value of the StyleOptions. * @@ -322,12 +268,10 @@ declare interface StyleOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ styledValue: StyledStringValue; } - /** * SpanStyle * @@ -335,8 +279,7 @@ declare interface StyleOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare interface SpanStyle { /** @@ -346,11 +289,9 @@ declare interface SpanStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ start: number; - /** * The length of the modifiedStyledString's characters. * @@ -358,11 +299,9 @@ declare interface SpanStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ length: number; - /** * The attribute key of the SpanStyle. * @@ -370,11 +309,9 @@ declare interface SpanStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ styledKey: StyledStringKey; - /** * The attribute value of the SpanStyle. * @@ -382,23 +319,19 @@ declare interface SpanStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ styledValue: StyledStringValue; } - /** * Defines TextStyle. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare class TextStyle { - /** * constructor. * @@ -406,11 +339,9 @@ declare class TextStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ constructor(value?: TextStyleInterface); - /** * Get the fontColor of the StyledString. * @@ -419,11 +350,9 @@ declare class TextStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ readonly fontColor?: ResourceColor; - /** * Get the fontFamily of the StyledString. * @@ -432,11 +361,9 @@ declare class TextStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ readonly fontFamily?: string; - /** * Get the fontSize of the StyledString. * If not undefined, the unit is vp. @@ -446,11 +373,9 @@ declare class TextStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ readonly fontSize?: number; - /** * Get the fontWeight of the StyledString. * @@ -459,11 +384,9 @@ declare class TextStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ readonly fontWeight?: number; - /** * Get the fontStyle of the StyledString. * @@ -472,11 +395,9 @@ declare class TextStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ readonly fontStyle?: FontStyle; - /** * Get the stroke width of the StyledString with the unit 'vp'. * @@ -488,7 +409,6 @@ declare class TextStyle { * @since 20 */ readonly strokeWidth?: number; - /** * Get the stroke color of the StyledString. * @@ -500,7 +420,6 @@ declare class TextStyle { * @since 20 */ readonly strokeColor?: ResourceColor; - /** * Get the superscript style of the StyledString. * @@ -513,7 +432,6 @@ declare class TextStyle { */ readonly superscript?: SuperscriptStyle; } - /** * TextStyleInterface * @@ -521,8 +439,7 @@ declare class TextStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare interface TextStyleInterface { /** @@ -532,11 +449,9 @@ declare interface TextStyleInterface { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ fontColor?: ResourceColor; - /** * The fontFamily value of the font property object. * @@ -544,11 +459,9 @@ declare interface TextStyleInterface { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ fontFamily?: ResourceStr; - /** * The fontSize value of the font property object. * @@ -556,11 +469,9 @@ declare interface TextStyleInterface { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ fontSize?: LengthMetrics; - /** * The fontWeight value of the font property object. * @@ -568,11 +479,9 @@ declare interface TextStyleInterface { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ fontWeight?: number | FontWeight | string; - /** * The fontStyle value of the font property object. * @@ -580,11 +489,9 @@ declare interface TextStyleInterface { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ fontStyle?: FontStyle; - /** * The stroke width of the text. * @@ -595,7 +502,6 @@ declare interface TextStyleInterface { * @since 20 */ strokeWidth?: LengthMetrics; - /** * The stroke color of the text. * @@ -606,7 +512,6 @@ declare interface TextStyleInterface { * @since 20 */ strokeColor?: ResourceColor; - /** * The superscript value of the font property object. * @@ -618,7 +523,6 @@ declare interface TextStyleInterface { */ superscript?: SuperscriptStyle; } - /** * Defines DecorationOptions for Decoration. * @@ -640,18 +544,15 @@ declare interface DecorationOptions { */ enableMultiType?: boolean; } - /** * Defines DecorationStyle. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare class DecorationStyle { - /** * constructor. * @@ -659,11 +560,9 @@ declare class DecorationStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ constructor(value: DecorationStyleInterface); - /** * constructor. * @@ -675,7 +574,6 @@ declare class DecorationStyle { * @since 20 */ constructor(value: DecorationStyleInterface, options?: DecorationOptions); - /** * Get the text decoration type of the StyledString. * @@ -684,11 +582,9 @@ declare class DecorationStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ readonly type: TextDecorationType; - /** * Get the decorationColor of the StyledString. * @@ -697,11 +593,9 @@ declare class DecorationStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ readonly color?: ResourceColor; - /** * Get the decorationStyle of the StyledString. * @@ -710,11 +604,9 @@ declare class DecorationStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ readonly style?: TextDecorationStyle; - /** * Get the thickness scale of the StyledString. * @@ -726,7 +618,6 @@ declare class DecorationStyle { * @since 20 */ readonly thicknessScale?: number; - /** * Get the DecorationOptions of the StyledString. * @@ -739,7 +630,6 @@ declare class DecorationStyle { */ readonly options?: DecorationOptions; } - /** * DecorationStyleInterface * @@ -747,8 +637,7 @@ declare class DecorationStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare interface DecorationStyleInterface { /** @@ -758,11 +647,9 @@ declare interface DecorationStyleInterface { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ type: TextDecorationType; - /** * The color value of the decoration property object. * @@ -770,11 +657,9 @@ declare interface DecorationStyleInterface { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ color?: ResourceColor; - /** * The style value of the decoration property object. * @@ -782,11 +667,9 @@ declare interface DecorationStyleInterface { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ style?: TextDecorationStyle; - /** * The thickness scale of the decoration * @@ -798,18 +681,15 @@ declare interface DecorationStyleInterface { */ thicknessScale?: number; } - /** * Defines BaselineOffsetStyle. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare class BaselineOffsetStyle { - /** * constructor. * @@ -817,11 +697,9 @@ declare class BaselineOffsetStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ constructor(value: LengthMetrics); - /** * Get the baselineOffset value of the StyledString. * The unit is vp. @@ -831,23 +709,19 @@ declare class BaselineOffsetStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ readonly baselineOffset: number; } - /** * Defines LetterSpacingStyle. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare class LetterSpacingStyle { - /** * constructor. * @@ -855,37 +729,31 @@ declare class LetterSpacingStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ constructor(value: LengthMetrics); - /** * Get the letterSpacing value of the StyledString. * The unit is vp. - * + * * @type { number } - the letterSpacing value of the StyledString * @readonly * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ readonly letterSpacing: number; } - /** * Defines TextShadowStyle. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare class TextShadowStyle { - /** * constructor. * @@ -893,11 +761,9 @@ declare class TextShadowStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ constructor(value: ShadowOptions | Array); - /** * Get the textShadow value of the StyledString. * @@ -906,23 +772,19 @@ declare class TextShadowStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ readonly textShadow: Array; } - /** * Defines Sets the property string background color. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'14','1.2':'20'} - * @arkts 1.1&1.2 + * @since 14 */ declare class BackgroundColorStyle { - /** * constructor. * @@ -930,11 +792,9 @@ declare class BackgroundColorStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'14','1.2':'20'} - * @arkts 1.1&1.2 + * @since 14 */ constructor(textBackgroundStyle: TextBackgroundStyle); - /** * Get the textBackgroundStyle value of the StyledString. * @@ -943,23 +803,19 @@ declare class BackgroundColorStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'14','1.2':'20'} - * @arkts 1.1&1.2 + * @since 14 */ readonly textBackgroundStyle: TextBackgroundStyle; } - /** * Defines GestureStyle. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare class GestureStyle { - /** * constructor. * @@ -967,12 +823,10 @@ declare class GestureStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ constructor(value?: GestureStyleInterface); } - /** * Defines the Gesture Events. * @@ -980,8 +834,7 @@ declare class GestureStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare interface GestureStyleInterface { /** @@ -991,11 +844,9 @@ declare interface GestureStyleInterface { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ onClick?: Callback; - /** * Trigger a gesture event when long press event is complete. * @@ -1003,11 +854,9 @@ declare interface GestureStyleInterface { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ onLongPress?: Callback; - /** * Trigger a touch event when touched. * @@ -1019,18 +868,15 @@ declare interface GestureStyleInterface { */ onTouch?: Callback; } - /** * Defines ParagraphStyle. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare class ParagraphStyle { - /** * constructor. * @@ -1038,11 +884,9 @@ declare class ParagraphStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ constructor(value?: ParagraphStyleInterface); - /** * Get the text alignment of the StyledString. * @@ -1051,11 +895,9 @@ declare class ParagraphStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ readonly textAlign?: TextAlign; - /** * Get the text vertical alignment of the StyledString. * @@ -1067,7 +909,6 @@ declare class ParagraphStyle { * @since 20 */ readonly textVerticalAlign?: TextVerticalAlign; - /** * Get the first line indentation of the StyledString. * The unit is vp. @@ -1077,11 +918,9 @@ declare class ParagraphStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ readonly textIndent?: number; - /** * Get the maximum number of lines of the StyledString. * @@ -1090,11 +929,9 @@ declare class ParagraphStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ readonly maxLines?: number; - /** * Get the overflow mode of the StyledString. * @@ -1103,11 +940,9 @@ declare class ParagraphStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ readonly overflow?: TextOverflow; - /** * Get the wordBreak mode of the StyledString. * @@ -1116,11 +951,9 @@ declare class ParagraphStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ readonly wordBreak?: WordBreak; - /** * Get the leading margin of the StyledString. * @@ -1129,11 +962,9 @@ declare class ParagraphStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ readonly leadingMargin?: number | LeadingMarginPlaceholder; - /** * Get the paragraph spacing of the StyledString. * The unit is vp. @@ -1143,12 +974,10 @@ declare class ParagraphStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'19','1.2':'20'} - * @arkts 1.1&1.2 + * @since 19 */ readonly paragraphSpacing?: number; } - /** * ParagraphStyleInterface * @@ -1156,8 +985,7 @@ declare class ParagraphStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare interface ParagraphStyleInterface { /** @@ -1167,11 +995,9 @@ declare interface ParagraphStyleInterface { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ textAlign?: TextAlign; - /** * Vertical alignment of text. * @@ -1182,7 +1008,6 @@ declare interface ParagraphStyleInterface { * @since 20 */ textVerticalAlign?: TextVerticalAlign; - /** * Set the first line indentation. * @@ -1190,11 +1015,9 @@ declare interface ParagraphStyleInterface { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ textIndent?: LengthMetrics; - /** * The maximum number of lines of content. * @@ -1202,11 +1025,9 @@ declare interface ParagraphStyleInterface { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ maxLines?: number; - /** * The overflow mode of the content. * @@ -1214,11 +1035,9 @@ declare interface ParagraphStyleInterface { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ overflow?: TextOverflow; - /** * Set word break type. * @@ -1226,11 +1045,9 @@ declare interface ParagraphStyleInterface { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ wordBreak?: WordBreak; - /** * Leading margin. * @@ -1238,11 +1055,9 @@ declare interface ParagraphStyleInterface { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ leadingMargin?: LengthMetrics | LeadingMarginPlaceholder; - /** * Set the paragraph spacing of the StyledString. * @@ -1250,23 +1065,19 @@ declare interface ParagraphStyleInterface { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'19','1.2':'20'} - * @arkts 1.1&1.2 + * @since 19 */ paragraphSpacing?: LengthMetrics; } - /** * Defines LineHeightStyle. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare class LineHeightStyle { - /** * constructor. * @@ -1274,26 +1085,22 @@ declare class LineHeightStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ constructor(lineHeight: LengthMetrics); - /** * Get the lineHeight value of the StyledString. * The unit is vp. - * + * * @type { number } - the lineHeight value of the StyledString * @readonly * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ readonly lineHeight: number; } - /** * Defines the URLStyle hyperlink that allows setting a URL string. When clicking on the text to * which the span is attached, the URLStyle will try to open the URL. @@ -1301,11 +1108,9 @@ declare class LineHeightStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'14','1.2':'20'} - * @arkts 1.1&1.2 + * @since 14 */ declare class UrlStyle { - /** * Constructor. * @@ -1313,11 +1118,9 @@ declare class UrlStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'14','1.2':'20'} - * @arkts 1.1&1.2 + * @since 14 */ constructor(url: string); - /** * Get the URL value of the StyledString. * @@ -1326,12 +1129,10 @@ declare class UrlStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'14','1.2':'20'} - * @arkts 1.1&1.2 + * @since 14 */ readonly url: string; } - /** * Defines the Span Type. * @@ -1343,7 +1144,6 @@ declare class UrlStyle { * @atomicservice * @since 12 */ - /** * Defines the Span Type. * @@ -1353,13 +1153,9 @@ declare class UrlStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'14','1.2':'20'} - * @arkts 1.1&1.2 + * @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 * @@ -1367,91 +1163,69 @@ UserDataSpan | BackgroundColorStyle; * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare class MutableStyledString extends StyledString { - /** - * constructor. - * - * @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 - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - constructor(value: string | ImageAttachment | CustomSpan, styles?: Array); - /** * Replace the string of the specified range. * * @param { number } start - the start position of the replacedString. * @param { number } length - the length of the replacedString's characters. * @param { string } other - must be unicode string. - * @throws { BusinessError } 401 - Parameter error. Possible causes: + * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ replaceString(start: number, length: number, other: string): void; - /** * Insert the string at the specified location. * * @param { number } start - the start position of the insertedString. * @param { string } other - must be unicode string. - * @throws { BusinessError } 401 - Parameter error. Possible causes: + * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ insertString(start: number, other: string): void; - /** * Remove the string of the specified range. * * @param { number } start - the start position of the removedString. * @param { number } length - the length of the removedString's characters. - * @throws { BusinessError } 401 - Parameter error. Possible causes: + * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ removeString(start: number, length: number): void; - /** * Replace the specified range string attribute. * * @param { SpanStyle } spanStyle - the SpanStyle Object. - * @throws { BusinessError } 401 - Parameter error. Possible causes: + * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ replaceStyle(spanStyle: SpanStyle): void; - /** * Add attributes to the specified range string. * @@ -1460,92 +1234,80 @@ declare class MutableStyledString extends StyledString { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ setStyle(spanStyle: SpanStyle): void; - /** * Delete the specified type attributes for the specified range string. * * @param { number } start - the start position of the removedAttributeStyledString. * @param { number } length - the length of the removedAttributeStyledString's characters. * @param { StyledStringKey } styledKey - the specified attribute type's key. - * @throws { BusinessError } 401 - Parameter error. Possible causes: + * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ removeStyle(start: number, length: number, styledKey: StyledStringKey): void; - /** * Delete all attributes for the specified range styledString. * * @param { number } start - the start position of the attributeRemovedStyledString's characters. * @param { number } length - the length of the attributeRemovedStyledString's characters. - * @throws { BusinessError } 401 - Parameter error. Possible causes: + * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ removeStyles(start: number, length: number): void; - /** * Delete all attributes. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ clearStyles(): void; - /** * Replace the StyledString of the specified range. * * @param { number } start - the start position of the replacedStyledString. * @param { number } length - the length of the replacedStyledString's characters. * @param { StyledString } other - new StyledString. - * @throws { BusinessError } 401 - Parameter error. Possible causes: + * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ replaceStyledString(start: number, length: number, other: StyledString): void; - /** * Insert new StyledString at the specified location. * * @param { number } start - the start position of the insertedStyledString. * @param { StyledString } other - new StyledString. - * @throws { BusinessError } 401 - Parameter error. Possible causes: + * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameters types. *
3. Parameter verification failed. * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ insertStyledString(start: number, other: StyledString): void; - /** * Append new StyledString at the end. * @@ -1553,13 +1315,10 @@ declare class MutableStyledString extends StyledString { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ appendStyledString(other: StyledString): void; } - - /** * the attribute type of the StyledString * @@ -1567,8 +1326,7 @@ declare class MutableStyledString extends StyledString { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare enum StyledStringKey { /** @@ -1577,155 +1335,127 @@ declare enum StyledStringKey { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ FONT = 0, - /** * The key of DecorationStyle. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 - */ - DECORATION = 1, - - /** - * The key of BaselineOffsetStyle. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 - */ - BASELINE_OFFSET = 2, - - /** - * The key of LetterSpacingStyle. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 - */ - LETTER_SPACING = 3, - - /** - * The key of TextShadowStyle. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 - */ - TEXT_SHADOW = 4, - - /** - * The key of LineHeightStyle. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 - */ - LINE_HEIGHT = 5, - - /** - * The key of BackgroundColorStyle. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since arkts {'1.1':'14','1.2':'20'} - * @arkts 1.1&1.2 - */ - BACKGROUND_COLOR = 6, - - /** - * The key of UrlStyle. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since arkts {'1.1':'14','1.2':'20'} - * @arkts 1.1&1.2 - */ - URL = 7, - + * @since 12 + */ + DECORATION = 1, + /** + * The key of BaselineOffsetStyle. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + BASELINE_OFFSET = 2, + /** + * The key of LetterSpacingStyle. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + LETTER_SPACING = 3, + /** + * The key of TextShadowStyle. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + TEXT_SHADOW = 4, + /** + * The key of LineHeightStyle. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 12 + */ + LINE_HEIGHT = 5, + /** + * The key of BackgroundColorStyle. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + BACKGROUND_COLOR = 6, + /** + * The key of UrlStyle. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 14 + */ + URL = 7, /** * The key of GestureStyle. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ GESTURE = 100, - /** * The key of ParagraphStyle. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ PARAGRAPH_STYLE = 200, - /** * The key of ImageAttachment. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ IMAGE = 300, - /** * The key of CustomSpan. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ CUSTOM_SPAN = 400, - /** * The key of UserDataSpan. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ - USER_DATA = 500, + USER_DATA = 500 } - /** * Defines ImageAttachment. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare class ImageAttachment { - /** * constructor. * @@ -1736,7 +1466,6 @@ declare class ImageAttachment { * @since 12 */ constructor(value: ImageAttachmentInterface); - /** * constructor supported by AttachmentType. * @@ -1747,19 +1476,6 @@ declare class ImageAttachment { * @since 15 */ constructor(attachment: Optional); - - /** - * constructor supported by AttachmentType. - * - * @param { ImageAttachmentInterface | Optional } attachment - image attachment object. - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - constructor(value: ImageAttachmentInterface | Optional); - /** * Get the image content of the StyledString. * @@ -1768,11 +1484,9 @@ declare class ImageAttachment { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ readonly value: PixelMap; - /** * Get the imageSize of the StyledString. * @@ -1781,11 +1495,9 @@ declare class ImageAttachment { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ readonly size?: SizeOptions; - /** * Get the ImageSpanAlignment of the StyledString. * @@ -1794,11 +1506,9 @@ declare class ImageAttachment { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ readonly verticalAlign?: ImageSpanAlignment; - /** * Get the imageFit of the StyledString. * @@ -1807,11 +1517,9 @@ declare class ImageAttachment { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ readonly objectFit?: ImageFit; - /** * Get the imageAttachmentLayoutStyle of the StyledString. * @@ -1820,11 +1528,9 @@ declare class ImageAttachment { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ readonly layoutStyle?: ImageAttachmentLayoutStyle; - /** * Get the imageAttachment colorFilter of the StyledString. * @@ -1833,12 +1539,10 @@ declare class ImageAttachment { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'15','1.2':'20'} - * @arkts 1.1&1.2 + * @since 15 */ readonly colorFilter?: ColorFilterType; } - /** * Defines the ResourceImageAttachmentOptions. * @@ -1846,8 +1550,7 @@ declare class ImageAttachment { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'15','1.2':'20'} - * @arkts 1.1&1.2 + * @since 15 */ declare interface ResourceImageAttachmentOptions { /** @@ -1857,11 +1560,9 @@ declare interface ResourceImageAttachmentOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'15','1.2':'20'} - * @arkts 1.1&1.2 + * @since 15 */ resourceValue: Optional; - /** * size of the ResourceImage. * @@ -1869,11 +1570,9 @@ declare interface ResourceImageAttachmentOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'15','1.2':'20'} - * @arkts 1.1&1.2 + * @since 15 */ size?: SizeOptions; - /** * Image vertical align. * @@ -1881,11 +1580,9 @@ declare interface ResourceImageAttachmentOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'15','1.2':'20'} - * @arkts 1.1&1.2 + * @since 15 */ verticalAlign?: ImageSpanAlignment; - /** * Sets the zoom type of the ImageAttachment. * @@ -1893,11 +1590,9 @@ declare interface ResourceImageAttachmentOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'15','1.2':'20'} - * @arkts 1.1&1.2 + * @since 15 */ objectFit?: ImageFit; - /** * The Image Layout Style of the Resource Image. * @@ -1905,11 +1600,9 @@ declare interface ResourceImageAttachmentOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'15','1.2':'20'} - * @arkts 1.1&1.2 + * @since 15 */ layoutStyle?: ImageAttachmentLayoutStyle; - /** * Sets the color filter effect on the image attachment. * @@ -1917,11 +1610,9 @@ declare interface ResourceImageAttachmentOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'15','1.2':'20'} - * @arkts 1.1&1.2 + * @since 15 */ colorFilter?: ColorFilterType; - /** * Sets the synchronous or asynchronous mode for image loading. * The default parameter type is bool, and the default value is false. @@ -1930,12 +1621,10 @@ declare interface ResourceImageAttachmentOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'15','1.2':'20'} - * @arkts 1.1&1.2 + * @since 15 */ syncLoad?: boolean; } - /** * Defines the ImageAttachmentInterface. * @@ -1943,8 +1632,7 @@ declare interface ResourceImageAttachmentOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare interface ImageAttachmentInterface { /** @@ -1954,11 +1642,9 @@ declare interface ImageAttachmentInterface { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ value: PixelMap; - /** * Image size. * @@ -1966,11 +1652,9 @@ declare interface ImageAttachmentInterface { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ size?: SizeOptions; - /** * Image vertical align. * @@ -1978,11 +1662,9 @@ declare interface ImageAttachmentInterface { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ verticalAlign?: ImageSpanAlignment; - /** * Image fit. * @@ -1990,11 +1672,9 @@ declare interface ImageAttachmentInterface { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ objectFit?: ImageFit; - /** * The Image Layout Style. * @@ -2002,11 +1682,9 @@ declare interface ImageAttachmentInterface { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ layoutStyle?: ImageAttachmentLayoutStyle; - /** * Sets the color filter effect on the image attachment. * @@ -2014,12 +1692,10 @@ declare interface ImageAttachmentInterface { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'15','1.2':'20'} - * @arkts 1.1&1.2 + * @since 15 */ colorFilter?: ColorFilterType; } - /** * Defines the Attachment Type. * @@ -2027,11 +1703,9 @@ declare interface ImageAttachmentInterface { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'15','1.2':'20'} - * @arkts 1.1&1.2 + * @since 15 */ declare type AttachmentType = ImageAttachmentInterface | ResourceImageAttachmentOptions; - /** * Defines the ColorFilter Type. * @@ -2039,11 +1713,9 @@ declare type AttachmentType = ImageAttachmentInterface | ResourceImageAttachment * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'15','1.2':'20'} - * @arkts 1.1&1.2 + * @since 15 */ declare type ColorFilterType = ColorFilter | DrawingColorFilter; - /** * Defines the ImageAttachment Layout Style. * @@ -2051,8 +1723,7 @@ declare type ColorFilterType = ColorFilter | DrawingColorFilter; * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare interface ImageAttachmentLayoutStyle { /** @@ -2062,11 +1733,9 @@ declare interface ImageAttachmentLayoutStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ margin?: LengthMetrics | Margin; - /** * Inner margin. * @@ -2074,11 +1743,9 @@ declare interface ImageAttachmentLayoutStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ padding?: LengthMetrics | Padding; - /** * Border radius. * @@ -2086,12 +1753,10 @@ declare interface ImageAttachmentLayoutStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ borderRadius?: LengthMetrics | BorderRadiuses; } - /** * Defines the CustomSpanMetrics interface. * @@ -2099,8 +1764,7 @@ declare interface ImageAttachmentLayoutStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare interface CustomSpanMetrics { /** @@ -2112,11 +1776,9 @@ declare interface CustomSpanMetrics { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ width: number; - /** * CustomSpan Height. * The unit is vp. @@ -2125,12 +1787,10 @@ declare interface CustomSpanMetrics { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ height?: number; } - /** * Defines the CustomSpanDrawInfo interface. * @@ -2138,63 +1798,54 @@ declare interface CustomSpanMetrics { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare interface CustomSpanDrawInfo { /** * CustomSpan's offset relative to the parent component. * The unit is px. - * + * * @type { number } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ x: number; - /** * The top position of the line where customSpan is located. * The unit is px. - * + * * @type { number } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ lineTop: number; - /** * The bottom position of the line where customSpan is located. * The unit is px. - * + * * @type { number } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ lineBottom: number; - /** * The baseline offset of the line where customSpan is located. * The unit is px. - * + * * @type { number } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ baseline: number; } - /** * Defines the CustomSpanMeasureInfo interface. * @@ -2202,32 +1853,28 @@ declare interface CustomSpanDrawInfo { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare interface CustomSpanMeasureInfo { /** * Current component's fontSize value. * The unit is fp. - * + * * @type { number } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ fontSize: number; } - /** * Defines CustomSpan. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare abstract class CustomSpan { /** @@ -2238,11 +1885,9 @@ declare abstract class CustomSpan { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ - abstract onMeasure(measureInfo: CustomSpanMeasureInfo) : CustomSpanMetrics; - + abstract onMeasure(measureInfo: CustomSpanMeasureInfo): CustomSpanMetrics; /** * Draw the custom span. * @@ -2251,30 +1896,26 @@ declare abstract class CustomSpan { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ abstract onDraw(context: DrawContext, drawInfo: CustomSpanDrawInfo): void; - /** * Invalidate all components that use the object, which will cause a re-render of all components. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'13','1.2':'20'} - * @arkts 1.1&1.2 + * @since 13 */ invalidate(): void; } - /** * Defines UserDataSpan. Used to store and obtain user data. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ -declare abstract class UserDataSpan {} +declare abstract class UserDataSpan { +} diff --git a/api/@internal/component/ets/text_common.d.ts b/api/@internal/component/ets/text_common.d.ts index 648c2676fd46995bbff903081d492554a5169895..4f75e5b57c836c9c5d7f38065ec50c5071632a86 100644 --- a/api/@internal/component/ets/text_common.d.ts +++ b/api/@internal/component/ets/text_common.d.ts @@ -18,13 +18,6 @@ * @kit ArkUI */ -/*** if arkts 1.2 */ -import { ResourceColor, ResourceStr, Length } from './units'; -import { DecorationStyleInterface, MutableStyledString, StyledString } from './styled_string'; -import { SelectionOptions, Callback } from './common'; -import { TextDecorationType, TextDecorationStyle } from './enums'; -/*** endif */ - /** * Defines the text data detector type. * @@ -38,8 +31,7 @@ import { TextDecorationType, TextDecorationStyle } from './enums'; * @enum { number } * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare enum TextDataDetectorType { /** @@ -53,8 +45,7 @@ declare enum TextDataDetectorType { * * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ PHONE_NUMBER = 0, @@ -69,8 +60,7 @@ declare enum TextDataDetectorType { * * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ URL = 1, @@ -85,8 +75,7 @@ declare enum TextDataDetectorType { * * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ EMAIL = 2, @@ -101,8 +90,7 @@ declare enum TextDataDetectorType { * * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ ADDRESS = 3, @@ -111,8 +99,7 @@ declare enum TextDataDetectorType { * * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ DATE_TIME = 4, } @@ -130,8 +117,7 @@ declare enum TextDataDetectorType { * @interface TextDataDetectorConfig * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare interface TextDataDetectorConfig { /** @@ -147,8 +133,7 @@ declare interface TextDataDetectorConfig { * @type { TextDataDetectorType[] } * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ types: TextDataDetectorType[] @@ -168,24 +153,14 @@ declare interface TextDataDetectorConfig { * @since 12 */ onDetectResultUpdate?: (result: string) => void - /** - * Text data detect result callback. - * - * @type { ?Callback } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - onDetectResultUpdate?: Callback + /** * The color of AI entity. * * @type { ?ResourceColor } * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ color?: ResourceColor, @@ -195,8 +170,7 @@ declare interface TextDataDetectorConfig { * @type { ?DecorationStyleInterface } * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ decoration?: DecorationStyleInterface; @@ -218,8 +192,7 @@ declare interface TextDataDetectorConfig { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare interface TextRange { /** @@ -230,8 +203,7 @@ declare interface TextRange { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ start?: number; @@ -243,8 +215,7 @@ declare interface TextRange { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ end?: number; } @@ -256,8 +227,7 @@ declare interface TextRange { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare interface InsertValue { /** @@ -267,8 +237,7 @@ declare interface InsertValue { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ insertOffset: number; @@ -279,8 +248,7 @@ declare interface InsertValue { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ insertValue: string; } @@ -292,8 +260,7 @@ declare interface InsertValue { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare enum TextDeleteDirection { /** @@ -302,8 +269,7 @@ declare enum TextDeleteDirection { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ BACKWARD = 0, @@ -313,8 +279,7 @@ declare enum TextDeleteDirection { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ FORWARD = 1, } @@ -367,8 +332,7 @@ declare enum SuperscriptStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'13','1.2':'20'} - * @arkts 1.1&1.2 + * @since 13 */ declare enum MenuType { /** @@ -377,8 +341,7 @@ declare enum MenuType { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'13','1.2':'20'} - * @arkts 1.1&1.2 + * @since 13 */ SELECTION_MENU = 0, @@ -388,8 +351,7 @@ declare enum MenuType { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'13','1.2':'20'} - * @arkts 1.1&1.2 + * @since 13 */ PREVIEW_MENU = 1, } @@ -401,8 +363,7 @@ declare enum MenuType { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'20','1.2':'20'} - * @arkts 1.1&1.2 + * @since 20 */ declare enum AutoCapitalizationMode { /** @@ -411,8 +372,7 @@ declare enum AutoCapitalizationMode { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'20','1.2':'20'} - * @arkts 1.1&1.2 + * @since 20 */ NONE = 0, @@ -422,8 +382,7 @@ declare enum AutoCapitalizationMode { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'20','1.2':'20'} - * @arkts 1.1&1.2 + * @since 20 */ WORDS = 1, @@ -433,8 +392,7 @@ declare enum AutoCapitalizationMode { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'20','1.2':'20'} - * @arkts 1.1&1.2 + * @since 20 */ SENTENCES = 2, @@ -444,8 +402,7 @@ declare enum AutoCapitalizationMode { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'20','1.2':'20'} - * @arkts 1.1&1.2 + * @since 20 */ ALL_CHARACTERS = 3, } @@ -457,8 +414,7 @@ declare enum AutoCapitalizationMode { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare interface DeleteValue { /** @@ -468,8 +424,7 @@ declare interface DeleteValue { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ deleteOffset: number; @@ -480,8 +435,7 @@ declare interface DeleteValue { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ direction: TextDeleteDirection; @@ -492,8 +446,7 @@ declare interface DeleteValue { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ deleteValue: string; } @@ -507,8 +460,7 @@ declare interface DeleteValue { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare type OnDidChangeCallback = (rangeBefore: TextRange, rangeAfter: TextRange) => void; @@ -521,8 +473,7 @@ declare type OnDidChangeCallback = (rangeBefore: TextRange, rangeAfter: TextRang * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ /** * Callback when input sometimes has info of previewText. @@ -534,8 +485,7 @@ declare type OnDidChangeCallback = (rangeBefore: TextRange, rangeAfter: TextRang * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'15','1.2':'20'} - * @arkts 1.1&1.2 + * @since 15 */ declare type EditableTextOnChangeCallback = (value: string, previewText?: PreviewText, options?: TextChangeOptions) => void; @@ -546,8 +496,7 @@ declare type EditableTextOnChangeCallback = (value: string, previewText?: Previe * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare interface TextBaseController { /** @@ -559,8 +508,7 @@ declare interface TextBaseController { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ setSelection(selectionStart: number, selectionEnd: number, options?: SelectionOptions): void; @@ -570,8 +518,7 @@ declare interface TextBaseController { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ closeSelectionMenu(): void; @@ -582,8 +529,7 @@ declare interface TextBaseController { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ getLayoutManager(): LayoutManager; } @@ -596,8 +542,7 @@ declare interface TextBaseController { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare interface TextEditControllerEx extends TextBaseController { /** @@ -607,8 +552,7 @@ declare interface TextEditControllerEx extends TextBaseController { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ isEditing(): boolean; @@ -618,8 +562,7 @@ declare interface TextEditControllerEx extends TextBaseController { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ stopEditing(): void; @@ -631,8 +574,7 @@ declare interface TextEditControllerEx extends TextBaseController { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ setCaretOffset(offset: number): boolean; @@ -643,8 +585,7 @@ declare interface TextEditControllerEx extends TextBaseController { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ getCaretOffset(): number; @@ -658,18 +599,6 @@ declare interface TextEditControllerEx extends TextBaseController { * @since 12 */ getPreviewText?(): PreviewText; - - /** - * Get PreviewText. - * - * @returns { PreviewText } - Return the PreviewText. - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - getPreviewText(): PreviewText; } /** @@ -678,8 +607,7 @@ declare interface TextEditControllerEx extends TextBaseController { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare interface PreviewText { /** @@ -689,8 +617,7 @@ declare interface PreviewText { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ offset: number; @@ -701,8 +628,7 @@ declare interface PreviewText { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ value: string; } @@ -714,8 +640,7 @@ declare interface PreviewText { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare interface StyledStringController { /** @@ -725,8 +650,7 @@ declare interface StyledStringController { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ setStyledString(styledString: StyledString): void; @@ -737,8 +661,7 @@ declare interface StyledStringController { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ getStyledString(): MutableStyledString; } @@ -750,8 +673,7 @@ declare interface StyledStringController { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare interface StyledStringChangedListener { /** @@ -761,8 +683,7 @@ declare interface StyledStringChangedListener { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ onWillChange?: Callback; @@ -773,8 +694,7 @@ declare interface StyledStringChangedListener { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ onDidChange?: OnDidChangeCallback; } @@ -786,8 +706,7 @@ declare interface StyledStringChangedListener { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ interface StyledStringChangeValue { /** @@ -797,8 +716,7 @@ interface StyledStringChangeValue { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ range: TextRange; @@ -809,8 +727,7 @@ interface StyledStringChangeValue { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ replacementString: StyledString; @@ -821,8 +738,7 @@ interface StyledStringChangeValue { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ previewText?: StyledString; } @@ -834,8 +750,7 @@ interface StyledStringChangeValue { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare interface LayoutManager { /** @@ -845,8 +760,7 @@ declare interface LayoutManager { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ getLineCount(): number; @@ -859,8 +773,7 @@ declare interface LayoutManager { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ getGlyphPositionAtCoordinate(x: number, y: number): PositionWithAffinity; @@ -897,8 +810,7 @@ declare interface LayoutManager { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ interface PositionWithAffinity { /** @@ -908,8 +820,7 @@ interface PositionWithAffinity { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ position: number; @@ -995,8 +906,7 @@ declare type TextBox = import('../api/@ohos.graphics.text').default.TextBox; * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ interface CaretStyle { /** @@ -1014,8 +924,7 @@ interface CaretStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ width?: Length, @@ -1034,8 +943,7 @@ interface CaretStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ color?: ResourceColor, } @@ -1046,8 +954,7 @@ interface CaretStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare class TextMenuItemId { /** @@ -1059,8 +966,7 @@ declare class TextMenuItemId { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ static of(id: ResourceStr): TextMenuItemId; @@ -1072,8 +978,7 @@ declare class TextMenuItemId { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ equals(id: TextMenuItemId): boolean; @@ -1085,8 +990,7 @@ declare class TextMenuItemId { * @static * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ static readonly CUT: TextMenuItemId; @@ -1098,8 +1002,7 @@ declare class TextMenuItemId { * @static * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ static readonly COPY: TextMenuItemId; @@ -1111,8 +1014,7 @@ declare class TextMenuItemId { * @static * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ static readonly PASTE: TextMenuItemId; @@ -1124,8 +1026,7 @@ declare class TextMenuItemId { * @static * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ static readonly SELECT_ALL: TextMenuItemId; @@ -1137,8 +1038,7 @@ declare class TextMenuItemId { * @static * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ static readonly COLLABORATION_SERVICE: TextMenuItemId; @@ -1150,8 +1050,7 @@ declare class TextMenuItemId { * @static * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ static readonly CAMERA_INPUT: TextMenuItemId; @@ -1163,8 +1062,7 @@ declare class TextMenuItemId { * @static * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice - * @since arkts {'1.1':'13','1.2':'20'} - * @arkts 1.1&1.2 + * @since 13 */ static readonly AI_WRITER: TextMenuItemId; @@ -1176,8 +1074,7 @@ declare class TextMenuItemId { * @static * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice - * @since arkts {'1.1':'15','1.2':'20'} - * @arkts 1.1&1.2 + * @since 15 */ static readonly TRANSLATE: TextMenuItemId; @@ -1189,8 +1086,7 @@ declare class TextMenuItemId { * @static * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ static readonly SEARCH: TextMenuItemId; @@ -1202,8 +1098,7 @@ declare class TextMenuItemId { * @static * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ static readonly SHARE: TextMenuItemId; @@ -1275,8 +1170,7 @@ declare class TextMenuItemId { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare interface TextMenuItem { /** @@ -1286,8 +1180,7 @@ declare interface TextMenuItem { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ content: ResourceStr; /** @@ -1297,8 +1190,7 @@ declare interface TextMenuItem { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ icon?: ResourceStr; /** @@ -1308,8 +1200,7 @@ declare interface TextMenuItem { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ id: TextMenuItemId; /** @@ -1319,8 +1210,7 @@ declare interface TextMenuItem { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'15','1.2':'20'} - * @arkts 1.1&1.2 + * @since 15 */ labelInfo?: ResourceStr; } @@ -1338,35 +1228,6 @@ declare interface TextMenuItem { */ type OnPrepareMenuCallback = (menuItems: Array) => Array; -/** - * Callback function when the selection menu create. - * - * @typedef { function } OnCreateMenuCallback - * @param { Array } menuItems - currently displayed menu items. - * @returns { Array } Return the menu items will displayed after operations. - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ -type OnCreateMenuCallback = (menuItems: Array) => Array; - -/** - * Invoke upon clicking an item, capable of intercepting the default system menu execution behavior. - * - * @typedef { function } OnMenuItemClickCallback - * @param { TextMenuItem } menuItem - current default menu. - * @param { TextRange } range - current selected range. - * @returns { boolean } - Return True, the event is consumed, false otherwise. - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ -type OnMenuItemClickCallback = (menuItem: TextMenuItem, range: TextRange) => boolean - /** * EditMenuOptions * @@ -1374,8 +1235,7 @@ type OnMenuItemClickCallback = (menuItem: TextMenuItem, range: TextRange) => boo * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare interface EditMenuOptions { /** @@ -1411,30 +1271,6 @@ declare interface EditMenuOptions { * @since 20 */ onPrepareMenu?: OnPrepareMenuCallback; - - /** - * Passes the default menu, invokes before every display to generate a menu for triggering click events. - * - * @type { OnCreateMenuCallback } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - onCreateMenu: OnCreateMenuCallback; - - /** - * Invoke upon clicking an item, capable of intercepting the default system menu execution behavior. - * - * @type { OnMenuItemClickCallback } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - onMenuItemClick: OnMenuItemClickCallback; } /** @@ -1444,8 +1280,7 @@ declare interface EditMenuOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ interface DecorationStyleResult { /** @@ -1455,8 +1290,7 @@ interface DecorationStyleResult { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ type: TextDecorationType; @@ -1467,8 +1301,7 @@ interface DecorationStyleResult { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ color: ResourceColor; @@ -1479,8 +1312,7 @@ interface DecorationStyleResult { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ style?: TextDecorationStyle; @@ -1504,8 +1336,7 @@ interface DecorationStyleResult { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare interface FontSettingOptions { /** @@ -1516,8 +1347,7 @@ declare interface FontSettingOptions { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ enableVariableFontWeight?: boolean; } @@ -1528,8 +1358,7 @@ declare interface FontSettingOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'15','1.2':'20'} - * @arkts 1.1&1.2 + * @since 15 */ declare interface TextChangeOptions { /** @@ -1539,8 +1368,7 @@ declare interface TextChangeOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'15','1.2':'20'} - * @arkts 1.1&1.2 + * @since 15 */ rangeBefore: TextRange; @@ -1551,8 +1379,7 @@ declare interface TextChangeOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'15','1.2':'20'} - * @arkts 1.1&1.2 + * @since 15 */ rangeAfter: TextRange; @@ -1563,8 +1390,7 @@ declare interface TextChangeOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'15','1.2':'20'} - * @arkts 1.1&1.2 + * @since 15 */ oldContent: string; @@ -1575,8 +1401,7 @@ declare interface TextChangeOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'15','1.2':'20'} - * @arkts 1.1&1.2 + * @since 15 */ oldPreviewText: PreviewText; } @@ -1588,8 +1413,7 @@ declare interface TextChangeOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'15','1.2':'20'} - * @arkts 1.1&1.2 + * @since 15 */ interface EditableTextChangeValue { /** @@ -1599,8 +1423,7 @@ interface EditableTextChangeValue { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'15','1.2':'20'} - * @arkts 1.1&1.2 + * @since 15 */ content: string; @@ -1611,8 +1434,7 @@ interface EditableTextChangeValue { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'15','1.2':'20'} - * @arkts 1.1&1.2 + * @since 15 */ previewText?: PreviewText; @@ -1623,8 +1445,7 @@ interface EditableTextChangeValue { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'15','1.2':'20'} - * @arkts 1.1&1.2 + * @since 15 */ options?: TextChangeOptions; } @@ -1636,8 +1457,7 @@ interface EditableTextChangeValue { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'16','1.2':'20'} - * @arkts 1.1&1.2 + * @since 16 */ declare enum TextMenuShowMode { /** @@ -1646,8 +1466,7 @@ declare enum TextMenuShowMode { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'16','1.2':'20'} - * @arkts 1.1&1.2 + * @since 16 */ DEFAULT = 0, @@ -1658,8 +1477,7 @@ declare enum TextMenuShowMode { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'16','1.2':'20'} - * @arkts 1.1&1.2 + * @since 16 */ PREFER_WINDOW = 1, } @@ -1671,8 +1489,7 @@ declare enum TextMenuShowMode { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'16','1.2':'20'} - * @arkts 1.1&1.2 + * @since 16 */ declare interface TextMenuOptions { /** @@ -1682,8 +1499,7 @@ declare interface TextMenuOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'16','1.2':'20'} - * @arkts 1.1&1.2 + * @since 16 */ showMode?: TextMenuShowMode; } @@ -1693,8 +1509,7 @@ declare interface TextMenuOptions { * @enum { number } * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice - * @since arkts {'1.1':'15','1.2':'20'} - * @arkts 1.1&1.2 + * @since 15 */ declare enum KeyboardAppearance { /** @@ -1702,8 +1517,7 @@ declare enum KeyboardAppearance { * * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice - * @since arkts {'1.1':'15','1.2':'20'} - * @arkts 1.1&1.2 + * @since 15 */ NONE_IMMERSIVE = 0, @@ -1712,8 +1526,7 @@ declare enum KeyboardAppearance { * * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice - * @since arkts {'1.1':'15','1.2':'20'} - * @arkts 1.1&1.2 + * @since 15 */ IMMERSIVE = 1, @@ -1722,8 +1535,7 @@ declare enum KeyboardAppearance { * * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice - * @since arkts {'1.1':'15','1.2':'20'} - * @arkts 1.1&1.2 + * @since 15 */ LIGHT_IMMERSIVE = 2, @@ -1732,8 +1544,7 @@ declare enum KeyboardAppearance { * * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice - * @since arkts {'1.1':'15','1.2':'20'} - * @arkts 1.1&1.2 + * @since 15 */ DARK_IMMERSIVE = 3, } diff --git a/api/arkui/SymbolGlyphModifier.d.ts b/api/arkui/SymbolGlyphModifier.d.ts index 308aa40be6900d215b99bffd9c39390d52f59240..6da4209ad579c21a930302f5ab5b7141ff618de8 100644 --- a/api/arkui/SymbolGlyphModifier.d.ts +++ b/api/arkui/SymbolGlyphModifier.d.ts @@ -18,95 +18,8 @@ * @kit ArkUI */ -/*** if arkts 1.2 */ -import { SymbolGlyphAttribute } from './component/symbolglyph' -import { AttributeModifier } from './component/common' -import { Resource } from '../global/resource' -/*** endif */ -/*** if arkts 1.2 */ -/** - * Declare the apply normal status function. - * - * @typedef { function } SymbolGlyphApplyNormalFunction - * @param { SymbolGlyphAttribute } symbolGlyphAttribute - The attribute of component. - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - * @noninterop - */ -declare type SymbolGlyphApplyNormalFunction = (symbolGlyphAttribute: SymbolGlyphAttribute) => void; -/** - * Defines SymbolGlyph Modifier - * - * @extends SymbolGlyphAttribute, AttributeModifier - * @typedef SymbolGlyphModifier - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @atomicservice - * @since 20 - * @arkts 1.2 - * @noninterop -*/ -export declare interface SymbolGlyphModifier extends SymbolGlyphAttribute, AttributeModifier { - /** - * Defines the normal update attribute function. - * - * @type {undefined | ((instance: SymbolGlyphAttribute) => void)} - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - applyNormalAttribute: undefined | ((instance: SymbolGlyphAttribute) => void); - /** - * Defines the pressed update attribute function. - * - * @type {undefined | ((instance: SymbolGlyphAttribute) => void)} - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - applyPressedAttribute: undefined | ((instance: SymbolGlyphAttribute) => void); - /** - * Defines the focused update attribute function. - * - * @type {undefined | ((instance: SymbolGlyphAttribute) => void)} - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - applyFocusedAttribute: undefined | ((instance: SymbolGlyphAttribute) => void); - /** - * Defines the disabled update attribute function. - * - * @type {undefined | ((instance: SymbolGlyphAttribute) => void)} - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - applyDisabledAttribute: undefined | ((instance: SymbolGlyphAttribute) => void); - /** - * Defines the selected update attribute function. - * - * @type {undefined | ((instance: SymbolGlyphAttribute) => void)} - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - applySelectedAttribute: undefined | ((instance: SymbolGlyphAttribute) => void); -} -/*** endif */ + /** * Defines SymbolGlyph Modifier @@ -166,4 +79,4 @@ export declare class SymbolGlyphModifier extends SymbolGlyphAttribute implements * @since 20 */ applyNormalAttribute?(instance: SymbolGlyphAttribute): void; - } \ No newline at end of file + } diff --git a/api/arkui/TextModifier.d.ts b/api/arkui/TextModifier.d.ts index e3c67a056064c42b0fd42ad2d4c23a25ab9d7d88..178b7154bcb32bfd7d716fec3dbdeda5981fdadd 100755 --- a/api/arkui/TextModifier.d.ts +++ b/api/arkui/TextModifier.d.ts @@ -18,95 +18,8 @@ * @kit ArkUI */ -/*** if arkts 1.2 */ -import { TextAttribute } from './component/text' -import { AttributeModifier }from './component/common' -/*** endif */ -/*** if arkts 1.2 */ -/** - * Declare the apply normal status function. - * - * @typedef { function } TextApplyNormalFunction - * @param { TextAttribute } textAttribute - The attribute of component. - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ -declare type TextApplyNormalFunction = (textAttribute: TextAttribute) => void; - -/** - * Defines Text Modifier - * - * @extends TextAttribute, AttributeModifier - * @typedef TextModifier - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @atomicservice - * @since 20 - * @arkts 1.2 - * @noninterop -*/ -export declare interface TextModifier extends TextAttribute, AttributeModifier { - /** - * Defines the normal update attribute function. - * - * @type {undefined | ((instance: TextAttribute) => void)} - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - applyNormalAttribute: undefined | ((instance: TextAttribute) => void); - /** - * Defines the pressed update attribute function. - * - * @type {undefined | ((instance: TextAttribute) => void)} - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - applyPressedAttribute: undefined | ((instance: TextAttribute) => void); - /** - * Defines the focused update attribute function. - * - * @type {undefined | ((instance: TextAttribute) => void)} - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - applyFocusedAttribute: undefined | ((instance: TextAttribute) => void); - /** - * Defines the disabled update attribute function. - * - * @type {undefined | ((instance: TextAttribute) => void)} - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - applyDisabledAttribute: undefined | ((instance: TextAttribute) => void); - /** - * Defines the selected update attribute function. - * - * @type {undefined | ((instance: TextAttribute) => void)} - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - applySelectedAttribute: undefined | ((instance: TextAttribute) => void); -} -/*** endif */ /** * Defines Text Modifier diff --git a/api/arkui/component/styledString.static.d.ets b/api/arkui/component/styledString.static.d.ets new file mode 100644 index 0000000000000000000000000000000000000000..9dc7ea0f68645e43d50818875f3cc6a21a525292 --- /dev/null +++ b/api/arkui/component/styledString.static.d.ets @@ -0,0 +1,1455 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @file + * @kit ArkUI + * @arkts 1.2 + */ +import { Callback, ShadowOptions, ClickEvent, Optional, PixelMap } 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 image from '../../@ohos.multimedia.image'; +import drawing from '../../@ohos.graphics.drawing'; +import { DrawContext } from '../../arkui/Graphics'; +import { memo, ComponentBuilder } from "./../stateManagement/runtime"; +import { AttributeModifier, CommonMethod } from "./common"; +/** + * Defines the StyledStringMarshallingValue Type. + * + * @typedef { UserDataSpan } StyledStringMarshallingValue + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 20 + */ +export type StyledStringMarshallingValue = UserDataSpan; +/** + * Defines the callback type used in marshalling. + * + * @typedef { function } StyledStringMarshallCallback + * @param { StyledStringMarshallingValue } marshallableVal - value that will be serialized to array buffer + * @returns { ArrayBuffer } Array buffer from the serialized marshalling value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 20 + */ +export type StyledStringMarshallCallback = (marshallableVal: StyledStringMarshallingValue) => ArrayBuffer; +/** + * Defines the callback type used in unmarshalling. + * + * @typedef { function } StyledStringUnmarshallCallback + * @param { ArrayBuffer } buf - The buffer that will be deserialized to a StyledStringMarshallingValue. + * @returns { StyledStringMarshallingValue } Marshalling value from the deserialized ArrayBuffer. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 20 + */ +export type StyledStringUnmarshallCallback = (buf: ArrayBuffer) => StyledStringMarshallingValue; +/** + * StyledString + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare class StyledString { + /** + * constructor. + * + * @param { string | ImageAttachment | CustomSpan } value - indicates the current object value of the StyledString. + * @param { Array } [styles] - indicates the SpanStyle objects. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + constructor(value: string | ImageAttachment | CustomSpan, styles?: Array); + /** + * Get the length of the StyledString's characters. + * + * @type { number } - the length of the StyledString's characters. + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + readonly length: number; + /** + * Get the literal content of the StyledString. + * + * @returns { string } - the literal content of the StyledString + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + getString(): string; + /** + * Get the attribute objects of the subStyledString. + * + * @param { number } start - the start position of the subStyledString. + * @param { number } length - the length of the subStyledString's characters. + * @param { StyledStringKey } [styledKey] - the specified type. + * @returns { Array } + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + getStyles(start: number, length: number, styledKey?: StyledStringKey): Array; + /** + * Judge if two attribute strings are equal. + * + * @param { StyledString } other - another StyledString. + * @returns { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + equals(other: StyledString): boolean; + /** + * Get the substring of the StyledString. + * + * @param { number } start - the start position of the subStyledString. + * @param { number } [length] - the length of the subStyledString's characters. + * @returns { StyledString } + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + subStyledString(start: number, length?: number): StyledString; + /** + * Returns StyledString from the provided HTML string. + * + * @param { string } html - the html text will be converted to a StyledString. + * @returns { Promise } + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @throws { BusinessError } 170001 - Convert Error. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + static fromHtml(html: string): Promise; + /** + * Returns HTML string from the provided StyledString. + * + * @param { StyledString } styledString - the StyledString will be converted to a HTML string. + * @returns { string } Returns the HTML string converted from the provided StyledString. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + static toHtml(styledString: StyledString): string; + /** + * Returns ArrayBuffer from the serialized styled string. + * + * @param { StyledString } styledString - StyledString parameter. + * @param { function } callback - When marshalling StyledStringMarshingValue, will trigger this callback to get ArrayBuffer + * @returns { ArrayBuffer } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 20 + */ + static marshalling(styledString: StyledString, callback: StyledStringMarshallCallback): ArrayBuffer; + /** + * Returns StyledString from the deserialized ArrayBuffer. + * + * @param { ArrayBuffer } buffer - The buffer will be deserialized to a StyledString. + * @param { function } 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. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @throws { BusinessError } 170002 - Styled string decode error. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 20 + */ + static unmarshalling(buffer: ArrayBuffer, callback: StyledStringUnmarshallCallback): Promise; + /** + * Returns ArrayBuffer from the serialized styled string. + * + * @param { StyledString } styledString - StyledString parameter. + * @returns { ArrayBuffer } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 20 + */ + static marshalling(styledString: StyledString): ArrayBuffer; + /** + * Returns StyledString from the deserialized ArrayBuffer. + * + * @param { ArrayBuffer } buffer - The buffer will be deserialized to a StyledString. + * @returns { Promise } + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @throws { BusinessError } 170002 - Styled string decode error. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 20 + */ + static unmarshalling(buffer: ArrayBuffer): Promise; +} +/** + * StyleOptions + * + * @interface StyleOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface StyleOptions { + /** + * The start position of the StyleOptions. + * + * @type { ?int } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + start?: int; + /** + * The length of the modifiedStyledString's characters. + * + * @type { ?int } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + length?: int; + /** + * The attribute key of the StyleOptions. + * + * @type { StyledStringKey } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + styledKey: StyledStringKey; + /** + * The attribute value of the StyleOptions. + * + * @type { StyledStringValue } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + styledValue: StyledStringValue; +} +/** + * SpanStyle + * + * @interface SpanStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface SpanStyle { + /** + * The start position of the SpanStyle. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + start: number; + /** + * The length of the modifiedStyledString's characters. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + length: number; + /** + * The attribute key of the SpanStyle. + * + * @type { StyledStringKey } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + styledKey: StyledStringKey; + /** + * The attribute value of the SpanStyle. + * + * @type { StyledStringValue } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + styledValue: StyledStringValue; +} +/** + * Defines TextStyle. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare class TextStyle { + /** + * constructor. + * + * @param { TextStyleInterface } [value] - font property object. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + constructor(value?: TextStyleInterface); + /** + * Get the fontColor of the StyledString. + * + * @type { ?ResourceColor } - the set fontColor of the StyledString or undefined + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + readonly fontColor?: ResourceColor; + /** + * Get the fontFamily of the StyledString. + * + * @type { ?string } - the fontFamily of the StyledString or undefined + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + readonly fontFamily?: string; + /** + * Get the fontSize of the StyledString. + * If not undefined, the unit is vp. + * + * @type { ?number } - the fontSize of the StyledString or undefined + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + readonly fontSize?: number; + /** + * Get the fontWeight of the StyledString. + * + * @type { ?number } - the fontWeight of the StyledString or undefined + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + readonly fontWeight?: number; + /** + * Get the fontStyle of the StyledString. + * + * @type { ?FontStyle } - the fontStyle of the StyledString or undefined + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + readonly fontStyle?: FontStyle; +} +/** + * TextStyleInterface + * + * @interface TextStyleInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface TextStyleInterface { + /** + * The fontColor value of the font property object. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + fontColor?: ResourceColor; + /** + * The fontFamily value of the font property object. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + fontFamily?: ResourceStr; + /** + * The fontSize value of the font property object. + * + * @type { ?LengthMetrics } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + fontSize?: LengthMetrics; + /** + * The fontWeight value of the font property object. + * + * @type { ?(number | FontWeight | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + fontWeight?: number | FontWeight | string; + /** + * The fontStyle value of the font property object. + * + * @type { ?FontStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + fontStyle?: FontStyle; +} +/** + * Defines DecorationStyle. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare class DecorationStyle { + /** + * constructor. + * + * @param { DecorationStyleInterface } value - text decoration value. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + constructor(value: DecorationStyleInterface); + /** + * Get the text decoration type of the StyledString. + * + * @type { TextDecorationType } - the decoration type of the StyledString + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + readonly type: TextDecorationType; + /** + * Get the decorationColor of the StyledString. + * + * @type { ?ResourceColor } - the decorationColor of the StyledString or undefined + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + readonly color?: ResourceColor; + /** + * Get the decorationStyle of the StyledString. + * + * @type { ?TextDecorationStyle } - the decorationStyle of the StyledString or undefined + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + readonly style?: TextDecorationStyle; +} +/** + * DecorationStyleInterface + * + * @interface DecorationStyleInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface DecorationStyleInterface { + /** + * The type value of the decoration property object. + * + * @type { TextDecorationType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + type: TextDecorationType; + /** + * The color value of the decoration property object. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + color?: ResourceColor; + /** + * The style value of the decoration property object. + * + * @type { ?TextDecorationStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + style?: TextDecorationStyle; +} +/** + * Defines BaselineOffsetStyle. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare class BaselineOffsetStyle { + /** + * constructor. + * + * @param { LengthMetrics } value - baseline offset value. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + constructor(value: LengthMetrics); + /** + * Get the baselineOffset value of the StyledString. + * The unit is vp. + * + * @type { number } - the baselineOffset value of the StyledString + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + readonly baselineOffset: number; +} +/** + * Defines LetterSpacingStyle. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare class LetterSpacingStyle { + /** + * constructor. + * + * @param { LengthMetrics } value - letter space value. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + constructor(value: LengthMetrics); + /** + * Get the letterSpacing value of the StyledString. + * The unit is vp. + * + * @type { number } - the letterSpacing value of the StyledString + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + readonly letterSpacing: number; +} +/** + * Defines TextShadowStyle. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare class TextShadowStyle { + /** + * constructor. + * + * @param { ShadowOptions | Array } value - text shadow value. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + constructor(value: ShadowOptions | Array); + /** + * Get the textShadow value of the StyledString. + * + * @type { Array } - the textShadow value of the StyledString + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + readonly textShadow: Array; +} +/** + * Defines Sets the property string background color. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare class BackgroundColorStyle { + /** + * constructor. + * + * @param { TextBackgroundStyle } textBackgroundStyle - textBackgroundStyle value. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + constructor(textBackgroundStyle: TextBackgroundStyle); + /** + * Get the textBackgroundStyle value of the StyledString. + * + * @type { TextBackgroundStyle } - the textBackgroundStyle value of the StyledString + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + readonly textBackgroundStyle: TextBackgroundStyle; +} +/** + * Defines GestureStyle. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare class GestureStyle { + /** + * constructor. + * + * @param { GestureStyleInterface } [value] - gesture event object. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + constructor(value?: GestureStyleInterface); +} +/** + * Defines the Gesture Events. + * + * @interface GestureStyleInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface GestureStyleInterface { + /** + * Trigger a click event when a click is clicked. + * + * @type { ?Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + onClick?: Callback; + /** + * Trigger a gesture event when long press event is complete. + * + * @type { ?Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + onLongPress?: Callback; +} +/** + * Defines ParagraphStyle. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare class ParagraphStyle { + /** + * constructor. + * + * @param { ParagraphStyleInterface } [value] - paragraph property object. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + constructor(value?: ParagraphStyleInterface); + /** + * Get the text alignment of the StyledString. + * + * @type { ?TextAlign } - the text alignment of the StyledString or undefined + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + readonly textAlign?: TextAlign; + /** + * Get the first line indentation of the StyledString. + * The unit is vp. + * + * @type { ?number } - the first line indentation of the StyledString or undefined + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + readonly textIndent?: number; + /** + * Get the maximum number of lines of the StyledString. + * + * @type { ?number } - the maximum number of the StyledString or undefined + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + readonly maxLines?: number; + /** + * Get the overflow mode of the StyledString. + * + * @type { ?TextOverflow } - the overflow mode of the StyledString or undefined + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + readonly overflow?: TextOverflow; + /** + * Get the wordBreak mode of the StyledString. + * + * @type { ?WordBreak } - the wordBreak mode of the StyledString or undefined + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + readonly wordBreak?: WordBreak; + /** + * Get the leading margin of the StyledString. + * + * @type { ?(number | LeadingMarginPlaceholder) } - the leading margin of the StyledString or undefined + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + readonly leadingMargin?: number | LeadingMarginPlaceholder; + /** + * Get the paragraph spacing of the StyledString. + * The unit is vp. + * + * @type { ?number } + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + readonly paragraphSpacing?: number; +} +/** + * ParagraphStyleInterface + * + * @interface ParagraphStyleInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface ParagraphStyleInterface { + /** + * Alignment of text. + * + * @type { ?TextAlign } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + textAlign?: TextAlign; + /** + * Set the first line indentation. + * + * @type { ?LengthMetrics } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + textIndent?: LengthMetrics; + /** + * The maximum number of lines of content. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + maxLines?: number; + /** + * The overflow mode of the content. + * + * @type { ?TextOverflow } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + overflow?: TextOverflow; + /** + * Set word break type. + * + * @type { ?WordBreak } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + wordBreak?: WordBreak; + /** + * Leading margin. + * + * @type { ?(LengthMetrics | LeadingMarginPlaceholder) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + leadingMargin?: LengthMetrics | LeadingMarginPlaceholder; + /** + * Set the paragraph spacing of the StyledString. + * + * @type { ?LengthMetrics } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + paragraphSpacing?: LengthMetrics; +} +/** + * Defines LineHeightStyle. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare class LineHeightStyle { + /** + * constructor. + * + * @param { LengthMetrics } lineHeight - line height value. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + constructor(lineHeight: LengthMetrics); + /** + * Get the lineHeight value of the StyledString. + * The unit is vp. + * + * @type { number } - the lineHeight value of the StyledString + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + readonly lineHeight: number; +} +/** + * Defines the URLStyle hyperlink that allows setting a URL string. When clicking on the text to + * which the span is attached, the URLStyle will try to open the URL. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare class UrlStyle { + /** + * Constructor. + * + * @param { string } url - URL value. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + constructor(url: string); + /** + * Get the URL value of the StyledString. + * + * @type { string } - the URL value of the StyledString + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + readonly url: string; +} +/** + * Defines the Span Type. + * + * @typedef { TextStyle | DecorationStyle | BaselineOffsetStyle | LetterSpacingStyle | TextShadowStyle | + * GestureStyle | ImageAttachment | ParagraphStyle | LineHeightStyle | UrlStyle | CustomSpan | + * UserDataSpan | BackgroundColorStyle } StyledStringValue + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export type StyledStringValue = TextStyle | DecorationStyle | BaselineOffsetStyle | LetterSpacingStyle | TextShadowStyle | GestureStyle | ImageAttachment | ParagraphStyle | LineHeightStyle | UrlStyle | CustomSpan | UserDataSpan | BackgroundColorStyle; +/** + * MutableStyledString + * + * @extends StyledString + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare class MutableStyledString extends StyledString { + /** + * constructor. + * + * @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 + */ + constructor(value: string | ImageAttachment | CustomSpan, styles?: Array); + /** + * Replace the string of the specified range. + * + * @param { number } start - the start position of the replacedString. + * @param { number } length - the length of the replacedString's characters. + * @param { string } other - must be unicode string. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + replaceString(start: number, length: number, other: string): void; + /** + * Insert the string at the specified location. + * + * @param { number } start - the start position of the insertedString. + * @param { string } other - must be unicode string. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + insertString(start: number, other: string): void; + /** + * Remove the string of the specified range. + * + * @param { number } start - the start position of the removedString. + * @param { number } length - the length of the removedString's characters. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + removeString(start: number, length: number): void; + /** + * Replace the specified range string attribute. + * + * @param { SpanStyle } spanStyle - the SpanStyle Object. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + replaceStyle(spanStyle: SpanStyle): void; + /** + * Add attributes to the specified range string. + * + * @param { SpanStyle } spanStyle - the SpanStyle Object. + * @throws { BusinessError } 401 - The parameter check failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + setStyle(spanStyle: SpanStyle): void; + /** + * Delete the specified type attributes for the specified range string. + * + * @param { number } start - the start position of the removedAttributeStyledString. + * @param { number } length - the length of the removedAttributeStyledString's characters. + * @param { StyledStringKey } styledKey - the specified attribute type's key. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + removeStyle(start: number, length: number, styledKey: StyledStringKey): void; + /** + * Delete all attributes for the specified range styledString. + * + * @param { number } start - the start position of the attributeRemovedStyledString's characters. + * @param { number } length - the length of the attributeRemovedStyledString's characters. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + removeStyles(start: number, length: number): void; + /** + * Delete all attributes. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + clearStyles(): void; + /** + * Replace the StyledString of the specified range. + * + * @param { number } start - the start position of the replacedStyledString. + * @param { number } length - the length of the replacedStyledString's characters. + * @param { StyledString } other - new StyledString. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + replaceStyledString(start: number, length: number, other: StyledString): void; + /** + * Insert new StyledString at the specified location. + * + * @param { number } start - the start position of the insertedStyledString. + * @param { StyledString } other - new StyledString. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + insertStyledString(start: number, other: StyledString): void; + /** + * Append new StyledString at the end. + * + * @param { StyledString } other - new StyledString. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + appendStyledString(other: StyledString): void; +} +/** + * the attribute type of the StyledString + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare enum StyledStringKey { + /** + * The key of TextStyle. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + FONT = 0, + /** + * The key of DecorationStyle. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + DECORATION = 1, + /** + * The key of BaselineOffsetStyle. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + BASELINE_OFFSET = 2, + /** + * The key of LetterSpacingStyle. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + LETTER_SPACING = 3, + /** + * The key of TextShadowStyle. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + TEXT_SHADOW = 4, + /** + * The key of LineHeightStyle. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + LINE_HEIGHT = 5, + /** + * The key of BackgroundColorStyle. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + BACKGROUND_COLOR = 6, + /** + * The key of UrlStyle. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + URL = 7, + /** + * The key of GestureStyle. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + GESTURE = 100, + /** + * The key of ParagraphStyle. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + PARAGRAPH_STYLE = 200, + /** + * The key of ImageAttachment. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + IMAGE = 300, + /** + * The key of CustomSpan. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + CUSTOM_SPAN = 400, + /** + * The key of UserDataSpan. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + USER_DATA = 500 +} +/** + * Defines ImageAttachment. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare class ImageAttachment { + /** + * constructor supported by AttachmentType. + * + * @param { ImageAttachmentInterface | Optional } attachment - image attachment object. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + constructor(value: ImageAttachmentInterface | Optional); + /** + * Get the image content of the StyledString. + * + * @type { PixelMap } - the image content of the StyledString or undefined + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + readonly value: PixelMap; + /** + * Get the imageSize of the StyledString. + * + * @type { ?SizeOptions } - the imageSize of the StyledString or undefined + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + readonly size?: SizeOptions; + /** + * Get the ImageSpanAlignment of the StyledString. + * + * @type { ?ImageSpanAlignment } - the ImageSpanAlignment of the StyledString or undefined + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + readonly verticalAlign?: ImageSpanAlignment; + /** + * Get the imageFit of the StyledString. + * + * @type { ?ImageFit } - the imageFit of the StyledString or undefined + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + readonly objectFit?: ImageFit; + /** + * Get the imageAttachmentLayoutStyle of the StyledString. + * + * @type { ?ImageAttachmentLayoutStyle } - the imageAttachmentLayoutStyle of the StyledString or undefined + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + readonly layoutStyle?: ImageAttachmentLayoutStyle; + /** + * Get the imageAttachment colorFilter of the StyledString. + * + * @type { ?ColorFilterType } - the imageAttachment colorFilter of the StyledString or undefined + * @readonly + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + readonly colorFilter?: ColorFilterType; +} +/** + * Defines the ResourceImageAttachmentOptions. + * + * @interface ResourceImageAttachmentOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface ResourceImageAttachmentOptions { + /** + * The content of the ResourceImageAttachment. + * + * @type { Optional } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + resourceValue: Optional; + /** + * size of the ResourceImage. + * + * @type { ?SizeOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + size?: SizeOptions; + /** + * Image vertical align. + * + * @type { ?ImageSpanAlignment } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + verticalAlign?: ImageSpanAlignment; + /** + * Sets the zoom type of the ImageAttachment. + * + * @type { ?ImageFit } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + objectFit?: ImageFit; + /** + * The Image Layout Style of the Resource Image. + * + * @type { ?ImageAttachmentLayoutStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + layoutStyle?: ImageAttachmentLayoutStyle; + /** + * Sets the color filter effect on the image attachment. + * + * @type { ?ColorFilterType } filter ColorFilter object. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + colorFilter?: ColorFilterType; + /** + * Sets the synchronous or asynchronous mode for image loading. + * The default parameter type is bool, and the default value is false. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + syncLoad?: boolean; +} +/** + * Defines the ImageAttachmentInterface. + * + * @interface ImageAttachmentInterface + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface ImageAttachmentInterface { + /** + * The content of the ImageAttachment. + * + * @type { PixelMap } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + value: PixelMap; + /** + * Image size. + * + * @type { ?SizeOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + size?: SizeOptions; + /** + * Image vertical align. + * + * @type { ?ImageSpanAlignment } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + verticalAlign?: ImageSpanAlignment; + /** + * Image fit. + * + * @type { ?ImageFit } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + objectFit?: ImageFit; + /** + * The Image Layout Style. + * + * @type { ?ImageAttachmentLayoutStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + layoutStyle?: ImageAttachmentLayoutStyle; + /** + * Sets the color filter effect on the image attachment. + * + * @type { ?ColorFilterType } filter ColorFilter object. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + colorFilter?: ColorFilterType; +} +/** + * Defines the Attachment Type. + * + * @typedef { ImageAttachmentInterface | ResourceImageAttachmentOptions } AttachmentType + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export type AttachmentType = ImageAttachmentInterface | ResourceImageAttachmentOptions; +/** + * Defines the ColorFilter Type. + * + * @typedef { ColorFilter | DrawingColorFilter } ColorFilterType + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export type ColorFilterType = ColorFilter | DrawingColorFilter; +/** + * Defines the ImageAttachment Layout Style. + * + * @interface ImageAttachmentLayoutStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface ImageAttachmentLayoutStyle { + /** + * Outer Margin. + * + * @type { ?(LengthMetrics | Margin) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + margin?: LengthMetrics | Margin; + /** + * Inner margin. + * + * @type { ?(LengthMetrics | Padding) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + padding?: LengthMetrics | Padding; + /** + * Border radius. + * + * @type { ?(LengthMetrics | BorderRadiuses) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + borderRadius?: LengthMetrics | BorderRadiuses; +} +/** + * Defines the CustomSpanMetrics interface. + * + * @interface CustomSpanMetrics + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface CustomSpanMetrics { + /** + * CustomSpan Width. + * The unit is vp. + * + * @type { number } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + width: number; + /** + * CustomSpan Height. + * The unit is vp. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + height?: number; +} +/** + * Defines the CustomSpanDrawInfo interface. + * + * @interface CustomSpanDrawInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface CustomSpanDrawInfo { + /** + * CustomSpan's offset relative to the parent component. + * The unit is px. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + x: number; + /** + * The top position of the line where customSpan is located. + * The unit is px. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + lineTop: number; + /** + * The bottom position of the line where customSpan is located. + * The unit is px. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + lineBottom: number; + /** + * The baseline offset of the line where customSpan is located. + * The unit is px. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + baseline: number; +} +/** + * Defines the CustomSpanMeasureInfo interface. + * + * @interface CustomSpanMeasureInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface CustomSpanMeasureInfo { + /** + * Current component's fontSize value. + * The unit is fp. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + fontSize: number; +} +/** + * Defines CustomSpan. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare abstract class CustomSpan { + /** + * Measure the size of custom span. + * + * @param { CustomSpanMeasureInfo } measureInfo + * @returns { CustomSpanMetrics } - CustomSpan Size + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + abstract onMeasure(measureInfo: CustomSpanMeasureInfo): CustomSpanMetrics; + /** + * Draw the custom span. + * + * @param { DrawContext } context + * @param { CustomSpanDrawInfo } drawInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + abstract onDraw(context: DrawContext, drawInfo: CustomSpanDrawInfo): void; + /** + * Invalidate all components that use the object, which will cause a re-render of all components. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + invalidate(): void; +} +/** + * Defines UserDataSpan. Used to store and obtain user data. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare abstract class UserDataSpan { +} diff --git a/api/arkui/component/textCommon.d.ets b/api/arkui/component/textCommon.d.ets deleted file mode 100644 index afc59ae707dc41974ae5f7d6c982b2f6d4037a61..0000000000000000000000000000000000000000 --- a/api/arkui/component/textCommon.d.ets +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Copyright (c) 2024-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * @file - * @kit ArkUI - * @arkts 1.2 - */ - - -// WARNING! THIS FILE IS AUTO-GENERATED, DO NOT MAKE CHANGES, THEY WILL BE LOST ON NEXT GENERATION! - -import { memo, ComponentBuilder, __memo_context_type, __memo_id_type } from './../stateManagement/runtime' -import { ResourceColor, Length, ResourceStr } from './units' -import { SelectionOptions } from './common' -import { TextDecorationType, TextDecorationStyle } from './enums' -export enum TextDataDetectorType { - PHONE_NUMBER = 0, - URL = 1, - EMAIL = 2, - ADDRESS = 3, - DATE_TIME = 4 -} -export interface TextDataDetectorConfig { - types: Array; - onDetectResultUpdate?: ((breakpoints: string) => void); - color?: ResourceColor; -} -export interface TextRange { - start?: number; - end?: number; -} -export interface InsertValue { - insertOffset: number; - insertValue: string; -} -export enum TextDeleteDirection { - BACKWARD = 0, - FORWARD = 1 -} -export enum MenuType { - SELECTION_MENU = 0, - PREVIEW_MENU = 1 -} -export interface DeleteValue { - deleteOffset: number; - direction: TextDeleteDirection; - deleteValue: string; -} -export type OnDidChangeCallback = (rangeBefore: TextRange, rangeAfter: TextRange) => void; -export type EditableTextOnChangeCallback = (value: string, previewText?: PreviewText) => void; -export interface TextBaseController { - setSelection(selectionStart: number, selectionEnd: number, options?: SelectionOptions): void - closeSelectionMenu(): void - getLayoutManager(): LayoutManager -} -export interface TextEditControllerEx extends TextBaseController { - isEditing(): boolean - stopEditing(): void - setCaretOffset(offset: number): boolean - getCaretOffset(): number - getPreviewText(): PreviewText -} - -export type Callback_StyledStringChangeValue_Boolean = (parameter: StyledStringChangeValue) => boolean; -export interface StyledStringChangedListener { - onWillChange?: ((parameter: StyledStringChangeValue) => boolean); - onDidChange?: OnDidChangeCallback; -} -export interface StyledStringChangeValue { - range: TextRange; -} -export interface LayoutManager { - getLineCount(): number - getGlyphPositionAtCoordinate(x: number, y: number): PositionWithAffinity -} -export interface PositionWithAffinity { - position: number; -} -export interface CaretStyle { - width?: Length; - color?: ResourceColor; -} -export interface TextMenuItemId { - of(id: ResourceStr): TextMenuItemId - equals(id: TextMenuItemId): boolean -} -export interface PreviewText { - offset: number; - value: string; -} -export interface TextMenuItem { - content: ResourceStr; - icon?: ResourceStr; - id: TextMenuItemId; -} -export interface EditMenuOptions { - onCreateMenu(menuItems: Array): Array - onMenuItemClick(menuItem: TextMenuItem, range: TextRange): boolean -} -export interface DecorationStyleResult { - type: TextDecorationType; - color: ResourceColor; - style?: TextDecorationStyle; -} -export interface FontSettingOptions { - enableVariableFontWeight?: boolean; -} \ No newline at end of file diff --git a/api/arkui/component/textCommon.static.d.ets b/api/arkui/component/textCommon.static.d.ets new file mode 100644 index 0000000000000000000000000000000000000000..f617192f88508500bdac2819a6b5b655aabc51e2 --- /dev/null +++ b/api/arkui/component/textCommon.static.d.ets @@ -0,0 +1,974 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @file + * @kit ArkUI + * @arkts 1.2 + */ +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"; +/** + * Defines the text data detector type. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare enum TextDataDetectorType { + /** + * Detector type phone number. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + PHONE_NUMBER = 0, + /** + * Detector type URL. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + URL = 1, + /** + * Detector type email. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + EMAIL = 2, + /** + * Detector type address. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + ADDRESS = 3, + /** + * Detector type datetime. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + DATE_TIME = 4 +} +/** + * Text data detector config. + * + * @interface TextDataDetectorConfig + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface TextDataDetectorConfig { + /** + * Text data detector types. + * + * @type { TextDataDetectorType[] } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + types: TextDataDetectorType[]; + /** + * Text data detect result callback. + * + * @type { ?Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + onDetectResultUpdate?: Callback; + /** + * The color of AI entity. + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + color?: ResourceColor; + /** + * The decoration of AI entity. + * + * @type { ?DecorationStyleInterface } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + decoration?: DecorationStyleInterface; +} +/** + * Defines range of text type component. + * + * @interface TextRange + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface TextRange { + /** + * Start offset. + * + * @type { ?number } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + start?: number; + /** + * End offset. + * + * @type { ?number } + * @default text length + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + end?: number; +} +/** + * Defines the inserted text value info. + * + * @interface InsertValue + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface InsertValue { + /** + * The location info where the value will be inserted. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + insertOffset: number; + /** + * The inserted value. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + insertValue: string; +} +/** + * Defines delete text direction. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare enum TextDeleteDirection { + /** + * Delete backward. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + BACKWARD = 0, + /** + * Delete forward. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + FORWARD = 1 +} +/** + * Defines menu type. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare enum MenuType { + /** + * Selection menu. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + SELECTION_MENU = 0, + /** + * Preview menu, only for image. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + PREVIEW_MENU = 1 +} +/** + * Declare the type of automatic case mode switching. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare enum AutoCapitalizationMode { + /** + * The default status is invalid. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + NONE = 0, + /** + * Automatic case by words. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + WORDS = 1, + /** + * Automatic case by sentences. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + SENTENCES = 2, + /** + * Automatic case by full characters. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + ALL_CHARACTERS = 3 +} +/** + * Provides an interface for deleting value from text. + * + * @interface DeleteValue + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface DeleteValue { + /** + * The location info where the value will be deleted. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + deleteOffset: number; + /** + * The deleted direction. + * + * @type { TextDeleteDirection } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + direction: TextDeleteDirection; + /** + * The deleted value. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + deleteValue: string; +} +/** + * Callback after content changed. + * + * @typedef { function } OnDidChangeCallback + * @param { TextRange } rangeBefore - Range of content that had been replaced. + * @param { TextRange } rangeAfter - Range of content that newly added. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export type OnDidChangeCallback = (rangeBefore: TextRange, rangeAfter: TextRange) => void; +/** + * Callback when input sometimes has info of previewText. + * + * @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. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export type EditableTextOnChangeCallback = (value: string, previewText?: PreviewText, options?: TextChangeOptions) => void; +/** + * Define the text selection controller. + * + * @interface TextBaseController + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface TextBaseController { + /** + * Set selection to select a range of content. + * + * @param { number } selectionStart - The start position of the selected text. + * @param { number } selectionEnd - The end position of the selected text. + * @param { SelectionOptions } [options] - Indicates the options of selection. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + setSelection(selectionStart: number, selectionEnd: number, options?: SelectionOptions): void; + /** + * Close the select menu when menu is on. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + closeSelectionMenu(): void; + /** + * Get LayoutManager. + * + * @returns { LayoutManager } - Return the LayoutManager. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + getLayoutManager(): LayoutManager; +} +/** + * Define the text extended editing controller. + * + * @extends TextBaseController + * @interface TextEditControllerEx + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface TextEditControllerEx extends TextBaseController { + /** + * Judge whether is in editing state + * + * @returns { boolean } - true means that the component is in editing state, false means is non in editing status + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + isEditing(): boolean; + /** + * Stop editing state. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + stopEditing(): void; + /** + * Set caret offset. + * + * @param { number } offset - caret offset. + * @returns { boolean } - Return true if the caret offset was successfully set, false otherwise. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + setCaretOffset(offset: number): boolean; + /** + * Get caret offset from controller. + * + * @returns { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + getCaretOffset(): number; + /** + * Get PreviewText. + * + * @returns { PreviewText } - Return the PreviewText. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + getPreviewText(): PreviewText; +} +/** + * The previewText. + * @interface PreviewText + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface PreviewText { + /** + * Start offset of the previewText + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + offset: number; + /** + * Value of the previewText. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + value: string; +} +/** + * Define the StyledString controller. + * + * @interface StyledStringController + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface StyledStringController { + /** + * Set the StyledString of the component. + * + * @param { StyledString } styledString - StyledString. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + setStyledString(styledString: StyledString): void; + /** + * Get the StyledString of the component. + * + * @returns { MutableStyledString } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + getStyledString(): MutableStyledString; +} +/** + * Define the StyledString changed listener. + * + * @interface StyledStringChangedListener + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface StyledStringChangedListener { + /** + * Called before text changed. + * + * @type { ?Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + onWillChange?: Callback; + /** + * Called after text changed. + * + * @type { ?OnDidChangeCallback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + onDidChange?: OnDidChangeCallback; +} +/** + * Define the StyledString changed value. + * + * @interface StyledStringChangeValue + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export interface StyledStringChangeValue { + /** + * Range of the content to be replaced. + * + * @type { TextRange } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + range: TextRange; + /** + * StyledString to replace. + * + * @type { StyledString } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + replacementString: StyledString; + /** + * Preview StyledString + * + * @type { ?StyledString } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + previewText?: StyledString; +} +/** + * Define the LayoutManager for querying layout information. + * + * @interface LayoutManager + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface LayoutManager { + /** + * Get the line count. + * + * @returns { number } The line count value returned to the caller. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + getLineCount(): number; + /** + * Get the glyph position at coordinate. + * + * @param { number } x - the positionX of typography. + * @param { number } y - the positionY of typography. + * @returns { PositionWithAffinity } TextBlob object. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + getGlyphPositionAtCoordinate(x: number, y: number): PositionWithAffinity; +} +/** + * Position and affinity. + * + * @typedef PositionWithAffinity + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export interface PositionWithAffinity { + /** + * Position of text. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + position: number; +} +/** + * Defines the cursor style + * + * @interface CaretStyle + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export interface CaretStyle { + /** + * Set the cursor width + * + * @type { ?Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + width?: Length; + /** + * Set the cursor color + * + * @type { ?ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + color?: ResourceColor; +} +/** + * Defines the TextMenuItemId. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare class TextMenuItemId { + /** + * Init a TextMenuItemId with id. + * + * @param { ResourceStr } id - The id of the TextMenuItemId. + * @returns { TextMenuItemId } - Returns the TextMenuItemId object. + * @static + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + static of(id: ResourceStr): TextMenuItemId; + /** + * Judge if two TextMenuItemId are equal. + * + * @param { TextMenuItemId } id - id TextMenuItemId. + * @returns { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + equals(id: TextMenuItemId): boolean; + /** + * Indicates the TextMenuItemId to copy and delete the currently selected text. + * + * @type { TextMenuItemId } + * @readonly + * @static + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + static readonly CUT: TextMenuItemId; + /** + * Indicates the TextMenuItemId to copy the currently selected text to the clipboard. + * + * @type { TextMenuItemId } + * @readonly + * @static + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + static readonly COPY: TextMenuItemId; + /** + * Indicates the TextMenuItemId to copy the current contents of the clipboard into the text view. + * + * @type { TextMenuItemId } + * @readonly + * @static + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + static readonly PASTE: TextMenuItemId; + /** + * Indicates the TextMenuItemId to select all text in a text view. + * + * @type { TextMenuItemId } + * @readonly + * @static + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + static readonly SELECT_ALL: TextMenuItemId; + /** + * Indicates the TextMenuItemId for collaboration service menu items. + * + * @type { TextMenuItemId } + * @readonly + * @static + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + static readonly COLLABORATION_SERVICE: TextMenuItemId; + /** + * Indicates the TextMenuItemId to recognize the text in the picture and input it into the text view. + * + * @type { TextMenuItemId } + * @readonly + * @static + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + static readonly CAMERA_INPUT: TextMenuItemId; + /** + * Indicates the TextMenuItemId to help with text creation by invoking large models. + * + * @type { TextMenuItemId } + * @readonly + * @static + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + static readonly AI_WRITER: TextMenuItemId; + /** + * Indicates the TextMenuItemId to translate the selected content. + * + * @type { TextMenuItemId } + * @readonly + * @static + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + static readonly TRANSLATE: TextMenuItemId; + /** + * Indicates the TextMenuItemId to search the selected content. + * + * @type { TextMenuItemId } + * @readonly + * @static + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + static readonly SEARCH: TextMenuItemId; + /** + * Indicates the TextMenuItemId to share the selected content. + * + * @type { TextMenuItemId } + * @readonly + * @static + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + static readonly SHARE: TextMenuItemId; +} +/** + * TextMenuItem + * + * @interface TextMenuItem + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface TextMenuItem { + /** + * Customize what the menu displays. + * + * @type { ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + content: ResourceStr; + /** + * Customize the icon before the menu displays content. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + icon?: ResourceStr; + /** + * Distinguish clicked menu content by Id. + * + * @type { TextMenuItemId } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + id: TextMenuItemId; + /** + * Customize what the menu item shortcut displays. + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + labelInfo?: ResourceStr; +} +/** + * Callback function when the selection menu create. + * + * @typedef { function } OnCreateMenuCallback + * @param { Array } menuItems - currently displayed menu items. + * @returns { Array } Return the menu items will displayed after operations. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export type OnCreateMenuCallback = (menuItems: Array) => Array; +/** + * Invoke upon clicking an item, capable of intercepting the default system menu execution behavior. + * + * @typedef { function } OnMenuItemClickCallback + * @param { TextMenuItem } menuItem - current default menu. + * @param { TextRange } range - current selected range. + * @returns { boolean } - Return True, the event is consumed, false otherwise. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export type OnMenuItemClickCallback = (menuItem: TextMenuItem, range: TextRange) => boolean; +/** + * EditMenuOptions + * + * @interface EditMenuOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface EditMenuOptions { + /** + * Passes the default menu, invokes before every display to generate a menu for triggering click events. + * + * @type { OnCreateMenuCallback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + onCreateMenu: OnCreateMenuCallback; + /** + * Invoke upon clicking an item, capable of intercepting the default system menu execution behavior. + * + * @type { OnMenuItemClickCallback } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + onMenuItemClick: OnMenuItemClickCallback; +} +/** + * Defines the font decoration result. + * + * @interface DecorationStyleResult + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export interface DecorationStyleResult { + /** + * Font decoration type. + * + * @type { TextDecorationType } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + type: TextDecorationType; + /** + * Font decoration color. + * + * @type { ResourceColor } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + color: ResourceColor; + /** + * The style value of the decoration property object. + * + * @type { ?TextDecorationStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + style?: TextDecorationStyle; +} +/** + * Defines the options of font. + * + * @interface FontSettingOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface FontSettingOptions { + /** + * Define whether VariableFontWeight is supported. + * + * @type { ?boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + enableVariableFontWeight?: boolean; +} +/** +* The TextChangeOptions. +* @interface TextChangeOptions +* @syscap SystemCapability.ArkUI.ArkUI.Full +* @since 20 +*/ +export declare interface TextChangeOptions { + /** + * The selected area before the change. + * + * @type { TextRange } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + rangeBefore: TextRange; + /** + * The selected area after the change. + * + * @type { TextRange } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + rangeAfter: TextRange; + /** + * The content before the change. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + oldContent: string; + /** + * The info of PreviewText before the change. + * + * @type { PreviewText } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + oldPreviewText: PreviewText; +} +/** + * Define the editableText Component changed value. + * + * @interface EditableTextChangeValue + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export interface EditableTextChangeValue { + /** + * Value of body text, without previewText value. + * + * @type { string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + content: string; + /** + * Info of previewText, contains previewText value and start index. + * + * @type { ?PreviewText } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + previewText?: PreviewText; + /** + * The TextChangeOptions. + * + * @type { TextChangeOptions } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + options?: TextChangeOptions; +} +/** + * Defines text menu show mode. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare enum TextMenuShowMode { + /** + * Display the text selection menu in the current window. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + DEFAULT = 0, + /** + * Prefer to display the text selection menu in a separate window + * and continue to display it within the current window if a separate window is not supported + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + PREFER_WINDOW = 1 +} +/** + * Defines text menu options. + * + * @interface TextMenuOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface TextMenuOptions { + /** + * Text menu show mode. + * + * @type { ?TextMenuShowMode } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + showMode?: TextMenuShowMode; +} +/** + * Defines keyboard appearance. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare enum KeyboardAppearance { + /** + * Default appearance mode, don't adopt immersive styles + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + NONE_IMMERSIVE = 0, + /** + * Immersive mode + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + IMMERSIVE = 1, + /** + * Light immersive style + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + LIGHT_IMMERSIVE = 2, + /** + * Dark immersive style + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + DARK_IMMERSIVE = 3 +}