1/* 2 * Copyright (c) 2021-2024 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 { CancelButtonSymbolOptions, CancelButtonOptions } from "./search"; 23import { Callback, CommonMethod, TextContentControllerBase, SelectionOptions, InputCounterOptions, TextDecorationOptions, Optional } from "./common"; 24import { CustomBuilder } from './builder'; 25import { BarState, LineBreakStrategy, TextAlign, FontStyle, FontWeight, WordBreak, TextOverflow, 26 CopyOptions, TextHeightAdaptivePolicy, TextContentStyle, EllipsisMode } from './enums'; 27import { Resource, ResourceStr, ResourceColor, Dimension, Font, Length } from './units'; 28import { InsertValue, DeleteValue, CaretStyle, EditableTextOnChangeCallback, EditMenuOptions, 29 AutoCapitalizationMode,EditableTextChangeValue,KeyboardAppearance } from "./textCommon"; 30import { KeyboardOptions, PasteEvent } from "./richEditor"; 31/*** endif */ 32 33/** 34 * Declare the type of input box 35 * 36 * @enum { number } 37 * @syscap SystemCapability.ArkUI.ArkUI.Full 38 * @since 7 39 */ 40/** 41 * Declare the type of input box 42 * 43 * @enum { number } 44 * @syscap SystemCapability.ArkUI.ArkUI.Full 45 * @crossplatform 46 * @since 10 47 */ 48/** 49 * Declare the type of input box 50 * 51 * @enum { number } 52 * @syscap SystemCapability.ArkUI.ArkUI.Full 53 * @crossplatform 54 * @atomicservice 55 * @since arkts {'1.1':'11','1.2':'20'} 56 * @arkts 1.1&1.2 57 */ 58declare enum InputType { 59 /** 60 * Basic input mode. 61 * 62 * @syscap SystemCapability.ArkUI.ArkUI.Full 63 * @since 7 64 */ 65 /** 66 * Basic input mode. 67 * 68 * @syscap SystemCapability.ArkUI.ArkUI.Full 69 * @crossplatform 70 * @since 10 71 */ 72 /** 73 * Basic input mode. 74 * 75 * @syscap SystemCapability.ArkUI.ArkUI.Full 76 * @crossplatform 77 * @atomicservice 78 * @since arkts {'1.1':'11','1.2':'20'} 79 * @arkts 1.1&1.2 80 */ 81 Normal, 82 83 /** 84 * Pure digital input mode. 85 * 86 * @syscap SystemCapability.ArkUI.ArkUI.Full 87 * @since 7 88 */ 89 /** 90 * Pure digital input mode. 91 * 92 * @syscap SystemCapability.ArkUI.ArkUI.Full 93 * @crossplatform 94 * @since 10 95 */ 96 /** 97 * Pure digital input mode. 98 * 99 * @syscap SystemCapability.ArkUI.ArkUI.Full 100 * @crossplatform 101 * @atomicservice 102 * @since arkts {'1.1':'11','1.2':'20'} 103 * @arkts 1.1&1.2 104 */ 105 Number, 106 107 /** 108 * Phone number entry mode. 109 * 110 * @syscap SystemCapability.ArkUI.ArkUI.Full 111 * @since 9 112 */ 113 /** 114 * Phone number entry mode. 115 * 116 * @syscap SystemCapability.ArkUI.ArkUI.Full 117 * @crossplatform 118 * @since 10 119 */ 120 /** 121 * Phone number entry mode. 122 * 123 * @syscap SystemCapability.ArkUI.ArkUI.Full 124 * @crossplatform 125 * @atomicservice 126 * @since arkts {'1.1':'11','1.2':'20'} 127 * @arkts 1.1&1.2 128 */ 129 PhoneNumber, 130 131 /** 132 * E-mail address input mode. 133 * 134 * @syscap SystemCapability.ArkUI.ArkUI.Full 135 * @since 7 136 */ 137 /** 138 * E-mail address input mode. 139 * 140 * @syscap SystemCapability.ArkUI.ArkUI.Full 141 * @crossplatform 142 * @since 10 143 */ 144 /** 145 * E-mail address input mode. 146 * 147 * <p><strong>NOTE</strong>: 148 * <br>This mode accepts only digits, letters, underscores (_), dots (.), 149 * and the following special characters: ! # $ % & ' " * + - / = ? ^ ` { | } ~ @ (which can only appear once) 150 * </p> 151 * 152 * @syscap SystemCapability.ArkUI.ArkUI.Full 153 * @crossplatform 154 * @atomicservice 155 * @since arkts {'1.1':'11','1.2':'20'} 156 * @arkts 1.1&1.2 157 */ 158 Email, 159 160 /** 161 * Password entry mode. 162 * 163 * @syscap SystemCapability.ArkUI.ArkUI.Full 164 * @since 7 165 */ 166 /** 167 * Password entry mode. 168 * 169 * @syscap SystemCapability.ArkUI.ArkUI.Full 170 * @crossplatform 171 * @since 10 172 */ 173 /** 174 * Password entry mode. 175 * 176 * <p><strong>NOTE</strong>: 177 * <br>An eye icon is used to show or hide the password. 178 * <br>By default, the entered characters are temporarily shown before being obscured by dots; 179 * they are directly obscured by dots since API version 12 on certain devices. 180 * <br>The password input mode does not support underlines. 181 * <br>If Password Vault is enabled, autofill is available for the username and password. 182 * </p> 183 * 184 * @syscap SystemCapability.ArkUI.ArkUI.Full 185 * @crossplatform 186 * @atomicservice 187 * @since arkts {'1.1':'11','1.2':'20'} 188 * @arkts 1.1&1.2 189 */ 190 Password, 191 192 /** 193 * Number Password entry mode. 194 * 195 * @syscap SystemCapability.ArkUI.ArkUI.Full 196 * @crossplatform 197 * @since 11 198 */ 199 /** 200 * Number Password entry mode. 201 * 202 * <p><strong>NOTE</strong>: 203 * <br>An eye icon is used to show or hide the password. 204 * <br>By default, the entered characters are temporarily shown before being obscured by dots; 205 * they are directly obscured by dots since API version 12 on certain devices. 206 * <br>The password input mode does not support underlines. 207 * </p> 208 * 209 * @syscap SystemCapability.ArkUI.ArkUI.Full 210 * @crossplatform 211 * @atomicservice 212 * @since arkts {'1.1':'12','1.2':'20'} 213 * @arkts 1.1&1.2 214 */ 215 NUMBER_PASSWORD = 8, 216 217 /** 218 * Screen Lock Password entry mode. 219 * 220 * @syscap SystemCapability.ArkUI.ArkUI.Full 221 * @systemapi 222 * @since arkts {'1.1':'11','1.2':'20'} 223 * @arkts 1.1&1.2 224 */ 225 SCREEN_LOCK_PASSWORD = 9, 226 227 /** 228 * UserName entry mode. 229 * 230 * @syscap SystemCapability.ArkUI.ArkUI.Full 231 * @since 11 232 */ 233 /** 234 * UserName entry mode. 235 * 236 * <p><strong>NOTE</strong>: 237 * <br>If Password Vault is enabled, autofill is available for the username and password. 238 * </p> 239 * 240 * @syscap SystemCapability.ArkUI.ArkUI.Full 241 * @atomicservice 242 * @since arkts {'1.1':'12','1.2':'20'} 243 * @arkts 1.1&1.2 244 */ 245 USER_NAME = 10, 246 247 /** 248 * NewPassword entry mode. 249 * 250 * @syscap SystemCapability.ArkUI.ArkUI.Full 251 * @since 11 252 */ 253 /** 254 * NewPassword entry mode. 255 * 256 * <p><strong>NOTE</strong>: 257 * <br>An eye icon is used to show or hide the password. 258 * <br>By default, the entered characters are temporarily shown before being obscured by dots; 259 * they are directly obscured by dots since API version 12 on certain devices. 260 * <br>If Password Vault is enabled, a new password can be automatically generated. 261 * </p> 262 * 263 * @syscap SystemCapability.ArkUI.ArkUI.Full 264 * @atomicservice 265 * @since arkts {'1.1':'12','1.2':'20'} 266 * @arkts 1.1&1.2 267 */ 268 NEW_PASSWORD = 11, 269 270 /** 271 * Number decimal entry mode. 272 * 273 * <p><strong>NOTE</strong>: 274 * <br>The value can contain digits and one decimal point. 275 * </p> 276 * 277 * @syscap SystemCapability.ArkUI.ArkUI.Full 278 * @crossplatform 279 * @atomicservice 280 * @since arkts {'1.1':'11','1.2':'20'} 281 * @arkts 1.1&1.2 282 */ 283 NUMBER_DECIMAL = 12, 284 285 /** 286 * URL entry mode. 287 * 288 * @syscap SystemCapability.ArkUI.ArkUI.Full 289 * @crossplatform 290 * @atomicservice 291 * @since arkts {'1.1':'12','1.2':'20'} 292 * @arkts 1.1&1.2 293 */ 294 URL = 13, 295 296 /** 297 * One time code mode. 298 * 299 * @syscap SystemCapability.ArkUI.ArkUI.Full 300 * @atomicservice 301 * @since 20 302 */ 303 ONE_TIME_CODE = 14, 304} 305 306/** 307 * Declare the type of input content 308 * 309 * @enum { number } 310 * @syscap SystemCapability.ArkUI.ArkUI.Full 311 * @atomicservice 312 * @since arkts {'1.1':'12','1.2':'20'} 313 * @arkts 1.1&1.2 314 */ 315declare enum ContentType { 316 /** 317 * User name content type. 318 * Password Vault, when enabled, can automatically save and fill in usernames. 319 * 320 * @syscap SystemCapability.ArkUI.ArkUI.Full 321 * @atomicservice 322 * @since arkts {'1.1':'12','1.2':'20'} 323 * @arkts 1.1&1.2 324 */ 325 USER_NAME = 0, 326 327 /** 328 * Password content type. 329 * Password Vault, when enabled, can automatically save and fill in passwords. 330 * 331 * @syscap SystemCapability.ArkUI.ArkUI.Full 332 * @atomicservice 333 * @since arkts {'1.1':'12','1.2':'20'} 334 * @arkts 1.1&1.2 335 */ 336 PASSWORD = 1, 337 338 /** 339 * New password content type. 340 * Password Vault, when enabled, can automatically generate a new password. 341 * 342 * @syscap SystemCapability.ArkUI.ArkUI.Full 343 * @atomicservice 344 * @since arkts {'1.1':'12','1.2':'20'} 345 * @arkts 1.1&1.2 346 */ 347 NEW_PASSWORD = 2, 348 349 /** 350 * Full street address content type. 351 * The scenario-based autofill feature, when enabled, 352 * can automatically save and fill in full street addresses. 353 * 354 * @syscap SystemCapability.ArkUI.ArkUI.Full 355 * @atomicservice 356 * @since arkts {'1.1':'12','1.2':'20'} 357 * @arkts 1.1&1.2 358 */ 359 FULL_STREET_ADDRESS = 3, 360 361 /** 362 * House number content type. 363 * The scenario-based autofill feature, when enabled, 364 * can automatically save and fill in house numbers. 365 * 366 * @syscap SystemCapability.ArkUI.ArkUI.Full 367 * @atomicservice 368 * @since arkts {'1.1':'12','1.2':'20'} 369 * @arkts 1.1&1.2 370 */ 371 HOUSE_NUMBER = 4, 372 373 /** 374 * District address content type. 375 * The scenario-based autofill feature, when enabled, 376 * can automatically save and fill in districts and counties. 377 * 378 * @syscap SystemCapability.ArkUI.ArkUI.Full 379 * @atomicservice 380 * @since arkts {'1.1':'12','1.2':'20'} 381 * @arkts 1.1&1.2 382 */ 383 DISTRICT_ADDRESS = 5, 384 385 /** 386 * City address content type. 387 * The scenario-based autofill feature, when enabled, 388 * can automatically save and fill in cities. 389 * 390 * @syscap SystemCapability.ArkUI.ArkUI.Full 391 * @atomicservice 392 * @since arkts {'1.1':'12','1.2':'20'} 393 * @arkts 1.1&1.2 394 */ 395 CITY_ADDRESS = 6, 396 397 /** 398 * Province address content type. 399 * The scenario-based autofill feature, when enabled, 400 * can automatically save and fill in provinces. 401 * 402 * @syscap SystemCapability.ArkUI.ArkUI.Full 403 * @atomicservice 404 * @since arkts {'1.1':'12','1.2':'20'} 405 * @arkts 1.1&1.2 406 */ 407 PROVINCE_ADDRESS = 7, 408 409 /** 410 * Country address content type. 411 * The scenario-based autofill feature, when enabled, 412 * can automatically save and fill in countries. 413 * 414 * @syscap SystemCapability.ArkUI.ArkUI.Full 415 * @atomicservice 416 * @since arkts {'1.1':'12','1.2':'20'} 417 * @arkts 1.1&1.2 418 */ 419 COUNTRY_ADDRESS = 8, 420 421 /** 422 * Person full name content type. 423 * The scenario-based autofill feature, when enabled, 424 * can automatically save and fill in full names. 425 * 426 * @syscap SystemCapability.ArkUI.ArkUI.Full 427 * @atomicservice 428 * @since arkts {'1.1':'12','1.2':'20'} 429 * @arkts 1.1&1.2 430 */ 431 PERSON_FULL_NAME = 9, 432 433 /** 434 * Person last name content type. 435 * The scenario-based autofill feature, when enabled, 436 * can automatically save and fill in last names. 437 * 438 * @syscap SystemCapability.ArkUI.ArkUI.Full 439 * @atomicservice 440 * @since arkts {'1.1':'12','1.2':'20'} 441 * @arkts 1.1&1.2 442 */ 443 PERSON_LAST_NAME = 10, 444 445 /** 446 * Person first name content type. 447 * The scenario-based autofill feature, when enabled, 448 * can automatically save and fill in first names. 449 * 450 * @syscap SystemCapability.ArkUI.ArkUI.Full 451 * @atomicservice 452 * @since arkts {'1.1':'12','1.2':'20'} 453 * @arkts 1.1&1.2 454 */ 455 PERSON_FIRST_NAME = 11, 456 457 /** 458 * Phone number content type. 459 * The scenario-based autofill feature, when enabled, 460 * can automatically save and fill in phone numbers. 461 * 462 * @syscap SystemCapability.ArkUI.ArkUI.Full 463 * @atomicservice 464 * @since arkts {'1.1':'12','1.2':'20'} 465 * @arkts 1.1&1.2 466 */ 467 PHONE_NUMBER = 12, 468 469 /** 470 * Phone country code content type. 471 * The scenario-based autofill feature, when enabled, 472 * can automatically save and fill in country codes. 473 * 474 * @syscap SystemCapability.ArkUI.ArkUI.Full 475 * @atomicservice 476 * @since arkts {'1.1':'12','1.2':'20'} 477 * @arkts 1.1&1.2 478 */ 479 PHONE_COUNTRY_CODE = 13, 480 481 /** 482 * Full phone number content type. 483 * The scenario-based autofill feature, when enabled, 484 * can automatically save and fill in phone numbers with country codes. 485 * 486 * @syscap SystemCapability.ArkUI.ArkUI.Full 487 * @atomicservice 488 * @since arkts {'1.1':'12','1.2':'20'} 489 * @arkts 1.1&1.2 490 */ 491 FULL_PHONE_NUMBER = 14, 492 493 /** 494 * Email address content type. 495 * The scenario-based autofill feature, when enabled, 496 * can automatically save and fill in email addresses. 497 * 498 * @syscap SystemCapability.ArkUI.ArkUI.Full 499 * @atomicservice 500 * @since arkts {'1.1':'12','1.2':'20'} 501 * @arkts 1.1&1.2 502 */ 503 EMAIL_ADDRESS = 15, 504 505 /** 506 * Bank card number content type. 507 * The scenario-based autofill feature, when enabled, 508 * can automatically save and fill in bank card numbers. 509 * 510 * @syscap SystemCapability.ArkUI.ArkUI.Full 511 * @atomicservice 512 * @since arkts {'1.1':'12','1.2':'20'} 513 * @arkts 1.1&1.2 514 */ 515 BANK_CARD_NUMBER = 16, 516 517 /** 518 * ID card number content type. 519 * The scenario-based autofill feature, when enabled, 520 * can automatically save and fill in ID card numbers. 521 * 522 * @syscap SystemCapability.ArkUI.ArkUI.Full 523 * @atomicservice 524 * @since arkts {'1.1':'12','1.2':'20'} 525 * @arkts 1.1&1.2 526 */ 527 ID_CARD_NUMBER = 17, 528 529 /** 530 * Nickname content type. 531 * The scenario-based autofill feature, when enabled, 532 * can automatically save and fill in nicknames. 533 * 534 * @syscap SystemCapability.ArkUI.ArkUI.Full 535 * @atomicservice 536 * @since arkts {'1.1':'12','1.2':'20'} 537 * @arkts 1.1&1.2 538 */ 539 NICKNAME = 23, 540 541 /** 542 * Detail info without street content type. 543 * The scenario-based autofill feature, when enabled, 544 * can automatically save and fill in address information without street addresses. 545 * 546 * @syscap SystemCapability.ArkUI.ArkUI.Full 547 * @atomicservice 548 * @since arkts {'1.1':'12','1.2':'20'} 549 * @arkts 1.1&1.2 550 */ 551 DETAIL_INFO_WITHOUT_STREET = 24, 552 553 /** 554 * Format address content type. 555 * The scenario-based autofill feature, when enabled, 556 * can automatically save and fill in standard addresses. 557 * 558 * @syscap SystemCapability.ArkUI.ArkUI.Full 559 * @atomicservice 560 * @since arkts {'1.1':'12','1.2':'20'} 561 * @arkts 1.1&1.2 562 */ 563 FORMAT_ADDRESS = 25, 564 565 /** 566 * Passport number content type. 567 * The scenario-based autofill feature, when enabled, 568 * can automatically save and fill in passport numbers. 569 * 570 * @syscap SystemCapability.ArkUI.ArkUI.Full 571 * @atomicservice 572 * @since arkts {'1.1':'18','1.2':'20'} 573 * @arkts 1.1&1.2 574 */ 575 PASSPORT_NUMBER = 26, 576 577 /** 578 * Passport validity content type. 579 * The scenario-based autofill feature, when enabled, 580 * can automatically save and fill in passport validity periods. 581 * 582 * @syscap SystemCapability.ArkUI.ArkUI.Full 583 * @atomicservice 584 * @since arkts {'1.1':'18','1.2':'20'} 585 * @arkts 1.1&1.2 586 */ 587 VALIDITY = 27, 588 589 /** 590 * Place of issue content type. 591 * The scenario-based autofill feature, when enabled, 592 * can automatically save and fill in the place of issue for passports. 593 * 594 * @syscap SystemCapability.ArkUI.ArkUI.Full 595 * @atomicservice 596 * @since arkts {'1.1':'18','1.2':'20'} 597 * @arkts 1.1&1.2 598 */ 599 ISSUE_AT = 28, 600 601 /** 602 * Invoice organization content type. 603 * The scenario-based autofill feature, when enabled, 604 * can automatically save and fill in invoice titles. 605 * 606 * @syscap SystemCapability.ArkUI.ArkUI.Full 607 * @atomicservice 608 * @since arkts {'1.1':'18','1.2':'20'} 609 * @arkts 1.1&1.2 610 */ 611 ORGANIZATION = 29, 612 613 /** 614 * Invoice tax id content type. 615 * The scenario-based autofill feature, when enabled, 616 * can automatically save and fill in tax IDs. 617 * 618 * @syscap SystemCapability.ArkUI.ArkUI.Full 619 * @atomicservice 620 * @since arkts {'1.1':'18','1.2':'20'} 621 * @arkts 1.1&1.2 622 */ 623 TAX_ID = 30, 624 625 /** 626 * Address city and state content type. 627 * The scenario-based autofill feature, when enabled, 628 * can automatically save and fill in locations. 629 * 630 * @syscap SystemCapability.ArkUI.ArkUI.Full 631 * @atomicservice 632 * @since arkts {'1.1':'18','1.2':'20'} 633 * @arkts 1.1&1.2 634 */ 635 ADDRESS_CITY_AND_STATE = 31, 636 637 /** 638 * Airline flight number content type. 639 * Currently not supported for automatic saving and auto-filling. 640 * 641 * @syscap SystemCapability.ArkUI.ArkUI.Full 642 * @atomicservice 643 * @since arkts {'1.1':'18','1.2':'20'} 644 * @arkts 1.1&1.2 645 */ 646 FLIGHT_NUMBER = 32, 647 648 /** 649 * License number for drivers content type. 650 * Currently not supported for automatic saving and auto-filling. 651 * 652 * @syscap SystemCapability.ArkUI.ArkUI.Full 653 * @atomicservice 654 * @since arkts {'1.1':'18','1.2':'20'} 655 * @arkts 1.1&1.2 656 */ 657 LICENSE_NUMBER = 33, 658 659 /** 660 * License file number for drivers content type. 661 * Currently not supported for automatic saving and auto-filling. 662 * 663 * @syscap SystemCapability.ArkUI.ArkUI.Full 664 * @atomicservice 665 * @since arkts {'1.1':'18','1.2':'20'} 666 * @arkts 1.1&1.2 667 */ 668 LICENSE_FILE_NUMBER = 34, 669 670 /** 671 * License plate for vehicles content type. 672 * The scenario-based autofill feature, when enabled, 673 * can automatically save and fill in license plate numbers. 674 * 675 * @syscap SystemCapability.ArkUI.ArkUI.Full 676 * @atomicservice 677 * @since arkts {'1.1':'18','1.2':'20'} 678 * @arkts 1.1&1.2 679 */ 680 LICENSE_PLATE = 35, 681 682 /** 683 * Engine number for vehicles content type. 684 * Currently not supported for automatic saving and auto-filling. 685 * 686 * @syscap SystemCapability.ArkUI.ArkUI.Full 687 * @atomicservice 688 * @since arkts {'1.1':'18','1.2':'20'} 689 * @arkts 1.1&1.2 690 */ 691 ENGINE_NUMBER = 36, 692 693 /** 694 * License chassis number for vehicles content type. 695 * Currently not supported for automatic saving and auto-filling. 696 * 697 * @syscap SystemCapability.ArkUI.ArkUI.Full 698 * @atomicservice 699 * @since arkts {'1.1':'18','1.2':'20'} 700 * @arkts 1.1&1.2 701 */ 702 LICENSE_CHASSIS_NUMBER = 37 703} 704 705/** 706 * Declare the type of soft keyboard. 707 * 708 * @enum { number } 709 * @syscap SystemCapability.ArkUI.ArkUI.Full 710 * @since 7 711 */ 712/** 713 * Declare the type of soft keyboard. 714 * 715 * @enum { number } 716 * @syscap SystemCapability.ArkUI.ArkUI.Full 717 * @crossplatform 718 * @since 10 719 */ 720/** 721 * Declare the type of soft keyboard. 722 * 723 * @enum { number } 724 * @syscap SystemCapability.ArkUI.ArkUI.Full 725 * @crossplatform 726 * @atomicservice 727 * @since arkts {'1.1':'11','1.2':'20'} 728 * @arkts 1.1&1.2 729 */ 730declare enum EnterKeyType { 731 /** 732 * Go. 733 * 734 * @syscap SystemCapability.ArkUI.ArkUI.Full 735 * @since 7 736 */ 737 /** 738 * Go. 739 * 740 * @syscap SystemCapability.ArkUI.ArkUI.Full 741 * @crossplatform 742 * @since 10 743 */ 744 /** 745 * Go. 746 * 747 * @syscap SystemCapability.ArkUI.ArkUI.Full 748 * @crossplatform 749 * @atomicservice 750 * @since arkts {'1.1':'11','1.2':'20'} 751 * @arkts 1.1&1.2 752 */ 753 Go = 2, 754 755 /** 756 * Search. 757 * 758 * @syscap SystemCapability.ArkUI.ArkUI.Full 759 * @since 7 760 */ 761 /** 762 * Search. 763 * 764 * @syscap SystemCapability.ArkUI.ArkUI.Full 765 * @crossplatform 766 * @since 10 767 */ 768 /** 769 * Search. 770 * 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 Search = 3, 778 779 /** 780 * Send. 781 * 782 * @syscap SystemCapability.ArkUI.ArkUI.Full 783 * @since 7 784 */ 785 /** 786 * Send. 787 * 788 * @syscap SystemCapability.ArkUI.ArkUI.Full 789 * @crossplatform 790 * @since 10 791 */ 792 /** 793 * Send. 794 * 795 * @syscap SystemCapability.ArkUI.ArkUI.Full 796 * @crossplatform 797 * @atomicservice 798 * @since arkts {'1.1':'11','1.2':'20'} 799 * @arkts 1.1&1.2 800 */ 801 Send = 4, 802 803 /** 804 * Next. 805 * 806 * @syscap SystemCapability.ArkUI.ArkUI.Full 807 * @since 7 808 */ 809 /** 810 * Next. 811 * 812 * @syscap SystemCapability.ArkUI.ArkUI.Full 813 * @crossplatform 814 * @since 10 815 */ 816 /** 817 * Next. 818 * 819 * @syscap SystemCapability.ArkUI.ArkUI.Full 820 * @crossplatform 821 * @atomicservice 822 * @since arkts {'1.1':'11','1.2':'20'} 823 * @arkts 1.1&1.2 824 */ 825 Next = 5, 826 827 /** 828 * Done. 829 * 830 * @syscap SystemCapability.ArkUI.ArkUI.Full 831 * @since 7 832 */ 833 /** 834 * Done. 835 * 836 * @syscap SystemCapability.ArkUI.ArkUI.Full 837 * @crossplatform 838 * @since 10 839 */ 840 /** 841 * Done. 842 * 843 * @syscap SystemCapability.ArkUI.ArkUI.Full 844 * @crossplatform 845 * @atomicservice 846 * @since arkts {'1.1':'11','1.2':'20'} 847 * @arkts 1.1&1.2 848 */ 849 Done = 6, 850 851 /** 852 * Showed as 'previous' pattern. 853 * 854 * @syscap SystemCapability.ArkUI.ArkUI.Full 855 * @crossplatform 856 * @since 11 857 */ 858 /** 859 * Showed as 'previous' pattern. 860 * 861 * @syscap SystemCapability.ArkUI.ArkUI.Full 862 * @crossplatform 863 * @atomicservice 864 * @since arkts {'1.1':'12','1.2':'20'} 865 * @arkts 1.1&1.2 866 */ 867 PREVIOUS = 7, 868 869 /** 870 * Showed as 'new line' pattern. 871 * 872 * @syscap SystemCapability.ArkUI.ArkUI.Full 873 * @crossplatform 874 * @since 11 875 */ 876 /** 877 * Showed as 'new line' pattern. 878 * 879 * @syscap SystemCapability.ArkUI.ArkUI.Full 880 * @crossplatform 881 * @atomicservice 882 * @since arkts {'1.1':'12','1.2':'20'} 883 * @arkts 1.1&1.2 884 */ 885 NEW_LINE = 8, 886} 887 888/** 889 * Defines the underline color width property. 890 * 891 * @interface UnderlineColor 892 * @syscap SystemCapability.ArkUI.ArkUI.Full 893 * @crossplatform 894 * @atomicservice 895 * @since arkts {'1.1':'12','1.2':'20'} 896 * @arkts 1.1&1.2 897 */ 898declare interface UnderlineColor { 899 /** 900 * Typing underline color width property. 901 * 902 * <p><strong>NOTE</strong>: 903 * <br>If no value is specified or if the value specified is undefined, 904 * null, or invalid, the default value is used. 905 * </p> 906 * 907 * @type { ?(ResourceColor | undefined) } 908 * @syscap SystemCapability.ArkUI.ArkUI.Full 909 * @crossplatform 910 * @atomicservice 911 * @since arkts {'1.1':'12','1.2':'20'} 912 * @arkts 1.1&1.2 913 */ 914 typing?: ResourceColor | undefined; 915 /** 916 * Normal underline color width property. 917 * 918 * <p><strong>NOTE</strong>: 919 * <br>If no value is specified or if the value specified is undefined, 920 * null, or invalid, the default value is used. 921 * </p> 922 * 923 * @type { ?(ResourceColor | undefined) } 924 * @syscap SystemCapability.ArkUI.ArkUI.Full 925 * @crossplatform 926 * @atomicservice 927 * @since arkts {'1.1':'12','1.2':'20'} 928 * @arkts 1.1&1.2 929 */ 930 normal?: ResourceColor | undefined; 931 /** 932 * Error underline color width property. 933 * 934 * <p><strong>NOTE</strong>: 935 * <br>If no value is specified or if the value specified is undefined, 936 * null, or invalid, the default value is used. 937 * <br>This option changes the color used in the showCounter attribute 938 * when the maximum number of characters is reached. 939 * </p> 940 * 941 * @type { ?(ResourceColor | undefined) } 942 * @syscap SystemCapability.ArkUI.ArkUI.Full 943 * @crossplatform 944 * @atomicservice 945 * @since arkts {'1.1':'12','1.2':'20'} 946 * @arkts 1.1&1.2 947 */ 948 error?: ResourceColor | undefined; 949 /** 950 * Disable underline color width property. 951 * 952 * <p><strong>NOTE</strong>: 953 * <br>If no value is specified or if the value specified is undefined, 954 * null, or invalid, the default value is used. 955 * </p> 956 * 957 * @type { ?(ResourceColor | undefined) } 958 * @syscap SystemCapability.ArkUI.ArkUI.Full 959 * @crossplatform 960 * @atomicservice 961 * @since arkts {'1.1':'12','1.2':'20'} 962 * @arkts 1.1&1.2 963 */ 964 disable?: ResourceColor | undefined; 965} 966 967/** 968 * Provides the method of keeping TextInput editable state when submitted. 969 * 970 * @interface SubmitEvent 971 * @syscap SystemCapability.ArkUI.ArkUI.Full 972 * @crossplatform 973 * @atomicservice 974 * @since arkts {'1.1':'11','1.2':'20'} 975 * @arkts 1.1&1.2 976 */ 977declare interface SubmitEvent { 978 /** 979 * Keeps TextInput editable state when submitted 980 * 981 * @syscap SystemCapability.ArkUI.ArkUI.Full 982 * @crossplatform 983 * @atomicservice 984 * @since arkts {'1.1':'11','1.2':'20'} 985 * @arkts 1.1&1.2 986 */ 987 keepEditableState(): void; 988 989 /** 990 * Sets the current value of TextInput. 991 * 992 * @type { string } 993 * @syscap SystemCapability.ArkUI.ArkUI.Full 994 * @crossplatform 995 * @atomicservice 996 * @since arkts {'1.1':'11','1.2':'20'} 997 * @arkts 1.1&1.2 998 */ 999 text: string; 1000} 1001 1002/** 1003 * Provides the method of switching the cursor position. 1004 * 1005 * @extends TextContentControllerBase 1006 * @since 8 1007 */ 1008/** 1009 * Provides the method of switching the cursor position. 1010 * 1011 * @extends TextContentControllerBase 1012 * @syscap SystemCapability.ArkUI.ArkUI.Full 1013 * @crossplatform 1014 * @since 10 1015 */ 1016/** 1017 * Provides the method of switching the cursor position. 1018 * 1019 * @extends TextContentControllerBase 1020 * @syscap SystemCapability.ArkUI.ArkUI.Full 1021 * @crossplatform 1022 * @atomicservice 1023 * @since arkts {'1.1':'11','1.2':'20'} 1024 * @arkts 1.1&1.2 1025 */ 1026declare class TextInputController extends TextContentControllerBase { 1027 /** 1028 * constructor. 1029 * 1030 * @syscap SystemCapability.ArkUI.ArkUI.Full 1031 * @since 8 1032 */ 1033 /** 1034 * constructor. 1035 * 1036 * @syscap SystemCapability.ArkUI.ArkUI.Full 1037 * @crossplatform 1038 * @since 10 1039 */ 1040 /** 1041 * constructor. 1042 * A constructor used to create a TextInputController object. 1043 * 1044 * @syscap SystemCapability.ArkUI.ArkUI.Full 1045 * @crossplatform 1046 * @atomicservice 1047 * @since arkts {'1.1':'11','1.2':'20'} 1048 * @arkts 1.1&1.2 1049 */ 1050 constructor(); 1051 1052 /** 1053 * Called when the position of the insertion cursor is set. 1054 * 1055 * @param { number } value 1056 * @syscap SystemCapability.ArkUI.ArkUI.Full 1057 * @since 8 1058 */ 1059 /** 1060 * Called when the position of the insertion cursor is set. 1061 * 1062 * @param { number } value 1063 * @syscap SystemCapability.ArkUI.ArkUI.Full 1064 * @crossplatform 1065 * @since 10 1066 */ 1067 /** 1068 * Called when the position of the insertion cursor is set. 1069 * 1070 * <p><strong>NOTE</strong>: 1071 * <br>If the value is less than 0, the value 0 is used. 1072 * <br>If the value exceeds the text length, the caret is placed at the end of the text. 1073 * </p> 1074 * 1075 * @param { number } value 1076 * @syscap SystemCapability.ArkUI.ArkUI.Full 1077 * @crossplatform 1078 * @atomicservice 1079 * @since arkts {'1.1':'11','1.2':'20'} 1080 * @arkts 1.1&1.2 1081 */ 1082 caretPosition(value: number): void; 1083 1084 /** 1085 * Text selection is achieved by specifying the start and end positions of the text. 1086 * 1087 * @param { number } selectionStart - The start position of the selected text. 1088 * @param { number } selectionEnd - The end position of the selected text. 1089 * @syscap SystemCapability.ArkUI.ArkUI.Full 1090 * @crossplatform 1091 * @since 10 1092 */ 1093 /** 1094 * Text selection is achieved by specifying the start and end positions of the text. 1095 * 1096 * @param { number } selectionStart - The start position of the selected text. 1097 * @param { number } selectionEnd - The end position of the selected text. 1098 * @syscap SystemCapability.ArkUI.ArkUI.Full 1099 * @crossplatform 1100 * @atomicservice 1101 * @since 11 1102 */ 1103 /** 1104 * Text selection is achieved by specifying the start and end positions of the text. 1105 * 1106 * <p><strong>NOTE</strong>: 1107 * <br>If selectionStart or selectionEnd is set to undefined, the value 0 will be used. 1108 * <br>If selectionMenuHidden is set to true or a 2-in-1 device is used, 1109 * calling setTextSelection does not display the context menu even when options is set to MenuPolicy.SHOW. 1110 * <br>If the selected text contains an emoji, 1111 * the emoji is selected when its start position is within the text selection range. 1112 * </p> 1113 * 1114 * @param { number } selectionStart - The start position of the selected text.The start position of text in the text box is 0. 1115 * @param { number } selectionEnd - The end position of the selected text. 1116 * @param { SelectionOptions } [options] - Indicates the options of the text selection.Default value is MenuPolicy.DEFAULT. 1117 * @syscap SystemCapability.ArkUI.ArkUI.Full 1118 * @crossplatform 1119 * @atomicservice 1120 * @since arkts {'1.1':'12','1.2':'20'} 1121 * @arkts 1.1&1.2 1122 */ 1123 setTextSelection(selectionStart: number, selectionEnd: number, options?: SelectionOptions): void; 1124 1125 /** 1126 * Exit edit state. 1127 * 1128 * @syscap SystemCapability.ArkUI.ArkUI.Full 1129 * @crossplatform 1130 * @since 10 1131 */ 1132 /** 1133 * Exit edit state. 1134 * 1135 * @syscap SystemCapability.ArkUI.ArkUI.Full 1136 * @crossplatform 1137 * @atomicservice 1138 * @since arkts {'1.1':'11','1.2':'20'} 1139 * @arkts 1.1&1.2 1140 */ 1141 stopEditing(): void; 1142} 1143 1144/** 1145 * Defines the options of TextInput. 1146 * 1147 * @interface TextInputOptions 1148 * @syscap SystemCapability.ArkUI.ArkUI.Full 1149 * @since 7 1150 */ 1151/** 1152 * Defines the options of TextInput. 1153 * 1154 * @interface TextInputOptions 1155 * @syscap SystemCapability.ArkUI.ArkUI.Full 1156 * @crossplatform 1157 * @since 10 1158 */ 1159/** 1160 * Defines the options of TextInput. 1161 * 1162 * @interface TextInputOptions 1163 * @syscap SystemCapability.ArkUI.ArkUI.Full 1164 * @crossplatform 1165 * @atomicservice 1166 * @since arkts {'1.1':'11','1.2':'20'} 1167 * @arkts 1.1&1.2 1168 */ 1169declare interface TextInputOptions { 1170 /** 1171 * The place holder text string. 1172 * 1173 * @type { ?ResourceStr } 1174 * @syscap SystemCapability.ArkUI.ArkUI.Full 1175 * @since 7 1176 */ 1177 /** 1178 * The place holder text string. 1179 * 1180 * @type { ?ResourceStr } 1181 * @syscap SystemCapability.ArkUI.ArkUI.Full 1182 * @crossplatform 1183 * @since 10 1184 */ 1185 /** 1186 * The place holder text string. 1187 * 1188 * @type { ?ResourceStr } 1189 * @syscap SystemCapability.ArkUI.ArkUI.Full 1190 * @crossplatform 1191 * @atomicservice 1192 * @since arkts {'1.1':'11','1.2':'20'} 1193 * @arkts 1.1&1.2 1194 */ 1195 placeholder?: ResourceStr; 1196 1197 /** 1198 * Sets the current value of TextInput. 1199 * 1200 * @type { ?ResourceStr } 1201 * @syscap SystemCapability.ArkUI.ArkUI.Full 1202 * @since 7 1203 */ 1204 /** 1205 * Sets the current value of TextInput. 1206 * 1207 * @type { ?ResourceStr } 1208 * @syscap SystemCapability.ArkUI.ArkUI.Full 1209 * @crossplatform 1210 * @since 10 1211 */ 1212 /** 1213 * Sets the current value of TextInput. 1214 * 1215 * <p><strong>NOTE</strong>: 1216 * <br>You are advised to bind the state variable to the text in real time through the onChange event, 1217 * so as to prevent display errors when the component is updated. 1218 * <br>Since API version 10, this parameter supports two-way binding through $$. 1219 * <br>Since API version 18, this parameter supports two-way binding through !!. 1220 * </p> 1221 * 1222 * @type { ?ResourceStr } 1223 * @syscap SystemCapability.ArkUI.ArkUI.Full 1224 * @crossplatform 1225 * @atomicservice 1226 * @since arkts {'1.1':'11','1.2':'20'} 1227 * @arkts 1.1&1.2 1228 */ 1229 text?: ResourceStr; 1230 1231 /** 1232 * Called when the position of the insertion cursor is set. 1233 * 1234 * @type { ?TextInputController } 1235 * @syscap SystemCapability.ArkUI.ArkUI.Full 1236 * @since 8 1237 */ 1238 /** 1239 * Called when the position of the insertion cursor is set. 1240 * 1241 * @type { ?TextInputController } 1242 * @syscap SystemCapability.ArkUI.ArkUI.Full 1243 * @crossplatform 1244 * @since 10 1245 */ 1246 /** 1247 * Called when the position of the insertion cursor is set. 1248 * 1249 * @type { ?TextInputController } 1250 * @syscap SystemCapability.ArkUI.ArkUI.Full 1251 * @crossplatform 1252 * @atomicservice 1253 * @since arkts {'1.1':'11','1.2':'20'} 1254 * @arkts 1.1&1.2 1255 */ 1256 controller?: TextInputController; 1257} 1258 1259/** 1260 * Text input style. 1261 * 1262 * @enum { number } 1263 * @syscap SystemCapability.ArkUI.ArkUI.Full 1264 * @since 9 1265 */ 1266/** 1267 * Text input style. 1268 * 1269 * @enum { number } 1270 * @syscap SystemCapability.ArkUI.ArkUI.Full 1271 * @crossplatform 1272 * @since 10 1273 */ 1274/** 1275 * Text input style. 1276 * 1277 * @enum { number } 1278 * @syscap SystemCapability.ArkUI.ArkUI.Full 1279 * @crossplatform 1280 * @atomicservice 1281 * @since arkts {'1.1':'11','1.2':'20'} 1282 * @arkts 1.1&1.2 1283 */ 1284declare enum TextInputStyle { 1285 /** 1286 * Text input default style. 1287 * 1288 * @syscap SystemCapability.ArkUI.ArkUI.Full 1289 * @since 9 1290 */ 1291 /** 1292 * Text input default style. 1293 * 1294 * @syscap SystemCapability.ArkUI.ArkUI.Full 1295 * @crossplatform 1296 * @since 10 1297 */ 1298 /** 1299 * Text input default style. 1300 * 1301 * <p><strong>NOTE</strong>: 1302 * <br>The caret width is fixed at 1.5 vp, 1303 * and the caret height is subject to the background height and font size of the selected text. 1304 * </p> 1305 * 1306 * @syscap SystemCapability.ArkUI.ArkUI.Full 1307 * @crossplatform 1308 * @atomicservice 1309 * @since arkts {'1.1':'11','1.2':'20'} 1310 * @arkts 1.1&1.2 1311 */ 1312 Default, 1313 1314 /** 1315 * Text input inline style. 1316 * 1317 * @syscap SystemCapability.ArkUI.ArkUI.Full 1318 * @since 9 1319 */ 1320 /** 1321 * Text input inline style. 1322 * 1323 * @syscap SystemCapability.ArkUI.ArkUI.Full 1324 * @crossplatform 1325 * @since 10 1326 */ 1327 /** 1328 * Text input inline style. 1329 * 1330 * <p><strong>NOTE</strong>: 1331 * <br>The background height of the selected text is the same as the height of the text box. 1332 * <br>This style is used in scenarios where editing and non-editing states are obvious, 1333 * for example, renaming in the file list view. 1334 * <br>The showError attribute is not supported for this style. 1335 * <br>This style does not allow for text dragging and dropping. 1336 * </p> 1337 * 1338 * @syscap SystemCapability.ArkUI.ArkUI.Full 1339 * @crossplatform 1340 * @atomicservice 1341 * @since arkts {'1.1':'11','1.2':'20'} 1342 * @arkts 1.1&1.2 1343 */ 1344 Inline 1345} 1346 1347/** 1348 * Provides a single-line text input component interface. 1349 * 1350 * @interface TextInputInterface 1351 * @syscap SystemCapability.ArkUI.ArkUI.Full 1352 * @since 7 1353 */ 1354/** 1355 * Provides a single-line text input component interface. 1356 * 1357 * @interface TextInputInterface 1358 * @syscap SystemCapability.ArkUI.ArkUI.Full 1359 * @crossplatform 1360 * @since 10 1361 */ 1362/** 1363 * Provides a single-line text input component interface. 1364 * 1365 * @interface TextInputInterface 1366 * @syscap SystemCapability.ArkUI.ArkUI.Full 1367 * @crossplatform 1368 * @atomicservice 1369 * @since arkts {'1.1':'11','1.2':'20'} 1370 * @arkts 1.1&1.2 1371 */ 1372interface TextInputInterface { 1373 /** 1374 * Called when writing a single line of text. 1375 * 1376 * @param { TextInputOptions } value 1377 * @returns { TextInputAttribute } 1378 * @syscap SystemCapability.ArkUI.ArkUI.Full 1379 * @since 7 1380 */ 1381 /** 1382 * Called when writing a single line of text. 1383 * 1384 * @param { TextInputOptions } value 1385 * @returns { TextInputAttribute } 1386 * @syscap SystemCapability.ArkUI.ArkUI.Full 1387 * @crossplatform 1388 * @since 10 1389 */ 1390 /** 1391 * Called when writing a single line of text. 1392 * 1393 * @param { TextInputOptions } value 1394 * @returns { TextInputAttribute } 1395 * @syscap SystemCapability.ArkUI.ArkUI.Full 1396 * @crossplatform 1397 * @atomicservice 1398 * @since arkts {'1.1':'11','1.2':'20'} 1399 * @arkts 1.1&1.2 1400 */ 1401 (value?: TextInputOptions): TextInputAttribute; 1402} 1403 1404/** 1405 * PasswordIcon object. 1406 * 1407 * @interface PasswordIcon 1408 * @syscap SystemCapability.ArkUI.ArkUI.Full 1409 * @since 10 1410 */ 1411/** 1412 * PasswordIcon object. 1413 * 1414 * @interface PasswordIcon 1415 * @syscap SystemCapability.ArkUI.ArkUI.Full 1416 * @crossplatform 1417 * @atomicservice 1418 * @since arkts {'1.1':'11','1.2':'20'} 1419 * @arkts 1.1&1.2 1420 */ 1421interface PasswordIcon { 1422 /** 1423 * Define the on icon source of PasswordIcon. 1424 * 1425 * @type { ?(string | Resource) } 1426 * @syscap SystemCapability.ArkUI.ArkUI.Full 1427 * @since 10 1428 */ 1429 /** 1430 * Define the on icon source of PasswordIcon. 1431 * 1432 * <p><strong>NOTE</strong>: 1433 * <br>Icon that can be used to hide the password in password input mode. 1434 * <br>The string type can be used to load network images and local images. 1435 * </p> 1436 * 1437 * @type { ?(string | Resource) } 1438 * @syscap SystemCapability.ArkUI.ArkUI.Full 1439 * @crossplatform 1440 * @atomicservice 1441 * @since arkts {'1.1':'11','1.2':'20'} 1442 * @arkts 1.1&1.2 1443 */ 1444 onIconSrc?: string | Resource; 1445 1446 /** 1447 * Define the off icon source of PasswordIcon. 1448 * 1449 * @type { ?(string | Resource) } 1450 * @syscap SystemCapability.ArkUI.ArkUI.Full 1451 * @since 10 1452 */ 1453 /** 1454 * Define the off icon source of PasswordIcon. 1455 * 1456 * <p><strong>NOTE</strong>: 1457 * <br>Icon that can be used to show the password in password input mode. 1458 * <br>The string type can be used to load network images and local images. 1459 * </p> 1460 * 1461 * @type { ?(string | Resource) } 1462 * @syscap SystemCapability.ArkUI.ArkUI.Full 1463 * @crossplatform 1464 * @atomicservice 1465 * @since arkts {'1.1':'11','1.2':'20'} 1466 * @arkts 1.1&1.2 1467 */ 1468 offIconSrc?: string | Resource; 1469} 1470 1471/** 1472 * Defines a TextInput callback when onSubmit. 1473 * 1474 * Anonymous Object Rectification. 1475 * @typedef { function } OnSubmitCallback 1476 * @param { EnterKeyType } enterKey - Input method Enter key type. 1477 * @param { SubmitEvent } event - The event submitted. 1478 * @syscap SystemCapability.ArkUI.ArkUI.Full 1479 * @crossplatform 1480 * @atomicservice 1481 * @since arkts {'1.1':'18','1.2':'20'} 1482 * @arkts 1.1&1.2 1483 */ 1484declare type OnSubmitCallback = (enterKey: EnterKeyType, event: SubmitEvent) => void; 1485 1486/** 1487 * Defines a TextInput callback when onTextSelectionChange. 1488 * 1489 * Anonymous Object Rectification. 1490 * @typedef { function } OnTextSelectionChangeCallback 1491 * @param { number } selectionStart - The starting position of the selected text, the starting position of the text is 0. 1492 * @param { number } selectionEnd - The end location of the selected text. 1493 * @syscap SystemCapability.ArkUI.ArkUI.Full 1494 * @crossplatform 1495 * @atomicservice 1496 * @since arkts {'1.1':'18','1.2':'20'} 1497 * @arkts 1.1&1.2 1498 */ 1499declare type OnTextSelectionChangeCallback = (selectionStart: number, selectionEnd: number) => void; 1500 1501/** 1502 * Defines a TextInput callback when onContentScroll. 1503 * 1504 * Anonymous Object Rectification. 1505 * @typedef { function } OnContentScrollCallback 1506 * @param { number } totalOffsetX - The text is offset in px on the horizontal axis of the content area. 1507 * @param { number } totalOffsetY - The text is offset in px on the vertical axis of the content area. 1508 * @syscap SystemCapability.ArkUI.ArkUI.Full 1509 * @crossplatform 1510 * @atomicservice 1511 * @since arkts {'1.1':'18','1.2':'20'} 1512 * @arkts 1.1&1.2 1513 */ 1514declare type OnContentScrollCallback = (totalOffsetX: number, totalOffsetY: number) => void; 1515 1516 1517/** 1518 * Defines a TextInput callback when onPaste. 1519 * 1520 * Anonymous Object Rectification. 1521 * @typedef { function } OnPasteCallback 1522 * @param { string } content - The text content of the paste. 1523 * @param { PasteEvent } event - User-defined paste event. 1524 * @syscap SystemCapability.ArkUI.ArkUI.Full 1525 * @crossplatform 1526 * @atomicservice 1527 * @since arkts {'1.1':'18','1.2':'20'} 1528 * @arkts 1.1&1.2 1529 */ 1530declare type OnPasteCallback = (content: string, event: PasteEvent) => void; 1531 1532/** 1533 * Defines the TextInput attribute functions. 1534 * 1535 * @extends CommonMethod<TextInputAttribute> 1536 * @syscap SystemCapability.ArkUI.ArkUI.Full 1537 * @since 7 1538 */ 1539/** 1540 * Defines the TextInput attribute functions. 1541 * 1542 * @extends CommonMethod<TextInputAttribute> 1543 * @syscap SystemCapability.ArkUI.ArkUI.Full 1544 * @crossplatform 1545 * @since 10 1546 */ 1547/** 1548 * Defines the TextInput attribute functions. 1549 * 1550 * @extends CommonMethod<TextInputAttribute> 1551 * @syscap SystemCapability.ArkUI.ArkUI.Full 1552 * @crossplatform 1553 * @atomicservice 1554 * @since arkts {'1.1':'11','1.2':'20'} 1555 * @arkts 1.1&1.2 1556 */ 1557declare class TextInputAttribute extends CommonMethod<TextInputAttribute> { 1558 /** 1559 * Called when the input type is set. 1560 * 1561 * @param { InputType } value 1562 * @returns { TextInputAttribute } 1563 * @syscap SystemCapability.ArkUI.ArkUI.Full 1564 * @since 7 1565 */ 1566 /** 1567 * Called when the input type is set. 1568 * 1569 * @param { InputType } value 1570 * @returns { TextInputAttribute } 1571 * @syscap SystemCapability.ArkUI.ArkUI.Full 1572 * @crossplatform 1573 * @since 10 1574 */ 1575 /** 1576 * Called when the input type is set. 1577 * 1578 * @param { InputType } value - Default value is InputType.Normal. 1579 * @returns { TextInputAttribute } 1580 * @syscap SystemCapability.ArkUI.ArkUI.Full 1581 * @crossplatform 1582 * @atomicservice 1583 * @since arkts {'1.1':'11','1.2':'20'} 1584 * @arkts 1.1&1.2 1585 */ 1586 type(value: InputType): TextInputAttribute; 1587 1588 /** 1589 * Called when the content type is set. 1590 * 1591 * @param { ContentType } value 1592 * @returns { TextInputAttribute } 1593 * @syscap SystemCapability.ArkUI.ArkUI.Full 1594 * @atomicservice 1595 * @since arkts {'1.1':'12','1.2':'20'} 1596 * @arkts 1.1&1.2 1597 */ 1598 contentType(value: ContentType): TextInputAttribute; 1599 1600 /** 1601 * Called when the color of the placeholder is set. 1602 * 1603 * @param { ResourceColor } value 1604 * @returns { TextInputAttribute } 1605 * @syscap SystemCapability.ArkUI.ArkUI.Full 1606 * @since 7 1607 */ 1608 /** 1609 * Called when the color of the placeholder is set. 1610 * 1611 * @param { ResourceColor } value 1612 * @returns { TextInputAttribute } 1613 * @syscap SystemCapability.ArkUI.ArkUI.Full 1614 * @crossplatform 1615 * @since 10 1616 */ 1617 /** 1618 * Called when the color of the placeholder is set. 1619 * 1620 * @param { ResourceColor } value - Default value follows the theme.The default value on wearable devices is '#99ffffff'. 1621 * @returns { TextInputAttribute } 1622 * @syscap SystemCapability.ArkUI.ArkUI.Full 1623 * @crossplatform 1624 * @atomicservice 1625 * @since arkts {'1.1':'11','1.2':'20'} 1626 * @arkts 1.1&1.2 1627 */ 1628 placeholderColor(value: ResourceColor): TextInputAttribute; 1629 1630 /** 1631 * Called when the overflow mode of the font is set. 1632 * 1633 * <p><strong>NOTE</strong>: 1634 * <br>This attribute is only available for the inline input style. 1635 * <br>Text is clipped at the transition between words. 1636 * <br>To clip text in the middle of a word, set wordBreak to WordBreak.BREAK_ALL. 1637 * <br>TextOverflow.None produces the same effect as TextOverflow.Clip. 1638 * <br>Default value in non-editing state in the inline input style: TextOverflow.Ellipsis. 1639 * <br>Default value in editing state in the inline input style: TextOverflow.Clip. 1640 * <br>The TextInput component does not support the TextOverflow.MARQUEE mode. 1641 * <br>If TextOverflow.MARQUEE is set, the component automatically switches to TextOverflow.Ellipsis 1642 * for the non-editing state in the inline input style and TextOverflow.Clip 1643 * for the non-inline input style and the editing state in the inline input style. 1644 * </p> 1645 * 1646 * @param { TextOverflow } value 1647 * @returns { TextInputAttribute } 1648 * @syscap SystemCapability.ArkUI.ArkUI.Full 1649 * @crossplatform 1650 * @atomicservice 1651 * @since arkts {'1.1':'12','1.2':'20'} 1652 * @arkts 1.1&1.2 1653 */ 1654 textOverflow(value: TextOverflow): TextInputAttribute; 1655 1656 /** 1657 * Specify the indentation of the first line in a text-block. 1658 * 1659 * @param { Dimension } value - The length of text indent.Default value is 0. 1660 * @returns { TextInputAttribute } The attribute of the text. 1661 * @syscap SystemCapability.ArkUI.ArkUI.Full 1662 * @crossplatform 1663 * @atomicservice 1664 * @since arkts {'1.1':'12','1.2':'20'} 1665 * @arkts 1.1&1.2 1666 */ 1667 textIndent(value: Dimension): TextInputAttribute; 1668 1669 /** 1670 * Called when the font property of the placeholder is set. 1671 * 1672 * @param { Font } value 1673 * @returns { TextInputAttribute } 1674 * @syscap SystemCapability.ArkUI.ArkUI.Full 1675 * @since 7 1676 */ 1677 /** 1678 * Called when the font property of the placeholder is set. 1679 * 1680 * @param { Font } value 1681 * @returns { TextInputAttribute } 1682 * @syscap SystemCapability.ArkUI.ArkUI.Full 1683 * @crossplatform 1684 * @since 10 1685 */ 1686 /** 1687 * Called when the font property of the placeholder is set. 1688 * 1689 * <p><strong>NOTE</strong>: 1690 * <br>The 'HarmonyOS Sans' font and registered custom fonts are supported. 1691 * <br>The default value on wearable devices is 18fp. 1692 * </p> 1693 * 1694 * @param { Font } value 1695 * @returns { TextInputAttribute } 1696 * @syscap SystemCapability.ArkUI.ArkUI.Full 1697 * @crossplatform 1698 * @atomicservice 1699 * @since arkts {'1.1':'11','1.2':'20'} 1700 * @arkts 1.1&1.2 1701 */ 1702 placeholderFont(value?: Font): TextInputAttribute; 1703 1704 /** 1705 * Called when the type of soft keyboard input button is set. 1706 * 1707 * @param { EnterKeyType } value 1708 * @returns { TextInputAttribute } 1709 * @syscap SystemCapability.ArkUI.ArkUI.Full 1710 * @since 7 1711 */ 1712 /** 1713 * Called when the type of soft keyboard input button is set. 1714 * 1715 * @param { EnterKeyType } value 1716 * @returns { TextInputAttribute } 1717 * @syscap SystemCapability.ArkUI.ArkUI.Full 1718 * @crossplatform 1719 * @since 10 1720 */ 1721 /** 1722 * Called when the type of soft keyboard input button is set. 1723 * 1724 * @param { EnterKeyType } value - Default value is EnterKeyType.Done. 1725 * @returns { TextInputAttribute } 1726 * @syscap SystemCapability.ArkUI.ArkUI.Full 1727 * @crossplatform 1728 * @atomicservice 1729 * @since arkts {'1.1':'11','1.2':'20'} 1730 * @arkts 1.1&1.2 1731 */ 1732 enterKeyType(value: EnterKeyType): TextInputAttribute; 1733 1734 /** 1735 * Called when the color of the insertion cursor is set. 1736 * 1737 * @param { ResourceColor } value 1738 * @returns { TextInputAttribute } 1739 * @syscap SystemCapability.ArkUI.ArkUI.Full 1740 * @since 7 1741 */ 1742 /** 1743 * Called when the color of the insertion cursor is set. 1744 * 1745 * @param { ResourceColor } value 1746 * @returns { TextInputAttribute } 1747 * @syscap SystemCapability.ArkUI.ArkUI.Full 1748 * @crossplatform 1749 * @since 10 1750 */ 1751 /** 1752 * Called when the color of the insertion cursor is set. 1753 * 1754 * <p><strong>NOTE</strong>: 1755 * <br>Since API version 12, this API can be used to set the text handle color, which is the same as the caret color. 1756 * </p> 1757 * 1758 * @param { ResourceColor } value - Default value is '#007DFF'. 1759 * @returns { TextInputAttribute } 1760 * @syscap SystemCapability.ArkUI.ArkUI.Full 1761 * @crossplatform 1762 * @atomicservice 1763 * @since arkts {'1.1':'11','1.2':'20'} 1764 * @arkts 1.1&1.2 1765 */ 1766 caretColor(value: ResourceColor): TextInputAttribute; 1767 1768 /** 1769 * Called when judging whether the text editing change finished. 1770 * 1771 * <p><strong>NOTE</strong>: 1772 * <br>This API is deprecated since API version 8. 1773 * <br>You are advised to use onEditChange instead. 1774 * </p> 1775 * 1776 * @param { function } callback - The value true indicates that the text box is in the editing state. 1777 * @returns { TextInputAttribute } 1778 * @syscap SystemCapability.ArkUI.ArkUI.Full 1779 * @since 7 1780 * @deprecated since 8 1781 * @useinstead onEditChange 1782 */ 1783 onEditChanged(callback: (isEditing: boolean) => void): TextInputAttribute; 1784 1785 /** 1786 * Called when judging whether the text editing change finished. 1787 * 1788 * @param { function } callback 1789 * @returns { TextInputAttribute } 1790 * @syscap SystemCapability.ArkUI.ArkUI.Full 1791 * @since 8 1792 */ 1793 /** 1794 * Called when judging whether the text editing change finished. 1795 * 1796 * @param { function } callback 1797 * @returns { TextInputAttribute } 1798 * @syscap SystemCapability.ArkUI.ArkUI.Full 1799 * @crossplatform 1800 * @since 10 1801 */ 1802 /** 1803 * Called when judging whether the text editing change finished. 1804 * 1805 * @param { function } callback 1806 * @returns { TextInputAttribute } 1807 * @syscap SystemCapability.ArkUI.ArkUI.Full 1808 * @crossplatform 1809 * @atomicservice 1810 * @since 11 1811 */ 1812 /** 1813 * Called when judging whether the text editing change finished. 1814 * 1815 * Anonymous Object Rectification. 1816 * 1817 * <p><strong>NOTE</strong>: 1818 * <br>The text box is in the editing state when it has the caret placed in it, 1819 * and is in the non-editing state otherwise. 1820 * <br>It returns true if the input operation is currently in progress. 1821 * </p> 1822 * 1823 * @param { Callback<boolean> } callback 1824 * @returns { TextInputAttribute } 1825 * @syscap SystemCapability.ArkUI.ArkUI.Full 1826 * @crossplatform 1827 * @atomicservice 1828 * @since arkts {'1.1':'18','1.2':'20'} 1829 * @arkts 1.1&1.2 1830 */ 1831 onEditChange(callback: Callback<boolean>): TextInputAttribute; 1832 1833 /** 1834 * Called when submitted. 1835 * 1836 * @param { function } callback 1837 * @returns { TextInputAttribute } 1838 * @syscap SystemCapability.ArkUI.ArkUI.Full 1839 * @since 7 1840 */ 1841 /** 1842 * Called when submitted. 1843 * 1844 * @param { function } callback 1845 * @returns { TextInputAttribute } 1846 * @syscap SystemCapability.ArkUI.ArkUI.Full 1847 * @crossplatform 1848 * @since 10 1849 */ 1850 /** 1851 * Called when submitted. 1852 * 1853 * @param { function } callback - callback of the listened event. 1854 * @returns { TextInputAttribute } 1855 * @syscap SystemCapability.ArkUI.ArkUI.Full 1856 * @crossplatform 1857 * @atomicservice 1858 * @since 11 1859 */ 1860 /** 1861 * Called when submitted. 1862 * 1863 * Anonymous Object Rectification. 1864 * @param { OnSubmitCallback } callback - Callback of the listened event. 1865 * @returns { TextInputAttribute } 1866 * @syscap SystemCapability.ArkUI.ArkUI.Full 1867 * @crossplatform 1868 * @atomicservice 1869 * @since arkts {'1.1':'18','1.2':'20'} 1870 * @arkts 1.1&1.2 1871 */ 1872 onSubmit(callback: OnSubmitCallback): TextInputAttribute; 1873 1874 /** 1875 * Called when the input of the input box changes. 1876 * 1877 * @param { function } callback 1878 * @returns { TextInputAttribute } 1879 * @syscap SystemCapability.ArkUI.ArkUI.Full 1880 * @since 7 1881 */ 1882 /** 1883 * Called when the input of the input box changes. 1884 * 1885 * @param { function } callback 1886 * @returns { TextInputAttribute } 1887 * @syscap SystemCapability.ArkUI.ArkUI.Full 1888 * @crossplatform 1889 * @since 10 1890 */ 1891 /** 1892 * Called when the input of the input box changes. 1893 * 1894 * @param { function } callback 1895 * @returns { TextInputAttribute } 1896 * @syscap SystemCapability.ArkUI.ArkUI.Full 1897 * @crossplatform 1898 * @atomicservice 1899 * @since 11 1900 */ 1901 /** 1902 * Called when the input of the input box changes. 1903 * 1904 * <p><strong>NOTE</strong>: 1905 * <br>In this callback, if cursor operations are performed, you need to adjust the cursor logic 1906 * based on the previewText parameter to ensure it works seamlessly within the preview display scenario. 1907 * </p> 1908 * 1909 * @param { EditableTextOnChangeCallback } callback 1910 * @returns { TextInputAttribute } 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 onChange(callback: EditableTextOnChangeCallback): TextInputAttribute; 1918 1919 /** 1920 * Called when the text selection changes. 1921 * 1922 * @param { function } callback - callback of the listened event. 1923 * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. 1924 * @syscap SystemCapability.ArkUI.ArkUI.Full 1925 * @crossplatform 1926 * @since 10 1927 */ 1928 /** 1929 * Called when the text selection changes. 1930 * 1931 * @param { function } callback - callback of the listened event. 1932 * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. 1933 * @syscap SystemCapability.ArkUI.ArkUI.Full 1934 * @crossplatform 1935 * @atomicservice 1936 * @since 11 1937 */ 1938 /** 1939 * Called when the text selection changes. 1940 * 1941 * Anonymous Object Rectification. 1942 * @param { OnTextSelectionChangeCallback } callback - Callback of the listened event. 1943 * @returns { TextInputAttribute } Returns the instance of the TextInputAttribute. 1944 * @syscap SystemCapability.ArkUI.ArkUI.Full 1945 * @crossplatform 1946 * @atomicservice 1947 * @since arkts {'1.1':'18','1.2':'20'} 1948 * @arkts 1.1&1.2 1949 */ 1950 onTextSelectionChange(callback: OnTextSelectionChangeCallback): TextInputAttribute; 1951 1952 /** 1953 * Called when the content scrolls. 1954 * 1955 * @param { function } callback - callback of the listened event. 1956 * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. 1957 * @syscap SystemCapability.ArkUI.ArkUI.Full 1958 * @crossplatform 1959 * @since 10 1960 */ 1961 /** 1962 * Called when the content scrolls. 1963 * 1964 * @param { function } callback - callback of the listened event. 1965 * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. 1966 * @syscap SystemCapability.ArkUI.ArkUI.Full 1967 * @crossplatform 1968 * @atomicservice 1969 * @since 11 1970 */ 1971 /** 1972 * Called when the content scrolls. 1973 * 1974 * Anonymous Object Rectification. 1975 * @param { OnContentScrollCallback } callback - Callback of the listened event. 1976 * @returns { TextInputAttribute } Returns the instance of the TextInputAttribute. 1977 * @syscap SystemCapability.ArkUI.ArkUI.Full 1978 * @crossplatform 1979 * @atomicservice 1980 * @since arkts {'1.1':'18','1.2':'20'} 1981 * @arkts 1.1&1.2 1982 */ 1983 onContentScroll(callback: OnContentScrollCallback): TextInputAttribute; 1984 1985 /** 1986 * Called when the input of maximum text length is set. 1987 * 1988 * @param { number } value 1989 * @returns { TextInputAttribute } 1990 * @syscap SystemCapability.ArkUI.ArkUI.Full 1991 * @since 7 1992 */ 1993 /** 1994 * Called when the input of maximum text length is set. 1995 * 1996 * @param { number } value 1997 * @returns { TextInputAttribute } 1998 * @syscap SystemCapability.ArkUI.ArkUI.Full 1999 * @crossplatform 2000 * @since 10 2001 */ 2002 /** 2003 * Called when the input of maximum text length is set. 2004 * 2005 * <p><strong>NOTE</strong>: 2006 * <br>If this attribute is not set or is set to an invalid value, the default value is used. 2007 * <br>If a decimal number is specified, the integer part is used. 2008 * </p> 2009 * 2010 * @param { number } value - Default value is Infinity, indicating that there is no upper limit on the number of characters that can be entered. 2011 * @returns { TextInputAttribute } 2012 * @syscap SystemCapability.ArkUI.ArkUI.Full 2013 * @crossplatform 2014 * @atomicservice 2015 * @since arkts {'1.1':'11','1.2':'20'} 2016 * @arkts 1.1&1.2 2017 */ 2018 maxLength(value: number): TextInputAttribute; 2019 2020 /** 2021 * Called when the font color is set. 2022 * 2023 * @param { ResourceColor } value 2024 * @returns { TextInputAttribute } 2025 * @syscap SystemCapability.ArkUI.ArkUI.Full 2026 * @since 7 2027 */ 2028 /** 2029 * Called when the font color is set. 2030 * 2031 * @param { ResourceColor } value 2032 * @returns { TextInputAttribute } 2033 * @syscap SystemCapability.ArkUI.ArkUI.Full 2034 * @crossplatform 2035 * @since 10 2036 */ 2037 /** 2038 * Called when the font color is set. 2039 * 2040 * @param { ResourceColor } value - The default value on wearable devices is '#dbffffff'. 2041 * @returns { TextInputAttribute } 2042 * @syscap SystemCapability.ArkUI.ArkUI.Full 2043 * @crossplatform 2044 * @atomicservice 2045 * @since arkts {'1.1':'11','1.2':'20'} 2046 * @arkts 1.1&1.2 2047 */ 2048 fontColor(value: ResourceColor): TextInputAttribute; 2049 2050 /** 2051 * Called when the font size is set. 2052 * 2053 * @param { Length } value 2054 * @returns { TextInputAttribute } 2055 * @syscap SystemCapability.ArkUI.ArkUI.Full 2056 * @since 7 2057 */ 2058 /** 2059 * Called when the font size is set. 2060 * 2061 * @param { Length } value 2062 * @returns { TextInputAttribute } 2063 * @syscap SystemCapability.ArkUI.ArkUI.Full 2064 * @crossplatform 2065 * @since 10 2066 */ 2067 /** 2068 * Called when the font size is set. 2069 * 2070 * <p><strong>NOTE</strong>: 2071 * <br>If fontSize is of the number type, the unit fp is used. 2072 * <br>The default font size is 16 fp. 2073 * <br>The value cannot be a percentage. 2074 * <br>The default value on wearable devices is 18fp. 2075 * </p> 2076 * 2077 * @param { Length } value 2078 * @returns { TextInputAttribute } 2079 * @syscap SystemCapability.ArkUI.ArkUI.Full 2080 * @crossplatform 2081 * @atomicservice 2082 * @since arkts {'1.1':'11','1.2':'20'} 2083 * @arkts 1.1&1.2 2084 */ 2085 fontSize(value: Length): TextInputAttribute; 2086 2087 /** 2088 * Called when the font style of a font is set. 2089 * 2090 * @param { FontStyle } value 2091 * @returns { TextInputAttribute } 2092 * @syscap SystemCapability.ArkUI.ArkUI.Full 2093 * @since 7 2094 */ 2095 /** 2096 * Called when the font style of a font is set. 2097 * 2098 * @param { FontStyle } value 2099 * @returns { TextInputAttribute } 2100 * @syscap SystemCapability.ArkUI.ArkUI.Full 2101 * @crossplatform 2102 * @since 10 2103 */ 2104 /** 2105 * Called when the font style of a font is set. 2106 * 2107 * @param { FontStyle } value - Default value is FontStyle.Normal. 2108 * @returns { TextInputAttribute } 2109 * @syscap SystemCapability.ArkUI.ArkUI.Full 2110 * @crossplatform 2111 * @atomicservice 2112 * @since arkts {'1.1':'11','1.2':'20'} 2113 * @arkts 1.1&1.2 2114 */ 2115 fontStyle(value: FontStyle): TextInputAttribute; 2116 2117 /** 2118 * Called when the font weight is set. 2119 * 2120 * @param { number | FontWeight | string } value 2121 * @returns { TextInputAttribute } 2122 * @syscap SystemCapability.ArkUI.ArkUI.Full 2123 * @since 7 2124 */ 2125 /** 2126 * Called when the font weight is set. 2127 * 2128 * @param { number | FontWeight | string } value 2129 * @returns { TextInputAttribute } 2130 * @syscap SystemCapability.ArkUI.ArkUI.Full 2131 * @crossplatform 2132 * @since 10 2133 */ 2134 /** 2135 * Called when the font weight is set. 2136 * 2137 * <p><strong>NOTE</strong>: 2138 * <br>If the value is too large, the text may be clipped depending on the font. 2139 * <br>For the number type, the value range is [100, 900], at an interval of 100. 2140 * <br>The default value is 400. 2141 * <br>A larger value indicates a heavier font weight. 2142 * <br>For the string type, only strings that represent a number, for example, "400", 2143 * and the following enumerated values of FontWeight are supported: "bold", "bolder", "lighter", "regular", and "medium". 2144 * </p> 2145 * 2146 * @param { number | FontWeight | string } value - Default value is FontWeight.Normal. 2147 * @returns { TextInputAttribute } 2148 * @syscap SystemCapability.ArkUI.ArkUI.Full 2149 * @crossplatform 2150 * @atomicservice 2151 * @since 11 2152 */ 2153 /** 2154 * Called when the font weight is set. 2155 * 2156 * @param { number | FontWeight | ResourceStr } value 2157 * @returns { TextInputAttribute } 2158 * @syscap SystemCapability.ArkUI.ArkUI.Full 2159 * @crossplatform 2160 * @atomicservice 2161 * @since 20 2162 * @arkts 1.1&1.2 2163 */ 2164 fontWeight(value: number | FontWeight | ResourceStr): TextInputAttribute; 2165 2166 /** 2167 * Called when the font list of text is set. 2168 * 2169 * @param { ResourceStr } value 2170 * @returns { TextInputAttribute } 2171 * @syscap SystemCapability.ArkUI.ArkUI.Full 2172 * @since 7 2173 */ 2174 /** 2175 * Called when the font list of text is set. 2176 * 2177 * @param { ResourceStr } value 2178 * @returns { TextInputAttribute } 2179 * @syscap SystemCapability.ArkUI.ArkUI.Full 2180 * @crossplatform 2181 * @since 10 2182 */ 2183 /** 2184 * Called when the font list of text is set. 2185 * 2186 * <p><strong>NOTE</strong>: 2187 * <br>Default font: 'HarmonyOS Sans' 2188 * <br>The 'HarmonyOS Sans' font and registered custom fonts are supported for applications. 2189 * <br>Only the 'HarmonyOS Sans' font is supported for widgets. 2190 * </p> 2191 * 2192 * @param { ResourceStr } value 2193 * @returns { TextInputAttribute } 2194 * @syscap SystemCapability.ArkUI.ArkUI.Full 2195 * @crossplatform 2196 * @atomicservice 2197 * @since arkts {'1.1':'11','1.2':'20'} 2198 * @arkts 1.1&1.2 2199 */ 2200 fontFamily(value: ResourceStr): TextInputAttribute; 2201 2202 /** 2203 * Called when the inputFilter of text is set. 2204 * 2205 * @param { ResourceStr } value 2206 * @param { function } error 2207 * @returns { TextInputAttribute } 2208 * @syscap SystemCapability.ArkUI.ArkUI.Full 2209 * @since 8 2210 */ 2211 /** 2212 * Called when the inputFilter of text is set. 2213 * 2214 * @param { ResourceStr } value 2215 * @param { function } error 2216 * @returns { TextInputAttribute } 2217 * @syscap SystemCapability.ArkUI.ArkUI.Full 2218 * @crossplatform 2219 * @since 10 2220 */ 2221 /** 2222 * Called when the inputFilter of text is set. 2223 * 2224 * @param { ResourceStr } value 2225 * @param { function } error 2226 * @returns { TextInputAttribute } 2227 * @syscap SystemCapability.ArkUI.ArkUI.Full 2228 * @crossplatform 2229 * @atomicservice 2230 * @since 11 2231 */ 2232 /** 2233 * Called when the inputFilter of text is set. 2234 * 2235 * Anonymous Object Rectification. 2236 * 2237 * <p><strong>NOTE</strong>: 2238 * <br>Only inputs that comply with the regular expression can be displayed. 2239 * <br>Other inputs are filtered out. 2240 * <br>The specified regular expression can match single characters, but not strings. 2241 * <br>Since API version 11, if inputFilter is set and the entered characters are not null, 2242 * the filtering effect attached to the text box type (specified through the type attribute) does not take effect. 2243 * </p> 2244 * 2245 * @param { ResourceStr } value 2246 * @param { Callback<string> } [error] 2247 * @returns { TextInputAttribute } 2248 * @syscap SystemCapability.ArkUI.ArkUI.Full 2249 * @crossplatform 2250 * @atomicservice 2251 * @since arkts {'1.1':'18','1.2':'20'} 2252 * @arkts 1.1&1.2 2253 */ 2254 inputFilter(value: ResourceStr, error?: Callback<string>): TextInputAttribute; 2255 2256 /** 2257 * Called when using the Clipboard menu 2258 * 2259 * @param { function } callback 2260 * @returns { TextInputAttribute } 2261 * @syscap SystemCapability.ArkUI.ArkUI.Full 2262 * @since 8 2263 */ 2264 /** 2265 * Called when using the Clipboard menu 2266 * 2267 * @param { function } callback 2268 * @returns { TextInputAttribute } 2269 * @syscap SystemCapability.ArkUI.ArkUI.Full 2270 * @crossplatform 2271 * @since 10 2272 */ 2273 /** 2274 * Called when using the Clipboard menu 2275 * 2276 * @param { function } callback 2277 * @returns { TextInputAttribute } 2278 * @syscap SystemCapability.ArkUI.ArkUI.Full 2279 * @crossplatform 2280 * @atomicservice 2281 * @since 11 2282 */ 2283 /** 2284 * Called when using the Clipboard menu. 2285 * 2286 * Anonymous Object Rectification. 2287 * @param { Callback<string> } callback - Callback used to return the copied text content. 2288 * @returns { TextInputAttribute } 2289 * @syscap SystemCapability.ArkUI.ArkUI.Full 2290 * @crossplatform 2291 * @atomicservice 2292 * @since arkts {'1.1':'18','1.2':'20'} 2293 * @arkts 1.1&1.2 2294 */ 2295 onCopy(callback: Callback<string>): TextInputAttribute; 2296 2297 /** 2298 * Called when using the Clipboard menu 2299 * 2300 * @param { function } callback 2301 * @returns { TextInputAttribute } 2302 * @syscap SystemCapability.ArkUI.ArkUI.Full 2303 * @since 8 2304 */ 2305 /** 2306 * Called when using the Clipboard menu 2307 * 2308 * @param { function } callback 2309 * @returns { TextInputAttribute } 2310 * @syscap SystemCapability.ArkUI.ArkUI.Full 2311 * @crossplatform 2312 * @since 10 2313 */ 2314 /** 2315 * Called when using the Clipboard menu 2316 * 2317 * @param { function } callback 2318 * @returns { TextInputAttribute } 2319 * @syscap SystemCapability.ArkUI.ArkUI.Full 2320 * @crossplatform 2321 * @atomicservice 2322 * @since 11 2323 */ 2324 /** 2325 * Called when using the Clipboard menu. 2326 * 2327 * Anonymous Object Rectification. 2328 * @param { Callback<string> } callback 2329 * @returns { TextInputAttribute } 2330 * @syscap SystemCapability.ArkUI.ArkUI.Full 2331 * @crossplatform 2332 * @atomicservice 2333 * @since arkts {'1.1':'18','1.2':'20'} 2334 * @arkts 1.1&1.2 2335 */ 2336 onCut(callback: Callback<string>): TextInputAttribute; 2337 2338 /** 2339 * Called when using the Clipboard menu 2340 * 2341 * @param { function } callback 2342 * @returns { TextInputAttribute } 2343 * @syscap SystemCapability.ArkUI.ArkUI.Full 2344 * @since 8 2345 */ 2346 /** 2347 * Called when using the Clipboard menu 2348 * 2349 * @param { function } callback 2350 * @returns { TextInputAttribute } 2351 * @syscap SystemCapability.ArkUI.ArkUI.Full 2352 * @crossplatform 2353 * @since 10 2354 */ 2355 /** 2356 * Called when using the Clipboard menu 2357 * 2358 * @param { function } callback 2359 * Executed when a paste operation is performed. 2360 * { string } value - The text content to be pasted. 2361 * { PasteEvent } event - The user-defined paste event. 2362 * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. 2363 * @syscap SystemCapability.ArkUI.ArkUI.Full 2364 * @crossplatform 2365 * @atomicservice 2366 * @since 11 2367 */ 2368 /** 2369 * Called when using the Clipboard menu. 2370 * 2371 * Anonymous Object Rectification. 2372 * @param { OnPasteCallback } callback - Executed when a paste operation is performed. 2373 * @returns { TextInputAttribute } Returns the instance of the TextInputAttribute. 2374 * @syscap SystemCapability.ArkUI.ArkUI.Full 2375 * @crossplatform 2376 * @atomicservice 2377 * @since arkts {'1.1':'18','1.2':'20'} 2378 * @arkts 1.1&1.2 2379 */ 2380 onPaste(callback: OnPasteCallback): TextInputAttribute; 2381 2382 /** 2383 * Called when the copy option is set. 2384 * 2385 * @param { CopyOptions } value 2386 * @returns { TextInputAttribute } 2387 * @syscap SystemCapability.ArkUI.ArkUI.Full 2388 * @since 9 2389 */ 2390 /** 2391 * Called when the copy option is set. 2392 * 2393 * @param { CopyOptions } value 2394 * @returns { TextInputAttribute } 2395 * @syscap SystemCapability.ArkUI.ArkUI.Full 2396 * @crossplatform 2397 * @since 10 2398 */ 2399 /** 2400 * Called when the copy option is set. 2401 * 2402 * <p><strong>NOTE</strong>: 2403 * <br>If this attribute is set to CopyOptions.None, the text can only be pasted; 2404 * all other actions, such as copying, cutting, and sharing, are disabled. 2405 * <br>Dragging is not allowed when CopyOptions.None is set. 2406 * </p> 2407 * 2408 * @param { CopyOptions } value - Default value is CopyOptions.LocalDevice. 2409 * @returns { TextInputAttribute } 2410 * @syscap SystemCapability.ArkUI.ArkUI.Full 2411 * @crossplatform 2412 * @atomicservice 2413 * @since arkts {'1.1':'11','1.2':'20'} 2414 * @arkts 1.1&1.2 2415 */ 2416 copyOption(value: CopyOptions): TextInputAttribute; 2417 2418 /** 2419 * Called when the password show/hide icon is set. 2420 * 2421 * @param { boolean } value 2422 * @returns { TextInputAttribute } 2423 * @syscap SystemCapability.ArkUI.ArkUI.Full 2424 * @since 9 2425 */ 2426 /** 2427 * Called when the password show/hide icon is set. 2428 * 2429 * @param { boolean } value 2430 * @returns { TextInputAttribute } 2431 * @syscap SystemCapability.ArkUI.ArkUI.Full 2432 * @crossplatform 2433 * @since 10 2434 */ 2435 /** 2436 * Called when the password show/hide icon is set. 2437 * 2438 * <p><strong>NOTE</strong>: 2439 * <br>This API has effect only when the input type is set to Password, 2440 * NEWPASSWORD, or NUMBERPASSWORD mode. It does not work in other modes. 2441 * <br>When in password mode, there may be inconsistency between the backend state of the text box 2442 * and the frontend application's state management variables. 2443 * <br>This can cause issues with the icon at the end of the password text box. 2444 * <br>To avoid such issues, use the onSecurityStateChange callback to sync the states. 2445 * </p> 2446 * 2447 * @param { boolean } value - Default value is false. 2448 * @returns { TextInputAttribute } 2449 * @syscap SystemCapability.ArkUI.ArkUI.Full 2450 * @crossplatform 2451 * @atomicservice 2452 * @since arkts {'1.1':'11','1.2':'20'} 2453 * @arkts 1.1&1.2 2454 */ 2455 showPasswordIcon(value: boolean): TextInputAttribute; 2456 2457 /** 2458 * Called when the text align is set. 2459 * 2460 * @param { TextAlign } value 2461 * @returns { TextInputAttribute } 2462 * @syscap SystemCapability.ArkUI.ArkUI.Full 2463 * @since 9 2464 */ 2465 /** 2466 * Called when the text align is set. 2467 * 2468 * @param { TextAlign } value 2469 * @returns { TextInputAttribute } 2470 * @syscap SystemCapability.ArkUI.ArkUI.Full 2471 * @crossplatform 2472 * @since 10 2473 */ 2474 /** 2475 * Called when the text align is set. 2476 * 2477 * <p><strong>NOTE</strong>: 2478 * <br>Available options are TextAlign.Start, TextAlign.Center, and TextAlign.End. 2479 * <br>To set vertical alignment for the text, use the align attribute. 2480 * <br>The align attribute alone does not control the horizontal position of the text. 2481 * <br>In other words, Alignment.TopStart, Alignment.Top, and Alignment.TopEnd produce the same effect, top-aligning the text; 2482 * Alignment.Start, Alignment.Center, and Alignment.End produce the same effect, centered-aligning the text vertically; 2483 * Alignment.BottomStart, Alignment.Bottom, and Alignment.BottomEnd produce the same effect, bottom-aligning the text. 2484 * </p> 2485 * 2486 * @param { TextAlign } value - Default value is TextAlign.Start. 2487 * @returns { TextInputAttribute } 2488 * @syscap SystemCapability.ArkUI.ArkUI.Full 2489 * @crossplatform 2490 * @atomicservice 2491 * @since arkts {'1.1':'11','1.2':'20'} 2492 * @arkts 1.1&1.2 2493 */ 2494 textAlign(value: TextAlign): TextInputAttribute; 2495 2496 /** 2497 * Text input style 2498 * 2499 * @param { TextInputStyle | TextContentStyle } value - Text input style 2500 * @returns { TextInputAttribute } 2501 * @syscap SystemCapability.ArkUI.ArkUI.Full 2502 * @since 9 2503 */ 2504 /** 2505 * Text input style 2506 * 2507 * @param { TextInputStyle | TextContentStyle } value - Text input style 2508 * @returns { TextInputAttribute } 2509 * @syscap SystemCapability.ArkUI.ArkUI.Full 2510 * @crossplatform 2511 * @since 10 2512 */ 2513 /** 2514 * Text input style 2515 * 2516 * <p><strong>NOTE</strong>: 2517 * <br>The inline input style only supports InputType.Normal. 2518 * </p> 2519 * 2520 * @param { TextInputStyle | TextContentStyle } value - Text input style.Default value is TextInputStyle.Default. 2521 * @returns { TextInputAttribute } 2522 * @syscap SystemCapability.ArkUI.ArkUI.Full 2523 * @crossplatform 2524 * @atomicservice 2525 * @since arkts {'1.1':'11','1.2':'20'} 2526 * @arkts 1.1&1.2 2527 */ 2528 style(value: TextInputStyle | TextContentStyle): TextInputAttribute; 2529 2530 /** 2531 * Define the caret style of the text input 2532 * 2533 * @param { CaretStyle } value 2534 * @returns { TextInputAttribute } 2535 * @syscap SystemCapability.ArkUI.ArkUI.Full 2536 * @crossplatform 2537 * @since 10 2538 */ 2539 /** 2540 * Define the caret style of the text input 2541 * 2542 * @param { CaretStyle } value 2543 * @returns { TextInputAttribute } 2544 * @syscap SystemCapability.ArkUI.ArkUI.Full 2545 * @crossplatform 2546 * @atomicservice 2547 * @since arkts {'1.1':'11','1.2':'20'} 2548 * @arkts 1.1&1.2 2549 */ 2550 caretStyle(value: CaretStyle): TextInputAttribute; 2551 2552 /** 2553 * Define the text selected background color of the text input. 2554 * 2555 * @param { ResourceColor } value 2556 * @returns { TextInputAttribute } 2557 * @syscap SystemCapability.ArkUI.ArkUI.Full 2558 * @crossplatform 2559 * @since 10 2560 */ 2561 /** 2562 * Define the text selected background color of the text input. 2563 * 2564 * <p><strong>NOTE</strong>: 2565 * <br>If the opacity is not set, a 20% opacity will be used. 2566 * </p> 2567 * 2568 * @param { ResourceColor } value 2569 * @returns { TextInputAttribute } 2570 * @syscap SystemCapability.ArkUI.ArkUI.Full 2571 * @crossplatform 2572 * @atomicservice 2573 * @since arkts {'1.1':'11','1.2':'20'} 2574 * @arkts 1.1&1.2 2575 */ 2576 selectedBackgroundColor(value: ResourceColor): TextInputAttribute; 2577 2578 /** 2579 * Define the caret position of the text input. 2580 * 2581 * @param { number } value 2582 * @returns { TextInputAttribute } 2583 * @syscap SystemCapability.ArkUI.ArkUI.Full 2584 * @crossplatform 2585 * @since 10 2586 */ 2587 /** 2588 * Define the caret position of the text input. 2589 * 2590 * @param { number } value 2591 * @returns { TextInputAttribute } 2592 * @syscap SystemCapability.ArkUI.ArkUI.Full 2593 * @crossplatform 2594 * @atomicservice 2595 * @since arkts {'1.1':'11','1.2':'20'} 2596 * @arkts 1.1&1.2 2597 */ 2598 caretPosition(value: number): TextInputAttribute; 2599 2600 /** 2601 * Sets whether request keyboard or not when on focus. 2602 * 2603 * @param { boolean } value 2604 * @returns { TextInputAttribute } Returns the instance of the TextInputAttribute. 2605 * @syscap SystemCapability.ArkUI.ArkUI.Full 2606 * @crossplatform 2607 * @since 10 2608 */ 2609 /** 2610 * Sets whether request keyboard or not when on focus. 2611 * Sets whether to enable the input method when the TextInput component obtains focus in a way other than clicking. 2612 * 2613 * <p><strong>NOTE</strong>: 2614 * <br>Since API version 10, the TextInput component brings up the keyboard by default when it obtains focus. 2615 * </p> 2616 * 2617 * @param { boolean } value - Default value is true. 2618 * @returns { TextInputAttribute } Returns the instance of the TextInputAttribute. 2619 * @syscap SystemCapability.ArkUI.ArkUI.Full 2620 * @crossplatform 2621 * @atomicservice 2622 * @since arkts {'1.1':'11','1.2':'20'} 2623 * @arkts 1.1&1.2 2624 */ 2625 enableKeyboardOnFocus(value: boolean): TextInputAttribute; 2626 2627 /** 2628 * Define the password icon of the text input. 2629 * 2630 * @param { PasswordIcon } value 2631 * @returns { TextInputAttribute } 2632 * @syscap SystemCapability.ArkUI.ArkUI.Full 2633 * @since 10 2634 */ 2635 /** 2636 * Define the password icon of the text input. 2637 * 2638 * <p><strong>NOTE</strong>: 2639 * <br>Images in JPG, PNG, BMP, HEIC, and WEBP formats are supported. 2640 * <br>By default, the system-provided icon is used. 2641 * <br>The icon size is fixed at 24 vp (or 28 vp on wearable devices), regardless of the source image size. 2642 * </p> 2643 * 2644 * @param { PasswordIcon } value 2645 * @returns { TextInputAttribute } 2646 * @syscap SystemCapability.ArkUI.ArkUI.Full 2647 * @crossplatform 2648 * @atomicservice 2649 * @since arkts {'1.1':'11','1.2':'20'} 2650 * @arkts 1.1&1.2 2651 */ 2652 passwordIcon(value: PasswordIcon): TextInputAttribute; 2653 2654 /** 2655 * Define the show error of the text input. 2656 * 2657 * @param { string | undefined } value 2658 * @returns { TextInputAttribute } 2659 * @syscap SystemCapability.ArkUI.ArkUI.Full 2660 * @since 10 2661 */ 2662 /** 2663 * Define the show error of the text input. 2664 * 2665 * @param { string | undefined } value 2666 * @returns { TextInputAttribute } 2667 * @syscap SystemCapability.ArkUI.ArkUI.Full 2668 * @crossplatform 2669 * @atomicservice 2670 * @since 11 2671 */ 2672 /** 2673 * Define the show error of the text input. 2674 * 2675 * <p><strong>NOTE</strong>: 2676 * <br>On wearable devices, the error message is displayed at a font size of 13 fp and center-aligned. 2677 * <br>If the data type is ResourceStr and the input content does not comply with specifications, the error message is displayed. 2678 * <br>If the error message does not fit in one line, an ellipsis (…) is displayed to represent clipped text. 2679 * <br>If the data type is undefined, no error message is displayed. 2680 * <br>By default, no error message is displayed. 2681 * </p> 2682 * 2683 * @param { ResourceStr | undefined } [value] 2684 * @returns { TextInputAttribute } 2685 * @syscap SystemCapability.ArkUI.ArkUI.Full 2686 * @crossplatform 2687 * @atomicservice 2688 * @since arkts {'1.1':'12','1.2':'20'} 2689 * @arkts 1.1&1.2 2690 */ 2691 showError(value?: ResourceStr | undefined): TextInputAttribute; 2692 2693 /** 2694 * Define the show unit of the text input. 2695 * 2696 * @param { CustomBuilder } value 2697 * @returns { TextInputAttribute } 2698 * @syscap SystemCapability.ArkUI.ArkUI.Full 2699 * @since 10 2700 */ 2701 /** 2702 * Define the show unit of the text input. 2703 * 2704 * <p><strong>NOTE</strong>: 2705 * <br>This attribute effective only when showUnderline is set to true. 2706 * </p> 2707 * 2708 * @param { CustomBuilder } value 2709 * @returns { TextInputAttribute } 2710 * @syscap SystemCapability.ArkUI.ArkUI.Full 2711 * @crossplatform 2712 * @atomicservice 2713 * @since arkts {'1.1':'11','1.2':'20'} 2714 * @arkts 1.1&1.2 2715 */ 2716 showUnit(value: CustomBuilder): TextInputAttribute; 2717 2718 /** 2719 * Define the show underline of the text input. 2720 * 2721 * @param { boolean } value 2722 * @returns { TextInputAttribute } 2723 * @syscap SystemCapability.ArkUI.ArkUI.Full 2724 * @since 10 2725 */ 2726 /** 2727 * Define the show underline of the text input. 2728 * 2729 * <p><strong>NOTE</strong>: 2730 * <br>By default, the underline comes in the color of '#33182431', thickness of 1 px, and text box size of 48 vp. 2731 * <br>The underline is only available for the InputType.Normal type. 2732 * </p> 2733 * 2734 * @param { boolean } value - Default value is false. 2735 * @returns { TextInputAttribute } 2736 * @syscap SystemCapability.ArkUI.ArkUI.Full 2737 * @crossplatform 2738 * @atomicservice 2739 * @since arkts {'1.1':'11','1.2':'20'} 2740 * @arkts 1.1&1.2 2741 */ 2742 showUnderline(value: boolean): TextInputAttribute; 2743 2744 /** 2745 * Define the underline color of the text input. 2746 * 2747 * <p><strong>NOTE</strong>: 2748 * <br>The underline color changes with the underline mode. 2749 * <br>If the underline color is only set for the normal state, you can directly enter a value of the ResourceColor type. 2750 * <br>If the value specified is undefined, null, or invalid, all underlines are restored to the default value. 2751 * <br>Default value: underline color configured for the theme, which is #33182431 by default. 2752 * </p> 2753 * 2754 * @param { ResourceColor | UnderlineColor | undefined } value 2755 * @returns { TextInputAttribute } 2756 * @syscap SystemCapability.ArkUI.ArkUI.Full 2757 * @crossplatform 2758 * @atomicservice 2759 * @since arkts {'1.1':'12','1.2':'20'} 2760 * @arkts 1.1&1.2 2761 */ 2762 underlineColor(value: ResourceColor | UnderlineColor | undefined): TextInputAttribute; 2763 2764 /** 2765 * Controls whether the selection menu pops up. 2766 * 2767 * @param { boolean } value 2768 * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. 2769 * @syscap SystemCapability.ArkUI.ArkUI.Full 2770 * @crossplatform 2771 * @since 10 2772 */ 2773 /** 2774 * Controls whether the selection menu pops up. 2775 * 2776 * <p><strong>NOTE</strong>: 2777 * <br><em>true</em>: 2778 * <br>The system text selection menu does not appear under the following circumstances: 2779 * clicking the text box cursor, long-pressing the text box, double-tapping the text box, 2780 * triple-tapping the text box, or right-clicking the text box. 2781 * <br><em>false</em>: 2782 * <br>The system text selection menu appears under the following circumstances: 2783 * clicking the text box cursor, long-pressing the text box, double-tapping the text box, 2784 * triple-tapping the text box, or right-clicking the text box. 2785 * </p> 2786 * 2787 * @param { boolean } value - Default value is false. 2788 * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. 2789 * @syscap SystemCapability.ArkUI.ArkUI.Full 2790 * @crossplatform 2791 * @atomicservice 2792 * @since arkts {'1.1':'11','1.2':'20'} 2793 * @arkts 1.1&1.2 2794 */ 2795 selectionMenuHidden(value: boolean): TextInputAttribute; 2796 2797 /** 2798 * Define bar state of the text input. 2799 * 2800 * @param { BarState } value 2801 * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. 2802 * @syscap SystemCapability.ArkUI.ArkUI.Full 2803 * @since 10 2804 */ 2805 /** 2806 * Define bar state of the text input. 2807 * 2808 * @param { BarState } value - Default value is BarState.Auto. 2809 * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. 2810 * @syscap SystemCapability.ArkUI.ArkUI.Full 2811 * @atomicservice 2812 * @since arkts {'1.1':'11','1.2':'20'} 2813 * @arkts 1.1&1.2 2814 */ 2815 barState(value: BarState): TextInputAttribute; 2816 2817 /** 2818 * Define max lines of the text input. 2819 * 2820 * @param { number } value 2821 * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. 2822 * @syscap SystemCapability.ArkUI.ArkUI.Full 2823 * @since 10 2824 */ 2825 /** 2826 * Define max lines of the text input. 2827 * Value range: (0, +∞) 2828 * 2829 * @param { number } value - Default value is 3. 2830 * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. 2831 * @syscap SystemCapability.ArkUI.ArkUI.Full 2832 * @crossplatform 2833 * @atomicservice 2834 * @since arkts {'1.1':'11','1.2':'20'} 2835 * @arkts 1.1&1.2 2836 */ 2837 maxLines(value: number): TextInputAttribute; 2838 2839 /** 2840 * Set the text inline style word break type. 2841 * 2842 * <p><strong>NOTE</strong>: 2843 * <br>This attribute is effective for the inline input style, 2844 * but does not apply to the placeholder text. 2845 * <br>The component does not support the clip attribute. 2846 * <br>Therefore, setting this attribute does not affect text clipping. 2847 * </p> 2848 * 2849 * @param { WordBreak } value - The word break type.Default value is WordBreak.BREAK_WORD. 2850 * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. 2851 * @syscap SystemCapability.ArkUI.ArkUI.Full 2852 * @crossplatform 2853 * @atomicservice 2854 * @since arkts {'1.1':'12','1.2':'20'} 2855 * @arkts 1.1&1.2 2856 */ 2857 wordBreak(value: WordBreak): TextInputAttribute; 2858 2859 /** 2860 * Set the text line break strategy type. 2861 * 2862 * <p><strong>NOTE</strong>: 2863 * <br>This attribute takes effect when wordBreak is not set to breakAll. 2864 * <br>Hyphens are not supported. 2865 * <br>This attribute does not take effect for the non-inline input style. 2866 * </p> 2867 * 2868 * @param { LineBreakStrategy } strategy - The text line break strategy type.Default value is LineBreakStrategy.GREEDY. 2869 * @returns { TextInputAttribute } The attribute of the TextInputAttribute. 2870 * @syscap SystemCapability.ArkUI.ArkUI.Full 2871 * @crossplatform 2872 * @atomicservice 2873 * @since arkts {'1.1':'12','1.2':'20'} 2874 * @arkts 1.1&1.2 2875 */ 2876 lineBreakStrategy(strategy: LineBreakStrategy): TextInputAttribute; 2877 2878 /** 2879 * Define custom keyboard of the text input. 2880 * 2881 * @param { CustomBuilder } value 2882 * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. 2883 * @syscap SystemCapability.ArkUI.ArkUI.Full 2884 * @since 10 2885 */ 2886 /** 2887 * Define custom keyboard of the text input. 2888 * 2889 * @param { CustomBuilder } value 2890 * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. 2891 * @syscap SystemCapability.ArkUI.ArkUI.Full 2892 * @crossplatform 2893 * @atomicservice 2894 * @since 11 2895 */ 2896 2897 /** 2898 * Define custom keyboard of the text input. 2899 * 2900 * <p><strong>NOTE</strong>: 2901 * <br>When a custom keyboard is set, activating the text box opens the specified custom component, 2902 * instead of the system input method. 2903 * <br>The custom keyboard's height can be set through the height attribute of the custom component's root node, 2904 * and its width is fixed at the default value. 2905 * <br>The custom keyboard is presented by overlaying the original screen, 2906 * which is not compressed or lifted if avoid mode is not enabled or avoidance is not needed for the text box. 2907 * <br>The custom keyboard cannot obtain the focus, but it blocks gesture events. 2908 * <br>By default, the custom keyboard is closed when the input component loses the focus. 2909 * <br>You can also use the TextInputController.stopEditing API to close the keyboard. 2910 * <br>When a custom keyboard is set, the text box does not support camera input, even when the device supports. 2911 * <br>When setting a custom keyboard, you can bind the onKeyPrelme event to prevent input from the physical keyboard. 2912 * </p> 2913 * 2914 * @param { CustomBuilder } value - Set up a custom keyboard of TextInput 2915 * @param { KeyboardOptions } [options] - Indicates the custom keyboard options of TextInput 2916 * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. 2917 * @syscap SystemCapability.ArkUI.ArkUI.Full 2918 * @crossplatform 2919 * @atomicservice 2920 * @since arkts {'1.1':'12','1.2':'20'} 2921 * @arkts 1.1&1.2 2922 */ 2923 customKeyboard(value: CustomBuilder, options?: KeyboardOptions): TextInputAttribute; 2924 2925 /** 2926 * Show the counter when the number of characters entered exceeds the threshold through InputCounterOptions. 2927 * 2928 * <p><strong>NOTE</strong>: 2929 * <br>options can be set only when value is set to true, in which case a character counter is displayed below the text box. 2930 * <br>This attribute must be used together with maxLength. 2931 * <br>The character counter is displayed in this format: Number of characters entered/Character limit. 2932 * <br>It is visible when the number of characters entered is greater than the character limit multiplied by the threshold percentage value. 2933 * <br>If options is not set, the text box border and character counter subscript turn red 2934 * when the number of characters entered exceeds the limit. 2935 * <br>If value is set to true and options is set, the text box border and character counter subscript turn red 2936 * and the text box shakes when the number of characters entered reaches the limit, 2937 * provided that the value of thresholdPercentage is valid. 2938 * <br>If highlightBorder is set to false, the text box border does not turn red. 2939 * <br>By default, highlightBorder is set to true. 2940 * <br>The character counter is not displayed for text boxes in inline or password input style. 2941 * </p> 2942 * 2943 * @param { boolean } value - Set showcounter of the text input. 2944 * @param { InputCounterOptions } options - Set the percentage of counter. 2945 * @returns { TextInputAttribute } 2946 * @syscap SystemCapability.ArkUI.ArkUI.Full 2947 * @crossplatform 2948 * @atomicservice 2949 * @since arkts {'1.1':'11','1.2':'20'} 2950 * @arkts 1.1&1.2 2951 */ 2952 showCounter(value: boolean, options?: InputCounterOptions): TextInputAttribute; 2953 2954 /** 2955 * Set the cancel button style 2956 * 2957 * @param { object } value - indicates the style of the cancel button. 2958 * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. 2959 * @syscap SystemCapability.ArkUI.ArkUI.Full 2960 * @crossplatform 2961 * @since 11 2962 */ 2963 /** 2964 * Set the cancel button style 2965 * 2966 * @param { object } value - indicates the style of the cancel button. 2967 * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. 2968 * @syscap SystemCapability.ArkUI.ArkUI.Full 2969 * @crossplatform 2970 * @atomicservice 2971 * @since 12 2972 */ 2973 /** 2974 * Set the cancel button style. 2975 * 2976 * Anonymous Object Rectification. 2977 * 2978 * <p><strong>NOTE</strong>: 2979 * <br>This attribute is not available for the inline input style. 2980 * <br>The default value is 28fp on wearable devices. 2981 * </p> 2982 * 2983 * @param { CancelButtonOptions } options - Indicates the style of the cancel button.Default value is { style: CancelButtonStyle.INPUT }. 2984 * @returns { TextInputAttribute } Returns the instance of the TextInputAttribute. 2985 * @syscap SystemCapability.ArkUI.ArkUI.Full 2986 * @crossplatform 2987 * @atomicservice 2988 * @since 18 2989 */ 2990 cancelButton(options: CancelButtonOptions): TextInputAttribute; 2991 2992 /** 2993 * Set the cancel button style 2994 * 2995 * <p><strong>NOTE</strong>: 2996 * <br>This attribute is not available for the inline input style. 2997 * </p> 2998 * 2999 * @param { CancelButtonSymbolOptions } symbolOptions - indicates the style of the cancel button.Default value is { style: CancelButtonStyle.INPUT }. 3000 * @returns { TextInputAttribute } 3001 * @syscap SystemCapability.ArkUI.ArkUI.Full 3002 * @atomicservice 3003 * @since 18 3004 */ 3005 cancelButton(symbolOptions: CancelButtonSymbolOptions): TextInputAttribute; 3006 3007 /** 3008 * Set the cancel button style 3009 * 3010 * @param { CancelButtonOptions | CancelButtonSymbolOptions } symbolOptions - indicates the style of the cancel button. 3011 * @returns { TextInputAttribute } 3012 * @syscap SystemCapability.ArkUI.ArkUI.Full 3013 * @crossplatform 3014 * @atomicservice 3015 * @since 20 3016 * @arkts 1.2 3017 */ 3018 cancelButton(symbolOptions: CancelButtonOptions | CancelButtonSymbolOptions): TextInputAttribute; 3019 3020 /** 3021 * Sets selection when on focus. 3022 * 3023 * @param { boolean } value - Sets selection or not. 3024 * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. 3025 * @syscap SystemCapability.ArkUI.ArkUI.Full 3026 * @crossplatform 3027 * @since 11 3028 */ 3029 /** 3030 * Sets selection when on focus. 3031 * 3032 * <p><strong>NOTE</strong>: 3033 * <br>This attribute is not available for the inline input style. 3034 * </p> 3035 * 3036 * @param { boolean } value - Sets selection or not.Default value is false. 3037 * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. 3038 * @syscap SystemCapability.ArkUI.ArkUI.Full 3039 * @crossplatform 3040 * @atomicservice 3041 * @since arkts {'1.1':'12','1.2':'20'} 3042 * @arkts 1.1&1.2 3043 */ 3044 selectAll(value: boolean): TextInputAttribute; 3045 3046 /** 3047 * Called when the minimum font size of the font is set. 3048 * 3049 * <p><strong>NOTE</strong>: 3050 * <br>For the string type, numeric string values with optional units, 3051 * for example, "10" or "10fp", are supported. 3052 * <br>For the setting to take effect, this attribute must be used together with maxFontSize 3053 * and maxLines (when the component is in editing state in the inline input style), or layout constraint settings. 3054 * <br>When the adaptive font size is used, the fontSize settings do not take effect. 3055 * </p> 3056 * 3057 * @param { number | string | Resource } value - The unit is fp. 3058 * @returns { TextInputAttribute } 3059 * @syscap SystemCapability.ArkUI.ArkUI.Full 3060 * @crossplatform 3061 * @atomicservice 3062 * @since arkts {'1.1':'12','1.2':'20'} 3063 * @arkts 1.1&1.2 3064 */ 3065 minFontSize(value: number | string | Resource): TextInputAttribute; 3066 3067 /** 3068 * Called when the maximum font size of the font is set. 3069 * 3070 * <p><strong>NOTE</strong>: 3071 * <br>For the string type, numeric string values with optional units, 3072 * for example, "10" or "10fp", are supported. 3073 * <br>For the setting to take effect, this attribute must be used together with minFontSize 3074 * and maxLines (when the component is in editing state in the inline input style), or layout constraint settings. 3075 * <br>When the adaptive font size is used, the fontSize settings do not take effect. 3076 * </p> 3077 * 3078 * @param { number | string | Resource } value - The unit is fp. 3079 * @returns { TextInputAttribute } 3080 * @syscap SystemCapability.ArkUI.ArkUI.Full 3081 * @crossplatform 3082 * @atomicservice 3083 * @since arkts {'1.1':'12','1.2':'20'} 3084 * @arkts 1.1&1.2 3085 */ 3086 maxFontSize(value: number | string | Resource): TextInputAttribute; 3087 3088 /** 3089 * Called when the minimum font scale of the font is set. 3090 * 3091 * @param { Optional<number | Resource> } scale 3092 * @returns { TextInputAttribute } 3093 * @syscap SystemCapability.ArkUI.ArkUI.Full 3094 * @atomicservice 3095 * @since 18 3096 */ 3097 /** 3098 * Called when the minimum font scale of the font is set. 3099 * 3100 * @param { Optional<number | Resource> } scale 3101 * @returns { TextInputAttribute } 3102 * @syscap SystemCapability.ArkUI.ArkUI.Full 3103 * @crossplatform 3104 * @atomicservice 3105 * @since 20 3106 * @arkts 1.1&1.2 3107 */ 3108 minFontScale(scale: Optional<number | Resource>): TextInputAttribute; 3109 3110 /** 3111 * Called when the maximum font scale of the font is set. 3112 * 3113 * @param { Optional<number | Resource> } scale 3114 * @returns { TextInputAttribute } 3115 * @syscap SystemCapability.ArkUI.ArkUI.Full 3116 * @atomicservice 3117 * @since 18 3118 */ 3119 /** 3120 * Called when the maximum font scale of the font is set. 3121 * 3122 * @param { Optional<number | Resource> } scale 3123 * @returns { TextInputAttribute } 3124 * @syscap SystemCapability.ArkUI.ArkUI.Full 3125 * @crossplatform 3126 * @atomicservice 3127 * @since 20 3128 * @arkts 1.1&1.2 3129 */ 3130 maxFontScale(scale: Optional<number | Resource>): TextInputAttribute; 3131 3132 /** 3133 * Called when the height adaptive policy is set. 3134 * 3135 * <p><strong>NOTE</strong>: 3136 * <ul> 3137 * <li>When this attribute is set to TextHeightAdaptivePolicy.MAX_LINES_FIRST, 3138 * the maxLines attribute takes precedence for adjusting the text height. 3139 * <br>If the maxLines setting results in a layout beyond the layout constraints, 3140 * the text will shrink to a font size between minFontSize and maxFontSize to allow for more content to be shown.</li> 3141 * <li>If this attribute is set to TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST, 3142 * the minFontSize attribute takes precedence for adjusting the text height. 3143 * <br>If the text can fit in one line with the minFontSize setting, 3144 * the text will enlarge to the largest possible font size between minFontSize and maxFontSize.</li> 3145 * <li>TextHeightAdaptivePolicy.LAYOUT_CONSTRAINT_FIRST produces the same effect as TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST.</li> 3146 * </ul> 3147 * <br>When the component is in the non-inline input style, the three values of TextHeightAdaptivePolicy have the same effect, 3148 * that is, the text will shrink to a font size between minFontSize and maxFontSize to allow for more content to be shown. 3149 * <br>If the text box is in inline input style, 3150 * the font size in the editing state is different from that in the non-editing state. 3151 * </p> 3152 * 3153 * @param { TextHeightAdaptivePolicy } value - The height adaptive policy.Default value is TextHeightAdaptivePolicy.MAX_LINES_FIRST. 3154 * @returns { TextInputAttribute } 3155 * @syscap SystemCapability.ArkUI.ArkUI.Full 3156 * @crossplatform 3157 * @atomicservice 3158 * @since arkts {'1.1':'12','1.2':'20'} 3159 * @arkts 1.1&1.2 3160 */ 3161 heightAdaptivePolicy(value: TextHeightAdaptivePolicy): TextInputAttribute; 3162 3163 /** 3164 * Sets whether enable auto fill or not. 3165 * 3166 * @param { boolean } value - Indicates the flag whether autofill is enabled. 3167 * @returns { TextInputAttribute } Returns the instance of the TextInputAttribute. 3168 * @syscap SystemCapability.ArkUI.ArkUI.Full 3169 * @since 11 3170 */ 3171 /** 3172 * Sets whether enable auto fill or not. 3173 * 3174 * @param { boolean } value - Indicates the flag whether autofill is enabled.Default value is rue.True: enable, false: disable. 3175 * @returns { TextInputAttribute } Returns the instance of the TextInputAttribute. 3176 * @syscap SystemCapability.ArkUI.ArkUI.Full 3177 * @atomicservice 3178 * @since arkts {'1.1':'12','1.2':'20'} 3179 * @arkts 1.1&1.2 3180 */ 3181 enableAutoFill(value: boolean): TextInputAttribute; 3182 3183 /** 3184 * Called when the text decoration of the text is set. 3185 * 3186 * <p><strong>NOTE</strong>: 3187 * <br>This attribute does not take effect for the password input mode. 3188 * </p> 3189 * 3190 * @param { TextDecorationOptions } value - Default value is { type: TextDecorationType.None, color: Color.Black, style: TextDecorationStyle.SOLID }. 3191 * @returns { TextInputAttribute } 3192 * @syscap SystemCapability.ArkUI.ArkUI.Full 3193 * @crossplatform 3194 * @atomicservice 3195 * @since arkts {'1.1':'12','1.2':'20'} 3196 * @arkts 1.1&1.2 3197 */ 3198 decoration(value: TextDecorationOptions): TextInputAttribute; 3199 3200 /** 3201 * Called when the distance between text fonts is set. 3202 * 3203 * <p><strong>NOTE</strong>: 3204 * <br>If the value specified is a percentage or 0, the default value is used. 3205 * <br>For the string type, numeric string values with optional units, 3206 * for example, "10" or "10fp", are supported. 3207 * <br>If the value specified is a negative value, the text is compressed. 3208 * <br>A negative value too small may result in the text being compressed to 0 3209 * and no content being displayed. 3210 * </p> 3211 * 3212 * @param { number | string | Resource } value - The unit is fp. 3213 * @returns { TextInputAttribute } 3214 * @syscap SystemCapability.ArkUI.ArkUI.Full 3215 * @crossplatform 3216 * @atomicservice 3217 * @since arkts {'1.1':'12','1.2':'20'} 3218 * @arkts 1.1&1.2 3219 */ 3220 letterSpacing(value: number | string | Resource): TextInputAttribute; 3221 3222 /** 3223 * Called when the line height of the font is set. 3224 * 3225 * <p><strong>NOTE</strong>: 3226 * <br>If the value is less than or equal to 0, the line height is not limited and the font size is adaptive. 3227 * <br>If the value is of the number type, the unit fp is used. 3228 * <br>For the string type, numeric string values with optional units, for example, "10" or "10fp", are supported. 3229 * </p> 3230 * 3231 * @param { number | string | Resource } value 3232 * @returns { TextInputAttribute } 3233 * @syscap SystemCapability.ArkUI.ArkUI.Full 3234 * @crossplatform 3235 * @atomicservice 3236 * @since arkts {'1.1':'12','1.2':'20'} 3237 * @arkts 1.1&1.2 3238 */ 3239 lineHeight(value: number | string | Resource): TextInputAttribute; 3240 3241 /** 3242 * Define the password rules of the text input. 3243 * 3244 * @param { string } value - Indicates the password rules. 3245 * @returns { TextInputAttribute } Returns the instance of the TextInputAttribute. 3246 * @syscap SystemCapability.ArkUI.ArkUI.Full 3247 * @since 11 3248 */ 3249 /** 3250 * Define the password rules of the text input. 3251 * 3252 * <p><strong>NOTE</strong>: 3253 * <br>When autofill is used, these rules are transparently transmitted to Password Vault for generating a new password. 3254 * </p> 3255 * 3256 * @param { string } value - Indicates the password rules. 3257 * @returns { TextInputAttribute } Returns the instance of the TextInputAttribute. 3258 * @syscap SystemCapability.ArkUI.ArkUI.Full 3259 * @atomicservice 3260 * @since arkts {'1.1':'12','1.2':'20'} 3261 * @arkts 1.1&1.2 3262 */ 3263 passwordRules(value: string): TextInputAttribute; 3264 3265 /** 3266 * Set font feature. 3267 * 3268 * <p><strong>NOTE</strong>: 3269 * <br>This attribute is not available when type is set to an enum value that indicates the password input mode, 3270 * such as Password, NEW_PASSWORD, or NUMBER_PASSWORD. 3271 * </p> 3272 * 3273 * @param { string } value - The fontFeature. 3274 * normal | <feature-tag-value>, 3275 * where <feature-tag-value> = <string> [ <integer> | on | off ], like: "ss01" 0 3276 * the values of <feature-tag-value> reference to doc of TextInput component 3277 * number of <feature-tag-value> can be single or multiple, and separated by comma ','. 3278 * @returns { TextInputAttribute } 3279 * @syscap SystemCapability.ArkUI.ArkUI.Full 3280 * @crossplatform 3281 * @atomicservice 3282 * @since arkts {'1.1':'12','1.2':'20'} 3283 * @arkts 1.1&1.2 3284 */ 3285 fontFeature(value: string): TextInputAttribute; 3286 3287 /** 3288 * Define the password visible mode of the text input. 3289 * 3290 * <p><strong>NOTE</strong>: 3291 * <br>This API has effect only when the input type is set to Password, NEWPASSWORD, or NUMBERPASSWORD mode. 3292 * <br>It does not work in other modes. 3293 * <br>When in password mode, there may be inconsistency between the backend state of the text box 3294 * and the frontend application's state management variables. 3295 * <br>This can cause issues with the icon at the end of the password text box. 3296 * <br>To avoid such issues, use the onSecurityStateChange callback to sync the states. 3297 * </p> 3298 * 3299 * @param { boolean } visible - Indicates the password visible mode. Default value is false. 3300 * @returns { TextInputAttribute } Returns the instance of the TextInputAttribute. 3301 * @syscap SystemCapability.ArkUI.ArkUI.Full 3302 * @crossplatform 3303 * @atomicservice 3304 * @since arkts {'1.1':'12','1.2':'20'} 3305 * @arkts 1.1&1.2 3306 */ 3307 showPassword(visible: boolean): TextInputAttribute; 3308 3309 /** 3310 * Called when changing the password visible mode of the text input. 3311 * 3312 * @param { Callback<boolean> } callback - callback of the password visible mode change event. 3313 * @returns { TextInputAttribute } Returns the instance of the TextInputAttribute. 3314 * @syscap SystemCapability.ArkUI.ArkUI.Full 3315 * @crossplatform 3316 * @atomicservice 3317 * @since arkts {'1.1':'12','1.2':'20'} 3318 * @arkts 1.1&1.2 3319 */ 3320 onSecurityStateChange(callback: Callback<boolean>): TextInputAttribute; 3321 3322 /** 3323 * Get text value information when about to input. 3324 * 3325 * <p><strong>NOTE</strong>: 3326 * <br>It returns true if the text is inserted; returns false otherwise. 3327 * <br>This callback is not triggered for pre-edit or candidate word operations. 3328 * <br>It is available only for system input methods. 3329 * </p> 3330 * 3331 * @param { Callback<InsertValue, boolean> } callback - The triggered function when text content is about to insert. 3332 * @returns { TextInputAttribute } 3333 * @syscap SystemCapability.ArkUI.ArkUI.Full 3334 * @crossplatform 3335 * @atomicservice 3336 * @since arkts {'1.1':'12','1.2':'20'} 3337 * @arkts 1.1&1.2 3338 */ 3339 onWillInsert(callback: Callback<InsertValue, boolean>): TextInputAttribute; 3340 3341 /** 3342 * Get text value information when completed input. 3343 * 3344 * <p><strong>NOTE</strong>: 3345 * <br>It is available only for system input methods. 3346 * </p> 3347 * 3348 * @param { Callback<InsertValue> } callback - The triggered function when text content has been inserted. 3349 * @returns { TextInputAttribute } 3350 * @syscap SystemCapability.ArkUI.ArkUI.Full 3351 * @crossplatform 3352 * @atomicservice 3353 * @since arkts {'1.1':'12','1.2':'20'} 3354 * @arkts 1.1&1.2 3355 */ 3356 onDidInsert(callback: Callback<InsertValue>): TextInputAttribute; 3357 3358 /** 3359 * Get text value information when about to delete. 3360 * 3361 * <p><strong>NOTE</strong>: 3362 * <br>It returns true if the text is deleted; returns false otherwise. 3363 * <br>This callback is not called for text preview. 3364 * <br>It is available only for system input methods. 3365 * </p> 3366 * 3367 * @param { Callback<DeleteValue, boolean> } callback - The triggered function when text content is about to delete. 3368 * @returns { TextInputAttribute } 3369 * @syscap SystemCapability.ArkUI.ArkUI.Full 3370 * @crossplatform 3371 * @atomicservice 3372 * @since arkts {'1.1':'12','1.2':'20'} 3373 * @arkts 1.1&1.2 3374 */ 3375 onWillDelete(callback: Callback<DeleteValue, boolean>): TextInputAttribute; 3376 3377 /** 3378 * Get text value information when the deletion has been completed 3379 * 3380 * <p><strong>NOTE</strong>: 3381 * <br>It is available only for system input methods. 3382 * </p> 3383 * 3384 * @param { Callback<DeleteValue> } callback - The triggered function when text content has been deleted. 3385 * @returns { TextInputAttribute } 3386 * @syscap SystemCapability.ArkUI.ArkUI.Full 3387 * @crossplatform 3388 * @atomicservice 3389 * @since arkts {'1.1':'12','1.2':'20'} 3390 * @arkts 1.1&1.2 3391 */ 3392 onDidDelete(callback: Callback<DeleteValue>): TextInputAttribute; 3393 3394 /** 3395 * Called before the text input component attach the InputMethod. 3396 * 3397 * @param { Callback<IMEClient> } callback - The triggered function before attach the InputMethod. 3398 * @returns { TextInputAttribute } 3399 * @syscap SystemCapability.ArkUI.ArkUI.Full 3400 * @crossplatform 3401 * @atomicservice 3402 * @since 20 3403 */ 3404 onWillAttachIME(callback: Callback<IMEClient>): TextInputAttribute; 3405 3406 /** 3407 * Set the custom text menu. 3408 * Sets the extended options of the custom context menu on selection, 3409 * including the text content, icon, and callback. 3410 * 3411 * @param { EditMenuOptions } editMenu - Customize text menu options. 3412 * @returns { TextInputAttribute } 3413 * @syscap SystemCapability.ArkUI.ArkUI.Full 3414 * @crossplatform 3415 * @atomicservice 3416 * @since arkts {'1.1':'12','1.2':'20'} 3417 * @arkts 1.1&1.2 3418 */ 3419 editMenuOptions(editMenu: EditMenuOptions): TextInputAttribute; 3420 3421 /** 3422 * Define the preview text mode of the text input. 3423 * 3424 * <p><strong>NOTE</strong>: 3425 * <br>Preview text is in a temporary state and does not support text interception. 3426 * <br>As such, it does not trigger onWillInsert, onDidInsert, onWillDelete, or onDidDelete callbacks. 3427 * </p> 3428 * 3429 * @param { boolean } enable - Indicates the preview text mode.Default value is true. 3430 * @returns { TextInputAttribute } 3431 * @syscap SystemCapability.ArkUI.ArkUI.Full 3432 * @crossplatform 3433 * @atomicservice 3434 * @since arkts {'1.1':'12','1.2':'20'} 3435 * @arkts 1.1&1.2 3436 */ 3437 enablePreviewText(enable: boolean): TextInputAttribute; 3438 3439 /** 3440 * Enable or disable haptic feedback. 3441 * 3442 * @param { boolean } isEnabled - Default value is true, set false to disable haptic feedback. 3443 * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. 3444 * @syscap SystemCapability.ArkUI.ArkUI.Full 3445 * @crossplatform 3446 * @atomicservice 3447 * @since arkts {'1.1':'13','1.2':'20'} 3448 * @arkts 1.1&1.2 3449 */ 3450 enableHapticFeedback(isEnabled: boolean): TextInputAttribute; 3451 3452 /** 3453 * Set text mode of automatic case mode switching. 3454 * 3455 * @param { AutoCapitalizationMode } mode - Automatic case mode switching. 3456 * @returns { TextInputAttribute } 3457 * @syscap SystemCapability.ArkUI.ArkUI.Full 3458 * @crossplatform 3459 * @atomicservice 3460 * @since 20 3461 * @arkts 1.1&1.2 3462 */ 3463 autoCapitalizationMode(mode: AutoCapitalizationMode): TextInputAttribute; 3464 3465 /** 3466 * Set the text with half leading. 3467 * 3468 * @param { Optional<boolean> } halfLeading 3469 * @returns { TextInputAttribute } 3470 * @syscap SystemCapability.ArkUI.ArkUI.Full 3471 * @crossplatform 3472 * @atomicservice 3473 * @since arkts {'1.1':'18','1.2':'20'} 3474 * @arkts 1.1&1.2 3475 */ 3476 halfLeading(halfLeading: Optional<boolean>): TextInputAttribute; 3477 3478 /** 3479 * Set the ellipsis mode. 3480 * 3481 * @param { Optional<EllipsisMode> } mode - The ellipsis mode. 3482 * @returns { TextInputAttribute } The attribute of TextInput. 3483 * @syscap SystemCapability.ArkUI.ArkUI.Full 3484 * @crossplatform 3485 * @atomicservice 3486 * @since arkts {'1.1':'18','1.2':'20'} 3487 * @arkts 1.1&1.2 3488 */ 3489 ellipsisMode(mode: Optional<EllipsisMode>): TextInputAttribute; 3490 3491 /** 3492 * Set whether stop backPressed callback event or not. 3493 * 3494 * @param { Optional<boolean> } isStopped - Default value is true, set false to trigger the latest callback event. 3495 * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. 3496 * @syscap SystemCapability.ArkUI.ArkUI.Full 3497 * @atomicservice 3498 * @since arkts {'1.1':'15','1.2':'20'} 3499 * @arkts 1.1&1.2 3500 */ 3501 stopBackPress(isStopped: Optional<boolean>): TextInputAttribute; 3502 3503 /** 3504 * Get text value information when about to change. 3505 * 3506 * @param { Callback<EditableTextChangeValue, boolean> } callback - The triggered function when text content is about to change. 3507 * @returns { TextInputAttribute } 3508 * @syscap SystemCapability.ArkUI.ArkUI.Full 3509 * @crossplatform 3510 * @atomicservice 3511 * @since arkts {'1.1':'15','1.2':'20'} 3512 * @arkts 1.1&1.2 3513 */ 3514 onWillChange(callback: Callback<EditableTextChangeValue, boolean>): TextInputAttribute; 3515 3516 /** 3517 * Set the keyboard appearance. 3518 * 3519 * @param { Optional<KeyboardAppearance> } appearance - Default value is KeyboardAppearance.NONE_IMMERSIVE 3520 * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. 3521 * @syscap SystemCapability.ArkUI.ArkUI.Full 3522 * @atomicservice 3523 * @since arkts {'1.1':'15','1.2':'20'} 3524 * @arkts 1.1&1.2 3525 3526 */ 3527 keyboardAppearance(appearance: Optional<KeyboardAppearance>): TextInputAttribute; 3528 3529 /** 3530 * Set the stroke width. 3531 * 3532 * @param { Optional<LengthMetrics> } width - indicates the stroke width. 3533 * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. 3534 * @syscap SystemCapability.ArkUI.ArkUI.Full 3535 * @crossplatform 3536 * @atomicservice 3537 * @since 20 3538 */ 3539 strokeWidth(width: Optional<LengthMetrics>): TextInputAttribute; 3540 3541 /** 3542 * Set the stroke color. 3543 * 3544 * @param { Optional<ResourceColor> } color - indicates the stroke color. 3545 * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. 3546 * @syscap SystemCapability.ArkUI.ArkUI.Full 3547 * @crossplatform 3548 * @atomicservice 3549 * @since 20 3550 */ 3551 strokeColor(color: Optional<ResourceColor>): TextInputAttribute; 3552 3553 /** 3554 * Sets whether enable auto fill animation effect or not. 3555 * 3556 * @param { Optional<boolean> } enabled - Indicates the flag whether auto fill animation effect is enabled. 3557 * @returns { TextInputAttribute } Returns the instance of the TextInputAttribute. 3558 * @syscap SystemCapability.ArkUI.ArkUI.Full 3559 * @atomicservice 3560 * @since 20 3561 */ 3562 enableAutoFillAnimation(enabled: Optional<boolean>): TextInputAttribute; 3563 3564 /** 3565 * Whether to enable automatic spacing between Chinese and Latin characters. 3566 * 3567 * @param { Optional<boolean> } enabled - The default value is false, indicates the flag whether to enable automatic spacing. 3568 * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. 3569 * @syscap SystemCapability.ArkUI.ArkUI.Full 3570 * @crossplatform 3571 * @atomicservice 3572 * @since 20 3573 */ 3574 enableAutoSpacing(enabled: Optional<boolean>): TextInputAttribute; 3575} 3576 3577/** 3578 * Defines TextInput Component. 3579 * 3580 * @syscap SystemCapability.ArkUI.ArkUI.Full 3581 * @since 7 3582 */ 3583/** 3584 * Defines TextInput Component. 3585 * 3586 * @syscap SystemCapability.ArkUI.ArkUI.Full 3587 * @crossplatform 3588 * @since 10 3589 */ 3590/** 3591 * Defines TextInput Component. 3592 * 3593 * @syscap SystemCapability.ArkUI.ArkUI.Full 3594 * @crossplatform 3595 * @atomicservice 3596 * @since 11 3597 */ 3598declare const TextInput: TextInputInterface; 3599 3600/** 3601 * Defines TextInput Component instance. 3602 * 3603 * @syscap SystemCapability.ArkUI.ArkUI.Full 3604 * @since 7 3605 */ 3606/** 3607 * Defines TextInput Component instance. 3608 * 3609 * @syscap SystemCapability.ArkUI.ArkUI.Full 3610 * @crossplatform 3611 * @since 10 3612 */ 3613/** 3614 * Defines TextInput Component instance. 3615 * 3616 * @syscap SystemCapability.ArkUI.ArkUI.Full 3617 * @crossplatform 3618 * @atomicservice 3619 * @since 11 3620 */ 3621declare const TextInputInstance: TextInputAttribute; 3622