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/** 22 * Declare the type of input box 23 * 24 * @enum { number } 25 * @syscap SystemCapability.ArkUI.ArkUI.Full 26 * @since 7 27 */ 28/** 29 * Declare the type of input box 30 * 31 * @enum { number } 32 * @syscap SystemCapability.ArkUI.ArkUI.Full 33 * @crossplatform 34 * @since 10 35 */ 36/** 37 * Declare the type of input box 38 * 39 * @enum { number } 40 * @syscap SystemCapability.ArkUI.ArkUI.Full 41 * @crossplatform 42 * @atomicservice 43 * @since 11 44 */ 45declare enum InputType { 46 /** 47 * Basic input mode. 48 * 49 * @syscap SystemCapability.ArkUI.ArkUI.Full 50 * @since 7 51 */ 52 /** 53 * Basic input mode. 54 * 55 * @syscap SystemCapability.ArkUI.ArkUI.Full 56 * @crossplatform 57 * @since 10 58 */ 59 /** 60 * Basic input mode. 61 * 62 * @syscap SystemCapability.ArkUI.ArkUI.Full 63 * @crossplatform 64 * @atomicservice 65 * @since 11 66 */ 67 Normal, 68 69 /** 70 * Pure digital input mode. 71 * 72 * @syscap SystemCapability.ArkUI.ArkUI.Full 73 * @since 7 74 */ 75 /** 76 * Pure digital input mode. 77 * 78 * @syscap SystemCapability.ArkUI.ArkUI.Full 79 * @crossplatform 80 * @since 10 81 */ 82 /** 83 * Pure digital input mode. 84 * 85 * @syscap SystemCapability.ArkUI.ArkUI.Full 86 * @crossplatform 87 * @atomicservice 88 * @since 11 89 */ 90 Number, 91 92 /** 93 * Phone number entry mode. 94 * 95 * @syscap SystemCapability.ArkUI.ArkUI.Full 96 * @since 9 97 */ 98 /** 99 * Phone number entry mode. 100 * 101 * @syscap SystemCapability.ArkUI.ArkUI.Full 102 * @crossplatform 103 * @since 10 104 */ 105 /** 106 * Phone number entry mode. 107 * 108 * @syscap SystemCapability.ArkUI.ArkUI.Full 109 * @crossplatform 110 * @atomicservice 111 * @since 11 112 */ 113 PhoneNumber, 114 115 /** 116 * E-mail address input mode. 117 * 118 * @syscap SystemCapability.ArkUI.ArkUI.Full 119 * @since 7 120 */ 121 /** 122 * E-mail address input mode. 123 * 124 * @syscap SystemCapability.ArkUI.ArkUI.Full 125 * @crossplatform 126 * @since 10 127 */ 128 /** 129 * E-mail address input mode. 130 * 131 * @syscap SystemCapability.ArkUI.ArkUI.Full 132 * @crossplatform 133 * @atomicservice 134 * @since 11 135 */ 136 Email, 137 138 /** 139 * Password entry mode. 140 * 141 * @syscap SystemCapability.ArkUI.ArkUI.Full 142 * @since 7 143 */ 144 /** 145 * Password entry mode. 146 * 147 * @syscap SystemCapability.ArkUI.ArkUI.Full 148 * @crossplatform 149 * @since 10 150 */ 151 /** 152 * Password entry mode. 153 * 154 * @syscap SystemCapability.ArkUI.ArkUI.Full 155 * @crossplatform 156 * @atomicservice 157 * @since 11 158 */ 159 Password, 160 161 /** 162 * Number Password entry mode. 163 * 164 * @syscap SystemCapability.ArkUI.ArkUI.Full 165 * @crossplatform 166 * @since 11 167 */ 168 /** 169 * Number Password entry mode. 170 * 171 * @syscap SystemCapability.ArkUI.ArkUI.Full 172 * @crossplatform 173 * @atomicservice 174 * @since 12 175 */ 176 NUMBER_PASSWORD = 8, 177 178 /** 179 * Screen Lock Password entry mode. 180 * 181 * @syscap SystemCapability.ArkUI.ArkUI.Full 182 * @systemapi 183 * @since 11 184 */ 185 SCREEN_LOCK_PASSWORD = 9, 186 187 /** 188 * UserName entry mode. 189 * 190 * @syscap SystemCapability.ArkUI.ArkUI.Full 191 * @since 11 192 */ 193 /** 194 * UserName entry mode. 195 * 196 * @syscap SystemCapability.ArkUI.ArkUI.Full 197 * @atomicservice 198 * @since 12 199 */ 200 USER_NAME = 10, 201 202 /** 203 * NewPassword entry mode. 204 * 205 * @syscap SystemCapability.ArkUI.ArkUI.Full 206 * @since 11 207 */ 208 /** 209 * NewPassword entry mode. 210 * 211 * @syscap SystemCapability.ArkUI.ArkUI.Full 212 * @atomicservice 213 * @since 12 214 */ 215 NEW_PASSWORD = 11, 216 217 /** 218 * Number decimal entry mode. 219 * 220 * @syscap SystemCapability.ArkUI.ArkUI.Full 221 * @crossplatform 222 * @atomicservice 223 * @since 11 224 */ 225 NUMBER_DECIMAL = 12, 226 227 /** 228 * URL entry mode. 229 * 230 * @syscap SystemCapability.ArkUI.ArkUI.Full 231 * @crossplatform 232 * @atomicservice 233 * @since 12 234 */ 235 URL = 13, 236} 237 238/** 239 * Declare the type of input content 240 * 241 * @enum { number } 242 * @syscap SystemCapability.ArkUI.ArkUI.Full 243 * @atomicservice 244 * @since 12 245 */ 246declare enum ContentType { 247 /** 248 * User name content type. 249 * 250 * @syscap SystemCapability.ArkUI.ArkUI.Full 251 * @atomicservice 252 * @since 12 253 */ 254 USER_NAME = 0, 255 256 /** 257 * Password content type. 258 * 259 * @syscap SystemCapability.ArkUI.ArkUI.Full 260 * @atomicservice 261 * @since 12 262 */ 263 PASSWORD = 1, 264 265 /** 266 * New password content type. 267 * 268 * @syscap SystemCapability.ArkUI.ArkUI.Full 269 * @atomicservice 270 * @since 12 271 */ 272 NEW_PASSWORD = 2, 273 274 /** 275 * Full street address content type. 276 * 277 * @syscap SystemCapability.ArkUI.ArkUI.Full 278 * @atomicservice 279 * @since 12 280 */ 281 FULL_STREET_ADDRESS = 3, 282 283 /** 284 * House number content type. 285 * 286 * @syscap SystemCapability.ArkUI.ArkUI.Full 287 * @atomicservice 288 * @since 12 289 */ 290 HOUSE_NUMBER = 4, 291 292 /** 293 * District address content type. 294 * 295 * @syscap SystemCapability.ArkUI.ArkUI.Full 296 * @atomicservice 297 * @since 12 298 */ 299 DISTRICT_ADDRESS = 5, 300 301 /** 302 * City address content type. 303 * 304 * @syscap SystemCapability.ArkUI.ArkUI.Full 305 * @atomicservice 306 * @since 12 307 */ 308 CITY_ADDRESS = 6, 309 310 /** 311 * Province address content type. 312 * 313 * @syscap SystemCapability.ArkUI.ArkUI.Full 314 * @atomicservice 315 * @since 12 316 */ 317 PROVINCE_ADDRESS = 7, 318 319 /** 320 * Country address content type. 321 * 322 * @syscap SystemCapability.ArkUI.ArkUI.Full 323 * @atomicservice 324 * @since 12 325 */ 326 COUNTRY_ADDRESS = 8, 327 328 /** 329 * Person full name content type. 330 * 331 * @syscap SystemCapability.ArkUI.ArkUI.Full 332 * @atomicservice 333 * @since 12 334 */ 335 PERSON_FULL_NAME = 9, 336 337 /** 338 * Person last name content type. 339 * 340 * @syscap SystemCapability.ArkUI.ArkUI.Full 341 * @atomicservice 342 * @since 12 343 */ 344 PERSON_LAST_NAME = 10, 345 346 /** 347 * Person first name content type. 348 * 349 * @syscap SystemCapability.ArkUI.ArkUI.Full 350 * @atomicservice 351 * @since 12 352 */ 353 PERSON_FIRST_NAME = 11, 354 355 /** 356 * Phone number content type. 357 * 358 * @syscap SystemCapability.ArkUI.ArkUI.Full 359 * @atomicservice 360 * @since 12 361 */ 362 PHONE_NUMBER = 12, 363 364 /** 365 * Phone country code content type. 366 * 367 * @syscap SystemCapability.ArkUI.ArkUI.Full 368 * @atomicservice 369 * @since 12 370 */ 371 PHONE_COUNTRY_CODE = 13, 372 373 /** 374 * Full phone number content type. 375 * 376 * @syscap SystemCapability.ArkUI.ArkUI.Full 377 * @atomicservice 378 * @since 12 379 */ 380 FULL_PHONE_NUMBER = 14, 381 382 /** 383 * Email address content type. 384 * 385 * @syscap SystemCapability.ArkUI.ArkUI.Full 386 * @atomicservice 387 * @since 12 388 */ 389 EMAIL_ADDRESS = 15, 390 391 /** 392 * Bank card number content type. 393 * 394 * @syscap SystemCapability.ArkUI.ArkUI.Full 395 * @atomicservice 396 * @since 12 397 */ 398 BANK_CARD_NUMBER = 16, 399 400 /** 401 * ID card number content type. 402 * 403 * @syscap SystemCapability.ArkUI.ArkUI.Full 404 * @atomicservice 405 * @since 12 406 */ 407 ID_CARD_NUMBER = 17, 408 409 /** 410 * Nickname content type. 411 * 412 * @syscap SystemCapability.ArkUI.ArkUI.Full 413 * @atomicservice 414 * @since 12 415 */ 416 NICKNAME = 23, 417 418 /** 419 * Detail info without street content type. 420 * 421 * @syscap SystemCapability.ArkUI.ArkUI.Full 422 * @atomicservice 423 * @since 12 424 */ 425 DETAIL_INFO_WITHOUT_STREET = 24, 426 427 /** 428 * Format address content type. 429 * 430 * @syscap SystemCapability.ArkUI.ArkUI.Full 431 * @atomicservice 432 * @since 12 433 */ 434 FORMAT_ADDRESS = 25 435} 436 437/** 438 * Declare the type of soft keyboard. 439 * 440 * @enum { number } 441 * @syscap SystemCapability.ArkUI.ArkUI.Full 442 * @since 7 443 */ 444/** 445 * Declare the type of soft keyboard. 446 * 447 * @enum { number } 448 * @syscap SystemCapability.ArkUI.ArkUI.Full 449 * @crossplatform 450 * @since 10 451 */ 452/** 453 * Declare the type of soft keyboard. 454 * 455 * @enum { number } 456 * @syscap SystemCapability.ArkUI.ArkUI.Full 457 * @crossplatform 458 * @atomicservice 459 * @since 11 460 */ 461declare enum EnterKeyType { 462 /** 463 * Go. 464 * 465 * @syscap SystemCapability.ArkUI.ArkUI.Full 466 * @since 7 467 */ 468 /** 469 * Go. 470 * 471 * @syscap SystemCapability.ArkUI.ArkUI.Full 472 * @crossplatform 473 * @since 10 474 */ 475 /** 476 * Go. 477 * 478 * @syscap SystemCapability.ArkUI.ArkUI.Full 479 * @crossplatform 480 * @atomicservice 481 * @since 11 482 */ 483 Go = 2, 484 485 /** 486 * Search. 487 * 488 * @syscap SystemCapability.ArkUI.ArkUI.Full 489 * @since 7 490 */ 491 /** 492 * Search. 493 * 494 * @syscap SystemCapability.ArkUI.ArkUI.Full 495 * @crossplatform 496 * @since 10 497 */ 498 /** 499 * Search. 500 * 501 * @syscap SystemCapability.ArkUI.ArkUI.Full 502 * @crossplatform 503 * @atomicservice 504 * @since 11 505 */ 506 Search = 3, 507 508 /** 509 * Send. 510 * 511 * @syscap SystemCapability.ArkUI.ArkUI.Full 512 * @since 7 513 */ 514 /** 515 * Send. 516 * 517 * @syscap SystemCapability.ArkUI.ArkUI.Full 518 * @crossplatform 519 * @since 10 520 */ 521 /** 522 * Send. 523 * 524 * @syscap SystemCapability.ArkUI.ArkUI.Full 525 * @crossplatform 526 * @atomicservice 527 * @since 11 528 */ 529 Send = 4, 530 531 /** 532 * Next. 533 * 534 * @syscap SystemCapability.ArkUI.ArkUI.Full 535 * @since 7 536 */ 537 /** 538 * Next. 539 * 540 * @syscap SystemCapability.ArkUI.ArkUI.Full 541 * @crossplatform 542 * @since 10 543 */ 544 /** 545 * Next. 546 * 547 * @syscap SystemCapability.ArkUI.ArkUI.Full 548 * @crossplatform 549 * @atomicservice 550 * @since 11 551 */ 552 Next = 5, 553 554 /** 555 * Done. 556 * 557 * @syscap SystemCapability.ArkUI.ArkUI.Full 558 * @since 7 559 */ 560 /** 561 * Done. 562 * 563 * @syscap SystemCapability.ArkUI.ArkUI.Full 564 * @crossplatform 565 * @since 10 566 */ 567 /** 568 * Done. 569 * 570 * @syscap SystemCapability.ArkUI.ArkUI.Full 571 * @crossplatform 572 * @atomicservice 573 * @since 11 574 */ 575 Done = 6, 576 577 /** 578 * Showed as 'previous' pattern. 579 * 580 * @syscap SystemCapability.ArkUI.ArkUI.Full 581 * @crossplatform 582 * @since 11 583 */ 584 /** 585 * Showed as 'previous' pattern. 586 * 587 * @syscap SystemCapability.ArkUI.ArkUI.Full 588 * @crossplatform 589 * @atomicservice 590 * @since 12 591 */ 592 PREVIOUS = 7, 593 594 /** 595 * Showed as 'new line' pattern. 596 * 597 * @syscap SystemCapability.ArkUI.ArkUI.Full 598 * @crossplatform 599 * @since 11 600 */ 601 /** 602 * Showed as 'new line' pattern. 603 * 604 * @syscap SystemCapability.ArkUI.ArkUI.Full 605 * @crossplatform 606 * @atomicservice 607 * @since 12 608 */ 609 NEW_LINE = 8, 610} 611 612/** 613 * Defines the underline color width property. 614 * 615 * @interface UnderlineColor 616 * @syscap SystemCapability.ArkUI.ArkUI.Full 617 * @crossplatform 618 * @atomicservice 619 * @since 12 620 */ 621declare interface UnderlineColor { 622 /** 623 * Typing underline color width property. 624 * 625 * @type { ?(ResourceColor | undefined) } 626 * @syscap SystemCapability.ArkUI.ArkUI.Full 627 * @crossplatform 628 * @atomicservice 629 * @since 12 630 */ 631 typing?: ResourceColor | undefined; 632 /** 633 * Normal underline color width property. 634 * 635 * @type { ?(ResourceColor | undefined) } 636 * @syscap SystemCapability.ArkUI.ArkUI.Full 637 * @crossplatform 638 * @atomicservice 639 * @since 12 640 */ 641 normal?: ResourceColor | undefined; 642 /** 643 * Error underline color width property. 644 * 645 * @type { ?(ResourceColor | undefined) } 646 * @syscap SystemCapability.ArkUI.ArkUI.Full 647 * @crossplatform 648 * @atomicservice 649 * @since 12 650 */ 651 error?: ResourceColor | undefined; 652 /** 653 * Disable underline color width property. 654 * 655 * @type { ?(ResourceColor | undefined) } 656 * @syscap SystemCapability.ArkUI.ArkUI.Full 657 * @crossplatform 658 * @atomicservice 659 * @since 12 660 */ 661 disable?: ResourceColor | undefined; 662} 663 664/** 665 * Provides the method of keeping TextInput editable state when submitted. 666 * 667 * @interface SubmitEvent 668 * @syscap SystemCapability.ArkUI.ArkUI.Full 669 * @crossplatform 670 * @atomicservice 671 * @since 11 672 */ 673declare interface SubmitEvent { 674 /** 675 * Keeps TextInput editable state when submitted 676 * 677 * @syscap SystemCapability.ArkUI.ArkUI.Full 678 * @crossplatform 679 * @atomicservice 680 * @since 11 681 */ 682 keepEditableState(): void; 683 684 /** 685 * Sets the current value of TextInput. 686 * 687 * @type { string } 688 * @syscap SystemCapability.ArkUI.ArkUI.Full 689 * @crossplatform 690 * @atomicservice 691 * @since 11 692 */ 693 text: string; 694} 695 696/** 697 * Provides the method of switching the cursor position. 698 * 699 * @extends TextContentControllerBase 700 * @since 8 701 */ 702/** 703 * Provides the method of switching the cursor position. 704 * 705 * @extends TextContentControllerBase 706 * @syscap SystemCapability.ArkUI.ArkUI.Full 707 * @crossplatform 708 * @since 10 709 */ 710/** 711 * Provides the method of switching the cursor position. 712 * 713 * @extends TextContentControllerBase 714 * @syscap SystemCapability.ArkUI.ArkUI.Full 715 * @crossplatform 716 * @atomicservice 717 * @since 11 718 */ 719declare class TextInputController extends TextContentControllerBase { 720 /** 721 * constructor. 722 * 723 * @syscap SystemCapability.ArkUI.ArkUI.Full 724 * @since 8 725 */ 726 /** 727 * constructor. 728 * 729 * @syscap SystemCapability.ArkUI.ArkUI.Full 730 * @crossplatform 731 * @since 10 732 */ 733 /** 734 * constructor. 735 * 736 * @syscap SystemCapability.ArkUI.ArkUI.Full 737 * @crossplatform 738 * @atomicservice 739 * @since 11 740 */ 741 constructor(); 742 743 /** 744 * Called when the position of the insertion cursor is set. 745 * 746 * @param { number } value 747 * @syscap SystemCapability.ArkUI.ArkUI.Full 748 * @since 8 749 */ 750 /** 751 * Called when the position of the insertion cursor is set. 752 * 753 * @param { number } value 754 * @syscap SystemCapability.ArkUI.ArkUI.Full 755 * @crossplatform 756 * @since 10 757 */ 758 /** 759 * Called when the position of the insertion cursor is set. 760 * 761 * @param { number } value 762 * @syscap SystemCapability.ArkUI.ArkUI.Full 763 * @crossplatform 764 * @atomicservice 765 * @since 11 766 */ 767 caretPosition(value: number): void; 768 769 /** 770 * Text selection is achieved by specifying the start and end positions of the text. 771 * 772 * @param { number } selectionStart - The start position of the selected text. 773 * @param { number } selectionEnd - The end position of the selected text. 774 * @syscap SystemCapability.ArkUI.ArkUI.Full 775 * @crossplatform 776 * @since 10 777 */ 778 /** 779 * Text selection is achieved by specifying the start and end positions of the text. 780 * 781 * @param { number } selectionStart - The start position of the selected text. 782 * @param { number } selectionEnd - The end position of the selected text. 783 * @syscap SystemCapability.ArkUI.ArkUI.Full 784 * @crossplatform 785 * @atomicservice 786 * @since 11 787 */ 788 /** 789 * Text selection is achieved by specifying the start and end positions of the text. 790 * 791 * @param { number } selectionStart - The start position of the selected text. 792 * @param { number } selectionEnd - The end position of the selected text. 793 * @param { SelectionOptions } [options] - Indicates the options of the text selection. 794 * @syscap SystemCapability.ArkUI.ArkUI.Full 795 * @crossplatform 796 * @atomicservice 797 * @since 12 798 */ 799 setTextSelection(selectionStart: number, selectionEnd: number, options?: SelectionOptions): void; 800 801 /** 802 * Exit edit state. 803 * 804 * @syscap SystemCapability.ArkUI.ArkUI.Full 805 * @crossplatform 806 * @since 10 807 */ 808 /** 809 * Exit edit state. 810 * 811 * @syscap SystemCapability.ArkUI.ArkUI.Full 812 * @crossplatform 813 * @atomicservice 814 * @since 11 815 */ 816 stopEditing(): void; 817} 818 819/** 820 * Defines the options of TextInput. 821 * 822 * @interface TextInputOptions 823 * @syscap SystemCapability.ArkUI.ArkUI.Full 824 * @since 7 825 */ 826/** 827 * Defines the options of TextInput. 828 * 829 * @interface TextInputOptions 830 * @syscap SystemCapability.ArkUI.ArkUI.Full 831 * @crossplatform 832 * @since 10 833 */ 834/** 835 * Defines the options of TextInput. 836 * 837 * @interface TextInputOptions 838 * @syscap SystemCapability.ArkUI.ArkUI.Full 839 * @crossplatform 840 * @atomicservice 841 * @since 11 842 */ 843declare interface TextInputOptions { 844 /** 845 * The place holder text string. 846 * 847 * @type { ?ResourceStr } 848 * @syscap SystemCapability.ArkUI.ArkUI.Full 849 * @since 7 850 */ 851 /** 852 * The place holder text string. 853 * 854 * @type { ?ResourceStr } 855 * @syscap SystemCapability.ArkUI.ArkUI.Full 856 * @crossplatform 857 * @since 10 858 */ 859 /** 860 * The place holder text string. 861 * 862 * @type { ?ResourceStr } 863 * @syscap SystemCapability.ArkUI.ArkUI.Full 864 * @crossplatform 865 * @atomicservice 866 * @since 11 867 */ 868 placeholder?: ResourceStr; 869 870 /** 871 * Sets the current value of TextInput. 872 * 873 * @type { ?ResourceStr } 874 * @syscap SystemCapability.ArkUI.ArkUI.Full 875 * @since 7 876 */ 877 /** 878 * Sets the current value of TextInput. 879 * 880 * @type { ?ResourceStr } 881 * @syscap SystemCapability.ArkUI.ArkUI.Full 882 * @crossplatform 883 * @since 10 884 */ 885 /** 886 * Sets the current value of TextInput. 887 * 888 * @type { ?ResourceStr } 889 * @syscap SystemCapability.ArkUI.ArkUI.Full 890 * @crossplatform 891 * @atomicservice 892 * @since 11 893 */ 894 text?: ResourceStr; 895 896 /** 897 * Called when the position of the insertion cursor is set. 898 * 899 * @type { ?TextInputController } 900 * @syscap SystemCapability.ArkUI.ArkUI.Full 901 * @since 8 902 */ 903 /** 904 * Called when the position of the insertion cursor is set. 905 * 906 * @type { ?TextInputController } 907 * @syscap SystemCapability.ArkUI.ArkUI.Full 908 * @crossplatform 909 * @since 10 910 */ 911 /** 912 * Called when the position of the insertion cursor is set. 913 * 914 * @type { ?TextInputController } 915 * @syscap SystemCapability.ArkUI.ArkUI.Full 916 * @crossplatform 917 * @atomicservice 918 * @since 11 919 */ 920 controller?: TextInputController; 921} 922 923/** 924 * Text input style. 925 * 926 * @enum { number } 927 * @syscap SystemCapability.ArkUI.ArkUI.Full 928 * @since 9 929 */ 930/** 931 * Text input style. 932 * 933 * @enum { number } 934 * @syscap SystemCapability.ArkUI.ArkUI.Full 935 * @crossplatform 936 * @since 10 937 */ 938/** 939 * Text input style. 940 * 941 * @enum { number } 942 * @syscap SystemCapability.ArkUI.ArkUI.Full 943 * @crossplatform 944 * @atomicservice 945 * @since 11 946 */ 947declare enum TextInputStyle { 948 /** 949 * Text input default style. 950 * 951 * @syscap SystemCapability.ArkUI.ArkUI.Full 952 * @since 9 953 */ 954 /** 955 * Text input default style. 956 * 957 * @syscap SystemCapability.ArkUI.ArkUI.Full 958 * @crossplatform 959 * @since 10 960 */ 961 /** 962 * Text input default style. 963 * 964 * @syscap SystemCapability.ArkUI.ArkUI.Full 965 * @crossplatform 966 * @atomicservice 967 * @since 11 968 */ 969 Default, 970 971 /** 972 * Text input inline style. 973 * 974 * @syscap SystemCapability.ArkUI.ArkUI.Full 975 * @since 9 976 */ 977 /** 978 * Text input inline style. 979 * 980 * @syscap SystemCapability.ArkUI.ArkUI.Full 981 * @crossplatform 982 * @since 10 983 */ 984 /** 985 * Text input inline style. 986 * 987 * @syscap SystemCapability.ArkUI.ArkUI.Full 988 * @crossplatform 989 * @atomicservice 990 * @since 11 991 */ 992 Inline 993} 994 995/** 996 * Provides a single-line text input component interface. 997 * 998 * @interface TextInputInterface 999 * @syscap SystemCapability.ArkUI.ArkUI.Full 1000 * @since 7 1001 */ 1002/** 1003 * Provides a single-line text input component interface. 1004 * 1005 * @interface TextInputInterface 1006 * @syscap SystemCapability.ArkUI.ArkUI.Full 1007 * @crossplatform 1008 * @since 10 1009 */ 1010/** 1011 * Provides a single-line text input component interface. 1012 * 1013 * @interface TextInputInterface 1014 * @syscap SystemCapability.ArkUI.ArkUI.Full 1015 * @crossplatform 1016 * @atomicservice 1017 * @since 11 1018 */ 1019interface TextInputInterface { 1020 /** 1021 * Called when writing a single line of text. 1022 * 1023 * @param { TextInputOptions } value 1024 * @returns { TextInputAttribute } 1025 * @syscap SystemCapability.ArkUI.ArkUI.Full 1026 * @since 7 1027 */ 1028 /** 1029 * Called when writing a single line of text. 1030 * 1031 * @param { TextInputOptions } value 1032 * @returns { TextInputAttribute } 1033 * @syscap SystemCapability.ArkUI.ArkUI.Full 1034 * @crossplatform 1035 * @since 10 1036 */ 1037 /** 1038 * Called when writing a single line of text. 1039 * 1040 * @param { TextInputOptions } value 1041 * @returns { TextInputAttribute } 1042 * @syscap SystemCapability.ArkUI.ArkUI.Full 1043 * @crossplatform 1044 * @atomicservice 1045 * @since 11 1046 */ 1047 (value?: TextInputOptions): TextInputAttribute; 1048} 1049 1050/** 1051 * PasswordIcon object. 1052 * 1053 * @interface PasswordIcon 1054 * @syscap SystemCapability.ArkUI.ArkUI.Full 1055 * @since 10 1056 */ 1057/** 1058 * PasswordIcon object. 1059 * 1060 * @interface PasswordIcon 1061 * @syscap SystemCapability.ArkUI.ArkUI.Full 1062 * @crossplatform 1063 * @atomicservice 1064 * @since 11 1065 */ 1066interface PasswordIcon { 1067 /** 1068 * Define the on icon source of PasswordIcon. 1069 * 1070 * @type { ?(string | Resource) } 1071 * @syscap SystemCapability.ArkUI.ArkUI.Full 1072 * @since 10 1073 */ 1074 /** 1075 * Define the on icon source of PasswordIcon. 1076 * 1077 * @type { ?(string | Resource) } 1078 * @syscap SystemCapability.ArkUI.ArkUI.Full 1079 * @crossplatform 1080 * @atomicservice 1081 * @since 11 1082 */ 1083 onIconSrc?: string | Resource; 1084 1085 /** 1086 * Define the off icon source of PasswordIcon. 1087 * 1088 * @type { ?(string | Resource) } 1089 * @syscap SystemCapability.ArkUI.ArkUI.Full 1090 * @since 10 1091 */ 1092 /** 1093 * Define the off icon source of PasswordIcon. 1094 * 1095 * @type { ?(string | Resource) } 1096 * @syscap SystemCapability.ArkUI.ArkUI.Full 1097 * @crossplatform 1098 * @atomicservice 1099 * @since 11 1100 */ 1101 offIconSrc?: string | Resource; 1102} 1103 1104/** 1105 * Defines a TextInput callback when onSubmit. 1106 * 1107 * @typedef { function } OnSubmitCallback 1108 * @param { EnterKeyType } enterKey - Input method Enter key type. 1109 * @param { SubmitEvent } event - The event submitted. 1110 * @syscap SystemCapability.ArkUI.ArkUI.Full 1111 * @crossplatform 1112 * @atomicservice 1113 * @since 14 1114 */ 1115declare type OnSubmitCallback = (enterKey: EnterKeyType, event: SubmitEvent) => void; 1116 1117/** 1118 * Defines a TextInput callback when onTextSelectionChange. 1119 * 1120 * @typedef { function } OnTextSelectionChangeCallback 1121 * @param { number } selectionStart - The starting position of the selected text, the starting position of the text is 0. 1122 * @param { number } selectionEnd - The end location of the selected text. 1123 * @syscap SystemCapability.ArkUI.ArkUI.Full 1124 * @crossplatform 1125 * @atomicservice 1126 * @since 14 1127 */ 1128declare type OnTextSelectionChangeCallback = (selectionStart: number, selectionEnd: number) => void; 1129 1130/** 1131 * Defines a TextInput callback when onContentScroll. 1132 * 1133 * @typedef { function } OnContentScrollCallback 1134 * @param { number } totalOffsetX - The text is offset in px on the horizontal axis of the content area. 1135 * @param { number } totalOffsetY - The text is offset in px on the vertical axis of the content area. 1136 * @syscap SystemCapability.ArkUI.ArkUI.Full 1137 * @crossplatform 1138 * @atomicservice 1139 * @since 14 1140 */ 1141declare type OnContentScrollCallback = (totalOffsetX: number, totalOffsetY: number) => void; 1142 1143 1144/** 1145 * Defines a TextInput callback when onPaste. 1146 * 1147 * @typedef { function } OnPasteCallback 1148 * @param { string } content - The text content of the paste. 1149 * @param { PasteEvent } event - User-defined paste event. 1150 * @syscap SystemCapability.ArkUI.ArkUI.Full 1151 * @crossplatform 1152 * @atomicservice 1153 * @since 14 1154 */ 1155declare type OnPasteCallback = (content: string, event: PasteEvent) => void; 1156 1157/** 1158 * Defines the TextInput attribute functions. 1159 * 1160 * @extends CommonMethod<TextInputAttribute> 1161 * @syscap SystemCapability.ArkUI.ArkUI.Full 1162 * @since 7 1163 */ 1164/** 1165 * Defines the TextInput attribute functions. 1166 * 1167 * @extends CommonMethod<TextInputAttribute> 1168 * @syscap SystemCapability.ArkUI.ArkUI.Full 1169 * @crossplatform 1170 * @since 10 1171 */ 1172/** 1173 * Defines the TextInput attribute functions. 1174 * 1175 * @extends CommonMethod<TextInputAttribute> 1176 * @syscap SystemCapability.ArkUI.ArkUI.Full 1177 * @crossplatform 1178 * @atomicservice 1179 * @since 11 1180 */ 1181declare class TextInputAttribute extends CommonMethod<TextInputAttribute> { 1182 /** 1183 * Called when the input type is set. 1184 * 1185 * @param { InputType } value 1186 * @returns { TextInputAttribute } 1187 * @syscap SystemCapability.ArkUI.ArkUI.Full 1188 * @since 7 1189 */ 1190 /** 1191 * Called when the input type is set. 1192 * 1193 * @param { InputType } value 1194 * @returns { TextInputAttribute } 1195 * @syscap SystemCapability.ArkUI.ArkUI.Full 1196 * @crossplatform 1197 * @since 10 1198 */ 1199 /** 1200 * Called when the input type is set. 1201 * 1202 * @param { InputType } value 1203 * @returns { TextInputAttribute } 1204 * @syscap SystemCapability.ArkUI.ArkUI.Full 1205 * @crossplatform 1206 * @atomicservice 1207 * @since 11 1208 */ 1209 type(value: InputType): TextInputAttribute; 1210 1211 /** 1212 * Called when the content type is set. 1213 * 1214 * @param { ContentType } value 1215 * @returns { TextInputAttribute } 1216 * @syscap SystemCapability.ArkUI.ArkUI.Full 1217 * @atomicservice 1218 * @since 12 1219 */ 1220 contentType(value: ContentType): TextInputAttribute; 1221 1222 /** 1223 * Called when the color of the placeholder is set. 1224 * 1225 * @param { ResourceColor } value 1226 * @returns { TextInputAttribute } 1227 * @syscap SystemCapability.ArkUI.ArkUI.Full 1228 * @since 7 1229 */ 1230 /** 1231 * Called when the color of the placeholder is set. 1232 * 1233 * @param { ResourceColor } value 1234 * @returns { TextInputAttribute } 1235 * @syscap SystemCapability.ArkUI.ArkUI.Full 1236 * @crossplatform 1237 * @since 10 1238 */ 1239 /** 1240 * Called when the color of the placeholder is set. 1241 * 1242 * @param { ResourceColor } value 1243 * @returns { TextInputAttribute } 1244 * @syscap SystemCapability.ArkUI.ArkUI.Full 1245 * @crossplatform 1246 * @atomicservice 1247 * @since 11 1248 */ 1249 placeholderColor(value: ResourceColor): TextInputAttribute; 1250 1251 /** 1252 * Called when the overflow mode of the font is set. 1253 * 1254 * @param { TextOverflow } value 1255 * @returns { TextInputAttribute } 1256 * @syscap SystemCapability.ArkUI.ArkUI.Full 1257 * @crossplatform 1258 * @atomicservice 1259 * @since 12 1260 */ 1261 textOverflow(value: TextOverflow): TextInputAttribute; 1262 1263 /** 1264 * Specify the indentation of the first line in a text-block. 1265 * 1266 * @param { Dimension } value - The length of text indent. 1267 * @returns { TextInputAttribute } The attribute of the text. 1268 * @syscap SystemCapability.ArkUI.ArkUI.Full 1269 * @crossplatform 1270 * @atomicservice 1271 * @since 12 1272 */ 1273 textIndent(value: Dimension): TextInputAttribute; 1274 1275 /** 1276 * Called when the font property of the placeholder is set. 1277 * 1278 * @param { Font } value 1279 * @returns { TextInputAttribute } 1280 * @syscap SystemCapability.ArkUI.ArkUI.Full 1281 * @since 7 1282 */ 1283 /** 1284 * Called when the font property of the placeholder is set. 1285 * 1286 * @param { Font } value 1287 * @returns { TextInputAttribute } 1288 * @syscap SystemCapability.ArkUI.ArkUI.Full 1289 * @crossplatform 1290 * @since 10 1291 */ 1292 /** 1293 * Called when the font property of the placeholder is set. 1294 * 1295 * @param { Font } value 1296 * @returns { TextInputAttribute } 1297 * @syscap SystemCapability.ArkUI.ArkUI.Full 1298 * @crossplatform 1299 * @atomicservice 1300 * @since 11 1301 */ 1302 placeholderFont(value?: Font): TextInputAttribute; 1303 1304 /** 1305 * Called when the type of soft keyboard input button is set. 1306 * 1307 * @param { EnterKeyType } value 1308 * @returns { TextInputAttribute } 1309 * @syscap SystemCapability.ArkUI.ArkUI.Full 1310 * @since 7 1311 */ 1312 /** 1313 * Called when the type of soft keyboard input button is set. 1314 * 1315 * @param { EnterKeyType } value 1316 * @returns { TextInputAttribute } 1317 * @syscap SystemCapability.ArkUI.ArkUI.Full 1318 * @crossplatform 1319 * @since 10 1320 */ 1321 /** 1322 * Called when the type of soft keyboard input button is set. 1323 * 1324 * @param { EnterKeyType } value 1325 * @returns { TextInputAttribute } 1326 * @syscap SystemCapability.ArkUI.ArkUI.Full 1327 * @crossplatform 1328 * @atomicservice 1329 * @since 11 1330 */ 1331 enterKeyType(value: EnterKeyType): TextInputAttribute; 1332 1333 /** 1334 * Called when the color of the insertion cursor is set. 1335 * 1336 * @param { ResourceColor } value 1337 * @returns { TextInputAttribute } 1338 * @syscap SystemCapability.ArkUI.ArkUI.Full 1339 * @since 7 1340 */ 1341 /** 1342 * Called when the color of the insertion cursor is set. 1343 * 1344 * @param { ResourceColor } value 1345 * @returns { TextInputAttribute } 1346 * @syscap SystemCapability.ArkUI.ArkUI.Full 1347 * @crossplatform 1348 * @since 10 1349 */ 1350 /** 1351 * Called when the color of the insertion cursor is set. 1352 * 1353 * @param { ResourceColor } value 1354 * @returns { TextInputAttribute } 1355 * @syscap SystemCapability.ArkUI.ArkUI.Full 1356 * @crossplatform 1357 * @atomicservice 1358 * @since 11 1359 */ 1360 caretColor(value: ResourceColor): TextInputAttribute; 1361 1362 /** 1363 * Called when judging whether the text editing change finished. 1364 * 1365 * @param { function } callback 1366 * @returns { TextInputAttribute } 1367 * @syscap SystemCapability.ArkUI.ArkUI.Full 1368 * @since 7 1369 * @deprecated since 8 1370 * @useinstead onEditChange 1371 */ 1372 onEditChanged(callback: (isEditing: boolean) => void): TextInputAttribute; 1373 1374 /** 1375 * Called when judging whether the text editing change finished. 1376 * 1377 * @param { function } callback 1378 * @returns { TextInputAttribute } 1379 * @syscap SystemCapability.ArkUI.ArkUI.Full 1380 * @since 8 1381 */ 1382 /** 1383 * Called when judging whether the text editing change finished. 1384 * 1385 * @param { function } callback 1386 * @returns { TextInputAttribute } 1387 * @syscap SystemCapability.ArkUI.ArkUI.Full 1388 * @crossplatform 1389 * @since 10 1390 */ 1391 /** 1392 * Called when judging whether the text editing change finished. 1393 * 1394 * @param { function } callback 1395 * @returns { TextInputAttribute } 1396 * @syscap SystemCapability.ArkUI.ArkUI.Full 1397 * @crossplatform 1398 * @atomicservice 1399 * @since 11 1400 */ 1401 /** 1402 * Called when judging whether the text editing change finished. 1403 * 1404 * @param { Callback<boolean> } callback 1405 * @returns { TextInputAttribute } 1406 * @syscap SystemCapability.ArkUI.ArkUI.Full 1407 * @crossplatform 1408 * @atomicservice 1409 * @since 14 1410 */ 1411 onEditChange(callback: Callback<boolean>): TextInputAttribute; 1412 1413 /** 1414 * Called when submitted. 1415 * 1416 * @param { function } callback 1417 * @returns { TextInputAttribute } 1418 * @syscap SystemCapability.ArkUI.ArkUI.Full 1419 * @since 7 1420 */ 1421 /** 1422 * Called when submitted. 1423 * 1424 * @param { function } callback 1425 * @returns { TextInputAttribute } 1426 * @syscap SystemCapability.ArkUI.ArkUI.Full 1427 * @crossplatform 1428 * @since 10 1429 */ 1430 /** 1431 * Called when submitted. 1432 * 1433 * @param { function } callback - callback of the listened event. 1434 * @returns { TextInputAttribute } 1435 * @syscap SystemCapability.ArkUI.ArkUI.Full 1436 * @crossplatform 1437 * @atomicservice 1438 * @since 11 1439 */ 1440 /** 1441 * Called when submitted. 1442 * 1443 * @param { OnSubmitCallback } callback - Callback of the listened event. 1444 * @returns { TextInputAttribute } 1445 * @syscap SystemCapability.ArkUI.ArkUI.Full 1446 * @crossplatform 1447 * @atomicservice 1448 * @since 14 1449 */ 1450 onSubmit(callback: OnSubmitCallback): TextInputAttribute; 1451 1452 /** 1453 * Called when the input of the input box changes. 1454 * 1455 * @param { function } callback 1456 * @returns { TextInputAttribute } 1457 * @syscap SystemCapability.ArkUI.ArkUI.Full 1458 * @since 7 1459 */ 1460 /** 1461 * Called when the input of the input box changes. 1462 * 1463 * @param { function } callback 1464 * @returns { TextInputAttribute } 1465 * @syscap SystemCapability.ArkUI.ArkUI.Full 1466 * @crossplatform 1467 * @since 10 1468 */ 1469 /** 1470 * Called when the input of the input box changes. 1471 * 1472 * @param { function } callback 1473 * @returns { TextInputAttribute } 1474 * @syscap SystemCapability.ArkUI.ArkUI.Full 1475 * @crossplatform 1476 * @atomicservice 1477 * @since 11 1478 */ 1479 /** 1480 * Called when the input of the input box changes. 1481 * 1482 * @param { EditableTextOnChangeCallback } callback 1483 * @returns { TextInputAttribute } 1484 * @syscap SystemCapability.ArkUI.ArkUI.Full 1485 * @crossplatform 1486 * @atomicservice 1487 * @since 12 1488 */ 1489 onChange(callback: EditableTextOnChangeCallback): TextInputAttribute; 1490 1491 /** 1492 * Called when the text selection changes. 1493 * 1494 * @param { function } callback - callback of the listened event. 1495 * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. 1496 * @syscap SystemCapability.ArkUI.ArkUI.Full 1497 * @crossplatform 1498 * @since 10 1499 */ 1500 /** 1501 * Called when the text selection changes. 1502 * 1503 * @param { function } callback - callback of the listened event. 1504 * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. 1505 * @syscap SystemCapability.ArkUI.ArkUI.Full 1506 * @crossplatform 1507 * @atomicservice 1508 * @since 11 1509 */ 1510 /** 1511 * Called when the text selection changes. 1512 * 1513 * @param { OnTextSelectionChangeCallback } callback - Callback of the listened event. 1514 * @returns { TextInputAttribute } Returns the instance of the TextInputAttribute. 1515 * @syscap SystemCapability.ArkUI.ArkUI.Full 1516 * @crossplatform 1517 * @atomicservice 1518 * @since 14 1519 */ 1520 onTextSelectionChange(callback: OnTextSelectionChangeCallback): TextInputAttribute; 1521 1522 /** 1523 * Called when the content scrolls. 1524 * 1525 * @param { function } callback - callback of the listened event. 1526 * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. 1527 * @syscap SystemCapability.ArkUI.ArkUI.Full 1528 * @crossplatform 1529 * @since 10 1530 */ 1531 /** 1532 * Called when the content scrolls. 1533 * 1534 * @param { function } callback - callback of the listened event. 1535 * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. 1536 * @syscap SystemCapability.ArkUI.ArkUI.Full 1537 * @crossplatform 1538 * @atomicservice 1539 * @since 11 1540 */ 1541 /** 1542 * Called when the content scrolls. 1543 * 1544 * @param { OnContentScrollCallback } callback - Callback of the listened event. 1545 * @returns { TextInputAttribute } Returns the instance of the TextInputAttribute. 1546 * @syscap SystemCapability.ArkUI.ArkUI.Full 1547 * @crossplatform 1548 * @atomicservice 1549 * @since 14 1550 */ 1551 onContentScroll(callback: OnContentScrollCallback): TextInputAttribute; 1552 1553 /** 1554 * Called when the input of maximum text length is set. 1555 * 1556 * @param { number } value 1557 * @returns { TextInputAttribute } 1558 * @syscap SystemCapability.ArkUI.ArkUI.Full 1559 * @since 7 1560 */ 1561 /** 1562 * Called when the input of maximum text length is set. 1563 * 1564 * @param { number } value 1565 * @returns { TextInputAttribute } 1566 * @syscap SystemCapability.ArkUI.ArkUI.Full 1567 * @crossplatform 1568 * @since 10 1569 */ 1570 /** 1571 * Called when the input of maximum text length is set. 1572 * 1573 * @param { number } value 1574 * @returns { TextInputAttribute } 1575 * @syscap SystemCapability.ArkUI.ArkUI.Full 1576 * @crossplatform 1577 * @atomicservice 1578 * @since 11 1579 */ 1580 maxLength(value: number): TextInputAttribute; 1581 1582 /** 1583 * Called when the font color is set. 1584 * 1585 * @param { ResourceColor } value 1586 * @returns { TextInputAttribute } 1587 * @syscap SystemCapability.ArkUI.ArkUI.Full 1588 * @since 7 1589 */ 1590 /** 1591 * Called when the font color is set. 1592 * 1593 * @param { ResourceColor } value 1594 * @returns { TextInputAttribute } 1595 * @syscap SystemCapability.ArkUI.ArkUI.Full 1596 * @crossplatform 1597 * @since 10 1598 */ 1599 /** 1600 * Called when the font color is set. 1601 * 1602 * @param { ResourceColor } value 1603 * @returns { TextInputAttribute } 1604 * @syscap SystemCapability.ArkUI.ArkUI.Full 1605 * @crossplatform 1606 * @atomicservice 1607 * @since 11 1608 */ 1609 fontColor(value: ResourceColor): TextInputAttribute; 1610 1611 /** 1612 * Called when the font size is set. 1613 * 1614 * @param { Length } value 1615 * @returns { TextInputAttribute } 1616 * @syscap SystemCapability.ArkUI.ArkUI.Full 1617 * @since 7 1618 */ 1619 /** 1620 * Called when the font size is set. 1621 * 1622 * @param { Length } value 1623 * @returns { TextInputAttribute } 1624 * @syscap SystemCapability.ArkUI.ArkUI.Full 1625 * @crossplatform 1626 * @since 10 1627 */ 1628 /** 1629 * Called when the font size is set. 1630 * 1631 * @param { Length } value 1632 * @returns { TextInputAttribute } 1633 * @syscap SystemCapability.ArkUI.ArkUI.Full 1634 * @crossplatform 1635 * @atomicservice 1636 * @since 11 1637 */ 1638 fontSize(value: Length): TextInputAttribute; 1639 1640 /** 1641 * Called when the font style of a font is set. 1642 * 1643 * @param { FontStyle } value 1644 * @returns { TextInputAttribute } 1645 * @syscap SystemCapability.ArkUI.ArkUI.Full 1646 * @since 7 1647 */ 1648 /** 1649 * Called when the font style of a font is set. 1650 * 1651 * @param { FontStyle } value 1652 * @returns { TextInputAttribute } 1653 * @syscap SystemCapability.ArkUI.ArkUI.Full 1654 * @crossplatform 1655 * @since 10 1656 */ 1657 /** 1658 * Called when the font style of a font is set. 1659 * 1660 * @param { FontStyle } value 1661 * @returns { TextInputAttribute } 1662 * @syscap SystemCapability.ArkUI.ArkUI.Full 1663 * @crossplatform 1664 * @atomicservice 1665 * @since 11 1666 */ 1667 fontStyle(value: FontStyle): TextInputAttribute; 1668 1669 /** 1670 * Called when the font weight is set. 1671 * 1672 * @param { number | FontWeight | string } value 1673 * @returns { TextInputAttribute } 1674 * @syscap SystemCapability.ArkUI.ArkUI.Full 1675 * @since 7 1676 */ 1677 /** 1678 * Called when the font weight is set. 1679 * 1680 * @param { number | FontWeight | string } value 1681 * @returns { TextInputAttribute } 1682 * @syscap SystemCapability.ArkUI.ArkUI.Full 1683 * @crossplatform 1684 * @since 10 1685 */ 1686 /** 1687 * Called when the font weight is set. 1688 * 1689 * @param { number | FontWeight | string } value 1690 * @returns { TextInputAttribute } 1691 * @syscap SystemCapability.ArkUI.ArkUI.Full 1692 * @crossplatform 1693 * @atomicservice 1694 * @since 11 1695 */ 1696 fontWeight(value: number | FontWeight | string): TextInputAttribute; 1697 1698 /** 1699 * Called when the font list of text is set. 1700 * 1701 * @param { ResourceStr } value 1702 * @returns { TextInputAttribute } 1703 * @syscap SystemCapability.ArkUI.ArkUI.Full 1704 * @since 7 1705 */ 1706 /** 1707 * Called when the font list of text is set. 1708 * 1709 * @param { ResourceStr } value 1710 * @returns { TextInputAttribute } 1711 * @syscap SystemCapability.ArkUI.ArkUI.Full 1712 * @crossplatform 1713 * @since 10 1714 */ 1715 /** 1716 * Called when the font list of text is set. 1717 * 1718 * @param { ResourceStr } value 1719 * @returns { TextInputAttribute } 1720 * @syscap SystemCapability.ArkUI.ArkUI.Full 1721 * @crossplatform 1722 * @atomicservice 1723 * @since 11 1724 */ 1725 fontFamily(value: ResourceStr): TextInputAttribute; 1726 1727 /** 1728 * Called when the inputFilter of text is set. 1729 * 1730 * @param { ResourceStr } value 1731 * @param { function } error 1732 * @returns { TextInputAttribute } 1733 * @syscap SystemCapability.ArkUI.ArkUI.Full 1734 * @since 8 1735 */ 1736 /** 1737 * Called when the inputFilter of text is set. 1738 * 1739 * @param { ResourceStr } value 1740 * @param { function } error 1741 * @returns { TextInputAttribute } 1742 * @syscap SystemCapability.ArkUI.ArkUI.Full 1743 * @crossplatform 1744 * @since 10 1745 */ 1746 /** 1747 * Called when the inputFilter of text is set. 1748 * 1749 * @param { ResourceStr } value 1750 * @param { function } error 1751 * @returns { TextInputAttribute } 1752 * @syscap SystemCapability.ArkUI.ArkUI.Full 1753 * @crossplatform 1754 * @atomicservice 1755 * @since 11 1756 */ 1757 /** 1758 * Called when the inputFilter of text is set. 1759 * 1760 * @param { ResourceStr } value 1761 * @param { Callback<string> } [error] 1762 * @returns { TextInputAttribute } 1763 * @syscap SystemCapability.ArkUI.ArkUI.Full 1764 * @crossplatform 1765 * @atomicservice 1766 * @since 14 1767 */ 1768 inputFilter(value: ResourceStr, error?: Callback<string>): TextInputAttribute; 1769 1770 /** 1771 * Called when using the Clipboard menu 1772 * 1773 * @param { function } callback 1774 * @returns { TextInputAttribute } 1775 * @syscap SystemCapability.ArkUI.ArkUI.Full 1776 * @since 8 1777 */ 1778 /** 1779 * Called when using the Clipboard menu 1780 * 1781 * @param { function } callback 1782 * @returns { TextInputAttribute } 1783 * @syscap SystemCapability.ArkUI.ArkUI.Full 1784 * @crossplatform 1785 * @since 10 1786 */ 1787 /** 1788 * Called when using the Clipboard menu 1789 * 1790 * @param { function } callback 1791 * @returns { TextInputAttribute } 1792 * @syscap SystemCapability.ArkUI.ArkUI.Full 1793 * @crossplatform 1794 * @atomicservice 1795 * @since 11 1796 */ 1797 /** 1798 * Called when using the Clipboard menu. 1799 * 1800 * @param { Callback<string> } callback 1801 * @returns { TextInputAttribute } 1802 * @syscap SystemCapability.ArkUI.ArkUI.Full 1803 * @crossplatform 1804 * @atomicservice 1805 * @since 14 1806 */ 1807 onCopy(callback: Callback<string>): TextInputAttribute; 1808 1809 /** 1810 * Called when using the Clipboard menu 1811 * 1812 * @param { function } callback 1813 * @returns { TextInputAttribute } 1814 * @syscap SystemCapability.ArkUI.ArkUI.Full 1815 * @since 8 1816 */ 1817 /** 1818 * Called when using the Clipboard menu 1819 * 1820 * @param { function } callback 1821 * @returns { TextInputAttribute } 1822 * @syscap SystemCapability.ArkUI.ArkUI.Full 1823 * @crossplatform 1824 * @since 10 1825 */ 1826 /** 1827 * Called when using the Clipboard menu 1828 * 1829 * @param { function } callback 1830 * @returns { TextInputAttribute } 1831 * @syscap SystemCapability.ArkUI.ArkUI.Full 1832 * @crossplatform 1833 * @atomicservice 1834 * @since 11 1835 */ 1836 /** 1837 * Called when using the Clipboard menu. 1838 * 1839 * @param { Callback<string> } callback 1840 * @returns { TextInputAttribute } 1841 * @syscap SystemCapability.ArkUI.ArkUI.Full 1842 * @crossplatform 1843 * @atomicservice 1844 * @since 14 1845 */ 1846 onCut(callback: Callback<string>): TextInputAttribute; 1847 1848 /** 1849 * Called when using the Clipboard menu 1850 * 1851 * @param { function } callback 1852 * @returns { TextInputAttribute } 1853 * @syscap SystemCapability.ArkUI.ArkUI.Full 1854 * @since 8 1855 */ 1856 /** 1857 * Called when using the Clipboard menu 1858 * 1859 * @param { function } callback 1860 * @returns { TextInputAttribute } 1861 * @syscap SystemCapability.ArkUI.ArkUI.Full 1862 * @crossplatform 1863 * @since 10 1864 */ 1865 /** 1866 * Called when using the Clipboard menu 1867 * 1868 * @param { function } callback 1869 * Executed when a paste operation is performed. 1870 * { string } value - The text content to be pasted. 1871 * { PasteEvent } event - The user-defined paste event. 1872 * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. 1873 * @syscap SystemCapability.ArkUI.ArkUI.Full 1874 * @crossplatform 1875 * @atomicservice 1876 * @since 11 1877 */ 1878 /** 1879 * Called when using the Clipboard menu. 1880 * 1881 * @param { OnPasteCallback } callback - Executed when a paste operation is performed. 1882 * @returns { TextInputAttribute } Returns the instance of the TextInputAttribute. 1883 * @syscap SystemCapability.ArkUI.ArkUI.Full 1884 * @crossplatform 1885 * @atomicservice 1886 * @since 14 1887 */ 1888 onPaste(callback: OnPasteCallback): TextInputAttribute; 1889 1890 /** 1891 * Called when the copy option is set. 1892 * 1893 * @param { CopyOptions } value 1894 * @returns { TextInputAttribute } 1895 * @syscap SystemCapability.ArkUI.ArkUI.Full 1896 * @since 9 1897 */ 1898 /** 1899 * Called when the copy option is set. 1900 * 1901 * @param { CopyOptions } value 1902 * @returns { TextInputAttribute } 1903 * @syscap SystemCapability.ArkUI.ArkUI.Full 1904 * @crossplatform 1905 * @since 10 1906 */ 1907 /** 1908 * Called when the copy option is set. 1909 * 1910 * @param { CopyOptions } value 1911 * @returns { TextInputAttribute } 1912 * @syscap SystemCapability.ArkUI.ArkUI.Full 1913 * @crossplatform 1914 * @atomicservice 1915 * @since 11 1916 */ 1917 copyOption(value: CopyOptions): TextInputAttribute; 1918 1919 /** 1920 * Called when the password show/hide icon is set. 1921 * 1922 * @param { boolean } value 1923 * @returns { TextInputAttribute } 1924 * @syscap SystemCapability.ArkUI.ArkUI.Full 1925 * @since 9 1926 */ 1927 /** 1928 * Called when the password show/hide icon is set. 1929 * 1930 * @param { boolean } value 1931 * @returns { TextInputAttribute } 1932 * @syscap SystemCapability.ArkUI.ArkUI.Full 1933 * @crossplatform 1934 * @since 10 1935 */ 1936 /** 1937 * Called when the password show/hide icon is set. 1938 * 1939 * @param { boolean } value 1940 * @returns { TextInputAttribute } 1941 * @syscap SystemCapability.ArkUI.ArkUI.Full 1942 * @crossplatform 1943 * @atomicservice 1944 * @since 11 1945 */ 1946 showPasswordIcon(value: boolean): TextInputAttribute; 1947 1948 /** 1949 * Called when the text align is set. 1950 * 1951 * @param { TextAlign } value 1952 * @returns { TextInputAttribute } 1953 * @syscap SystemCapability.ArkUI.ArkUI.Full 1954 * @since 9 1955 */ 1956 /** 1957 * Called when the text align is set. 1958 * 1959 * @param { TextAlign } value 1960 * @returns { TextInputAttribute } 1961 * @syscap SystemCapability.ArkUI.ArkUI.Full 1962 * @crossplatform 1963 * @since 10 1964 */ 1965 /** 1966 * Called when the text align is set. 1967 * 1968 * @param { TextAlign } value 1969 * @returns { TextInputAttribute } 1970 * @syscap SystemCapability.ArkUI.ArkUI.Full 1971 * @crossplatform 1972 * @atomicservice 1973 * @since 11 1974 */ 1975 textAlign(value: TextAlign): TextInputAttribute; 1976 1977 /** 1978 * Text input style 1979 * 1980 * @param { TextInputStyle | TextContentStyle } value - Text input style 1981 * @returns { TextInputAttribute } 1982 * @syscap SystemCapability.ArkUI.ArkUI.Full 1983 * @since 9 1984 */ 1985 /** 1986 * Text input style 1987 * 1988 * @param { TextInputStyle | TextContentStyle } value - Text input style 1989 * @returns { TextInputAttribute } 1990 * @syscap SystemCapability.ArkUI.ArkUI.Full 1991 * @crossplatform 1992 * @since 10 1993 */ 1994 /** 1995 * Text input style 1996 * 1997 * @param { TextInputStyle | TextContentStyle } value - Text input style 1998 * @returns { TextInputAttribute } 1999 * @syscap SystemCapability.ArkUI.ArkUI.Full 2000 * @crossplatform 2001 * @atomicservice 2002 * @since 11 2003 */ 2004 style(value: TextInputStyle | TextContentStyle): TextInputAttribute; 2005 2006 /** 2007 * Define the caret style of the text input 2008 * 2009 * @param { CaretStyle } value 2010 * @returns { TextInputAttribute } 2011 * @syscap SystemCapability.ArkUI.ArkUI.Full 2012 * @crossplatform 2013 * @since 10 2014 */ 2015 /** 2016 * Define the caret style of the text input 2017 * 2018 * @param { CaretStyle } value 2019 * @returns { TextInputAttribute } 2020 * @syscap SystemCapability.ArkUI.ArkUI.Full 2021 * @crossplatform 2022 * @atomicservice 2023 * @since 11 2024 */ 2025 caretStyle(value: CaretStyle): TextInputAttribute; 2026 2027 /** 2028 * Define the text selected background color of the text input. 2029 * 2030 * @param { ResourceColor } value 2031 * @returns { TextInputAttribute } 2032 * @syscap SystemCapability.ArkUI.ArkUI.Full 2033 * @crossplatform 2034 * @since 10 2035 */ 2036 /** 2037 * Define the text selected background color of the text input. 2038 * 2039 * @param { ResourceColor } value 2040 * @returns { TextInputAttribute } 2041 * @syscap SystemCapability.ArkUI.ArkUI.Full 2042 * @crossplatform 2043 * @atomicservice 2044 * @since 11 2045 */ 2046 selectedBackgroundColor(value: ResourceColor): TextInputAttribute; 2047 2048 /** 2049 * Define the caret position of the text input. 2050 * 2051 * @param { number } value 2052 * @returns { TextInputAttribute } 2053 * @syscap SystemCapability.ArkUI.ArkUI.Full 2054 * @crossplatform 2055 * @since 10 2056 */ 2057 /** 2058 * Define the caret position of the text input. 2059 * 2060 * @param { number } value 2061 * @returns { TextInputAttribute } 2062 * @syscap SystemCapability.ArkUI.ArkUI.Full 2063 * @crossplatform 2064 * @atomicservice 2065 * @since 11 2066 */ 2067 caretPosition(value: number): TextInputAttribute; 2068 2069 /** 2070 * Sets whether request keyboard or not when on focus. 2071 * 2072 * @param { boolean } value 2073 * @returns { TextInputAttribute } Returns the instance of the TextInputAttribute. 2074 * @syscap SystemCapability.ArkUI.ArkUI.Full 2075 * @crossplatform 2076 * @since 10 2077 */ 2078 /** 2079 * Sets whether request keyboard or not when on focus. 2080 * 2081 * @param { boolean } value 2082 * @returns { TextInputAttribute } Returns the instance of the TextInputAttribute. 2083 * @syscap SystemCapability.ArkUI.ArkUI.Full 2084 * @crossplatform 2085 * @atomicservice 2086 * @since 11 2087 */ 2088 enableKeyboardOnFocus(value: boolean): TextInputAttribute; 2089 2090 /** 2091 * Define the password icon of the text input. 2092 * 2093 * @param { PasswordIcon } value 2094 * @returns { TextInputAttribute } 2095 * @syscap SystemCapability.ArkUI.ArkUI.Full 2096 * @since 10 2097 */ 2098 /** 2099 * Define the password icon of the text input. 2100 * 2101 * @param { PasswordIcon } value 2102 * @returns { TextInputAttribute } 2103 * @syscap SystemCapability.ArkUI.ArkUI.Full 2104 * @crossplatform 2105 * @atomicservice 2106 * @since 11 2107 */ 2108 passwordIcon(value: PasswordIcon): TextInputAttribute; 2109 2110 /** 2111 * Define the show error of the text input. 2112 * 2113 * @param { string | undefined } value 2114 * @returns { TextInputAttribute } 2115 * @syscap SystemCapability.ArkUI.ArkUI.Full 2116 * @since 10 2117 */ 2118 /** 2119 * Define the show error of the text input. 2120 * 2121 * @param { string | undefined } value 2122 * @returns { TextInputAttribute } 2123 * @syscap SystemCapability.ArkUI.ArkUI.Full 2124 * @crossplatform 2125 * @atomicservice 2126 * @since 11 2127 */ 2128 /** 2129 * Define the show error of the text input. 2130 * 2131 * @param { ResourceStr | undefined } [value] 2132 * @returns { TextInputAttribute } 2133 * @syscap SystemCapability.ArkUI.ArkUI.Full 2134 * @crossplatform 2135 * @atomicservice 2136 * @since 12 2137 */ 2138 showError(value?: ResourceStr | undefined): TextInputAttribute; 2139 2140 /** 2141 * Define the show unit of the text input. 2142 * 2143 * @param { CustomBuilder } value 2144 * @returns { TextInputAttribute } 2145 * @syscap SystemCapability.ArkUI.ArkUI.Full 2146 * @since 10 2147 */ 2148 /** 2149 * Define the show unit of the text input. 2150 * 2151 * @param { CustomBuilder } value 2152 * @returns { TextInputAttribute } 2153 * @syscap SystemCapability.ArkUI.ArkUI.Full 2154 * @crossplatform 2155 * @atomicservice 2156 * @since 11 2157 */ 2158 showUnit(value: CustomBuilder): TextInputAttribute; 2159 2160 /** 2161 * Define the show underline of the text input. 2162 * 2163 * @param { boolean } value 2164 * @returns { TextInputAttribute } 2165 * @syscap SystemCapability.ArkUI.ArkUI.Full 2166 * @since 10 2167 */ 2168 /** 2169 * Define the show underline of the text input. 2170 * 2171 * @param { boolean } value 2172 * @returns { TextInputAttribute } 2173 * @syscap SystemCapability.ArkUI.ArkUI.Full 2174 * @crossplatform 2175 * @atomicservice 2176 * @since 11 2177 */ 2178 showUnderline(value: boolean): TextInputAttribute; 2179 2180 /** 2181 * Define the underline color of the text input. 2182 * 2183 * @param { ResourceColor | UnderlineColor | undefined } value 2184 * @returns { TextInputAttribute } 2185 * @syscap SystemCapability.ArkUI.ArkUI.Full 2186 * @crossplatform 2187 * @atomicservice 2188 * @since 12 2189 */ 2190 underlineColor(value: ResourceColor | UnderlineColor | undefined): TextInputAttribute; 2191 2192 /** 2193 * Controls whether the selection menu pops up. 2194 * 2195 * @param { boolean } value 2196 * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. 2197 * @syscap SystemCapability.ArkUI.ArkUI.Full 2198 * @crossplatform 2199 * @since 10 2200 */ 2201 /** 2202 * Controls whether the selection menu pops up. 2203 * 2204 * @param { boolean } value 2205 * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. 2206 * @syscap SystemCapability.ArkUI.ArkUI.Full 2207 * @crossplatform 2208 * @atomicservice 2209 * @since 11 2210 */ 2211 selectionMenuHidden(value: boolean): TextInputAttribute; 2212 2213 /** 2214 * Define bar state of the text input. 2215 * 2216 * @param { BarState } value 2217 * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. 2218 * @syscap SystemCapability.ArkUI.ArkUI.Full 2219 * @since 10 2220 */ 2221 /** 2222 * Define bar state of the text input. 2223 * 2224 * @param { BarState } value 2225 * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. 2226 * @syscap SystemCapability.ArkUI.ArkUI.Full 2227 * @atomicservice 2228 * @since 11 2229 */ 2230 barState(value: BarState): TextInputAttribute; 2231 2232 /** 2233 * Define max lines of the text input. 2234 * 2235 * @param { number } value 2236 * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. 2237 * @syscap SystemCapability.ArkUI.ArkUI.Full 2238 * @since 10 2239 */ 2240 /** 2241 * Define max lines of the text input. 2242 * 2243 * @param { number } value 2244 * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. 2245 * @syscap SystemCapability.ArkUI.ArkUI.Full 2246 * @crossplatform 2247 * @atomicservice 2248 * @since 11 2249 */ 2250 maxLines(value: number): TextInputAttribute; 2251 2252 /** 2253 * Set the text inline style word break type. 2254 * 2255 * @param { WordBreak } value - The word break type. 2256 * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. 2257 * @syscap SystemCapability.ArkUI.ArkUI.Full 2258 * @crossplatform 2259 * @atomicservice 2260 * @since 12 2261 */ 2262 wordBreak(value: WordBreak): TextInputAttribute; 2263 2264 /** 2265 * Set the text line break strategy type. 2266 * 2267 * @param { LineBreakStrategy } strategy - The text line break strategy type. 2268 * @returns { TextInputAttribute } The attribute of the TextInputAttribute. 2269 * @syscap SystemCapability.ArkUI.ArkUI.Full 2270 * @crossplatform 2271 * @atomicservice 2272 * @since 12 2273 */ 2274 lineBreakStrategy(strategy: LineBreakStrategy): TextInputAttribute; 2275 2276 /** 2277 * Define custom keyboard of the text input. 2278 * 2279 * @param { CustomBuilder } value 2280 * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. 2281 * @syscap SystemCapability.ArkUI.ArkUI.Full 2282 * @since 10 2283 */ 2284 /** 2285 * Define custom keyboard of the text input. 2286 * 2287 * @param { CustomBuilder } value 2288 * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. 2289 * @syscap SystemCapability.ArkUI.ArkUI.Full 2290 * @crossplatform 2291 * @atomicservice 2292 * @since 11 2293 */ 2294 2295 /** 2296 * Define custom keyboard of the text input. 2297 * 2298 * @param { CustomBuilder } value - Set up a custom keyboard of TextInput 2299 * @param { KeyboardOptions } [options] - Indicates the custom keyboard options of TextInput 2300 * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. 2301 * @syscap SystemCapability.ArkUI.ArkUI.Full 2302 * @crossplatform 2303 * @atomicservice 2304 * @since 12 2305 */ 2306 customKeyboard(value: CustomBuilder, options?: KeyboardOptions): TextInputAttribute; 2307 2308 /** 2309 * Show the counter when the number of characters entered exceeds the threshold through InputCounterOptions. 2310 * 2311 * @param { boolean } value - Set showcounter of the text input. 2312 * @param { InputCounterOptions } options - Set the percentage of counter. 2313 * @returns { TextInputAttribute } 2314 * @syscap SystemCapability.ArkUI.ArkUI.Full 2315 * @crossplatform 2316 * @atomicservice 2317 * @since 11 2318 */ 2319 showCounter(value: boolean, options?: InputCounterOptions): TextInputAttribute; 2320 2321 /** 2322 * Set the cancel button style 2323 * 2324 * @param { object } value - indicates the style of the cancel button. 2325 * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. 2326 * @syscap SystemCapability.ArkUI.ArkUI.Full 2327 * @crossplatform 2328 * @since 11 2329 */ 2330 /** 2331 * Set the cancel button style 2332 * 2333 * @param { object } value - indicates the style of the cancel button. 2334 * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. 2335 * @syscap SystemCapability.ArkUI.ArkUI.Full 2336 * @crossplatform 2337 * @atomicservice 2338 * @since 12 2339 */ 2340 /** 2341 * Set the cancel button style. 2342 * 2343 * @param { CancelButtonOptions } options - Indicates the style of the cancel button. 2344 * @returns { TextInputAttribute } Returns the instance of the TextInputAttribute. 2345 * @syscap SystemCapability.ArkUI.ArkUI.Full 2346 * @crossplatform 2347 * @atomicservice 2348 * @since 14 2349 */ 2350 cancelButton(options: CancelButtonOptions): TextInputAttribute; 2351 2352 /** 2353 * Set the cancel button style 2354 * 2355 * @param { CancelButtonSymbolOptions } symbolOptions - indicates the style of the cancel button. 2356 * @returns { TextInputAttribute } 2357 * @syscap SystemCapability.ArkUI.ArkUI.Full 2358 * @crossplatform 2359 * @atomicservice 2360 * @since 14 2361 */ 2362 cancelButton(symbolOptions: CancelButtonSymbolOptions): TextInputAttribute; 2363 2364 /** 2365 * Sets selection when on focus. 2366 * 2367 * @param { boolean } value - Sets selection or not. 2368 * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. 2369 * @syscap SystemCapability.ArkUI.ArkUI.Full 2370 * @crossplatform 2371 * @since 11 2372 */ 2373 /** 2374 * Sets selection when on focus. 2375 * 2376 * @param { boolean } value - Sets selection or not. 2377 * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. 2378 * @syscap SystemCapability.ArkUI.ArkUI.Full 2379 * @crossplatform 2380 * @atomicservice 2381 * @since 12 2382 */ 2383 selectAll(value: boolean): TextInputAttribute; 2384 2385 /** 2386 * Called when the minimum font size of the font is set. 2387 * 2388 * @param { number | string | Resource } value 2389 * @returns { TextInputAttribute } 2390 * @syscap SystemCapability.ArkUI.ArkUI.Full 2391 * @crossplatform 2392 * @atomicservice 2393 * @since 12 2394 */ 2395 minFontSize(value: number | string | Resource): TextInputAttribute; 2396 2397 /** 2398 * Called when the maximum font size of the font is set. 2399 * 2400 * @param { number | string | Resource } value 2401 * @returns { TextInputAttribute } 2402 * @syscap SystemCapability.ArkUI.ArkUI.Full 2403 * @crossplatform 2404 * @atomicservice 2405 * @since 12 2406 */ 2407 maxFontSize(value: number | string | Resource): TextInputAttribute; 2408 2409 /** 2410 * Called when the height adaptive policy is set. 2411 * 2412 * @param { TextHeightAdaptivePolicy } value - The height adaptive policy. 2413 * @returns { TextInputAttribute } 2414 * @syscap SystemCapability.ArkUI.ArkUI.Full 2415 * @crossplatform 2416 * @atomicservice 2417 * @since 12 2418 */ 2419 heightAdaptivePolicy(value: TextHeightAdaptivePolicy): TextInputAttribute; 2420 2421 /** 2422 * Sets whether enable auto fill or not. 2423 * 2424 * @param { boolean } value - Indicates the flag whether autofill is enabled. 2425 * @returns { TextInputAttribute } Returns the instance of the TextInputAttribute. 2426 * @syscap SystemCapability.ArkUI.ArkUI.Full 2427 * @since 11 2428 */ 2429 /** 2430 * Sets whether enable auto fill or not. 2431 * 2432 * @param { boolean } value - Indicates the flag whether autofill is enabled. 2433 * @returns { TextInputAttribute } Returns the instance of the TextInputAttribute. 2434 * @syscap SystemCapability.ArkUI.ArkUI.Full 2435 * @atomicservice 2436 * @since 12 2437 */ 2438 enableAutoFill(value: boolean): TextInputAttribute; 2439 2440 /** 2441 * Called when the text decoration of the text is set. 2442 * 2443 * @param { TextDecorationOptions } value 2444 * @returns { TextInputAttribute } 2445 * @syscap SystemCapability.ArkUI.ArkUI.Full 2446 * @crossplatform 2447 * @atomicservice 2448 * @since 12 2449 */ 2450 decoration(value: TextDecorationOptions): TextInputAttribute; 2451 2452 /** 2453 * Called when the distance between text fonts is set. 2454 * 2455 * @param { number | string | Resource } value 2456 * @returns { TextInputAttribute } 2457 * @syscap SystemCapability.ArkUI.ArkUI.Full 2458 * @crossplatform 2459 * @atomicservice 2460 * @since 12 2461 */ 2462 letterSpacing(value: number | string | Resource): TextInputAttribute; 2463 2464 /** 2465 * Called when the line height of the font is set. 2466 * 2467 * @param { number | string | Resource } value 2468 * @returns { TextInputAttribute } 2469 * @syscap SystemCapability.ArkUI.ArkUI.Full 2470 * @crossplatform 2471 * @atomicservice 2472 * @since 12 2473 */ 2474 lineHeight(value: number | string | Resource): TextInputAttribute; 2475 2476 /** 2477 * Define the password rules of the text input. 2478 * 2479 * @param { string } value - Indicates the password rules. 2480 * @returns { TextInputAttribute } Returns the instance of the TextInputAttribute. 2481 * @syscap SystemCapability.ArkUI.ArkUI.Full 2482 * @since 11 2483 */ 2484 /** 2485 * Define the password rules of the text input. 2486 * 2487 * @param { string } value - Indicates the password rules. 2488 * @returns { TextInputAttribute } Returns the instance of the TextInputAttribute. 2489 * @syscap SystemCapability.ArkUI.ArkUI.Full 2490 * @atomicservice 2491 * @since 12 2492 */ 2493 passwordRules(value: string): TextInputAttribute; 2494 2495 /** 2496 * Set font feature. 2497 * 2498 * @param { string } value - The fontFeature. 2499 * normal | <feature-tag-value>, 2500 * where <feature-tag-value> = <string> [ <integer> | on | off ], like: "ss01" 0 2501 * the values of <feature-tag-value> reference to doc of TextInput component 2502 * number of <feature-tag-value> can be single or multiple, and separated by comma ','. 2503 * @returns { TextInputAttribute } 2504 * @syscap SystemCapability.ArkUI.ArkUI.Full 2505 * @crossplatform 2506 * @atomicservice 2507 * @since 12 2508 */ 2509 fontFeature(value: string): TextInputAttribute; 2510 2511 /** 2512 * Define the password visible mode of the text input. 2513 * 2514 * @param { boolean } visible - Indicates the password visible mode. 2515 * @returns { TextInputAttribute } Returns the instance of the TextInputAttribute. 2516 * @syscap SystemCapability.ArkUI.ArkUI.Full 2517 * @crossplatform 2518 * @atomicservice 2519 * @since 12 2520 */ 2521 showPassword(visible: boolean): TextInputAttribute; 2522 2523 /** 2524 * Called when changing the password visible mode of the text input. 2525 * 2526 * @param { Callback<boolean> } callback - callback of the password visible mode change event. 2527 * @returns { TextInputAttribute } Returns the instance of the TextInputAttribute. 2528 * @syscap SystemCapability.ArkUI.ArkUI.Full 2529 * @crossplatform 2530 * @atomicservice 2531 * @since 12 2532 */ 2533 onSecurityStateChange(callback: Callback<boolean>): TextInputAttribute; 2534 2535 /** 2536 * Get text value information when about to input. 2537 * 2538 * @param { Callback<InsertValue, boolean> } callback - The triggered function when text content is about to insert. 2539 * @returns { TextInputAttribute } 2540 * @syscap SystemCapability.ArkUI.ArkUI.Full 2541 * @crossplatform 2542 * @atomicservice 2543 * @since 12 2544 */ 2545 onWillInsert(callback: Callback<InsertValue, boolean>): TextInputAttribute; 2546 2547 /** 2548 * Get text value information when completed input. 2549 * 2550 * @param { Callback<InsertValue> } callback - The triggered function when text content has been inserted. 2551 * @returns { TextInputAttribute } 2552 * @syscap SystemCapability.ArkUI.ArkUI.Full 2553 * @crossplatform 2554 * @atomicservice 2555 * @since 12 2556 */ 2557 onDidInsert(callback: Callback<InsertValue>): TextInputAttribute; 2558 2559 /** 2560 * Get text value information when about to delete. 2561 * 2562 * @param { Callback<DeleteValue, boolean> } callback - The triggered function when text content is about to delete. 2563 * @returns { TextInputAttribute } 2564 * @syscap SystemCapability.ArkUI.ArkUI.Full 2565 * @crossplatform 2566 * @atomicservice 2567 * @since 12 2568 */ 2569 onWillDelete(callback: Callback<DeleteValue, boolean>): TextInputAttribute; 2570 2571 /** 2572 * Get text value information when the deletion has been completed 2573 * 2574 * @param { Callback<DeleteValue> } callback - The triggered function when text content has been deleted. 2575 * @returns { TextInputAttribute } 2576 * @syscap SystemCapability.ArkUI.ArkUI.Full 2577 * @crossplatform 2578 * @atomicservice 2579 * @since 12 2580 */ 2581 onDidDelete(callback: Callback<DeleteValue>): TextInputAttribute; 2582 2583 /** 2584 * Set the custom text menu. 2585 * 2586 * @param { EditMenuOptions } editMenu - Customize text menu options. 2587 * @returns { TextInputAttribute } 2588 * @syscap SystemCapability.ArkUI.ArkUI.Full 2589 * @crossplatform 2590 * @atomicservice 2591 * @since 12 2592 */ 2593 editMenuOptions(editMenu: EditMenuOptions): TextInputAttribute; 2594 2595 /** 2596 * Define the preview text mode of the text input. 2597 * 2598 * @param { boolean } enable - Indicates the preview text mode. 2599 * @returns { TextInputAttribute } 2600 * @syscap SystemCapability.ArkUI.ArkUI.Full 2601 * @crossplatform 2602 * @atomicservice 2603 * @since 12 2604 */ 2605 enablePreviewText(enable: boolean): TextInputAttribute; 2606 2607 /** 2608 * Enable or disable haptic feedback. 2609 * 2610 * @param { boolean } isEnabled - Default value is true, set false to disable haptic feedback. 2611 * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. 2612 * @syscap SystemCapability.ArkUI.ArkUI.Full 2613 * @crossplatform 2614 * @atomicservice 2615 * @since 13 2616 */ 2617 enableHapticFeedback(isEnabled: boolean): TextInputAttribute; 2618} 2619 2620/** 2621 * Defines TextInput Component. 2622 * 2623 * @syscap SystemCapability.ArkUI.ArkUI.Full 2624 * @since 7 2625 */ 2626/** 2627 * Defines TextInput Component. 2628 * 2629 * @syscap SystemCapability.ArkUI.ArkUI.Full 2630 * @crossplatform 2631 * @since 10 2632 */ 2633/** 2634 * Defines TextInput Component. 2635 * 2636 * @syscap SystemCapability.ArkUI.ArkUI.Full 2637 * @crossplatform 2638 * @atomicservice 2639 * @since 11 2640 */ 2641declare const TextInput: TextInputInterface; 2642 2643/** 2644 * Defines TextInput Component instance. 2645 * 2646 * @syscap SystemCapability.ArkUI.ArkUI.Full 2647 * @since 7 2648 */ 2649/** 2650 * Defines TextInput Component instance. 2651 * 2652 * @syscap SystemCapability.ArkUI.ArkUI.Full 2653 * @crossplatform 2654 * @since 10 2655 */ 2656/** 2657 * Defines TextInput Component instance. 2658 * 2659 * @syscap SystemCapability.ArkUI.ArkUI.Full 2660 * @crossplatform 2661 * @atomicservice 2662 * @since 11 2663 */ 2664declare const TextInputInstance: TextInputAttribute; 2665