1/* 2 * Copyright (c) 2024-2025 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15/** 16 * @file 17 * @kit ArkUI 18 * @arkts 1.2 19 */ 20 21 22// WARNING! THIS FILE IS AUTO-GENERATED, DO NOT MAKE CHANGES, THEY WILL BE LOST ON NEXT GENERATION! 23 24import { TextOverflow, HitTestMode, ImageSize, Alignment, BorderStyle, ColoringStrategy, HoverEffect, Color, Visibility, ItemAlign, Direction, GradientDirection, ObscuredReasons, RenderFit, ImageRepeat, Axis, ResponseType, FunctionKey, ModifierKey, FontStyle, FontWeight, TextAlign, TextCase, CopyOptions, TextHeightAdaptivePolicy, WordBreak, LineBreakStrategy, EllipsisMode, TextSelectableMode } from './enums' 25import { memo, ComponentBuilder, __memo_context_type, __memo_id_type } from './../stateManagement/runtime' 26import { Resource } from './../../../api/global/resource' 27import { CommonMethod, DrawModifier, Rectangle, Callback_Array_TouchTestInfo_TouchResult, TouchTestInfo, TouchResult, PixelRoundPolicy, BackgroundEffectOptions, ForegroundEffectOptions, BorderImageOption, OutlineStyle, Callback_ClickEvent_Void, ClickEvent, Callback_Boolean_HoverEvent_Void, HoverEvent, AccessibilityCallback, Callback_MouseEvent_Void, MouseEvent, Callback_TouchEvent_Void, TouchEvent, Callback_KeyEvent_Void, KeyEvent, Callback_KeyEvent_Boolean, AnimateParam, TransitionOptions, TransitionEffect, MotionBlurOptions, InvertOptions, TranslateOptions, ScaleOptions, RotateOptions, Callback_Area_Area_Void, Literal_Union_Number_Literal_Number_offset_span_lg_md_sm_xs, Literal_Number_offset_span, AlignRuleOption, LocalizedAlignRuleOptions, ClickEffect, Callback_DragEvent_String_Union_CustomBuilder_DragItemInfo, DragEvent, CustomBuilder, DragItemInfo, Callback_DragEvent_String_Void, Callback_PreDragStatus_Void, PreDragStatus, Type_CommonMethod_linearGradient_value, Tuple_ResourceColor_Number, Type_CommonMethod_sweepGradient_value, Tuple_Length_Length, Type_CommonMethod_radialGradient_value, MotionPathOptions, ShadowOptions, ShadowStyle, ProgressMask, StateStyles, PixelStretchEffectOptions, AttributeModifier, GestureModifier, BackgroundBrightnessOptions, Callback_GestureInfo_BaseGestureEvent_GestureJudgeResult, GestureRecognizerJudgeBeginCallback, ShouldBuiltInRecognizerParallelWithCallback, Callback_TouchEvent_HitTestMode, SizeChangeCallback, SafeAreaType, SafeAreaEdge, Literal_Alignment_align, BlurStyle, BackgroundBlurStyleOptions, ForegroundBlurStyleOptions, TransitionFinishCallback, BlurOptions, LinearGradientBlurOptions, EffectType, sharedTransitionOptions, ChainStyle, DragPreviewOptions, DragInteractionOptions, OverlayOptions, BlendMode, BlendApplyType, GeometryTransitionOptions, PopupOptions, CustomPopupOptions, MenuElement, MenuOptions, ContextMenuOptions, ModalTransition, ContentCoverOptions, SheetOptions, VisibleAreaChangeCallback } from './common' 28import { VisualEffect, Filter, UniformDataType, Blender, Length, SizeOptions, ConstraintSizeOptions, ChainWeightOptions, Padding, LocalizedPadding, Margin, LocalizedMargin, ResourceColor, Position, BorderOptions, EdgeStyles, EdgeWidths, LocalizedEdgeWidths, EdgeColors, LocalizedEdgeColors, BorderRadiuses, LocalizedBorderRadiuses, OutlineOptions, EdgeOutlineStyles, Dimension, EdgeOutlineWidths, OutlineRadiuses, Area, Edges, LocalizedEdges, LocalizedPosition, ResourceStr, AccessibilityOptions, Font, PixelMap } from './units' 29import { ComponentContent } from './../ComponentContent' 30import { LengthMetrics } from './../Graphics' 31 32export interface TextOverflowOptions { 33 overflow: TextOverflow; 34} 35export type TextInterface = (content?: string | Resource, value?: TextOptions) => TextAttribute; 36export interface TextAttribute extends CommonMethod { 37 @memo 38 font(value: Font): this; 39 @memo 40 fontColor(value: ResourceColor): this; 41 @memo 42 fontSize(value: number | string | Resource): this; 43 @memo 44 minFontSize(value: number | string | Resource): this; 45 @memo 46 maxFontSize(value: number | string | Resource): this; 47 @memo 48 minFontScale(value: number | Resource): this; 49 @memo 50 maxFontScale(value: number | Resource): this; 51 @memo 52 fontStyle(value: FontStyle): this; 53 @memo 54 fontWeight(value: number | FontWeight | string): this; 55 @memo 56 lineSpacing(value: LengthMetrics): this; 57 @memo 58 textAlign(value: TextAlign): this; 59 @memo 60 lineHeight(value: number | string | Resource): this; 61 @memo 62 textOverflow(value: TextOverflowOptions): this; 63 @memo 64 fontFamily(value: string | Resource): this; 65 @memo 66 maxLines(value: number): this; 67 @memo 68 letterSpacing(value: number | string): this; 69 @memo 70 textCase(value: TextCase): this; 71 @memo 72 baselineOffset(value: number | string): this; 73 @memo 74 copyOption(value: CopyOptions): this; 75 @memo 76 draggable(value: boolean): this; 77 @memo 78 textShadow(value: ShadowOptions | Array<ShadowOptions>): this; 79 @memo 80 heightAdaptivePolicy(value: TextHeightAdaptivePolicy): this; 81 @memo 82 textIndent(value: Length): this; 83 @memo 84 wordBreak(value: WordBreak): this; 85 @memo 86 lineBreakStrategy(value: LineBreakStrategy): this; 87 @memo 88 onCopy(value: ((breakpoints: string) => void)): this; 89 @memo 90 caretColor(value: ResourceColor): this; 91 @memo 92 selectedBackgroundColor(value: ResourceColor): this; 93 @memo 94 ellipsisMode(value: EllipsisMode): this; 95 @memo 96 enableDataDetector(value: boolean): this; 97 @memo 98 onTextSelectionChange(value: ((first: number,last: number) => void)): this; 99 @memo 100 fontFeature(value: string): this; 101 @memo 102 privacySensitive(value: boolean): this; 103 @memo 104 textSelectable(value: TextSelectableMode): this; 105 @memo 106 halfLeading(value: boolean): this; 107 @memo 108 enableHapticFeedback(value: boolean): this; 109} 110export enum TextSpanType { 111 TEXT = 0, 112 IMAGE = 1, 113 MIXED = 2 114} 115export enum TextResponseType { 116 RIGHT_CLICK = 0, 117 LONG_PRESS = 1, 118 SELECT = 2 119} 120export interface TextOptions { 121 controller: TextController; 122} 123export declare class TextController { 124 closeSelectionMenu(): void 125} 126@memo 127@ComponentBuilder 128export declare function Text( 129 content?: string | Resource | undefined, 130 value?: TextOptions | undefined, 131 @memo 132 content_?: () => void, 133): TextAttribute 134