1/* 2 * Copyright (c) 2021-2023 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16/** 17 * Declare the type of input box 18 * 19 * @enum { number } 20 * @syscap SystemCapability.ArkUI.ArkUI.Full 21 * @since 7 22 */ 23/** 24 * Declare the type of input box 25 * 26 * @enum { number } 27 * @syscap SystemCapability.ArkUI.ArkUI.Full 28 * @crossplatform 29 * @since 10 30 */ 31declare enum InputType { 32 /** 33 * Basic input mode. 34 * 35 * @syscap SystemCapability.ArkUI.ArkUI.Full 36 * @since 7 37 */ 38 /** 39 * Basic input mode. 40 * 41 * @syscap SystemCapability.ArkUI.ArkUI.Full 42 * @crossplatform 43 * @since 10 44 */ 45 Normal, 46 47 /** 48 * Pure digital input mode. 49 * 50 * @syscap SystemCapability.ArkUI.ArkUI.Full 51 * @since 7 52 */ 53 /** 54 * Pure digital input mode. 55 * 56 * @syscap SystemCapability.ArkUI.ArkUI.Full 57 * @crossplatform 58 * @since 10 59 */ 60 Number, 61 62 /** 63 * Phone number entry mode. 64 * 65 * @syscap SystemCapability.ArkUI.ArkUI.Full 66 * @since 9 67 */ 68 /** 69 * Phone number entry mode. 70 * 71 * @syscap SystemCapability.ArkUI.ArkUI.Full 72 * @crossplatform 73 * @since 10 74 */ 75 PhoneNumber, 76 77 /** 78 * E-mail address input mode. 79 * 80 * @syscap SystemCapability.ArkUI.ArkUI.Full 81 * @since 7 82 */ 83 /** 84 * E-mail address input mode. 85 * 86 * @syscap SystemCapability.ArkUI.ArkUI.Full 87 * @crossplatform 88 * @since 10 89 */ 90 Email, 91 92 /** 93 * Password entry mode. 94 * 95 * @syscap SystemCapability.ArkUI.ArkUI.Full 96 * @since 7 97 */ 98 /** 99 * Password entry mode. 100 * 101 * @syscap SystemCapability.ArkUI.ArkUI.Full 102 * @crossplatform 103 * @since 10 104 */ 105 Password, 106} 107 108/** 109 * Declare the type of soft keyboard. 110 * 111 * @enum { number } 112 * @syscap SystemCapability.ArkUI.ArkUI.Full 113 * @since 7 114 */ 115/** 116 * Declare the type of soft keyboard. 117 * 118 * @enum { number } 119 * @syscap SystemCapability.ArkUI.ArkUI.Full 120 * @crossplatform 121 * @since 10 122 */ 123declare enum EnterKeyType { 124 /** 125 * Go. 126 * 127 * @syscap SystemCapability.ArkUI.ArkUI.Full 128 * @since 7 129 */ 130 /** 131 * Go. 132 * 133 * @syscap SystemCapability.ArkUI.ArkUI.Full 134 * @crossplatform 135 * @since 10 136 */ 137 Go, 138 139 /** 140 * Search. 141 * 142 * @syscap SystemCapability.ArkUI.ArkUI.Full 143 * @since 7 144 */ 145 /** 146 * Search. 147 * 148 * @syscap SystemCapability.ArkUI.ArkUI.Full 149 * @crossplatform 150 * @since 10 151 */ 152 Search, 153 154 /** 155 * Send. 156 * 157 * @syscap SystemCapability.ArkUI.ArkUI.Full 158 * @since 7 159 */ 160 /** 161 * Send. 162 * 163 * @syscap SystemCapability.ArkUI.ArkUI.Full 164 * @crossplatform 165 * @since 10 166 */ 167 Send, 168 169 /** 170 * Next. 171 * 172 * @syscap SystemCapability.ArkUI.ArkUI.Full 173 * @since 7 174 */ 175 /** 176 * Next. 177 * 178 * @syscap SystemCapability.ArkUI.ArkUI.Full 179 * @crossplatform 180 * @since 10 181 */ 182 Next, 183 184 /** 185 * Done. 186 * 187 * @syscap SystemCapability.ArkUI.ArkUI.Full 188 * @since 7 189 */ 190 /** 191 * Done. 192 * 193 * @syscap SystemCapability.ArkUI.ArkUI.Full 194 * @crossplatform 195 * @since 10 196 */ 197 Done, 198} 199 200/** 201 * Provides the method of switching the cursor position. 202 * 203 * @extends TextContentControllerBase 204 * @since 8 205 */ 206/** 207 * Provides the method of switching the cursor position. 208 * 209 * @extends TextContentControllerBase 210 * @syscap SystemCapability.ArkUI.ArkUI.Full 211 * @crossplatform 212 * @since 10 213 */ 214declare class TextInputController extends TextContentControllerBase { 215 /** 216 * constructor. 217 * 218 * @syscap SystemCapability.ArkUI.ArkUI.Full 219 * @since 8 220 */ 221 /** 222 * constructor. 223 * 224 * @syscap SystemCapability.ArkUI.ArkUI.Full 225 * @crossplatform 226 * @since 10 227 */ 228 constructor(); 229 230 /** 231 * Called when the position of the insertion cursor is set. 232 * 233 * @param { number } value 234 * @syscap SystemCapability.ArkUI.ArkUI.Full 235 * @since 8 236 */ 237 /** 238 * Called when the position of the insertion cursor is set. 239 * 240 * @param { number } value 241 * @syscap SystemCapability.ArkUI.ArkUI.Full 242 * @crossplatform 243 * @since 10 244 */ 245 caretPosition(value: number): void; 246 247 /** 248 * Text selection is achieved by specifying the start and end positions of the text. 249 * 250 * @param { number } selectionStart - The start position of the selected text. 251 * @param { number } selectionEnd - The end position of the selected text. 252 * @syscap SystemCapability.ArkUI.ArkUI.Full 253 * @crossplatform 254 * @since 10 255 */ 256 setTextSelection(selectionStart: number, selectionEnd: number): void; 257 258 /** 259 * Exit edit state. 260 * 261 * @syscap SystemCapability.ArkUI.ArkUI.Full 262 * @crossplatform 263 * @since 10 264 */ 265 stopEditing(): void; 266} 267 268/** 269 * Defines the options of TextInput. 270 * 271 * @interface TextInputOptions 272 * @syscap SystemCapability.ArkUI.ArkUI.Full 273 * @since 7 274 */ 275/** 276 * Defines the options of TextInput. 277 * 278 * @interface TextInputOptions 279 * @syscap SystemCapability.ArkUI.ArkUI.Full 280 * @crossplatform 281 * @since 10 282 */ 283declare interface TextInputOptions { 284 /** 285 * The place holder text string. 286 * 287 * @type { ?ResourceStr } 288 * @syscap SystemCapability.ArkUI.ArkUI.Full 289 * @since 7 290 */ 291 /** 292 * The place holder text string. 293 * 294 * @type { ?ResourceStr } 295 * @syscap SystemCapability.ArkUI.ArkUI.Full 296 * @crossplatform 297 * @since 10 298 */ 299 placeholder?: ResourceStr; 300 301 /** 302 * Sets the current value of TextArea. 303 * 304 * @type { ?ResourceStr } 305 * @syscap SystemCapability.ArkUI.ArkUI.Full 306 * @since 7 307 */ 308 /** 309 * Sets the current value of TextArea. 310 * 311 * @type { ?ResourceStr } 312 * @syscap SystemCapability.ArkUI.ArkUI.Full 313 * @crossplatform 314 * @since 10 315 */ 316 text?: ResourceStr; 317 318 /** 319 * Called when the position of the insertion cursor is set. 320 * 321 * @type { ?TextInputController } 322 * @syscap SystemCapability.ArkUI.ArkUI.Full 323 * @since 8 324 */ 325 /** 326 * Called when the position of the insertion cursor is set. 327 * 328 * @type { ?TextInputController } 329 * @syscap SystemCapability.ArkUI.ArkUI.Full 330 * @crossplatform 331 * @since 10 332 */ 333 controller?: TextInputController; 334} 335 336/** 337 * Text input style. 338 * 339 * @enum { number } 340 * @syscap SystemCapability.ArkUI.ArkUI.Full 341 * @since 9 342 */ 343/** 344 * Text input style. 345 * 346 * @enum { number } 347 * @syscap SystemCapability.ArkUI.ArkUI.Full 348 * @crossplatform 349 * @since 10 350 */ 351declare enum TextInputStyle { 352 /** 353 * Text input default style. 354 * 355 * @syscap SystemCapability.ArkUI.ArkUI.Full 356 * @since 9 357 */ 358 /** 359 * Text input default style. 360 * 361 * @syscap SystemCapability.ArkUI.ArkUI.Full 362 * @crossplatform 363 * @since 10 364 */ 365 Default, 366 367 /** 368 * Text input inline style. 369 * 370 * @syscap SystemCapability.ArkUI.ArkUI.Full 371 * @since 9 372 */ 373 /** 374 * Text input inline style. 375 * 376 * @syscap SystemCapability.ArkUI.ArkUI.Full 377 * @crossplatform 378 * @since 10 379 */ 380 Inline 381} 382 383/** 384 * Provides a single-line text input component interface. 385 * 386 * @interface TextInputInterface 387 * @syscap SystemCapability.ArkUI.ArkUI.Full 388 * @since 7 389 */ 390/** 391 * Provides a single-line text input component interface. 392 * 393 * @interface TextInputInterface 394 * @syscap SystemCapability.ArkUI.ArkUI.Full 395 * @crossplatform 396 * @since 10 397 */ 398interface TextInputInterface { 399 /** 400 * Called when writing a single line of text. 401 * 402 * @param { TextInputOptions } value 403 * @returns { TextInputAttribute } 404 * @syscap SystemCapability.ArkUI.ArkUI.Full 405 * @since 7 406 */ 407 /** 408 * Called when writing a single line of text. 409 * 410 * @param { TextInputOptions } value 411 * @returns { TextInputAttribute } 412 * @syscap SystemCapability.ArkUI.ArkUI.Full 413 * @crossplatform 414 * @since 10 415 */ 416 (value?: TextInputOptions): TextInputAttribute; 417} 418 419/** 420 * CaretStyle object. 421 * 422 * @interface CaretStyle 423 * @syscap SystemCapability.ArkUI.ArkUI.Full 424 * @crossplatform 425 * @since 10 426 */ 427interface CaretStyle { 428 /** 429 * Define the cursor width of CaretStyle. 430 * 431 * @type { ?Length } 432 * @syscap SystemCapability.ArkUI.ArkUI.Full 433 * @crossplatform 434 * @since 10 435 */ 436 width?: Length; 437} 438 439/** 440 * PasswordIcon object. 441 * 442 * @interface PasswordIcon 443 * @syscap SystemCapability.ArkUI.ArkUI.Full 444 * @since 10 445 */ 446interface PasswordIcon { 447 /** 448 * Define the on icon source of PasswordIcon. 449 * 450 * @type { ?(string | Resource) } 451 * @syscap SystemCapability.ArkUI.ArkUI.Full 452 * @since 10 453 */ 454 onIconSrc?: string | Resource; 455 456 /** 457 * Define the off icon source of PasswordIcon. 458 * 459 * @type { ?(string | Resource) } 460 * @syscap SystemCapability.ArkUI.ArkUI.Full 461 * @since 10 462 */ 463 offIconSrc?: string | Resource; 464} 465 466/** 467 * Defines the TextInput attribute functions. 468 * 469 * @extends CommonMethod 470 * @syscap SystemCapability.ArkUI.ArkUI.Full 471 * @since 7 472 */ 473/** 474 * Defines the TextInput attribute functions. 475 * 476 * @extends CommonMethod 477 * @syscap SystemCapability.ArkUI.ArkUI.Full 478 * @crossplatform 479 * @since 10 480 */ 481declare class TextInputAttribute extends CommonMethod<TextInputAttribute> { 482 /** 483 * Called when the input type is set. 484 * 485 * @param { InputType } value 486 * @returns { TextInputAttribute } 487 * @syscap SystemCapability.ArkUI.ArkUI.Full 488 * @since 7 489 */ 490 /** 491 * Called when the input type is set. 492 * 493 * @param { InputType } value 494 * @returns { TextInputAttribute } 495 * @syscap SystemCapability.ArkUI.ArkUI.Full 496 * @crossplatform 497 * @since 10 498 */ 499 type(value: InputType): TextInputAttribute; 500 501 /** 502 * Called when the color of the placeholder is set. 503 * 504 * @param { ResourceColor } value 505 * @returns { TextInputAttribute } 506 * @syscap SystemCapability.ArkUI.ArkUI.Full 507 * @since 7 508 */ 509 /** 510 * Called when the color of the placeholder is set. 511 * 512 * @param { ResourceColor } value 513 * @returns { TextInputAttribute } 514 * @syscap SystemCapability.ArkUI.ArkUI.Full 515 * @crossplatform 516 * @since 10 517 */ 518 placeholderColor(value: ResourceColor): TextInputAttribute; 519 520 /** 521 * Called when the font property of the placeholder is set. 522 * 523 * @param { Font } value 524 * @returns { TextInputAttribute } 525 * @syscap SystemCapability.ArkUI.ArkUI.Full 526 * @since 7 527 */ 528 /** 529 * Called when the font property of the placeholder is set. 530 * 531 * @param { Font } value 532 * @returns { TextInputAttribute } 533 * @syscap SystemCapability.ArkUI.ArkUI.Full 534 * @crossplatform 535 * @since 10 536 */ 537 placeholderFont(value?: Font): TextInputAttribute; 538 539 /** 540 * Called when the type of soft keyboard input button is set. 541 * 542 * @param { EnterKeyType } value 543 * @returns { TextInputAttribute } 544 * @syscap SystemCapability.ArkUI.ArkUI.Full 545 * @since 7 546 */ 547 /** 548 * Called when the type of soft keyboard input button is set. 549 * 550 * @param { EnterKeyType } value 551 * @returns { TextInputAttribute } 552 * @syscap SystemCapability.ArkUI.ArkUI.Full 553 * @crossplatform 554 * @since 10 555 */ 556 enterKeyType(value: EnterKeyType): TextInputAttribute; 557 558 /** 559 * Called when the color of the insertion cursor is set. 560 * 561 * @param { ResourceColor } value 562 * @returns { TextInputAttribute } 563 * @syscap SystemCapability.ArkUI.ArkUI.Full 564 * @since 7 565 */ 566 /** 567 * Called when the color of the insertion cursor is set. 568 * 569 * @param { ResourceColor } value 570 * @returns { TextInputAttribute } 571 * @syscap SystemCapability.ArkUI.ArkUI.Full 572 * @crossplatform 573 * @since 10 574 */ 575 caretColor(value: ResourceColor): TextInputAttribute; 576 577 /** 578 * Called when judging whether the text editing change finished. 579 * 580 * @param { function } callback 581 * @returns { TextInputAttribute } 582 * @syscap SystemCapability.ArkUI.ArkUI.Full 583 * @since 7 584 * @deprecated since 8 585 * @useinstead onEditChange 586 */ 587 onEditChanged(callback: (isEditing: boolean) => void): TextInputAttribute; 588 589 /** 590 * Called when judging whether the text editing change finished. 591 * 592 * @param { function } callback 593 * @returns { TextInputAttribute } 594 * @syscap SystemCapability.ArkUI.ArkUI.Full 595 * @since 8 596 */ 597 /** 598 * Called when judging whether the text editing change finished. 599 * 600 * @param { function } callback 601 * @returns { TextInputAttribute } 602 * @syscap SystemCapability.ArkUI.ArkUI.Full 603 * @crossplatform 604 * @since 10 605 */ 606 onEditChange(callback: (isEditing: boolean) => void): TextInputAttribute; 607 608 /** 609 * Called when submitted. 610 * 611 * @param { function } callback 612 * @returns { TextInputAttribute } 613 * @syscap SystemCapability.ArkUI.ArkUI.Full 614 * @since 7 615 */ 616 /** 617 * Called when submitted. 618 * 619 * @param { function } callback 620 * @returns { TextInputAttribute } 621 * @syscap SystemCapability.ArkUI.ArkUI.Full 622 * @crossplatform 623 * @since 10 624 */ 625 onSubmit(callback: (enterKey: EnterKeyType) => void): TextInputAttribute; 626 627 /** 628 * Called when the input of the input box changes. 629 * 630 * @param { function } callback 631 * @returns { TextInputAttribute } 632 * @syscap SystemCapability.ArkUI.ArkUI.Full 633 * @since 7 634 */ 635 /** 636 * Called when the input of the input box changes. 637 * 638 * @param { function } callback 639 * @returns { TextInputAttribute } 640 * @syscap SystemCapability.ArkUI.ArkUI.Full 641 * @crossplatform 642 * @since 10 643 */ 644 onChange(callback: (value: string) => void): TextInputAttribute; 645 646 /** 647 * Called when the text selection changes. 648 * 649 * @param { function } callback - callback of the listened event. 650 * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. 651 * @syscap SystemCapability.ArkUI.ArkUI.Full 652 * @crossplatform 653 * @since 10 654 */ 655 onTextSelectionChange(callback: (selectionStart: number, selectionEnd: number) => void): TextInputAttribute; 656 657 /** 658 * Called when the content scrolls. 659 * 660 * @param { function } callback - callback of the listened event. 661 * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. 662 * @syscap SystemCapability.ArkUI.ArkUI.Full 663 * @crossplatform 664 * @since 10 665 */ 666 onContentScroll(callback: (totalOffsetX: number, totalOffsetY: number) => void): TextInputAttribute; 667 668 /** 669 * Called when the input of maximum text length is set. 670 * 671 * @param { number } value 672 * @returns { TextInputAttribute } 673 * @syscap SystemCapability.ArkUI.ArkUI.Full 674 * @since 7 675 */ 676 /** 677 * Called when the input of maximum text length is set. 678 * 679 * @param { number } value 680 * @returns { TextInputAttribute } 681 * @syscap SystemCapability.ArkUI.ArkUI.Full 682 * @crossplatform 683 * @since 10 684 */ 685 maxLength(value: number): TextInputAttribute; 686 687 /** 688 * Called when the font color is set. 689 * 690 * @param { ResourceColor } value 691 * @returns { TextInputAttribute } 692 * @syscap SystemCapability.ArkUI.ArkUI.Full 693 * @since 7 694 */ 695 /** 696 * Called when the font color is set. 697 * 698 * @param { ResourceColor } value 699 * @returns { TextInputAttribute } 700 * @syscap SystemCapability.ArkUI.ArkUI.Full 701 * @crossplatform 702 * @since 10 703 */ 704 fontColor(value: ResourceColor): TextInputAttribute; 705 706 /** 707 * Called when the font size is set. 708 * 709 * @param { Length } value 710 * @returns { TextInputAttribute } 711 * @syscap SystemCapability.ArkUI.ArkUI.Full 712 * @since 7 713 */ 714 /** 715 * Called when the font size is set. 716 * 717 * @param { Length } value 718 * @returns { TextInputAttribute } 719 * @syscap SystemCapability.ArkUI.ArkUI.Full 720 * @crossplatform 721 * @since 10 722 */ 723 fontSize(value: Length): TextInputAttribute; 724 725 /** 726 * Called when the font style of a font is set. 727 * 728 * @param { FontStyle } value 729 * @returns { TextInputAttribute } 730 * @syscap SystemCapability.ArkUI.ArkUI.Full 731 * @since 7 732 */ 733 /** 734 * Called when the font style of a font is set. 735 * 736 * @param { FontStyle } value 737 * @returns { TextInputAttribute } 738 * @syscap SystemCapability.ArkUI.ArkUI.Full 739 * @crossplatform 740 * @since 10 741 */ 742 fontStyle(value: FontStyle): TextInputAttribute; 743 744 /** 745 * Called when the font weight is set. 746 * 747 * @param { number | FontWeight | string } value 748 * @returns { TextInputAttribute } 749 * @syscap SystemCapability.ArkUI.ArkUI.Full 750 * @since 7 751 */ 752 /** 753 * Called when the font weight is set. 754 * 755 * @param { number | FontWeight | string } value 756 * @returns { TextInputAttribute } 757 * @syscap SystemCapability.ArkUI.ArkUI.Full 758 * @crossplatform 759 * @since 10 760 */ 761 fontWeight(value: number | FontWeight | string): TextInputAttribute; 762 763 /** 764 * Called when the font list of text is set. 765 * 766 * @param { ResourceStr } value 767 * @returns { TextInputAttribute } 768 * @syscap SystemCapability.ArkUI.ArkUI.Full 769 * @since 7 770 */ 771 /** 772 * Called when the font list of text is set. 773 * 774 * @param { ResourceStr } value 775 * @returns { TextInputAttribute } 776 * @syscap SystemCapability.ArkUI.ArkUI.Full 777 * @crossplatform 778 * @since 10 779 */ 780 fontFamily(value: ResourceStr): TextInputAttribute; 781 782 /** 783 * Called when the inputFilter of text is set. 784 * 785 * @param { ResourceStr } value 786 * @param { function } error 787 * @returns { TextInputAttribute } 788 * @syscap SystemCapability.ArkUI.ArkUI.Full 789 * @since 8 790 */ 791 /** 792 * Called when the inputFilter of text is set. 793 * 794 * @param { ResourceStr } value 795 * @param { function } error 796 * @returns { TextInputAttribute } 797 * @syscap SystemCapability.ArkUI.ArkUI.Full 798 * @crossplatform 799 * @since 10 800 */ 801 inputFilter(value: ResourceStr, error?: (value: string) => void): TextInputAttribute; 802 803 /** 804 * Called when using the Clipboard menu 805 * 806 * @param { function } callback 807 * @returns { TextInputAttribute } 808 * @syscap SystemCapability.ArkUI.ArkUI.Full 809 * @since 8 810 */ 811 /** 812 * Called when using the Clipboard menu 813 * 814 * @param { function } callback 815 * @returns { TextInputAttribute } 816 * @syscap SystemCapability.ArkUI.ArkUI.Full 817 * @crossplatform 818 * @since 10 819 */ 820 onCopy(callback: (value: string) => void): TextInputAttribute; 821 822 /** 823 * Called when using the Clipboard menu 824 * 825 * @param { function } callback 826 * @returns { TextInputAttribute } 827 * @syscap SystemCapability.ArkUI.ArkUI.Full 828 * @since 8 829 */ 830 /** 831 * Called when using the Clipboard menu 832 * 833 * @param { function } callback 834 * @returns { TextInputAttribute } 835 * @syscap SystemCapability.ArkUI.ArkUI.Full 836 * @crossplatform 837 * @since 10 838 */ 839 onCut(callback: (value: string) => void): TextInputAttribute; 840 841 /** 842 * Called when using the Clipboard menu 843 * 844 * @param { function } callback 845 * @returns { TextInputAttribute } 846 * @syscap SystemCapability.ArkUI.ArkUI.Full 847 * @since 8 848 */ 849 /** 850 * Called when using the Clipboard menu 851 * 852 * @param { function } callback 853 * @returns { TextInputAttribute } 854 * @syscap SystemCapability.ArkUI.ArkUI.Full 855 * @crossplatform 856 * @since 10 857 */ 858 onPaste(callback: (value: string) => void): TextInputAttribute; 859 860 /** 861 * Called when the copy option is set. 862 * 863 * @param { CopyOptions } value 864 * @returns { TextInputAttribute } 865 * @syscap SystemCapability.ArkUI.ArkUI.Full 866 * @since 9 867 */ 868 /** 869 * Called when the copy option is set. 870 * 871 * @param { CopyOptions } value 872 * @returns { TextInputAttribute } 873 * @syscap SystemCapability.ArkUI.ArkUI.Full 874 * @crossplatform 875 * @since 10 876 */ 877 copyOption(value: CopyOptions): TextInputAttribute; 878 879 /** 880 * Called when the password show/hide icon is set. 881 * 882 * @param { boolean } value 883 * @returns { TextInputAttribute } 884 * @syscap SystemCapability.ArkUI.ArkUI.Full 885 * @since 9 886 */ 887 /** 888 * Called when the password show/hide icon is set. 889 * 890 * @param { boolean } value 891 * @returns { TextInputAttribute } 892 * @syscap SystemCapability.ArkUI.ArkUI.Full 893 * @crossplatform 894 * @since 10 895 */ 896 showPasswordIcon(value: boolean): TextInputAttribute; 897 898 /** 899 * Called when the text align is set. 900 * 901 * @param { TextAlign } value 902 * @returns { TextInputAttribute } 903 * @syscap SystemCapability.ArkUI.ArkUI.Full 904 * @since 9 905 */ 906 /** 907 * Called when the text align is set. 908 * 909 * @param { TextAlign } value 910 * @returns { TextInputAttribute } 911 * @syscap SystemCapability.ArkUI.ArkUI.Full 912 * @crossplatform 913 * @since 10 914 */ 915 textAlign(value: TextAlign): TextInputAttribute; 916 917 /** 918 * Text input style 919 * 920 * @param { TextInputStyle | TextContentStyle } value - Text input style 921 * @returns { TextInputAttribute } 922 * @syscap SystemCapability.ArkUI.ArkUI.Full 923 * @since 9 924 */ 925 /** 926 * Text input style 927 * 928 * @param { TextInputStyle | TextContentStyle } value - Text input style 929 * @returns { TextInputAttribute } 930 * @syscap SystemCapability.ArkUI.ArkUI.Full 931 * @crossplatform 932 * @since 10 933 */ 934 style(value: TextInputStyle | TextContentStyle): TextInputAttribute; 935 936 /** 937 * Define the caret style of the text input 938 * 939 * @param { CaretStyle } value 940 * @returns { TextInputAttribute } 941 * @syscap SystemCapability.ArkUI.ArkUI.Full 942 * @crossplatform 943 * @since 10 944 */ 945 caretStyle(value: CaretStyle): TextInputAttribute; 946 947 /** 948 * Define the text selected background color of the text input. 949 * 950 * @param { ResourceColor } value 951 * @returns { TextInputAttribute } 952 * @syscap SystemCapability.ArkUI.ArkUI.Full 953 * @crossplatform 954 * @since 10 955 */ 956 selectedBackgroundColor(value: ResourceColor): TextInputAttribute; 957 958 /** 959 * Define the caret position of the text input. 960 * 961 * @param { number } value 962 * @returns { TextInputAttribute } 963 * @syscap SystemCapability.ArkUI.ArkUI.Full 964 * @crossplatform 965 * @since 10 966 */ 967 caretPosition(value: number): TextInputAttribute; 968 969 /** 970 * Sets whether request keyboard or not when on focus. 971 * 972 * @param { boolean } value 973 * @returns { TextInputAttribute } Returns the instance of the TextInputAttribute. 974 * @syscap SystemCapability.ArkUI.ArkUI.Full 975 * @crossplatform 976 * @since 10 977 */ 978 enableKeyboardOnFocus(value: boolean): TextInputAttribute; 979 980 /** 981 * Define the password icon of the text input. 982 * 983 * @param { PasswordIcon } value 984 * @returns { TextInputAttribute } 985 * @syscap SystemCapability.ArkUI.ArkUI.Full 986 * @since 10 987 */ 988 passwordIcon(value: PasswordIcon): TextInputAttribute; 989 990 /** 991 * Define the show error of the text input. 992 * 993 * @param { string | undefined } value 994 * @returns { TextInputAttribute } 995 * @syscap SystemCapability.ArkUI.ArkUI.Full 996 * @since 10 997 */ 998 showError(value?: string | undefined): TextInputAttribute; 999 1000 /** 1001 * Define the show unit of the text input. 1002 * 1003 * @param { CustomBuilder } value 1004 * @returns { TextInputAttribute } 1005 * @syscap SystemCapability.ArkUI.ArkUI.Full 1006 * @since 10 1007 */ 1008 showUnit(value: CustomBuilder): TextInputAttribute; 1009 1010 /** 1011 * Define the show underline of the text input. 1012 * 1013 * @param { boolean } value 1014 * @returns { TextInputAttribute } 1015 * @syscap SystemCapability.ArkUI.ArkUI.Full 1016 * @since 10 1017 */ 1018 showUnderline(value: boolean): TextInputAttribute; 1019 1020 /** 1021 * Controls whether the selection menu pops up. 1022 * 1023 * @param { boolean } value 1024 * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. 1025 * @syscap SystemCapability.ArkUI.ArkUI.Full 1026 * @crossplatform 1027 * @since 10 1028 */ 1029 selectionMenuHidden(value: boolean): TextInputAttribute; 1030 1031 /** 1032 * Define bar state of the text input. 1033 * 1034 * @param { BarState } value 1035 * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. 1036 * @syscap SystemCapability.ArkUI.ArkUI.Full 1037 * @since 10 1038 */ 1039 barState(value: BarState): TextInputAttribute; 1040 1041 /** 1042 * Define max lines of the text input. 1043 * 1044 * @param { number } value 1045 * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. 1046 * @syscap SystemCapability.ArkUI.ArkUI.Full 1047 * @since 10 1048 */ 1049 maxLines(value: number): TextInputAttribute; 1050 1051 /** 1052 * Define custom keyboard of the text input. 1053 * 1054 * @param { CustomBuilder } value 1055 * @returns { TextInputAttribute } returns the instance of the TextInputAttribute. 1056 * @syscap SystemCapability.ArkUI.ArkUI.Full 1057 * @since 10 1058 */ 1059 customKeyboard(value: CustomBuilder): TextInputAttribute; 1060} 1061 1062/** 1063 * Defines TextInput Component. 1064 * 1065 * @syscap SystemCapability.ArkUI.ArkUI.Full 1066 * @since 7 1067 */ 1068/** 1069 * Defines TextInput Component. 1070 * 1071 * @syscap SystemCapability.ArkUI.ArkUI.Full 1072 * @crossplatform 1073 * @since 10 1074 */ 1075declare const TextInput: TextInputInterface; 1076 1077/** 1078 * Defines TextInput Component instance. 1079 * 1080 * @syscap SystemCapability.ArkUI.ArkUI.Full 1081 * @since 7 1082 */ 1083/** 1084 * Defines TextInput Component instance. 1085 * 1086 * @syscap SystemCapability.ArkUI.ArkUI.Full 1087 * @crossplatform 1088 * @since 10 1089 */ 1090declare const TextInputInstance: TextInputAttribute; 1091