1/* 2 * Copyright (c) 2021-2023 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/** 17 * @file 18 * @kit ArkUI 19 */ 20 21/*** if arkts 1.2 */ 22import { KeyboardOptions, PasteEvent } from './richEditor'; 23import { CaretStyle, DeleteValue, EditMenuOptions, EditableTextOnChangeCallback, InsertValue, 24 AutoCapitalizationMode,EditableTextChangeValue,KeyboardAppearance } from './textCommon'; 25import { BarState, CopyOptions, FontStyle, FontWeight, LineBreakStrategy, TextContentStyle, TextAlign, TextOverflow, 26 TextHeightAdaptivePolicy, WordBreak, EllipsisMode } from './enums'; 27import { EnterKeyType, SubmitEvent, ContentType } from './textInput'; 28import { Dimension, Font, Length, LengthMetrics, ResourceColor, ResourceStr } from './units'; 29import { InputCounterOptions, TextContentControllerBase, SelectionOptions, 30 TextDecorationOptions, CommonMethod, Callback, Optional, Bindable } from './common'; 31import { CustomBuilder } from './builder'; 32import { Resource } from '../../global/resource'; 33/*** endif */ 34 35/** 36 * Provides the method of switching the cursor position. 37 * 38 * @extends TextContentControllerBase 39 * @since 8 40 */ 41/** 42 * Provides the method of switching the cursor position. 43 * 44 * @extends TextContentControllerBase 45 * @syscap SystemCapability.ArkUI.ArkUI.Full 46 * @crossplatform 47 * @since 10 48 */ 49/** 50 * Provides the method of switching the cursor position. 51 * 52 * @extends TextContentControllerBase 53 * @syscap SystemCapability.ArkUI.ArkUI.Full 54 * @crossplatform 55 * @atomicservice 56 * @since arkts {'1.1':'11','1.2':'20'} 57 * @arkts 1.1&1.2 58 */ 59declare class TextAreaController extends TextContentControllerBase { 60 /** 61 * constructor. 62 * 63 * @syscap SystemCapability.ArkUI.ArkUI.Full 64 * @since 8 65 */ 66 /** 67 * constructor. 68 * 69 * @syscap SystemCapability.ArkUI.ArkUI.Full 70 * @crossplatform 71 * @since 10 72 */ 73 /** 74 * constructor. 75 * A constructor used to create a TextAreaController object. 76 * 77 * @syscap SystemCapability.ArkUI.ArkUI.Full 78 * @crossplatform 79 * @atomicservice 80 * @since arkts {'1.1':'11','1.2':'20'} 81 * @arkts 1.1&1.2 82 */ 83 constructor(); 84 85 /** 86 * Called when the position of the insertion cursor is set. 87 * 88 * @param { number } value 89 * @syscap SystemCapability.ArkUI.ArkUI.Full 90 * @since 8 91 */ 92 /** 93 * Called when the position of the insertion cursor is set. 94 * 95 * @param { number } value 96 * @syscap SystemCapability.ArkUI.ArkUI.Full 97 * @crossplatform 98 * @since 10 99 */ 100 /** 101 * Called when the position of the insertion cursor is set. 102 * 103 * @param { number } value - Length from the start of the string to the position where the caret is located. 104 * @syscap SystemCapability.ArkUI.ArkUI.Full 105 * @crossplatform 106 * @atomicservice 107 * @since arkts {'1.1':'11','1.2':'20'} 108 * @arkts 1.1&1.2 109 */ 110 caretPosition(value: number): void; 111 112 /** 113 * Text selection is achieved by specifying the start and end positions of the text. 114 * 115 * @param { number } selectionStart - The start position of the selected text. 116 * @param { number } selectionEnd - The end position of the selected text. 117 * @syscap SystemCapability.ArkUI.ArkUI.Full 118 * @crossplatform 119 * @since 10 120 */ 121 /** 122 * Text selection is achieved by specifying the start and end positions of the text. 123 * 124 * @param { number } selectionStart - The start position of the selected text. 125 * @param { number } selectionEnd - The end position of the selected text. 126 * @syscap SystemCapability.ArkUI.ArkUI.Full 127 * @crossplatform 128 * @atomicservice 129 * @since 11 130 */ 131 /** 132 * Text selection is achieved by specifying the start and end positions of the text. 133 * 134 * <p><strong>NOTE</strong>: 135 * <br>If <em>selectionMenuHidden</em> is set to <em>true</em> or a 2-in-1 device is used, 136 * calling setTextSelection does not display the context menu even when options is set to <em>MenuPolicy.SHOW</em>. 137 * <br>If the selected text contains an emoji, 138 * the emoji is selected when its start position is within the text selection range. 139 * </p> 140 * 141 * @param { number } selectionStart - The start position of the selected text. 142 * The start position of text in the text box is 0. 143 * A value less than 0 is handled as 0. 144 * A value greater than the maximum text length is handled as the maximum text length. 145 * @param { number } selectionEnd - The end position of the selected text. 146 * A value less than 0 is handled as the value 0. 147 * A value greater than the maximum text length is handled as the maximum text length. 148 * @param { SelectionOptions } [options] - Indicates the options of the text selection.Default value is MenuPolicy.DEFAULT. 149 * @syscap SystemCapability.ArkUI.ArkUI.Full 150 * @crossplatform 151 * @atomicservice 152 * @since arkts {'1.1':'12','1.2':'20'} 153 * @arkts 1.1&1.2 154 */ 155 setTextSelection(selectionStart: number, selectionEnd: number, options?: SelectionOptions): void; 156 157 /** 158 * Exit edit state. 159 * 160 * @syscap SystemCapability.ArkUI.ArkUI.Full 161 * @crossplatform 162 * @since 10 163 */ 164 /** 165 * Exit edit state. 166 * 167 * @syscap SystemCapability.ArkUI.ArkUI.Full 168 * @crossplatform 169 * @atomicservice 170 * @since arkts {'1.1':'11','1.2':'20'} 171 * @arkts 1.1&1.2 172 */ 173 stopEditing(): void; 174} 175 176/** 177 * Defines the options of TextArea. 178 * 179 * @interface TextAreaOptions 180 * @syscap SystemCapability.ArkUI.ArkUI.Full 181 * @since 7 182 */ 183/** 184 * Defines the options of TextArea. 185 * 186 * @interface TextAreaOptions 187 * @syscap SystemCapability.ArkUI.ArkUI.Full 188 * @crossplatform 189 * @since 10 190 */ 191/** 192 * Defines the options of TextArea. 193 * 194 * @interface TextAreaOptions 195 * @syscap SystemCapability.ArkUI.ArkUI.Full 196 * @crossplatform 197 * @atomicservice 198 * @since arkts {'1.1':'11','1.2':'20'} 199 * @arkts 1.1&1.2 200 */ 201declare interface TextAreaOptions { 202 /** 203 * The place holder text string. 204 * 205 * @type { ?ResourceStr } 206 * @syscap SystemCapability.ArkUI.ArkUI.Full 207 * @since 7 208 */ 209 /** 210 * The place holder text string. 211 * 212 * @type { ?ResourceStr } 213 * @syscap SystemCapability.ArkUI.ArkUI.Full 214 * @crossplatform 215 * @since 10 216 */ 217 /** 218 * The place holder text string. 219 * Text displayed when there is no input. 220 * 221 * <p><strong>NOTE</strong>: 222 * <br>When only the placeholder attribute is set, the text selection handle is still available. 223 * <br>The caret stays at the beginning of the placeholder text when the handle is released. 224 * </p> 225 * 226 * @type { ?ResourceStr } 227 * @syscap SystemCapability.ArkUI.ArkUI.Full 228 * @crossplatform 229 * @atomicservice 230 * @since arkts {'1.1':'11','1.2':'20'} 231 * @arkts 1.1&1.2 232 */ 233 placeholder?: ResourceStr; 234 235 /** 236 * Sets the current value of TextArea. 237 * 238 * @type { ?ResourceStr } 239 * @syscap SystemCapability.ArkUI.ArkUI.Full 240 * @since 7 241 */ 242 /** 243 * Sets the current value of TextArea. 244 * 245 * @type { ?ResourceStr } 246 * @syscap SystemCapability.ArkUI.ArkUI.Full 247 * @crossplatform 248 * @since 10 249 */ 250 /** 251 * Sets the current value of TextArea. 252 * 253 * <p><strong>NOTE</strong>: 254 * <br>You are advised to bind the state variable to the text in real time through the onChange event, 255 * so as to prevent display errors when the component is updated. 256 * </p> 257 * 258 * @type { ?ResourceStr } 259 * @syscap SystemCapability.ArkUI.ArkUI.Full 260 * @crossplatform 261 * @atomicservice 262 * @since 11 263 */ 264 text?: ResourceStr; 265 266 /** 267 * Sets the current value of TextArea. 268 * 269 * @type { ?(ResourceStr | Bindable<ResourceStr> | Bindable<Resource> | Bindable<string>) } 270 * @syscap SystemCapability.ArkUI.ArkUI.Full 271 * @crossplatform 272 * @atomicservice 273 * @since 20 274 * @arkts 1.2 275 */ 276 text?: ResourceStr | Bindable<ResourceStr> | Bindable<Resource> | Bindable<string>; 277 278 /** 279 * Called when the position of the insertion cursor is set. 280 * 281 * @type { ?TextAreaController } 282 * @syscap SystemCapability.ArkUI.ArkUI.Full 283 * @since 8 284 */ 285 /** 286 * Called when the position of the insertion cursor is set. 287 * 288 * @type { ?TextAreaController } 289 * @syscap SystemCapability.ArkUI.ArkUI.Full 290 * @crossplatform 291 * @since 10 292 */ 293 /** 294 * Called when the position of the insertion cursor is set. 295 * 296 * @type { ?TextAreaController } 297 * @syscap SystemCapability.ArkUI.ArkUI.Full 298 * @crossplatform 299 * @atomicservice 300 * @since arkts {'1.1':'11','1.2':'20'} 301 * @arkts 1.1&1.2 302 */ 303 controller?: TextAreaController; 304} 305 306/** 307 * Provides an interface for the multi-line text input component. 308 * 309 * @interface TextAreaInterface 310 * @syscap SystemCapability.ArkUI.ArkUI.Full 311 * @since 7 312 */ 313/** 314 * Provides an interface for the multi-line text input component. 315 * 316 * @interface TextAreaInterface 317 * @syscap SystemCapability.ArkUI.ArkUI.Full 318 * @crossplatform 319 * @since 10 320 */ 321/** 322 * Provides an interface for the multi-line text input component. 323 * 324 * @interface TextAreaInterface 325 * @syscap SystemCapability.ArkUI.ArkUI.Full 326 * @crossplatform 327 * @atomicservice 328 * @since arkts {'1.1':'11','1.2':'20'} 329 * @arkts 1.1&1.2 330 */ 331interface TextAreaInterface { 332 /** 333 * Called when writing multiple lines of text. 334 * 335 * @param { TextAreaOptions } value 336 * @returns { TextAreaAttribute } 337 * @syscap SystemCapability.ArkUI.ArkUI.Full 338 * @since 7 339 */ 340 /** 341 * Called when writing multiple lines of text. 342 * 343 * @param { TextAreaOptions } value 344 * @returns { TextAreaAttribute } 345 * @syscap SystemCapability.ArkUI.ArkUI.Full 346 * @crossplatform 347 * @since 10 348 */ 349 /** 350 * Called when writing multiple lines of text. 351 * 352 * @param { TextAreaOptions } value 353 * @returns { TextAreaAttribute } 354 * @syscap SystemCapability.ArkUI.ArkUI.Full 355 * @crossplatform 356 * @atomicservice 357 * @since arkts {'1.1':'11','1.2':'20'} 358 * @arkts 1.1&1.2 359 */ 360 (value?: TextAreaOptions): TextAreaAttribute; 361} 362 363/** 364 * Declare the type of input box 365 * 366 * @enum { number } 367 * @syscap SystemCapability.ArkUI.ArkUI.Full 368 * @crossplatform 369 * @since 11 370 */ 371/** 372 * Declare the type of input box 373 * 374 * @enum { number } 375 * @syscap SystemCapability.ArkUI.ArkUI.Full 376 * @crossplatform 377 * @atomicservice 378 * @since arkts {'1.1':'12','1.2':'20'} 379 * @arkts 1.1&1.2 380 */ 381declare enum TextAreaType { 382 /** 383 * Basic input mode. 384 * 385 * @syscap SystemCapability.ArkUI.ArkUI.Full 386 * @crossplatform 387 * @since 11 388 */ 389 /** 390 * Basic input mode. 391 * The value can contain digits, letters, underscores (_), spaces, and special characters. 392 * @syscap SystemCapability.ArkUI.ArkUI.Full 393 * @crossplatform 394 * @atomicservice 395 * @since arkts {'1.1':'12','1.2':'20'} 396 * @arkts 1.1&1.2 397 */ 398 NORMAL = 0, 399 400 /** 401 * Pure digital input mode. 402 * 403 * @syscap SystemCapability.ArkUI.ArkUI.Full 404 * @crossplatform 405 * @since 11 406 */ 407 /** 408 * Pure digital input mode. 409 * 410 * @syscap SystemCapability.ArkUI.ArkUI.Full 411 * @crossplatform 412 * @atomicservice 413 * @since arkts {'1.1':'12','1.2':'20'} 414 * @arkts 1.1&1.2 415 */ 416 NUMBER = 2, 417 418 /** 419 * Phone number entry mode. 420 * 421 * @syscap SystemCapability.ArkUI.ArkUI.Full 422 * @crossplatform 423 * @since 11 424 */ 425 /** 426 * Phone number entry mode. 427 * In this mode, the following are allowed: digits, spaces, plus signs (+), hyphens (-), asterisks (*), and number signs (#). 428 * the length is not limited. 429 * @syscap SystemCapability.ArkUI.ArkUI.Full 430 * @crossplatform 431 * @atomicservice 432 * @since arkts {'1.1':'12','1.2':'20'} 433 * @arkts 1.1&1.2 434 */ 435 PHONE_NUMBER = 3, 436 437 /** 438 * E-mail address input mode. 439 * 440 * @syscap SystemCapability.ArkUI.ArkUI.Full 441 * @crossplatform 442 * @since 11 443 */ 444 /** 445 * E-mail address input mode. 446 * This mode accepts only digits, letters, underscores (_), dots (.), 447 * and the following special characters: ! # $ % & ' * + - / = ? ^ ` { | } ~ @ (which can only appear once). 448 * @syscap SystemCapability.ArkUI.ArkUI.Full 449 * @crossplatform 450 * @atomicservice 451 * @since arkts {'1.1':'12','1.2':'20'} 452 * @arkts 1.1&1.2 453 */ 454 EMAIL = 5, 455 456 /** 457 * Number decimal entry mode. 458 * The value can contain digits and one decimal point. 459 * @syscap SystemCapability.ArkUI.ArkUI.Full 460 * @crossplatform 461 * @atomicservice 462 * @since arkts {'1.1':'12','1.2':'20'} 463 * @arkts 1.1&1.2 464 */ 465 NUMBER_DECIMAL = 12, 466 467 /** 468 * URL entry mode. 469 * 470 * @syscap SystemCapability.ArkUI.ArkUI.Full 471 * @crossplatform 472 * @atomicservice 473 * @since arkts {'1.1':'12','1.2':'20'} 474 * @arkts 1.1&1.2 475 */ 476 URL = 13, 477 478 /** 479 * One time code mode. 480 * 481 * @syscap SystemCapability.ArkUI.ArkUI.Full 482 * @atomicservice 483 * @since 20 484 */ 485 ONE_TIME_CODE = 14, 486} 487 488/** 489 * Declare the event listener callback of the enter key. 490 * 491 * @typedef { function } TextAreaSubmitCallback 492 * @param { EnterKeyType } enterKeyType - The enter key type of soft keyboard. 493 * If the type is EnterKeyType.NEW_LINE, onSubmit is not triggered. 494 * @param { SubmitEvent } [event] - Provides the method of keeping textArea editable state when submitted. 495 * @syscap SystemCapability.ArkUI.ArkUI.Full 496 * @crossplatform 497 * @atomicservice 498 * @since arkts {'1.1':'14','1.2':'20'} 499 * @arkts 1.1&1.2 500 */ 501declare type TextAreaSubmitCallback = (enterKeyType: EnterKeyType, event?: SubmitEvent) => void; 502 503/** 504 * Defines the attribute functions of TextArea. 505 * 506 * @extends CommonMethod<TextAreaAttribute> 507 * @syscap SystemCapability.ArkUI.ArkUI.Full 508 * @since 7 509 */ 510/** 511 * Defines the attribute functions of TextArea. 512 * 513 * @extends CommonMethod<TextAreaAttribute> 514 * @syscap SystemCapability.ArkUI.ArkUI.Full 515 * @crossplatform 516 * @since 10 517 */ 518/** 519 * Defines the attribute functions of TextArea. 520 * 521 * @extends CommonMethod<TextAreaAttribute> 522 * @syscap SystemCapability.ArkUI.ArkUI.Full 523 * @crossplatform 524 * @atomicservice 525 * @since arkts {'1.1':'11','1.2':'20'} 526 * @arkts 1.1&1.2 527 */ 528declare class TextAreaAttribute extends CommonMethod<TextAreaAttribute> { 529 /** 530 * Called when the color of the placeholder is set. 531 * 532 * @param { ResourceColor } value 533 * @returns { TextAreaAttribute } 534 * @syscap SystemCapability.ArkUI.ArkUI.Full 535 * @since 7 536 */ 537 /** 538 * Called when the color of the placeholder is set. 539 * 540 * @param { ResourceColor } value 541 * @returns { TextAreaAttribute } 542 * @syscap SystemCapability.ArkUI.ArkUI.Full 543 * @crossplatform 544 * @since 10 545 */ 546 /** 547 * Called when the color of the placeholder is set. 548 * 549 * @param { ResourceColor } value - Default value follows the theme. 550 * @returns { TextAreaAttribute } 551 * @syscap SystemCapability.ArkUI.ArkUI.Full 552 * @crossplatform 553 * @atomicservice 554 * @since arkts {'1.1':'11','1.2':'20'} 555 * @arkts 1.1&1.2 556 */ 557 placeholderColor(value: ResourceColor): TextAreaAttribute; 558 559 /** 560 * Called when the font property of the placeholder is set. 561 * 562 * @param { Font } value 563 * @returns { TextAreaAttribute } 564 * @syscap SystemCapability.ArkUI.ArkUI.Full 565 * @since 7 566 */ 567 /** 568 * Called when the font property of the placeholder is set. 569 * 570 * @param { Font } value 571 * @returns { TextAreaAttribute } 572 * @syscap SystemCapability.ArkUI.ArkUI.Full 573 * @crossplatform 574 * @since 10 575 */ 576 /** 577 * Called when the font property of the placeholder is set. 578 * The 'HarmonyOS Sans' font and registered custom fonts are supported. 579 * 580 * @param { Font } value 581 * @returns { TextAreaAttribute } 582 * @syscap SystemCapability.ArkUI.ArkUI.Full 583 * @crossplatform 584 * @atomicservice 585 * @since arkts {'1.1':'11','1.2':'20'} 586 * @arkts 1.1&1.2 587 */ 588 placeholderFont(value: Font): TextAreaAttribute; 589 590 /** 591 * Called when the type of soft keyboard input button is set. 592 * 593 * @param { EnterKeyType } value the type of soft keyboard 594 * @returns { TextAreaAttribute } 595 * @syscap SystemCapability.ArkUI.ArkUI.Full 596 * @crossplatform 597 * @since 11 598 */ 599 /** 600 * Called when the type of soft keyboard input button is set. 601 * 602 * @param { EnterKeyType } value the type of soft keyboard - Default value is EnterKeyType.NEW_LINE. 603 * @returns { TextAreaAttribute } 604 * @syscap SystemCapability.ArkUI.ArkUI.Full 605 * @crossplatform 606 * @atomicservice 607 * @since arkts {'1.1':'12','1.2':'20'} 608 * @arkts 1.1&1.2 609 */ 610 enterKeyType(value: EnterKeyType): TextAreaAttribute; 611 612 /** 613 * Called when the alignment of the contents of a multiline text box is set. 614 * 615 * @param { TextAlign } value 616 * @returns { TextAreaAttribute } 617 * @syscap SystemCapability.ArkUI.ArkUI.Full 618 * @since 7 619 */ 620 /** 621 * Called when the alignment of the contents of a multiline text box is set. 622 * 623 * @param { TextAlign } value 624 * @returns { TextAreaAttribute } 625 * @syscap SystemCapability.ArkUI.ArkUI.Full 626 * @crossplatform 627 * @since 10 628 */ 629 /** 630 * Called when the alignment of the contents of a multiline text box is set. 631 * 632 * <p><strong>NOTE</strong>: 633 * <br>To set vertical alignment for the text, use the align attribute. 634 * <br>The align attribute alone does not control the horizontal position of the text. 635 * <br>In other words, Alignment.TopStart, Alignment.Top, and Alignment.TopEnd produce the same effect, 636 * top-aligning the text; Alignment.Start, Alignment.Center, and Alignment.End produce the same effect, 637 * centered-aligning the text vertically; Alignment.BottomStart, Alignment.Bottom, 638 * and Alignment.BottomEnd produce the same effect, bottom-aligning the text. 639 * <br>When textAlign is set to TextAlign.JUSTIFY, the text in the last line is horizontally aligned with the start edge. 640 * <br>Since API version 11, textAlign can be set to TextAlign.JUSTIFY. 641 * </p> 642 * 643 * @param { TextAlign } value - Default value is TextAlign.Start. 644 * @returns { TextAreaAttribute } 645 * @syscap SystemCapability.ArkUI.ArkUI.Full 646 * @crossplatform 647 * @atomicservice 648 * @since arkts {'1.1':'11','1.2':'20'} 649 * @arkts 1.1&1.2 650 */ 651 textAlign(value: TextAlign): TextAreaAttribute; 652 653 /** 654 * Called when the insertion cursor color is set. 655 * 656 * @param { ResourceColor } value 657 * @returns { TextAreaAttribute } 658 * @syscap SystemCapability.ArkUI.ArkUI.Full 659 * @since 7 660 */ 661 /** 662 * Called when the insertion cursor color is set. 663 * 664 * @param { ResourceColor } value 665 * @returns { TextAreaAttribute } 666 * @syscap SystemCapability.ArkUI.ArkUI.Full 667 * @crossplatform 668 * @since 10 669 */ 670 /** 671 * Called when the insertion cursor color is set. 672 * 673 * <p><strong>NOTE</strong>: 674 * <br>Since API version 12, this API can be used to set the text handle color, which is the same as the caret color. 675 * </p> 676 * 677 * @param { ResourceColor } value - Default value is '#007DFF'. 678 * @returns { TextAreaAttribute } 679 * @syscap SystemCapability.ArkUI.ArkUI.Full 680 * @crossplatform 681 * @atomicservice 682 * @since arkts {'1.1':'11','1.2':'20'} 683 * @arkts 1.1&1.2 684 */ 685 caretColor(value: ResourceColor): TextAreaAttribute; 686 687 /** 688 * Called when the font color is set. 689 * 690 * @param { ResourceColor } value 691 * @returns { TextAreaAttribute } 692 * @syscap SystemCapability.ArkUI.ArkUI.Full 693 * @since 7 694 */ 695 /** 696 * Called when the font color is set. 697 * 698 * @param { ResourceColor } value 699 * @returns { TextAreaAttribute } 700 * @syscap SystemCapability.ArkUI.ArkUI.Full 701 * @crossplatform 702 * @since 10 703 */ 704 /** 705 * Called when the font color is set. 706 * 707 * @param { ResourceColor } value 708 * @returns { TextAreaAttribute } 709 * @syscap SystemCapability.ArkUI.ArkUI.Full 710 * @crossplatform 711 * @atomicservice 712 * @since arkts {'1.1':'11','1.2':'20'} 713 * @arkts 1.1&1.2 714 */ 715 fontColor(value: ResourceColor): TextAreaAttribute; 716 717 /** 718 * Called when the font size is set. 719 * 720 * @param { Length } value 721 * @returns { TextAreaAttribute } 722 * @syscap SystemCapability.ArkUI.ArkUI.Full 723 * @since 7 724 */ 725 /** 726 * Called when the font size is set. 727 * 728 * @param { Length } value 729 * @returns { TextAreaAttribute } 730 * @syscap SystemCapability.ArkUI.ArkUI.Full 731 * @crossplatform 732 * @since 10 733 */ 734 /** 735 * Called when the font size is set. 736 * 737 * @param { Length } value - Default value is 16fp.The default value on wearable devices is 18fp. 738 * If fontSize is of the number type, the unit fp is used. 739 * This parameter cannot be set in percentage. 740 * @returns { TextAreaAttribute } 741 * @syscap SystemCapability.ArkUI.ArkUI.Full 742 * @crossplatform 743 * @atomicservice 744 * @since arkts {'1.1':'11','1.2':'20'} 745 * @arkts 1.1&1.2 746 */ 747 fontSize(value: Length): TextAreaAttribute; 748 749 /** 750 * Called when the font style of a font is set. 751 * 752 * @param { FontStyle } value 753 * @returns { TextAreaAttribute } 754 * @syscap SystemCapability.ArkUI.ArkUI.Full 755 * @since 7 756 */ 757 /** 758 * Called when the font style of a font is set. 759 * 760 * @param { FontStyle } value 761 * @returns { TextAreaAttribute } 762 * @syscap SystemCapability.ArkUI.ArkUI.Full 763 * @crossplatform 764 * @since 10 765 */ 766 /** 767 * Called when the font style of a font is set. 768 * 769 * @param { FontStyle } value - Default value is FontStyle.Normal. 770 * @returns { TextAreaAttribute } 771 * @syscap SystemCapability.ArkUI.ArkUI.Full 772 * @crossplatform 773 * @atomicservice 774 * @since arkts {'1.1':'11','1.2':'20'} 775 * @arkts 1.1&1.2 776 */ 777 fontStyle(value: FontStyle): TextAreaAttribute; 778 779 /** 780 * Called when the font weight is set. 781 * 782 * @param { number | FontWeight | string } value 783 * @returns { TextAreaAttribute } 784 * @syscap SystemCapability.ArkUI.ArkUI.Full 785 * @since 7 786 */ 787 /** 788 * Called when the font weight is set. 789 * 790 * @param { number | FontWeight | string } value 791 * @returns { TextAreaAttribute } 792 * @syscap SystemCapability.ArkUI.ArkUI.Full 793 * @crossplatform 794 * @since 10 795 */ 796 /** 797 * Called when the font weight is set. 798 * 799 * <p><strong>NOTE</strong>: 800 * <br>If the value is too large, the text may be clipped depending on the font. 801 * <br>For the number type, the value range is [100, 900], at an interval of 100. The default value is 400. 802 * <br>A larger value indicates a heavier font weight. 803 * <br>For the string type, only strings that represent a number, for example, "400", 804 * and the following enumerated values of FontWeight are supported: "bold", "bolder", "lighter", "regular", and "medium". 805 * </p> 806 * 807 * @param { number | FontWeight | string } value - Default value is FontWeight.Normal. 808 * @returns { TextAreaAttribute } 809 * @syscap SystemCapability.ArkUI.ArkUI.Full 810 * @crossplatform 811 * @atomicservice 812 * @since 11 813 */ 814 /** 815 * Called when the font weight is set. 816 * 817 * @param { number | FontWeight | ResourceStr } value 818 * @returns { TextAreaAttribute } 819 * @syscap SystemCapability.ArkUI.ArkUI.Full 820 * @crossplatform 821 * @atomicservice 822 * @since 20 823 * @arkts 1.1&1.2 824 */ 825 fontWeight(value: number | FontWeight | ResourceStr): TextAreaAttribute; 826 827 /** 828 * Called when the font list of text is set. 829 * 830 * @param { ResourceStr } value 831 * @returns { TextAreaAttribute } 832 * @syscap SystemCapability.ArkUI.ArkUI.Full 833 * @since 7 834 */ 835 /** 836 * Called when the font list of text is set. 837 * 838 * @param { ResourceStr } value 839 * @returns { TextAreaAttribute } 840 * @syscap SystemCapability.ArkUI.ArkUI.Full 841 * @crossplatform 842 * @since 10 843 */ 844 /** 845 * Called when the font list of text is set. 846 * 847 * <p><strong>NOTE</strong>: 848 * <br>The 'HarmonyOS Sans' font and registered custom fonts are supported for applications. 849 * <br>Only the 'HarmonyOS Sans' font is supported for widgets. 850 * </p> 851 * 852 * @param { ResourceStr } value - Default value is 'HarmonyOS Sans'. 853 * @returns { TextAreaAttribute } 854 * @syscap SystemCapability.ArkUI.ArkUI.Full 855 * @crossplatform 856 * @atomicservice 857 * @since arkts {'1.1':'11','1.2':'20'} 858 * @arkts 1.1&1.2 859 */ 860 fontFamily(value: ResourceStr): TextAreaAttribute; 861 862 /** 863 * Called when the overflow mode of the font is set. 864 * 865 * <p><strong>NOTE</strong>: 866 * <br>In inline style, the effect of truncating text according to maxLines only applies when textOverflow is set. 867 * <br>Text is clipped at the transition between words. 868 * <br>To clip text in the middle of a word, set wordBreak to WordBreak.BREAK_ALL. 869 * <br>If overflow is set to TextOverflow.None, TextOverflow.Clip, or TextOverflow.Ellipsis, 870 * this attribute must be used with maxLines for the settings to take effect. 871 * <br>TextOverflow.None produces the same effect as TextOverflow.Clip. 872 * </p> 873 * 874 * @param { TextOverflow } value - Default value is TextOverflow.Clip. 875 * @returns { TextAreaAttribute } 876 * @syscap SystemCapability.ArkUI.ArkUI.Full 877 * @crossplatform 878 * @atomicservice 879 * @since arkts {'1.1':'12','1.2':'20'} 880 * @arkts 1.1&1.2 881 */ 882 textOverflow(value: TextOverflow): TextAreaAttribute; 883 884 /** 885 * Specify the indentation of the first line in a text-block. 886 * 887 * @param { Dimension } value - The length of text indent.Default value is 0. 888 * @returns { TextAreaAttribute } The attribute of the text. 889 * @syscap SystemCapability.ArkUI.ArkUI.Full 890 * @crossplatform 891 * @atomicservice 892 * @since arkts {'1.1':'12','1.2':'20'} 893 * @arkts 1.1&1.2 894 */ 895 textIndent(value: Dimension): TextAreaAttribute; 896 897 /** 898 * Called when the inputFilter of text is set. 899 * 900 * @param { ResourceStr } value 901 * @param { function } error 902 * @returns { TextAreaAttribute } 903 * @syscap SystemCapability.ArkUI.ArkUI.Full 904 * @since 8 905 */ 906 /** 907 * Called when the inputFilter of text is set. 908 * 909 * @param { ResourceStr } value 910 * @param { function } error 911 * @returns { TextAreaAttribute } 912 * @syscap SystemCapability.ArkUI.ArkUI.Full 913 * @crossplatform 914 * @since 10 915 */ 916 /** 917 * Called when the inputFilter of text is set. 918 * 919 * <p><strong>NOTE</strong>: 920 * <br>Only inputs that comply with the regular expression can be displayed. 921 * <br>Other inputs are filtered out. 922 * <br>The specified regular expression can match single characters, but not strings. 923 * </p> 924 * 925 * @param { ResourceStr } value 926 * @param { function } error 927 * @returns { TextAreaAttribute } 928 * @syscap SystemCapability.ArkUI.ArkUI.Full 929 * @crossplatform 930 * @atomicservice 931 * @since arkts {'1.1':'11','1.2':'20'} 932 * @arkts 1.1&1.2 933 */ 934 inputFilter(value: ResourceStr, error?: (value: string) => void): TextAreaAttribute; 935 936 /** 937 * Define the caret style of the text input. 938 * 939 * @param { CaretStyle } value 940 * @returns { TextAreaAttribute } 941 * @syscap SystemCapability.ArkUI.ArkUI.Full 942 * @crossplatform 943 * @atomicservice 944 * @since arkts {'1.1':'12','1.2':'20'} 945 * @arkts 1.1&1.2 946 */ 947 caretStyle(value: CaretStyle): TextAreaAttribute; 948 949 /** 950 * Define the text selected background color of the text input. 951 * If the opacity is not set, a 20% opacity will be used. 952 * 953 * @param { ResourceColor } value 954 * @returns { TextAreaAttribute } 955 * @syscap SystemCapability.ArkUI.ArkUI.Full 956 * @crossplatform 957 * @atomicservice 958 * @since arkts {'1.1':'12','1.2':'20'} 959 * @arkts 1.1&1.2 960 */ 961 selectedBackgroundColor(value: ResourceColor): TextAreaAttribute; 962 963 /** 964 * Called when submitted. 965 * 966 * @param { function } callback 967 * @returns { TextAreaAttribute } 968 * @syscap SystemCapability.ArkUI.ArkUI.Full 969 * @crossplatform 970 * @since 11 971 */ 972 /** 973 * Called when submitted. 974 * 975 * @param { function } callback - If it is EnterKeyType.NEW_LINE and the text box is in inline input style, onSubmit is not triggered. 976 * @returns { TextAreaAttribute } 977 * @syscap SystemCapability.ArkUI.ArkUI.Full 978 * @crossplatform 979 * @atomicservice 980 * @since 12 981 */ 982 onSubmit(callback: (enterKey: EnterKeyType) => void): TextAreaAttribute; 983 /** 984 * Called when submitted. 985 * Triggered when the Enter key on the soft keyboard is pressed, 986 * providing methods to maintain the editing state of the TextArea component upon submission. 987 * 988 * @param { TextAreaSubmitCallback } callback - callback of the listened event. 989 * @returns { TextAreaAttribute } 990 * @syscap SystemCapability.ArkUI.ArkUI.Full 991 * @crossplatform 992 * @atomicservice 993 * @since 14 994 */ 995 onSubmit(callback: TextAreaSubmitCallback): TextAreaAttribute; 996 /** 997 * Called when submitted. 998 * 999 * @param { ((enterKey: EnterKeyType) => void) | TextAreaSubmitCallback } callback - callback of the listened event. 1000 * @returns { TextAreaAttribute } 1001 * @syscap SystemCapability.ArkUI.ArkUI.Full 1002 * @crossplatform 1003 * @atomicservice 1004 * @since 20 1005 * @arkts 1.2 1006 */ 1007 onSubmit(callback: ((enterKey: EnterKeyType) => void) | TextAreaSubmitCallback): TextAreaAttribute; 1008 1009 /** 1010 * Called when the input changes. 1011 * 1012 * @param { function } callback 1013 * @returns { TextAreaAttribute } 1014 * @syscap SystemCapability.ArkUI.ArkUI.Full 1015 * @since 7 1016 */ 1017 /** 1018 * Called when the input changes. 1019 * 1020 * @param { function } callback 1021 * @returns { TextAreaAttribute } 1022 * @syscap SystemCapability.ArkUI.ArkUI.Full 1023 * @crossplatform 1024 * @since 10 1025 */ 1026 /** 1027 * Called when the input changes. 1028 * 1029 * @param { function } callback 1030 * @returns { TextAreaAttribute } 1031 * @syscap SystemCapability.ArkUI.ArkUI.Full 1032 * @crossplatform 1033 * @atomicservice 1034 * @since 11 1035 */ 1036 /** 1037 * Called when the input changes. 1038 * 1039 * <p><strong>NOTE</strong>: 1040 * <br>In this callback, if cursor operations are performed, 1041 * you need to adjust the cursor logic based on the previewText parameter 1042 * to make sure it works seamlessly under the preview display scenario. 1043 * </p> 1044 * 1045 * @param { EditableTextOnChangeCallback } callback 1046 * @returns { TextAreaAttribute } 1047 * @syscap SystemCapability.ArkUI.ArkUI.Full 1048 * @crossplatform 1049 * @atomicservice 1050 * @since arkts {'1.1':'12','1.2':'20'} 1051 * @arkts 1.1&1.2 1052 */ 1053 onChange(callback: EditableTextOnChangeCallback): TextAreaAttribute; 1054 1055 /** 1056 * Called when the text selection changes. 1057 * 1058 * @param { function } callback - callback of the listened event. 1059 * @returns { TextAreaAttribute } returns the instance of the TextAreaAttribute. 1060 * @syscap SystemCapability.ArkUI.ArkUI.Full 1061 * @crossplatform 1062 * @since 10 1063 */ 1064 /** 1065 * Called when the text selection changes. 1066 * 1067 * @param { function } callback - callback of the listened event. 1068 * { number } selectionStart - The start position of text is 0. 1069 * @returns { TextAreaAttribute } returns the instance of the TextAreaAttribute. 1070 * @syscap SystemCapability.ArkUI.ArkUI.Full 1071 * @crossplatform 1072 * @atomicservice 1073 * @since arkts {'1.1':'11','1.2':'20'} 1074 * @arkts 1.1&1.2 1075 */ 1076 onTextSelectionChange(callback: (selectionStart: number, selectionEnd: number) => void): TextAreaAttribute; 1077 1078 /** 1079 * Called when the content scrolls. 1080 * 1081 * @param { function } callback - callback of the listened event. 1082 * @returns { TextAreaAttribute } returns the instance of the TextAreaAttribute. 1083 * @syscap SystemCapability.ArkUI.ArkUI.Full 1084 * @crossplatform 1085 * @since 10 1086 */ 1087 /** 1088 * Called when the content scrolls. 1089 * 1090 * @param { function } callback - callback of the listened event. 1091 * { number } totalOffsetX - The unit is px. 1092 * { number } totalOffsetY - The unit is px. 1093 * @returns { TextAreaAttribute } returns the instance of the TextAreaAttribute. 1094 * @syscap SystemCapability.ArkUI.ArkUI.Full 1095 * @crossplatform 1096 * @atomicservice 1097 * @since arkts {'1.1':'11','1.2':'20'} 1098 * @arkts 1.1&1.2 1099 */ 1100 onContentScroll(callback: (totalOffsetX: number, totalOffsetY: number) => void): TextAreaAttribute; 1101 1102 /** 1103 * Called when judging whether the text editing change finished. 1104 * 1105 * @param { function } callback - Triggered when the text area status changes. 1106 * If the value of isEditing is true, text area is in progress. 1107 * @returns { TextAreaAttribute } 1108 * @syscap SystemCapability.ArkUI.ArkUI.Full 1109 * @crossplatform 1110 * @since 10 1111 */ 1112 /** 1113 * Called when judging whether the text editing change finished. 1114 * The text box is in the editing state when it has the caret placed in it, and is in the non-editing state otherwise. 1115 * 1116 * @param { function } callback - Triggered when the text area status changes. 1117 * If the value of isEditing is true, text area is in progress. 1118 * @returns { TextAreaAttribute } 1119 * @syscap SystemCapability.ArkUI.ArkUI.Full 1120 * @crossplatform 1121 * @atomicservice 1122 * @since arkts {'1.1':'11','1.2':'20'} 1123 * @arkts 1.1&1.2 1124 */ 1125 onEditChange(callback: (isEditing: boolean) => void): TextAreaAttribute; 1126 1127 /** 1128 * Called when using the Clipboard menu 1129 * 1130 * @param { function } callback 1131 * @returns { TextAreaAttribute } 1132 * @syscap SystemCapability.ArkUI.ArkUI.Full 1133 * @since 8 1134 */ 1135 /** 1136 * Called when using the Clipboard menu 1137 * 1138 * @param { function } callback 1139 * @returns { TextAreaAttribute } 1140 * @syscap SystemCapability.ArkUI.ArkUI.Full 1141 * @crossplatform 1142 * @since 10 1143 */ 1144 /** 1145 * Called when using the Clipboard menu 1146 * 1147 * @param { function } callback 1148 * @returns { TextAreaAttribute } 1149 * @syscap SystemCapability.ArkUI.ArkUI.Full 1150 * @crossplatform 1151 * @atomicservice 1152 * @since arkts {'1.1':'11','1.2':'20'} 1153 * @arkts 1.1&1.2 1154 */ 1155 onCopy(callback: (value: string) => void): TextAreaAttribute; 1156 1157 /** 1158 * Called when using the Clipboard menu 1159 * 1160 * @param { function } callback 1161 * @returns { TextAreaAttribute } 1162 * @syscap SystemCapability.ArkUI.ArkUI.Full 1163 * @since 8 1164 */ 1165 /** 1166 * Called when using the Clipboard menu 1167 * 1168 * @param { function } callback 1169 * @returns { TextAreaAttribute } 1170 * @syscap SystemCapability.ArkUI.ArkUI.Full 1171 * @crossplatform 1172 * @since 10 1173 */ 1174 /** 1175 * Called when using the Clipboard menu 1176 * 1177 * @param { function } callback 1178 * @returns { TextAreaAttribute } 1179 * @syscap SystemCapability.ArkUI.ArkUI.Full 1180 * @crossplatform 1181 * @atomicservice 1182 * @since arkts {'1.1':'11','1.2':'20'} 1183 * @arkts 1.1&1.2 1184 */ 1185 onCut(callback: (value: string) => void): TextAreaAttribute; 1186 1187 /** 1188 * Called when using the Clipboard menu 1189 * 1190 * @param { function } callback 1191 * @returns { TextAreaAttribute } 1192 * @syscap SystemCapability.ArkUI.ArkUI.Full 1193 * @since 7 1194 */ 1195 /** 1196 * Called when using the Clipboard menu 1197 * 1198 * @param { function } callback 1199 * @returns { TextAreaAttribute } 1200 * @syscap SystemCapability.ArkUI.ArkUI.Full 1201 * @crossplatform 1202 * @since 10 1203 */ 1204 /** 1205 * Called when using the Clipboard menu 1206 * 1207 * @param { function } callback 1208 * Executed when a paste operation is performed. 1209 * { string } value - The text content to be pasted. 1210 * { PasteEvent } event - The user-defined paste event. 1211 * @returns { TextAreaAttribute } returns the instance of the TextAreaAttribute. 1212 * @syscap SystemCapability.ArkUI.ArkUI.Full 1213 * @crossplatform 1214 * @atomicservice 1215 * @since arkts {'1.1':'11','1.2':'20'} 1216 * @arkts 1.1&1.2 1217 */ 1218 onPaste(callback: (value: string, event: PasteEvent) => void): TextAreaAttribute; 1219 1220 /** 1221 * Called when the copy option is set. 1222 * 1223 * @param { CopyOptions } value 1224 * @returns { TextAreaAttribute } 1225 * @syscap SystemCapability.ArkUI.ArkUI.Full 1226 * @since 9 1227 */ 1228 /** 1229 * Called when the copy option is set. 1230 * 1231 * @param { CopyOptions } value 1232 * @returns { TextAreaAttribute } 1233 * @syscap SystemCapability.ArkUI.ArkUI.Full 1234 * @crossplatform 1235 * @since 10 1236 */ 1237 /** 1238 * Called when the copy option is set. 1239 * 1240 * <p><strong>NOTE</strong>: 1241 * <br>If this attribute is set to CopyOptions.None, the text can only be pasted; 1242 * all other actions, such as copying, cutting, and sharing, are disabled. 1243 * <br>Dragging is not allowed when CopyOptions.None is set. 1244 * </p> 1245 * 1246 * @param { CopyOptions } value - Default value is CopyOptions.LocalDevice. 1247 * @returns { TextAreaAttribute } 1248 * @syscap SystemCapability.ArkUI.ArkUI.Full 1249 * @crossplatform 1250 * @atomicservice 1251 * @since arkts {'1.1':'11','1.2':'20'} 1252 * @arkts 1.1&1.2 1253 */ 1254 copyOption(value: CopyOptions): TextAreaAttribute; 1255 1256 /** 1257 * Sets whether request keyboard or not when on focus. 1258 * 1259 * @param { boolean } value 1260 * @returns { TextAreaAttribute } Returns the instance of the TextAreaAttribute. 1261 * @syscap SystemCapability.ArkUI.ArkUI.Full 1262 * @crossplatform 1263 * @since 10 1264 */ 1265 /** 1266 * Sets whether request keyboard or not when on focus. 1267 * 1268 * @param { boolean } value - Default value is true. 1269 * @returns { TextAreaAttribute } Returns the instance of the TextAreaAttribute. 1270 * @syscap SystemCapability.ArkUI.ArkUI.Full 1271 * @crossplatform 1272 * @atomicservice 1273 * @since arkts {'1.1':'11','1.2':'20'} 1274 * @arkts 1.1&1.2 1275 */ 1276 enableKeyboardOnFocus(value: boolean): TextAreaAttribute; 1277 1278 /** 1279 * Define the max length content of the text area. 1280 * 1281 * @param { number } value 1282 * @returns { TextAreaAttribute } 1283 * @syscap SystemCapability.ArkUI.ArkUI.Full 1284 * @since 10 1285 */ 1286 /** 1287 * Define the max length content of the text area. 1288 * 1289 * <p><strong>NOTE</strong>: 1290 * <br>By default, there is no maximum number of characters. 1291 * <br>When the maximum number of characters is reached, 1292 * no more characters can be entered, and the border turns red. 1293 * </p> 1294 * 1295 * @param { number } value 1296 * @returns { TextAreaAttribute } 1297 * @syscap SystemCapability.ArkUI.ArkUI.Full 1298 * @crossplatform 1299 * @atomicservice 1300 * @since arkts {'1.1':'11','1.2':'20'} 1301 * @arkts 1.1&1.2 1302 */ 1303 maxLength(value: number): TextAreaAttribute; 1304 1305 /** 1306 * Define show counter of the text area. 1307 * 1308 * @param { boolean } value 1309 * @returns { TextAreaAttribute } 1310 * @syscap SystemCapability.ArkUI.ArkUI.Full 1311 * @since 10 1312 */ 1313 /** 1314 * Define show counter of the text area. 1315 * 1316 * <p><strong>NOTE</strong>: 1317 * <br>options can be set only when value is set to true, 1318 * in which case a character counter is displayed below the text box. 1319 * <br>This attribute must be used together with maxlength. 1320 * <br>The character counter is displayed in this format: Number of characters entered/Character limit. 1321 * <br>It is visible when the number of characters entered is greater than 1322 * the character limit multiplied by the threshold percentage value. 1323 * <br>If options is not set, the text box border and character counter subscript turn red 1324 * when the number of characters entered reaches the limit. 1325 * <br>If value is set to true and options is set, 1326 * the text box border and character counter subscript turn red 1327 * and the text box shakes when the number of characters entered reaches the limit, 1328 * provided that the value of thresholdPercentage is valid. 1329 * <br>If highlightBorder is set to false, the text box border does not turn red. 1330 * <br>By default, highlightBorder is set to true. 1331 * <br>The character counter is not displayed for text boxes in inline input style. 1332 * </p> 1333 * 1334 * @param { boolean } value - Set showcounter of the text area. 1335 * @param { InputCounterOptions } options - Set the percentage of counter. 1336 * @returns { TextAreaAttribute } 1337 * @syscap SystemCapability.ArkUI.ArkUI.Full 1338 * @crossplatform 1339 * @atomicservice 1340 * @since arkts {'1.1':'11','1.2':'20'} 1341 * @arkts 1.1&1.2 1342 */ 1343 showCounter(value: boolean, options?: InputCounterOptions): TextAreaAttribute; 1344 1345 /** 1346 * Define style of the text area. 1347 * 1348 * @param { TextContentStyle } value 1349 * @returns { TextAreaAttribute } 1350 * @syscap SystemCapability.ArkUI.ArkUI.Full 1351 * @since 10 1352 */ 1353 /** 1354 * Define style of the text area. 1355 * 1356 * <p><strong>NOTE</strong>: 1357 * <br>The inline input style is only available for the TextAreaType.Normal type. 1358 * </p> 1359 * 1360 * @param { TextContentStyle } value - Default value is TextContentStyle.DEFAULT. 1361 * @returns { TextAreaAttribute } 1362 * @syscap SystemCapability.ArkUI.ArkUI.Full 1363 * @crossplatform 1364 * @atomicservice 1365 * @since arkts {'1.1':'11','1.2':'20'} 1366 * @arkts 1.1&1.2 1367 */ 1368 style(value: TextContentStyle): TextAreaAttribute; 1369 1370 /** 1371 * Define bar state of the text area. 1372 * 1373 * @param { BarState } value 1374 * @returns { TextAreaAttribute } 1375 * @syscap SystemCapability.ArkUI.ArkUI.Full 1376 * @since 10 1377 */ 1378 /** 1379 * Define bar state of the text area. 1380 * 1381 * @param { BarState } value - Default value is BarState.Auto. 1382 * @returns { TextAreaAttribute } 1383 * @syscap SystemCapability.ArkUI.ArkUI.Full 1384 * @atomicservice 1385 * @since arkts {'1.1':'11','1.2':'20'} 1386 * @arkts 1.1&1.2 1387 */ 1388 barState(value: BarState): TextAreaAttribute; 1389 1390 /** 1391 * Controls whether the selection menu pops up. 1392 * 1393 * @param { boolean } value 1394 * @returns { TextAreaAttribute } returns the instance of the TextAreaAttribute. 1395 * @syscap SystemCapability.ArkUI.ArkUI.Full 1396 * @crossplatform 1397 * @since 10 1398 */ 1399 /** 1400 * Controls whether the selection menu pops up. 1401 * 1402 * <p><strong>NOTE</strong>: 1403 * <br><em>true</em>: 1404 * <br>The system text selection menu does not appear under the following circumstances: clicking the text box cursor, 1405 * long-pressing the text box, double-tapping the text box, triple-tapping the text box, or right-clicking the text box. 1406 * <br><em>false</em>: 1407 * <br>The system text selection menu appears under the following circumstances: clicking the text box cursor, 1408 * long-pressing the text box, double-tapping the text box, triple-tapping the text box, or right-clicking the text box. 1409 * </p> 1410 * 1411 * @param { boolean } value - Default value is false. 1412 * @returns { TextAreaAttribute } returns the instance of the TextAreaAttribute. 1413 * @syscap SystemCapability.ArkUI.ArkUI.Full 1414 * @crossplatform 1415 * @atomicservice 1416 * @since arkts {'1.1':'11','1.2':'20'} 1417 * @arkts 1.1&1.2 1418 */ 1419 selectionMenuHidden(value: boolean): TextAreaAttribute; 1420 1421 /** 1422 * Called when the minimum font size of the font is set. 1423 * 1424 * <p><strong>NOTE</strong>: 1425 * <br>For the string type, numeric string values with optional units, for example, "10" or "10fp", are supported. 1426 * <br>For the setting to take effect, this attribute must be used together with maxFontSize and maxLines,or layout constraint settings. 1427 * <br>When the adaptive font size is used, the fontSize settings do not take effect. 1428 * </p> 1429 * 1430 * @param { number | string | Resource } value - The unit is fp. 1431 * @returns { TextAreaAttribute } 1432 * @syscap SystemCapability.ArkUI.ArkUI.Full 1433 * @crossplatform 1434 * @atomicservice 1435 * @since arkts {'1.1':'12','1.2':'20'} 1436 * @arkts 1.1&1.2 1437 */ 1438 minFontSize(value: number | string | Resource): TextAreaAttribute; 1439 1440 /** 1441 * Called when the maximum font size of the font is set. 1442 * 1443 * <p><strong>NOTE</strong>: 1444 * <br>For the string type, numeric string values with optional units, for example, "10" or "10fp", are supported. 1445 * <br>For the setting to take effect, this attribute must be used together with minFontSize and maxLines, or layout constraint settings. 1446 * <br>When the adaptive font size is used, the fontSize settings do not take effect. 1447 * </p> 1448 * 1449 * @param { number | string | Resource } value - The unit is fp. 1450 * @returns { TextAreaAttribute } 1451 * @syscap SystemCapability.ArkUI.ArkUI.Full 1452 * @crossplatform 1453 * @atomicservice 1454 * @since arkts {'1.1':'12','1.2':'20'} 1455 * @arkts 1.1&1.2 1456 */ 1457 maxFontSize(value: number | string | Resource): TextAreaAttribute; 1458 1459 /** 1460 * Called when the minimum font scale of the font is set. 1461 * Value range: [0, 1] 1462 * 1463 * <p><strong>NOTE</strong>: 1464 * <br>The undefined type is supported. 1465 * <br>A value less than 0 is handled as 0. 1466 * <br>A value greater than 1 is handled as 1. 1467 * <br>Abnormal values are ineffective by default. 1468 * </p> 1469 * 1470 * @param { Optional<number | Resource> } scale 1471 * @returns { TextAreaAttribute } 1472 * @syscap SystemCapability.ArkUI.ArkUI.Full 1473 * @atomicservice 1474 * @since 18 1475 */ 1476 /** 1477 * Called when the minimum font scale of the font is set. 1478 * Value range: [0, 1] 1479 * 1480 * <p><strong>NOTE</strong>: 1481 * <br>The undefined type is supported. 1482 * <br>A value less than 0 is handled as 0. 1483 * <br>A value greater than 1 is handled as 1. 1484 * <br>Abnormal values are ineffective by default. 1485 * </p> 1486 * 1487 * @param { Optional<number | Resource> } scale 1488 * @returns { TextAreaAttribute } 1489 * @syscap SystemCapability.ArkUI.ArkUI.Full 1490 * @crossplatform 1491 * @atomicservice 1492 * @since 20 1493 * @arkts 1.1&1.2 1494 */ 1495 minFontScale(scale: Optional<number | Resource>): TextAreaAttribute; 1496 1497 /** 1498 * Called when the maximum font scale of the font is set. 1499 * Value range: [1, +∞) 1500 * 1501 * <p><strong>NOTE</strong>: 1502 * <br>A value less than 1 is handled as 1. 1503 * <br>Abnormal values are ineffective by default. 1504 * </p> 1505 * 1506 * @param { Optional<number | Resource> } scale 1507 * @returns { TextAreaAttribute } 1508 * @syscap SystemCapability.ArkUI.ArkUI.Full 1509 * @atomicservice 1510 * @since 18 1511 */ 1512 /** 1513 * Called when the maximum font scale of the font is set. 1514 * Value range: [1, +∞) 1515 * 1516 * <p><strong>NOTE</strong>: 1517 * <br>A value less than 1 is handled as 1. 1518 * <br>Abnormal values are ineffective by default. 1519 * </p> 1520 * 1521 * @param { Optional<number | Resource> } scale 1522 * @returns { TextAreaAttribute } 1523 * @syscap SystemCapability.ArkUI.ArkUI.Full 1524 * @crossplatform 1525 * @atomicservice 1526 * @since 20 1527 * @arkts 1.1&1.2 1528 */ 1529 maxFontScale(scale: Optional<number | Resource>): TextAreaAttribute; 1530 1531 /** 1532 * Called when the height adaptive policy is set. 1533 * 1534 * <p><strong>NOTE</strong>: 1535 * <ul> 1536 * <li>When this attribute is set to TextHeightAdaptivePolicy.MAX_LINES_FIRST, 1537 * the maxLines attribute takes precedence for adjusting the text height. 1538 * <br>If the maxLines setting results in a layout beyond the layout constraints, 1539 * the text will shrink to a font size between minFontSize and maxFontSize to allow for more content to be shown. 1540 * <br>If the text box is in inline input style, 1541 * the font size in the editing state is different from that in the non-editing state.</li> 1542 * <li>If this attribute is set to TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST, 1543 * the minFontSize attribute takes precedence for adjusting the text height. 1544 * <br>If the text can fit in one line with the minFontSize setting, 1545 * the text will enlarge to the largest possible font size between minFontSize and maxFontSize.</li> 1546 * <li>If this attribute is set to TextHeightAdaptivePolicy.LAYOUT_CONSTRAINT_FIRST, 1547 * the layout constraints take precedence for adjusting the text height. 1548 * <br>If the resultant layout is beyond the layout constraints, 1549 * the text will shrink to a font size between minFontSize and maxFontSize to respect the layout constraints.</li> 1550 * </ul> 1551 * </p> 1552 * 1553 * @param { TextHeightAdaptivePolicy } value - The height adaptive policy.Default value is TextHeightAdaptivePolicy.MAX_LINES_FIRST. 1554 * @returns { TextAreaAttribute } 1555 * @syscap SystemCapability.ArkUI.ArkUI.Full 1556 * @crossplatform 1557 * @atomicservice 1558 * @since arkts {'1.1':'12','1.2':'20'} 1559 * @arkts 1.1&1.2 1560 */ 1561 heightAdaptivePolicy(value: TextHeightAdaptivePolicy): TextAreaAttribute; 1562 1563 /** 1564 * Define max lines of the text area. 1565 * 1566 * @param { number } value 1567 * @returns { TextAreaAttribute } returns the instance of the TextAreaAttribute. 1568 * @syscap SystemCapability.ArkUI.ArkUI.Full 1569 * @since 10 1570 */ 1571 /** 1572 * Define max lines of the text area. 1573 * Value range: (0, +∞) 1574 * 1575 * <p><strong>NOTE</strong>: 1576 * <br>Sets the maximum number of lines that can be displayed. 1577 * <br>When textOverflow is set, text is truncated if the content exceeds this limit. 1578 * <br>When textOverflow is not set, in inline style, 1579 * the text is scrollable if the content exceeds the limit while the text box is focused; 1580 * maxLines does not apply when the text box is not focused. 1581 * <br>In non-inline style, the text is truncated according to the number of lines. 1582 * <br>Default value: 3 with the inline style; +∞ with the non-inline style, 1583 * indicating that there is no maximum number of lines. 1584 * </p> 1585 * 1586 * @param { number } value 1587 * @returns { TextAreaAttribute } returns the instance of the TextAreaAttribute. 1588 * @syscap SystemCapability.ArkUI.ArkUI.Full 1589 * @crossplatform 1590 * @atomicservice 1591 * @since arkts {'1.1':'11','1.2':'20'} 1592 * @arkts 1.1&1.2 1593 */ 1594 maxLines(value: number): TextAreaAttribute; 1595 1596 /** 1597 * Define max lines of the text area, behavior can be displayed as the scrolling capability. 1598 * 1599 * @param { number } lines - Max lines of the node 1600 * @param { MaxLinesOptions } options - max lines of setting options. 1601 * @returns { TextAreaAttribute } returns the instance of the TextAreaAttribute. 1602 * @syscap SystemCapability.ArkUI.ArkUI.Full 1603 * @crossplatform 1604 * @atomicservice 1605 * @since 20 1606 */ 1607 maxLines(lines: number, options: MaxLinesOptions): TextAreaAttribute; 1608 1609 /** 1610 * Define min lines of the text area. 1611 * 1612 * @param { Optional<number> } lines - Min lines of the node 1613 * @returns { TextAreaAttribute } returns the instance of the TextAreaAttribute. 1614 * @syscap SystemCapability.ArkUI.ArkUI.Full 1615 * @crossplatform 1616 * @atomicservice 1617 * @since 20 1618 */ 1619 minLines(lines: Optional<number>): TextAreaAttribute; 1620 1621 /** 1622 * Set the word break type. 1623 * 1624 * <p><strong>NOTE</strong>: 1625 * <br>This attribute does not take effect for the placeholder text. 1626 * <br>The component does not support the clip attribute. 1627 * <br>Therefore, setting this attribute does not affect text clipping. 1628 * </p> 1629 * 1630 * @param { WordBreak } value - The word break type.Default value is WordBreak.BREAK_WORD. 1631 * @returns { TextAreaAttribute } returns the instance of the TextAreaAttribute. 1632 * @syscap SystemCapability.ArkUI.ArkUI.Full 1633 * @crossplatform 1634 * @atomicservice 1635 * @since arkts {'1.1':'12','1.2':'20'} 1636 * @arkts 1.1&1.2 1637 */ 1638 wordBreak(value: WordBreak): TextAreaAttribute; 1639 1640 /** 1641 * Set the text line break strategy type. 1642 * 1643 * <p><strong>NOTE</strong>: 1644 * <br>This attribute takes effect when wordBreak is not set to breakAll. Hyphens are not supported. 1645 * </p> 1646 * 1647 * @param { LineBreakStrategy } strategy - The text line break strategy type.Default value is LineBreakStrategy.GREEDY. 1648 * @returns { TextAreaAttribute } The attribute of the TextAreaAttribute. 1649 * @syscap SystemCapability.ArkUI.ArkUI.Full 1650 * @crossplatform 1651 * @atomicservice 1652 * @since arkts {'1.1':'12','1.2':'20'} 1653 * @arkts 1.1&1.2 1654 */ 1655 lineBreakStrategy(strategy: LineBreakStrategy): TextAreaAttribute; 1656 1657 /** 1658 * Define custom keyboard of the text area. 1659 * 1660 * @param { CustomBuilder } value 1661 * @returns { TextAreaAttribute } returns the instance of the TextAreaAttribute. 1662 * @syscap SystemCapability.ArkUI.ArkUI.Full 1663 * @since 10 1664 */ 1665 /** 1666 * Define custom keyboard of the text area. 1667 * 1668 * @param { CustomBuilder } value 1669 * @returns { TextAreaAttribute } returns the instance of the TextAreaAttribute. 1670 * @syscap SystemCapability.ArkUI.ArkUI.Full 1671 * @crossplatform 1672 * @atomicservice 1673 * @since 11 1674 */ 1675 /** 1676 * Define custom keyboard of the text area. 1677 * 1678 * <p><strong>NOTE</strong>: 1679 * <br>When a custom keyboard is set, activating the text box opens the specified custom component, 1680 * instead of the system input method. 1681 * <br>The custom keyboard's height can be set through the height attribute of the custom component's root node, 1682 * and its width is fixed at the default value. 1683 * <br>The custom keyboard is presented by overlaying the original screen, 1684 * which is not compressed or lifted if avoid mode is not enabled or avoidance is not needed for the text box. 1685 * <br>The custom keyboard cannot obtain the focus, but it blocks gesture events. 1686 * <br>By default, the custom keyboard is closed when the input component loses the focus. 1687 * <br>You can also use the TextAreaController.stopEditing API to close the keyboard. 1688 * <br>When a custom keyboard is set, the text box does not support camera input, even when the device supports. 1689 * <br>When setting a custom keyboard, you can bind the onKeyPrelme event to prevent input from the physical keyboard. 1690 * </p> 1691 * 1692 * @param { CustomBuilder } value - Set up a custom keyboard of TextArea 1693 * @param { KeyboardOptions } [options] - Indicates the custom keyboard options of TextArea 1694 * @returns { TextAreaAttribute } returns the instance of the TextAreaAttribute. 1695 * @syscap SystemCapability.ArkUI.ArkUI.Full 1696 * @crossplatform 1697 * @atomicservice 1698 * @since arkts {'1.1':'12','1.2':'20'} 1699 * @arkts 1.1&1.2 1700 */ 1701 customKeyboard(value: CustomBuilder, options?: KeyboardOptions): TextAreaAttribute; 1702 1703 /** 1704 * Called when the text decoration of the text is set. 1705 * 1706 * @param { TextDecorationOptions } value - Default value is { type: TextDecorationType.None, color: Color.Black, style: TextDecorationStyle.SOLID }. 1707 * @returns { TextAreaAttribute } 1708 * @syscap SystemCapability.ArkUI.ArkUI.Full 1709 * @crossplatform 1710 * @atomicservice 1711 * @since arkts {'1.1':'12','1.2':'20'} 1712 * @arkts 1.1&1.2 1713 */ 1714 decoration(value: TextDecorationOptions): TextAreaAttribute; 1715 1716 /** 1717 * Called when the distance between text fonts is set. 1718 * 1719 * <p><strong>NOTE</strong>: 1720 * <br>If the value specified is a percentage or 0, the default value is used. 1721 * <br>For the string type, numeric string values with optional units, for example, "10" or "10fp", are supported. 1722 * <br>If the value specified is a negative value, the text is compressed. 1723 * <br>A negative value too small may result in the text being compressed to 0 and no content being displayed. 1724 * </p> 1725 * 1726 * @param { number | string | Resource } value - The unit is fp. 1727 * @returns { TextAreaAttribute } 1728 * @syscap SystemCapability.ArkUI.ArkUI.Full 1729 * @crossplatform 1730 * @atomicservice 1731 * @since arkts {'1.1':'12','1.2':'20'} 1732 * @arkts 1.1&1.2 1733 */ 1734 letterSpacing(value: number | string | Resource): TextAreaAttribute; 1735 1736 /** 1737 * Set font line spacing. 1738 * 1739 * <p><strong>NOTE</strong>: 1740 * <br>If the value specified is less than or equal to 0, the default value 0 is used. 1741 * </p> 1742 * 1743 * @param { LengthMetrics } value - Default value is 0. 1744 * @returns { TextAreaAttribute } 1745 * @syscap SystemCapability.ArkUI.ArkUI.Full 1746 * @crossplatform 1747 * @atomicservice 1748 * @since arkts {'1.1':'12','1.2':'20'} 1749 * @arkts 1.1&1.2 1750 */ 1751 lineSpacing(value: LengthMetrics): TextAreaAttribute; 1752 1753 /** 1754 * Set font line spacing with options. 1755 * 1756 * @param { LengthMetrics } value 1757 * @param { LineSpacingOptions } options 1758 * @returns { TextAreaAttribute } 1759 * @syscap SystemCapability.ArkUI.ArkUI.Full 1760 * @crossplatform 1761 * @atomicservice 1762 * @since 20 1763 */ 1764 lineSpacing(value: LengthMetrics, options?: LineSpacingOptions): TextAreaAttribute; 1765 1766 /** 1767 * Called when the line height of the font is set. 1768 * 1769 * <p><strong>NOTE</strong>: 1770 * <br>If the value is less than or equal to 0, the line height is not limited and the font size is adaptive. 1771 * <br>If the value is of the number type, the unit fp is used. 1772 * </p> 1773 * 1774 * @param { number | string | Resource } value 1775 * @returns { TextAreaAttribute } 1776 * @syscap SystemCapability.ArkUI.ArkUI.Full 1777 * @crossplatform 1778 * @atomicservice 1779 * @since arkts {'1.1':'12','1.2':'20'} 1780 * @arkts 1.1&1.2 1781 */ 1782 lineHeight(value: number | string | Resource): TextAreaAttribute; 1783 1784 /** 1785 * Called when the input type is set. 1786 * 1787 * @param { TextAreaType } value 1788 * @returns { TextAreaAttribute } 1789 * @syscap SystemCapability.ArkUI.ArkUI.Full 1790 * @crossplatform 1791 * @since 11 1792 */ 1793 /** 1794 * Called when the input type is set. 1795 * 1796 * @param { TextAreaType } value - Default value is TextAreaType.Normal. 1797 * @returns { TextAreaAttribute } 1798 * @syscap SystemCapability.ArkUI.ArkUI.Full 1799 * @crossplatform 1800 * @atomicservice 1801 * @since arkts {'1.1':'12','1.2':'20'} 1802 * @arkts 1.1&1.2 1803 */ 1804 type(value: TextAreaType): TextAreaAttribute; 1805 1806 /** 1807 * Sets whether enable auto fill or not. 1808 * 1809 * @param { boolean } value - Indicates the flag whether autofill is enabled.Default value is true.True: enable, false: disable. 1810 * @returns { TextAreaAttribute } 1811 * @syscap SystemCapability.ArkUI.ArkUI.Full 1812 * @atomicservice 1813 * @since arkts {'1.1':'12','1.2':'20'} 1814 * @arkts 1.1&1.2 1815 */ 1816 enableAutoFill(value: boolean): TextAreaAttribute; 1817 1818 /** 1819 * Called when the auto fill type is set. 1820 * 1821 * @param { ContentType } contentType - Indicates autofill type. 1822 * @returns { TextAreaAttribute } 1823 * @syscap SystemCapability.ArkUI.ArkUI.Full 1824 * @atomicservice 1825 * @since arkts {'1.1':'12','1.2':'20'} 1826 * @arkts 1.1&1.2 1827 */ 1828 contentType(contentType: ContentType): TextAreaAttribute; 1829 1830 /** 1831 * Set font feature. 1832 * 1833 * @param { string } value - The fontFeature. 1834 * normal | <feature-tag-value>, 1835 * where <feature-tag-value> = <string> [ <integer> | on | off ], like: "ss01" 0 1836 * the values of <feature-tag-value> reference to doc of TextArea component 1837 * number of <feature-tag-value> can be single or multiple, and separated by comma ','. 1838 * @returns { TextAreaAttribute } 1839 * @syscap SystemCapability.ArkUI.ArkUI.Full 1840 * @crossplatform 1841 * @atomicservice 1842 * @since arkts {'1.1':'12','1.2':'20'} 1843 * @arkts 1.1&1.2 1844 */ 1845 fontFeature(value: string): TextAreaAttribute; 1846 1847 /** 1848 * Get text value information when about to input. 1849 * 1850 * <p><strong>NOTE</strong>: 1851 * <br>It returns true if the text is inserted; returns false otherwise. 1852 * <br>This callback is not triggered for pre-edit or candidate word operations. 1853 * <br>It is available only for system input methods. 1854 * </p> 1855 * 1856 * @param { Callback<InsertValue, boolean> } callback - The triggered function when text content is about to insert. 1857 * @returns { TextAreaAttribute } 1858 * @syscap SystemCapability.ArkUI.ArkUI.Full 1859 * @crossplatform 1860 * @atomicservice 1861 * @since arkts {'1.1':'12','1.2':'20'} 1862 * @arkts 1.1&1.2 1863 */ 1864 onWillInsert(callback: Callback<InsertValue, boolean>): TextAreaAttribute; 1865 1866 /** 1867 * Get text value information when completed input. 1868 * 1869 * <p><strong>NOTE</strong>: 1870 * <br>It is available only for system input methods. 1871 * </p> 1872 * 1873 * @param { Callback<InsertValue> } callback - The triggered function when text content has been inserted. 1874 * @returns { TextAreaAttribute } 1875 * @syscap SystemCapability.ArkUI.ArkUI.Full 1876 * @crossplatform 1877 * @atomicservice 1878 * @since arkts {'1.1':'12','1.2':'20'} 1879 * @arkts 1.1&1.2 1880 */ 1881 onDidInsert(callback: Callback<InsertValue>): TextAreaAttribute; 1882 1883 /** 1884 * Get text value information when about to delete. 1885 * 1886 * <p><strong>NOTE</strong>: 1887 * <br>It returns true if the text is deleted; returns false otherwise. 1888 * <br>This callback is not called for text preview. 1889 * <br>It is available only for system input methods. 1890 * </p> 1891 * 1892 * @param { Callback<DeleteValue, boolean> } callback - The triggered function when text content is about to delete. 1893 * @returns { TextAreaAttribute } 1894 * @syscap SystemCapability.ArkUI.ArkUI.Full 1895 * @crossplatform 1896 * @atomicservice 1897 * @since arkts {'1.1':'12','1.2':'20'} 1898 * @arkts 1.1&1.2 1899 */ 1900 onWillDelete(callback: Callback<DeleteValue, boolean>): TextAreaAttribute; 1901 1902 /** 1903 * Get text value information when the deletion has been completed 1904 * 1905 * <p><strong>NOTE</strong>: 1906 * <br>It is available only for system input methods. 1907 * </p> 1908 * 1909 * @param { Callback<DeleteValue> } callback - The triggered function when text content has been deleted. 1910 * @returns { TextAreaAttribute } 1911 * @syscap SystemCapability.ArkUI.ArkUI.Full 1912 * @crossplatform 1913 * @atomicservice 1914 * @since arkts {'1.1':'12','1.2':'20'} 1915 * @arkts 1.1&1.2 1916 */ 1917 onDidDelete(callback: Callback<DeleteValue>): TextAreaAttribute; 1918 1919 /** 1920 * Set the custom text menu. 1921 * Sets the extended options of the custom context menu on selection, 1922 * including the text content, icon, and callback. 1923 * 1924 * @param { EditMenuOptions } editMenu - Customize text menu options. 1925 * @returns { TextAreaAttribute } 1926 * @syscap SystemCapability.ArkUI.ArkUI.Full 1927 * @crossplatform 1928 * @atomicservice 1929 * @since arkts {'1.1':'12','1.2':'20'} 1930 * @arkts 1.1&1.2 1931 */ 1932 editMenuOptions(editMenu: EditMenuOptions): TextAreaAttribute; 1933 1934 /** 1935 * Define the preview text mode of the text input. 1936 * 1937 * <p><strong>NOTE</strong>: 1938 * <br>Preview text is in a temporary state and does not support text interception. 1939 * <br>As such, it does not trigger onWillInsert, onDidInsert, onWillDelete, or onDidDelete callbacks. 1940 * </p> 1941 * 1942 * @param { boolean } enable - Indicates the preview text mode.Default value is true. 1943 * @returns { TextAreaAttribute } 1944 * @syscap SystemCapability.ArkUI.ArkUI.Full 1945 * @crossplatform 1946 * @atomicservice 1947 * @since arkts {'1.1':'12','1.2':'20'} 1948 * @arkts 1.1&1.2 1949 */ 1950 enablePreviewText(enable: boolean): TextAreaAttribute; 1951 1952 /** 1953 * Enable or disable haptic feedback. 1954 * 1955 * <p><strong>NOTE</strong>: 1956 * <br>To enable haptic feedback, 1957 * <br>you must declare the ohos.permission.VIBRATE permission under requestPermissions in the module.json5 file of the project. 1958 * <code> 1959 * "requestPermissions": [ 1960 * { 1961 * "name": "ohos.permission.VIBRATE", 1962 * } 1963 * ] 1964 * </code> 1965 * </p> 1966 * 1967 * @param { boolean } isEnabled - Default value is true, set false to disable haptic feedback. 1968 * @returns { TextAreaAttribute } returns the instance of the TextAreaAttribute. 1969 * @syscap SystemCapability.ArkUI.ArkUI.Full 1970 * @crossplatform 1971 * @atomicservice 1972 * @since arkts {'1.1':'13','1.2':'20'} 1973 * @arkts 1.1&1.2 1974 */ 1975 enableHapticFeedback(isEnabled: boolean): TextAreaAttribute; 1976 1977 /** 1978 * Set text mode of automatic case mode switching. 1979 * 1980 * @param { AutoCapitalizationMode } mode - Automatic case mode values. 1981 * @returns { TextAreaAttribute } 1982 * @syscap SystemCapability.ArkUI.ArkUI.Full 1983 * @crossplatform 1984 * @atomicservice 1985 * @since 20 1986 * @arkts 1.1&1.2 1987 */ 1988 autoCapitalizationMode(mode: AutoCapitalizationMode): TextAreaAttribute; 1989 1990 /** 1991 * Set the text with half leading. 1992 * 1993 * @param { Optional<boolean> } halfLeading - Default value is false.The value true means that half leading is enabled, and false means the opposite. 1994 * @returns { TextAreaAttribute } 1995 * @syscap SystemCapability.ArkUI.ArkUI.Full 1996 * @crossplatform 1997 * @atomicservice 1998 * @since arkts {'1.1':'18','1.2':'20'} 1999 * @arkts 1.1&1.2 2000 */ 2001 halfLeading(halfLeading: Optional<boolean>): TextAreaAttribute; 2002 2003 /** 2004 * Set the ellipsis mode. 2005 * 2006 * <p><strong>NOTE</strong>: 2007 * <br>For the settings to work, overflow must be set to TextOverflow.Ellipsis and maxLines must be specified. 2008 * <br>Setting ellipsisMode alone does not take effect. 2009 * <br>EllipsisMode.START and EllipsisMode.CENTER take effect only when maxLines is set to 1. 2010 * </p> 2011 * 2012 * @param { EllipsisMode } mode - The ellipsis mode.Default value is EllipsisMode.END. 2013 * @returns { TextAreaAttribute } The attribute of TextArea. 2014 * @syscap SystemCapability.ArkUI.ArkUI.Full 2015 * @crossplatform 2016 * @atomicservice 2017 * @since arkts {'1.1':'18','1.2':'20'} 2018 * @arkts 1.1&1.2 2019 */ 2020 ellipsisMode(mode: Optional<EllipsisMode>): TextAreaAttribute; 2021 2022 /** 2023 * Set whether stop backPressed callback event or not. 2024 * 2025 * @param { Optional<boolean> } isStopped - Default value is true, set false to trigger the latest callback event. 2026 * @returns { TextAreaAttribute } returns the instance of the TextAreaAttribute. 2027 * @syscap SystemCapability.ArkUI.ArkUI.Full 2028 * @atomicservice 2029 * @since arkts {'1.1':'15','1.2':'20'} 2030 * @arkts 1.1&1.2 2031 */ 2032 stopBackPress(isStopped: Optional<boolean>): TextAreaAttribute; 2033 2034 /** 2035 * Get text value information when about to change. 2036 * 2037 * <p><strong>NOTE</strong>: 2038 * <br>This callback is triggered after onWillInsert and onWillDelete, but before onDidInsert and onDidDelete. 2039 * </p> 2040 * 2041 * @param { Callback<EditableTextChangeValue, boolean> } callback - The triggered function when text content is about to change. 2042 * Returning true allows the change to proceed, while returning false cancels the change. 2043 * @returns { TextAreaAttribute } 2044 * @syscap SystemCapability.ArkUI.ArkUI.Full 2045 * @crossplatform 2046 * @atomicservice 2047 * @since arkts {'1.1':'15','1.2':'20'} 2048 * @arkts 1.1&1.2 2049 */ 2050 onWillChange(callback: Callback<EditableTextChangeValue, boolean>): TextAreaAttribute; 2051 2052 /** 2053 * Set the keyboard appearance. 2054 * 2055 * @param { Optional<KeyboardAppearance> } appearance - Default value is KeyboardAppearance.NONE_IMMERSIVE 2056 * @returns { TextAreaAttribute } returns the instance of the TextAreaAttribute. 2057 * @syscap SystemCapability.ArkUI.ArkUI.Full 2058 * @atomicservice 2059 * @since arkts {'1.1':'15','1.2':'20'} 2060 * @arkts 1.1&1.2 2061 */ 2062 keyboardAppearance(appearance: Optional<KeyboardAppearance>): TextAreaAttribute; 2063 2064 /** 2065 * Set the stroke width. 2066 * 2067 * @param { Optional<LengthMetrics> } width - indicates the stroke width. 2068 * @returns { TextAreaAttribute } returns the instance of the TextAreaAttribute. 2069 * @syscap SystemCapability.ArkUI.ArkUI.Full 2070 * @crossplatform 2071 * @atomicservice 2072 * @since 20 2073 */ 2074 strokeWidth(width: Optional<LengthMetrics>): TextAreaAttribute; 2075 2076 /** 2077 * Set the stroke color. 2078 * 2079 * @param { Optional<ResourceColor> } color - indicates the stroke color. 2080 * @returns { TextAreaAttribute } returns the instance of the TextAreaAttribute. 2081 * @syscap SystemCapability.ArkUI.ArkUI.Full 2082 * @crossplatform 2083 * @atomicservice 2084 * @since 20 2085 */ 2086 strokeColor(color: Optional<ResourceColor>): TextAreaAttribute; 2087 2088 /** 2089 * Whether to enable automatic spacing between Chinese and Latin characters. 2090 * 2091 * @param { Optional<boolean> } enabled - The default value is false, indicates the flag whether to enable automatic spacing. 2092 * @returns { TextAreaAttribute } returns the instance of the TextAreaAttribute. 2093 * @syscap SystemCapability.ArkUI.ArkUI.Full 2094 * @crossplatform 2095 * @atomicservice 2096 * @since 20 2097 */ 2098 enableAutoSpacing(enabled: Optional<boolean>): TextAreaAttribute; 2099} 2100 2101/** 2102 * Defines TextArea Component. 2103 * 2104 * @syscap SystemCapability.ArkUI.ArkUI.Full 2105 * @since 7 2106 */ 2107/** 2108 * Defines TextArea Component. 2109 * 2110 * @syscap SystemCapability.ArkUI.ArkUI.Full 2111 * @crossplatform 2112 * @since 10 2113 */ 2114/** 2115 * Defines TextArea Component. 2116 * 2117 * @syscap SystemCapability.ArkUI.ArkUI.Full 2118 * @crossplatform 2119 * @atomicservice 2120 * @since 11 2121 */ 2122declare const TextArea: TextAreaInterface; 2123 2124/** 2125 * Defines TextArea Component instance. 2126 * 2127 * @syscap SystemCapability.ArkUI.ArkUI.Full 2128 * @since 7 2129 */ 2130/** 2131 * Defines TextArea Component instance. 2132 * 2133 * @syscap SystemCapability.ArkUI.ArkUI.Full 2134 * @crossplatform 2135 * @since 10 2136 */ 2137/** 2138 * Defines TextArea Component instance. 2139 * 2140 * @syscap SystemCapability.ArkUI.ArkUI.Full 2141 * @crossplatform 2142 * @atomicservice 2143 * @since 11 2144 */ 2145declare const TextAreaInstance: TextAreaAttribute; 2146